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

```c
#include <stdio.h>
#include <math.h>
int main(void) {
    int n,i,j,sieve[10001]={0};
    sieve[1]=1;
    for (i=2; i<=sqrt(10000); i++) {
        if (sieve[i]==0) {
            for (j=i*2; j<=10000; j+=i) sieve[j]=1;
        }
    }
    while (scanf("%d",&n)!=EOF) {
        int count=0;
        if (n%2==0) {
            for (i=2; i<=n/2; i++) {
                if (sieve[i]==0&&sieve[n+1-i]==0) count++;
            }
            printf("%d\n",count*2);
        } else {
            for (i=2; i<=n/2; i++) {
                if (sieve[i]==0&&sieve[n+1-i]==0) count++;
            }
            if (sieve[n/2+1]==0) {
                printf("%d\n",count*2+1);
            } else {
                printf("%d\n",count*2);
            }
        }
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3168, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40016(%rbp), %rax
	movl	$40004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -40012(%rbp)
	movl	$2, -40028(%rbp)
	jmp	.L2
.L6:
	movl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L3
	movl	-40028(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -40024(%rbp)
	jmp	.L4
.L5:
	movl	-40024(%rbp), %eax
	cltq
	movl	$1, -40016(%rbp,%rax,4)
	movl	-40028(%rbp), %eax
	addl	%eax, -40024(%rbp)
.L4:
	cmpl	$10000, -40024(%rbp)
	jle	.L5
.L3:
	addl	$1, -40028(%rbp)
.L2:
	cmpl	$100, -40028(%rbp)
	jle	.L6
	jmp	.L7
.L16:
	movl	$0, -40020(%rbp)
	movl	-40032(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L8
	movl	$2, -40028(%rbp)
	jmp	.L9
.L11:
	movl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-40032(%rbp), %eax
	addl	$1, %eax
	subl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	addl	$1, -40020(%rbp)
.L10:
	addl	$1, -40028(%rbp)
.L9:
	movl	-40032(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40028(%rbp)
	jle	.L11
	movl	-40020(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L8:
	movl	$2, -40028(%rbp)
	jmp	.L12
.L14:
	movl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-40032(%rbp), %eax
	addl	$1, %eax
	subl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L13
	addl	$1, -40020(%rbp)
.L13:
	addl	$1, -40028(%rbp)
.L12:
	movl	-40032(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40028(%rbp)
	jle	.L14
	movl	-40032(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-40020(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L15:
	movl	-40020(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	leaq	-40032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
user
	.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	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36904
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3176, %rsp
	.cfi_def_cfa_offset 40080
	movl	$40004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 40024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	movq	%rbx, %rdi
	call	memset@PLT
	movl	$4, %ecx
	movl	$2, %edx
	movl	$1, 20(%rsp)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$1, %rdx
	addq	$2, %rcx
	cmpq	$101, %rdx
	je	.L27
.L3:
	movl	(%rbx,%rdx,4), %r8d
	testl	%r8d, %r8d
	jne	.L28
	movq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$1, (%rbx,%rax,4)
	addq	%rdx, %rax
	cmpl	$10000, %eax
	jle	.L2
	addq	$1, %rdx
	addq	$2, %rcx
	cmpq	$101, %rdx
	jne	.L3
.L27:
	leaq	12(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L29
	movl	12(%rsp), %esi
	movl	%esi, %ecx
	shrl	$31, %ecx
	addl	%esi, %ecx
	sarl	%ecx
	testb	$1, %sil
	je	.L6
	movl	$2, %eax
	xorl	%edx, %edx
	leal	1(%rsi), %edi
	cmpl	$3, %esi
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rbx,%rax,4), %esi
	testl	%esi, %esi
	jne	.L13
	movl	%edi, %esi
	subl	%eax, %esi
	movslq	%esi, %rsi
	cmpl	$1, 16(%rsp,%rsi,4)
	adcl	$0, %edx
.L13:
	addq	$1, %rax
	cmpl	%eax, %ecx
	jge	.L7
.L8:
	addl	$1, %ecx
	addl	%edx, %edx
	movslq	%ecx, %rcx
	movl	16(%rsp,%rcx,4), %eax
	testl	%eax, %eax
	jne	.L14
	addl	$1, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	$3, %esi
	jle	.L19
	movl	$2, %eax
	xorl	%edx, %edx
	addl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%rbx,%rax,4), %edi
	testl	%edi, %edi
	jne	.L10
	movl	%esi, %edi
	subl	%eax, %edi
	movslq	%edi, %rdi
	cmpl	$1, 16(%rsp,%rdi,4)
	adcl	$0, %edx
.L10:
	addq	$1, %rax
	cmpl	%eax, %ecx
	jge	.L11
.L9:
	addl	%edx, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L14:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L29:
	movq	40024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$40040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L19:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L9
.L30:
	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
	.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	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36904
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3176, %rsp
	.cfi_def_cfa_offset 40080
	movl	$40004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 40024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	movq	%rbx, %rdi
	call	memset@PLT
	movl	$4, %ecx
	movl	$2, %edx
	movl	$1, 20(%rsp)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$1, %rdx
	addq	$2, %rcx
	cmpq	$101, %rdx
	je	.L27
.L3:
	movl	(%rbx,%rdx,4), %r8d
	testl	%r8d, %r8d
	jne	.L28
	movq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$1, (%rbx,%rax,4)
	addq	%rdx, %rax
	cmpl	$10000, %eax
	jle	.L2
	addq	$1, %rdx
	addq	$2, %rcx
	cmpq	$101, %rdx
	jne	.L3
.L27:
	leaq	12(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L29
	movl	12(%rsp), %esi
	movl	%esi, %ecx
	shrl	$31, %ecx
	addl	%esi, %ecx
	sarl	%ecx
	testb	$1, %sil
	je	.L6
	movl	$2, %eax
	xorl	%edx, %edx
	leal	1(%rsi), %edi
	cmpl	$3, %esi
	jle	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rbx,%rax,4), %esi
	testl	%esi, %esi
	jne	.L13
	movl	%edi, %esi
	subl	%eax, %esi
	movslq	%esi, %rsi
	cmpl	$1, 16(%rsp,%rsi,4)
	adcl	$0, %edx
.L13:
	addq	$1, %rax
	cmpl	%eax, %ecx
	jge	.L7
.L8:
	addl	$1, %ecx
	addl	%edx, %edx
	movslq	%ecx, %rcx
	movl	16(%rsp,%rcx,4), %eax
	testl	%eax, %eax
	jne	.L14
	addl	$1, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	$3, %esi
	jle	.L19
	movl	$2, %eax
	xorl	%edx, %edx
	addl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L11:
	movl	(%rbx,%rax,4), %edi
	testl	%edi, %edi
	jne	.L10
	movl	%esi, %edi
	subl	%eax, %edi
	movslq	%edi, %rdi
	cmpl	$1, 16(%rsp,%rdi,4)
	adcl	$0, %edx
.L10:
	addq	$1, %rax
	cmpl	%eax, %ecx
	jge	.L11
.L9:
	addl	%edx, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L14:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
.L29:
	movq	40024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$40040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L19:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L9
.L30:
	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:

#include <stdio.h>
#include <math.h>
int main(void) {
    int n,i,j,sieve[10001]={0};
    sieve[1]=1;
    for (i=2; i<=sqrt(10000); i++) {
        if (sieve[i]==0) {
            for (j=i*2; j<=10000; j+=i) sieve[j]=1;
        }
    }
    while (scanf("%d",&n)!=EOF) {
        int count=0;
        if (n%2==0) {
            for (i=2; i<=n/2; i++) {
                if (sieve[i]==0&&sieve[n+1-i]==0) count++;
            }
            printf("%d\n",count*2);
        } else {
            for (i=2; i<=n/2; i++) {
                if (sieve[i]==0&&sieve[n+1-i]==0) count++;
            }
            if (sieve[n/2+1]==0) {
                printf("%d\n",count*2+1);
            } else {
                printf("%d\n",count*2);
            }
        }
    }
    return 0;
}
1
8
7
51
 1
10
7
51
 1
10
7
65
 1
12
7
115
 1
12
9
115
 1
12
9
15
 1
26
9
15
 1
26
11
15
 1
26
11
20
 1
27
11
20

0
2
2
6
 0
0
2
6
 0
0
2
12
 0
2
2
12
 0
2
3
12
 0
2
3
4
 0
0
3
4
 0
0
2
4
 0
0
2
2
 0
4
2
2

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

```c
#include <stdio.h>
#include <math.h>
int main(void) {
    int n,i,j,sieve[10001]={0};
    sieve[1]=1;
    for (i=2; i<=sqrt(10000); i++) {
        if (sieve[i]==0) {
            for (j=i*2; j<=10000; j+=i) sieve[j]=1;
        }
    }
    while (scanf("%d",&n)!=EOF) {
        int count=0;
        if (n%2==0) {
            for (i=2; i<=n/2; i++) {
                if (sieve[i]==0&&sieve[n+1-i]==0) count++;
            }
            printf("%d\n",count*2);
        } else {
            for (i=2; i<=n/2; i++) {
                if (sieve[i]==0&&sieve[n+1-i]==0) count++;
            }
            if (sieve[n/2+1]==0) {
                printf("%d\n",count*2+1);
            } else {
                printf("%d\n",count*2);
            }
        }
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3168, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40016(%rbp), %rax
	movl	$40004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -40012(%rbp)
	movl	$2, -40028(%rbp)
	jmp	.L2
.L6:
	movl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L3
	movl	-40028(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -40024(%rbp)
	jmp	.L4
.L5:
	movl	-40024(%rbp), %eax
	cltq
	movl	$1, -40016(%rbp,%rax,4)
	movl	-40028(%rbp), %eax
	addl	%eax, -40024(%rbp)
.L4:
	cmpl	$10000, -40024(%rbp)
	jle	.L5
.L3:
	addl	$1, -40028(%rbp)
.L2:
	cmpl	$100, -40028(%rbp)
	jle	.L6
	jmp	.L7
.L16:
	movl	$0, -40020(%rbp)
	movl	-40032(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L8
	movl	$2, -40028(%rbp)
	jmp	.L9
.L11:
	movl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-40032(%rbp), %eax
	addl	$1, %eax
	subl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	addl	$1, -40020(%rbp)
.L10:
	addl	$1, -40028(%rbp)
.L9:
	movl	-40032(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40028(%rbp)
	jle	.L11
	movl	-40020(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L8:
	movl	$2, -40028(%rbp)
	jmp	.L12
.L14:
	movl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-40032(%rbp), %eax
	addl	$1, %eax
	subl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L13
	addl	$1, -40020(%rbp)
.L13:
	addl	$1, -40028(%rbp)
.L12:
	movl	-40032(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40028(%rbp)
	jle	.L14
	movl	-40032(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-40020(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L15:
	movl	-40020(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	leaq	-40032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3168, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40016(%rbp), %rax
	movl	$40004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -40012(%rbp)
	movl	$2, -40028(%rbp)
	jmp	.L2
.L6:
	movl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L3
	movl	-40028(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -40024(%rbp)
	jmp	.L4
.L5:
	movl	-40024(%rbp), %eax
	cltq
	movl	$1, -40016(%rbp,%rax,4)
	movl	-40028(%rbp), %eax
	addl	%eax, -40024(%rbp)
.L4:
	cmpl	$10000, -40024(%rbp)
	jle	.L5
.L3:
	addl	$1, -40028(%rbp)
.L2:
	cmpl	$100, -40028(%rbp)
	jle	.L6
	jmp	.L7
.L16:
	movl	$0, -40020(%rbp)
	movl	-40032(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L8
	movl	$2, -40028(%rbp)
	jmp	.L9
.L11:
	movl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	movl	-40032(%rbp), %eax
	addl	$1, %eax
	subl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	addl	$1, -40020(%rbp)
.L10:
	addl	$1, -40028(%rbp)
.L9:
	movl	-40032(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40028(%rbp)
	jle	.L11
	movl	-40020(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L8:
	movl	$2, -40028(%rbp)
	jmp	.L12
.L14:
	movl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-40032(%rbp), %eax
	addl	$1, %eax
	subl	-40028(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L13
	addl	$1, -40020(%rbp)
.L13:
	addl	$1, -40028(%rbp)
.L12:
	movl	-40032(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40028(%rbp)
	jle	.L14
	movl	-40032(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L15
	movl	-40020(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L15:
	movl	-40020(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	leaq	-40032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
