Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

#define N 200010
#define MAX 1000000000000000000

#include <stdio.h>

int main (void) {
    int n, m = 0, l[100], l_tmp, i, j, k, c = 0;

    scanf("%d", &n);

    for (i = 0; i < n; i++) {
        scanf("%d", &(l[i]));
    }

    for (i = 0; i < n; i++) {
        for (j = i + 1; j < n; j++) {
            if (l[i] == l[j]) continue;
            for (k = j + 1; k < n; k++) {
                if (l[i] == l[k] || l[j] == l[k]) continue;

                if ((l[i] + l[j] > l[k]) &&
                        (l[j] + l[k] > l[i]) &&
                        (l[k] + l[i] > l[j])){
                    c++;
                }
            }
        }
    }

    printf("%d", c);

    return 0;

}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	addq	$4, %r13
	cmpl	%r12d, %ebx
	jg	.L3
	testl	%ebx, %ebx
	jle	.L2
	cmpl	$1, %ebx
	je	.L2
	leal	1(%rbx), %eax
	leaq	36(%rsp), %r15
	xorl	%r12d, %r12d
	addq	$4, %rbp
	movq	%rax, 8(%rsp)
	movl	$2, %r14d
	leal	-1(%rbx), %r13d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %r10
	movl	-4(%r15), %esi
	movq	%r14, %r8
	movl	(%r10), %ecx
	cmpl	%ecx, %esi
	je	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%r8d, %ebx
	jle	.L9
	movl	%r13d, %edx
	leal	(%rsi,%rcx), %r9d
	subl	%r8d, %edx
	leaq	-1(%r8,%rdx), %rax
	movq	%r10, %rdx
	leaq	0(%rbp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movl	4(%rdx), %eax
	cmpl	%eax, %ecx
	je	.L10
	cmpl	%eax, %esi
	je	.L10
	cmpl	%r9d, %eax
	jge	.L10
	leal	(%rcx,%rax), %r11d
	cmpl	%r11d, %esi
	jge	.L10
	addl	%esi, %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %eax
	addl	%eax, %r12d
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L11
.L12:
	movl	4(%r10), %ecx
	addq	$4, %r10
	addq	$1, %r8
	cmpl	%ecx, %esi
	jne	.L20
.L8:
	cmpl	%r8d, %ebx
	jg	.L12
.L9:
	addq	$1, %r14
	addq	$4, %r15
	cmpq	8(%rsp), %r14
	jne	.L6
.L7:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$456, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L7
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	addq	$4, %r13
	cmpl	%r12d, %ebx
	jg	.L3
	testl	%ebx, %ebx
	jle	.L2
	cmpl	$1, %ebx
	je	.L2
	leal	1(%rbx), %eax
	leaq	36(%rsp), %r15
	xorl	%r12d, %r12d
	addq	$4, %rbp
	movq	%rax, 8(%rsp)
	movl	$2, %r14d
	leal	-1(%rbx), %r13d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %r10
	movl	-4(%r15), %esi
	movq	%r14, %r8
	movl	(%r10), %ecx
	cmpl	%ecx, %esi
	je	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%r8d, %ebx
	jle	.L9
	movl	%r13d, %edx
	leal	(%rsi,%rcx), %r9d
	subl	%r8d, %edx
	leaq	-1(%r8,%rdx), %rax
	movq	%r10, %rdx
	leaq	0(%rbp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movl	4(%rdx), %eax
	cmpl	%eax, %ecx
	je	.L10
	cmpl	%eax, %esi
	je	.L10
	cmpl	%r9d, %eax
	jge	.L10
	leal	(%rcx,%rax), %r11d
	cmpl	%r11d, %esi
	jge	.L10
	addl	%esi, %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %eax
	addl	%eax, %r12d
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L11
.L12:
	movl	4(%r10), %ecx
	addq	$4, %r10
	addq	$1, %r8
	cmpl	%ecx, %esi
	jne	.L20
.L8:
	cmpl	%r8d, %ebx
	jg	.L12
.L9:
	addq	$1, %r14
	addq	$4, %r15
	cmpq	8(%rsp), %r14
	jne	.L6
.L7:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$456, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L7
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	addq	$4, %r13
	cmpl	%r12d, %ebx
	jg	.L3
	testl	%ebx, %ebx
	jle	.L2
	cmpl	$1, %ebx
	je	.L2
	leal	1(%rbx), %eax
	leaq	36(%rsp), %r15
	xorl	%r12d, %r12d
	addq	$4, %rbp
	movq	%rax, 8(%rsp)
	movl	$2, %r14d
	leal	-1(%rbx), %r13d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %r10
	movl	-4(%r15), %esi
	movq	%r14, %r8
	movl	(%r10), %ecx
	cmpl	%ecx, %esi
	je	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%r8d, %ebx
	jle	.L9
	movl	%r13d, %edx
	leal	(%rsi,%rcx), %r9d
	subl	%r8d, %edx
	leaq	-1(%r8,%rdx), %rax
	movq	%r10, %rdx
	leaq	0(%rbp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movl	4(%rdx), %eax
	cmpl	%eax, %ecx
	je	.L10
	cmpl	%eax, %esi
	je	.L10
	cmpl	%r9d, %eax
	jge	.L10
	leal	(%rcx,%rax), %r11d
	cmpl	%r11d, %esi
	jge	.L10
	addl	%esi, %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %eax
	addl	%eax, %r12d
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L11
.L12:
	movl	4(%r10), %ecx
	addq	$4, %r10
	addq	$1, %r8
	cmpl	%ecx, %esi
	jne	.L20
.L8:
	cmpl	%r8d, %ebx
	jg	.L12
.L9:
	addq	$1, %r14
	addq	$4, %r15
	cmpq	8(%rsp), %r14
	jne	.L6
.L7:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$456, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L7
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

#define N 200010
#define MAX 1000000000000000000

#include <stdio.h>

int main (void) {
    int n, m = 0, l[100], l_tmp, i, j, k, c = 0;

    scanf("%d", &n);

    for (i = 0; i < n; i++) {
        scanf("%d", &(l[i]));
    }

    for (i = 0; i < n; i++) {
        for (j = i + 1; j < n; j++) {
            if (l[i] == l[j]) continue;
            for (k = j + 1; k < n; k++) {
                if (l[i] == l[k] || l[j] == l[k]) continue;

                if ((l[i] + l[j] > l[k]) &&
                        (l[j] + l[k] > l[i]) &&
                        (l[k] + l[i] > l[j])){
                    c++;
                }
            }
        }
    }

    printf("%d", c);

    return 0;

}

```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

#define N 200010
#define MAX 1000000000000000000

#include <stdio.h>

int main (void) {
    int n, m = 0, l[100], l_tmp, i, j, k, c = 0;

    scanf("%d", &n);

    for (i = 0; i < n; i++) {
        scanf("%d", &(l[i]));
    }

    for (i = 0; i < n; i++) {
        for (j = i + 1; j < n; j++) {
            if (l[i] == l[j]) continue;
            for (k = j + 1; k < n; k++) {
                if (l[i] == l[k] || l[j] == l[k]) continue;

                if ((l[i] + l[j] > l[k]) &&
                        (l[j] + l[k] > l[i]) &&
                        (l[k] + l[i] > l[j])){
                    c++;
                }
            }
        }
    }

    printf("%d", c);

    return 0;

}

```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

2
1 0
 10
9 4 8 1 9 6 10 6 6 8
 6
4 5 8 3 3 5
 5
4 4 3 7 5
 10
9 4 16 1 9 6 10 6 6 8
 6
4 5 6 3 3 5
 5
4 0 3 7 5
 10
9 7 16 1 9 6 10 6 6 8
 5
4 -1 0 7 5
 10
9 7 13 2 9 6 10 6 6 8

0 48 6 5 36 12 3 40 1 63
Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

#define N 200010
#define MAX 1000000000000000000

#include <stdio.h>

int main (void) {
    int n, m = 0, l[100], l_tmp, i, j, k, c = 0;

    scanf("%d", &n);

    for (i = 0; i < n; i++) {
        scanf("%d", &(l[i]));
    }

    for (i = 0; i < n; i++) {
        for (j = i + 1; j < n; j++) {
            if (l[i] == l[j]) continue;
            for (k = j + 1; k < n; k++) {
                if (l[i] == l[k] || l[j] == l[k]) continue;

                if ((l[i] + l[j] > l[k]) &&
                        (l[j] + l[k] > l[i]) &&
                        (l[k] + l[i] > l[j])){
                    c++;
                }
            }
        }
    }

    printf("%d", c);

    return 0;

}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	addq	$4, %r13
	cmpl	%r12d, %ebx
	jg	.L3
	testl	%ebx, %ebx
	jle	.L2
	cmpl	$1, %ebx
	je	.L2
	leal	1(%rbx), %eax
	leaq	36(%rsp), %r15
	xorl	%r12d, %r12d
	addq	$4, %rbp
	movq	%rax, 8(%rsp)
	movl	$2, %r14d
	leal	-1(%rbx), %r13d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %r10
	movl	-4(%r15), %esi
	movq	%r14, %r8
	movl	(%r10), %ecx
	cmpl	%ecx, %esi
	je	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%r8d, %ebx
	jle	.L9
	movl	%r13d, %edx
	leal	(%rsi,%rcx), %r9d
	subl	%r8d, %edx
	leaq	-1(%r8,%rdx), %rax
	movq	%r10, %rdx
	leaq	0(%rbp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movl	4(%rdx), %eax
	cmpl	%eax, %ecx
	je	.L10
	cmpl	%eax, %esi
	je	.L10
	cmpl	%r9d, %eax
	jge	.L10
	leal	(%rcx,%rax), %r11d
	cmpl	%r11d, %esi
	jge	.L10
	addl	%esi, %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %eax
	addl	%eax, %r12d
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L11
.L12:
	movl	4(%r10), %ecx
	addq	$4, %r10
	addq	$1, %r8
	cmpl	%ecx, %esi
	jne	.L20
.L8:
	cmpl	%r8d, %ebx
	jg	.L12
.L9:
	addq	$1, %r14
	addq	$4, %r15
	cmpq	8(%rsp), %r14
	jne	.L6
.L7:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$456, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L7
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rbp
	xorl	%r12d, %r12d
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	addq	$4, %r13
	cmpl	%r12d, %ebx
	jg	.L3
	testl	%ebx, %ebx
	jle	.L2
	cmpl	$1, %ebx
	je	.L2
	leal	1(%rbx), %eax
	leaq	36(%rsp), %r15
	xorl	%r12d, %r12d
	addq	$4, %rbp
	movq	%rax, 8(%rsp)
	movl	$2, %r14d
	leal	-1(%rbx), %r13d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %r10
	movl	-4(%r15), %esi
	movq	%r14, %r8
	movl	(%r10), %ecx
	cmpl	%ecx, %esi
	je	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%r8d, %ebx
	jle	.L9
	movl	%r13d, %edx
	leal	(%rsi,%rcx), %r9d
	subl	%r8d, %edx
	leaq	-1(%r8,%rdx), %rax
	movq	%r10, %rdx
	leaq	0(%rbp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movl	4(%rdx), %eax
	cmpl	%eax, %ecx
	je	.L10
	cmpl	%eax, %esi
	je	.L10
	cmpl	%r9d, %eax
	jge	.L10
	leal	(%rcx,%rax), %r11d
	cmpl	%r11d, %esi
	jge	.L10
	addl	%esi, %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %eax
	addl	%eax, %r12d
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L11
.L12:
	movl	4(%r10), %ecx
	addq	$4, %r10
	addq	$1, %r8
	cmpl	%ecx, %esi
	jne	.L20
.L8:
	cmpl	%r8d, %ebx
	jg	.L12
.L9:
	addq	$1, %r14
	addq	$4, %r15
	cmpq	8(%rsp), %r14
	jne	.L6
.L7:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$456, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L7
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```