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>

int main(){
    int n,a[10001],b[10001],i,j,d;
    while(scanf("%d",&n),n){
        for(i=0;i<n;i++){
            a[i]=0;
            b[i]=0;
        }
        for(i=1;i<n;i++)
            a[i*i%n]=1;
        for(i=0;i<n;i++)
            for(j=0;j<n;j++)
                if(i!=j&&a[i]&&a[j]){
                    d=i-j;
                    if(d<0)d+=n;
                    if(d>(n-1)/2)d=n-d;
                    b[d]++;
                }
        for(i=1;i<=(n-1)/2;i++)
            printf("%d\n",b[i]);
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2248, %rsp
	.cfi_def_cfa_offset 80128
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 80056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L13
	jle	.L10
	movslq	%r13d, %rdx
	leaq	32(%rsp), %r14
	xorl	%esi, %esi
	salq	$2, %rdx
	movq	%r14, %rdi
	leaq	40048(%rsp), %r15
	movq	%rdx, 8(%rsp)
	call	memset@PLT
	movq	8(%rsp), %rdx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	memset@PLT
	cmpl	$1, %r13d
	je	.L3
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %eax
	imull	%ecx, %eax
	addl	$1, %ecx
	cltd
	idivl	%r13d
	movslq	%edx, %rdx
	movl	$1, 32(%rsp,%rdx,4)
	cmpl	%ecx, %r13d
	jg	.L4
.L3:
	leal	-1(%r13), %r9d
	movq	%r14, %rdi
	xorl	%esi, %esi
	sarl	%r9d
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%esi, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%eax, %esi
	je	.L5
	movl	(%rdi), %r8d
	testl	%r8d, %r8d
	je	.L5
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L5
	testl	%edx, %edx
	leal	(%rdx,%r13), %ecx
	movl	%r13d, %r8d
	cmovns	%edx, %ecx
	subl	%ecx, %r8d
	cmpl	%ecx, %r9d
	cmovl	%r8d, %ecx
	movslq	%ecx, %rcx
	addl	$1, 40048(%rsp,%rcx,4)
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, %rax
	subl	$1, %edx
	cmpl	%eax, %r13d
	jg	.L8
	addl	$1, %esi
	addq	$4, %rdi
	cmpl	%esi, %r13d
	jg	.L9
.L10:
	cmpl	$2, %r13d
	jle	.L2
	movl	$1, %r13d
	leaq	40048(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%r15,%r13,4), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__printf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%r13d, %eax
	jge	.L12
	jmp	.L2
.L13:
	movq	80056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$80072, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2248, %rsp
	.cfi_def_cfa_offset 80128
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 80056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L13
	jle	.L10
	movslq	%r13d, %rdx
	leaq	32(%rsp), %r14
	xorl	%esi, %esi
	salq	$2, %rdx
	movq	%r14, %rdi
	leaq	40048(%rsp), %r15
	movq	%rdx, 8(%rsp)
	call	memset@PLT
	movq	8(%rsp), %rdx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	memset@PLT
	cmpl	$1, %r13d
	je	.L3
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %eax
	imull	%ecx, %eax
	addl	$1, %ecx
	cltd
	idivl	%r13d
	movslq	%edx, %rdx
	movl	$1, 32(%rsp,%rdx,4)
	cmpl	%ecx, %r13d
	jg	.L4
.L3:
	leal	-1(%r13), %r9d
	movq	%r14, %rdi
	xorl	%esi, %esi
	sarl	%r9d
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%esi, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%eax, %esi
	je	.L5
	movl	(%rdi), %r8d
	testl	%r8d, %r8d
	je	.L5
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L5
	testl	%edx, %edx
	leal	(%rdx,%r13), %ecx
	movl	%r13d, %r8d
	cmovns	%edx, %ecx
	subl	%ecx, %r8d
	cmpl	%ecx, %r9d
	cmovl	%r8d, %ecx
	movslq	%ecx, %rcx
	addl	$1, 40048(%rsp,%rcx,4)
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, %rax
	subl	$1, %edx
	cmpl	%eax, %r13d
	jg	.L8
	addl	$1, %esi
	addq	$4, %rdi
	cmpl	%esi, %r13d
	jg	.L9
.L10:
	cmpl	$2, %r13d
	jle	.L2
	movl	$1, %r13d
	leaq	40048(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%r15,%r13,4), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__printf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%r13d, %eax
	jge	.L12
	jmp	.L2
.L13:
	movq	80056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$80072, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2248, %rsp
	.cfi_def_cfa_offset 80128
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 80056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L13
	jle	.L10
	movslq	%r13d, %rdx
	leaq	32(%rsp), %r14
	xorl	%esi, %esi
	salq	$2, %rdx
	movq	%r14, %rdi
	leaq	40048(%rsp), %r15
	movq	%rdx, 8(%rsp)
	call	memset@PLT
	movq	8(%rsp), %rdx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	memset@PLT
	cmpl	$1, %r13d
	je	.L3
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %eax
	imull	%ecx, %eax
	addl	$1, %ecx
	cltd
	idivl	%r13d
	movslq	%edx, %rdx
	movl	$1, 32(%rsp,%rdx,4)
	cmpl	%ecx, %r13d
	jg	.L4
.L3:
	leal	-1(%r13), %r9d
	movq	%r14, %rdi
	xorl	%esi, %esi
	sarl	%r9d
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%esi, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%eax, %esi
	je	.L5
	movl	(%rdi), %r8d
	testl	%r8d, %r8d
	je	.L5
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L5
	testl	%edx, %edx
	leal	(%rdx,%r13), %ecx
	movl	%r13d, %r8d
	cmovns	%edx, %ecx
	subl	%ecx, %r8d
	cmpl	%ecx, %r9d
	cmovl	%r8d, %ecx
	movslq	%ecx, %rcx
	addl	$1, 40048(%rsp,%rcx,4)
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, %rax
	subl	$1, %edx
	cmpl	%eax, %r13d
	jg	.L8
	addl	$1, %esi
	addq	$4, %rdi
	cmpl	%esi, %r13d
	jg	.L9
.L10:
	cmpl	$2, %r13d
	jle	.L2
	movl	$1, %r13d
	leaq	40048(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%r15,%r13,4), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__printf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%r13d, %eax
	jge	.L12
	jmp	.L2
.L13:
	movq	80056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$80072, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>

int main(){
    int n,a[10001],b[10001],i,j,d;
    while(scanf("%d",&n),n){
        for(i=0;i<n;i++){
            a[i]=0;
            b[i]=0;
        }
        for(i=1;i<n;i++)
            a[i*i%n]=1;
        for(i=0;i<n;i++)
            for(j=0;j<n;j++)
                if(i!=j&&a[i]&&a[j]){
                    d=i-j;
                    if(d<0)d+=n;
                    if(d>(n-1)/2)d=n-d;
                    b[d]++;
                }
        for(i=1;i<=(n-1)/2;i++)
            printf("%d\n",b[i]);
    }
    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
    int n,a[10001],b[10001],i,j,d;
    while(scanf("%d",&n),n){
        for(i=0;i<n;i++){
            a[i]=0;
            b[i]=0;
        }
        for(i=1;i<n;i++)
            a[i*i%n]=1;
        for(i=0;i<n;i++)
            for(j=0;j<n;j++)
                if(i!=j&&a[i]&&a[j]){
                    d=i-j;
                    if(d<0)d+=n;
                    if(d>(n-1)/2)d=n-d;
                    b[d]++;
                }
        for(i=1;i<=(n-1)/2;i++)
            printf("%d\n",b[i]);
    }
    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:

11
23
0
 11
45
0
 11
77
0
 11
13
0
 11
17
0
 11
25
0
 11
37
0
 11
5
0
 11
69
0
 11
19
0

4
4
4
4
4
10
10
10
10
10
10
10
10
10
10
10
 4
4
4
4
4
4
2
6
4
6
12
2
2
16
6
4
6
2
4
18
4
2
8
4
6
12
2
 4
4
4
4
4
10
12
12
10
12
10
22
12
10
10
22
12
10
22
10
10
10
12
10
12
22
22
10
10
10
12
12
22
12
12
12
12
22
12
22
10
10
12
 4
4
4
4
4
4
6
4
4
6
6
 4
4
4
4
4
6
6
8
6
8
8
8
6
 4
4
4
4
4
4
10
10
4
20
4
10
10
4
20
4
10
 4
4
4
4
4
16
18
16
16
18
18
16
18
16
16
16
16
18
18
18
16
18
18
 4
4
4
4
4
0
2
 4
4
4
4
4
10
12
22
10
10
22
12
12
22
12
10
22
10
10
22
10
10
22
12
10
22
12
22
22
10
12
22
12
12
22
10
12
22
12
 4
4
4
4
4
8
8
8
8
8
8
8
8
8

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>

int main(){
    int n,a[10001],b[10001],i,j,d;
    while(scanf("%d",&n),n){
        for(i=0;i<n;i++){
            a[i]=0;
            b[i]=0;
        }
        for(i=1;i<n;i++)
            a[i*i%n]=1;
        for(i=0;i<n;i++)
            for(j=0;j<n;j++)
                if(i!=j&&a[i]&&a[j]){
                    d=i-j;
                    if(d<0)d+=n;
                    if(d>(n-1)/2)d=n-d;
                    b[d]++;
                }
        for(i=1;i<=(n-1)/2;i++)
            printf("%d\n",b[i]);
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2248, %rsp
	.cfi_def_cfa_offset 80128
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 80056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L13
	jle	.L10
	movslq	%r13d, %rdx
	leaq	32(%rsp), %r14
	xorl	%esi, %esi
	salq	$2, %rdx
	movq	%r14, %rdi
	leaq	40048(%rsp), %r15
	movq	%rdx, 8(%rsp)
	call	memset@PLT
	movq	8(%rsp), %rdx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	memset@PLT
	cmpl	$1, %r13d
	je	.L3
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %eax
	imull	%ecx, %eax
	addl	$1, %ecx
	cltd
	idivl	%r13d
	movslq	%edx, %rdx
	movl	$1, 32(%rsp,%rdx,4)
	cmpl	%ecx, %r13d
	jg	.L4
.L3:
	leal	-1(%r13), %r9d
	movq	%r14, %rdi
	xorl	%esi, %esi
	sarl	%r9d
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%esi, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%eax, %esi
	je	.L5
	movl	(%rdi), %r8d
	testl	%r8d, %r8d
	je	.L5
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L5
	testl	%edx, %edx
	leal	(%rdx,%r13), %ecx
	movl	%r13d, %r8d
	cmovns	%edx, %ecx
	subl	%ecx, %r8d
	cmpl	%ecx, %r9d
	cmovl	%r8d, %ecx
	movslq	%ecx, %rcx
	addl	$1, 40048(%rsp,%rcx,4)
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, %rax
	subl	$1, %edx
	cmpl	%eax, %r13d
	jg	.L8
	addl	$1, %esi
	addq	$4, %rdi
	cmpl	%esi, %r13d
	jg	.L9
.L10:
	cmpl	$2, %r13d
	jle	.L2
	movl	$1, %r13d
	leaq	40048(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%r15,%r13,4), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__printf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%r13d, %eax
	jge	.L12
	jmp	.L2
.L13:
	movq	80056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$80072, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2248, %rsp
	.cfi_def_cfa_offset 80128
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %rbx
	movq	%fs:40, %rax
	movq	%rax, 80056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L13
	jle	.L10
	movslq	%r13d, %rdx
	leaq	32(%rsp), %r14
	xorl	%esi, %esi
	salq	$2, %rdx
	movq	%r14, %rdi
	leaq	40048(%rsp), %r15
	movq	%rdx, 8(%rsp)
	call	memset@PLT
	movq	8(%rsp), %rdx
	xorl	%esi, %esi
	movq	%r15, %rdi
	call	memset@PLT
	cmpl	$1, %r13d
	je	.L3
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%ecx, %eax
	imull	%ecx, %eax
	addl	$1, %ecx
	cltd
	idivl	%r13d
	movslq	%edx, %rdx
	movl	$1, 32(%rsp,%rdx,4)
	cmpl	%ecx, %r13d
	jg	.L4
.L3:
	leal	-1(%r13), %r9d
	movq	%r14, %rdi
	xorl	%esi, %esi
	sarl	%r9d
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%esi, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	%eax, %esi
	je	.L5
	movl	(%rdi), %r8d
	testl	%r8d, %r8d
	je	.L5
	movl	(%r14,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L5
	testl	%edx, %edx
	leal	(%rdx,%r13), %ecx
	movl	%r13d, %r8d
	cmovns	%edx, %ecx
	subl	%ecx, %r8d
	cmpl	%ecx, %r9d
	cmovl	%r8d, %ecx
	movslq	%ecx, %rcx
	addl	$1, 40048(%rsp,%rcx,4)
	.p2align 4,,10
	.p2align 3
.L5:
	addq	$1, %rax
	subl	$1, %edx
	cmpl	%eax, %r13d
	jg	.L8
	addl	$1, %esi
	addq	$4, %rdi
	cmpl	%esi, %r13d
	jg	.L9
.L10:
	cmpl	$2, %r13d
	jle	.L2
	movl	$1, %r13d
	leaq	40048(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%r15,%r13,4), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__printf_chk@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%r13d, %eax
	jge	.L12
	jmp	.L2
.L13:
	movq	80056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$80072, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```