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

```c
#define M 39999
T[M],t[M];main(i,j,k,L,r){
for(i=2;i<M;i++)if(!T[i])for(j=i*2;j<M;j+=i)T[j]=1;
for(i=2,j=0;i<M;i++)if(!T[i])t[j++]=i;
for(;scanf("%d",&L),L;printf("%d\n",r))for(r=i=0;t[i]<L;i++)for(j=i;;j++){
	k=L-t[i]-t[j];
	if(k<t[j])break;
	if(!T[k]&&t[j]-t[i]<k&&k<t[j]+t[i])r++;
}exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	T
	.bss
	.align 32
	.type	T, @object
	.size	T, 159996
T:
	.zero	159996
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 159996
t:
	.zero	159996
	.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
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	movl	$2, -4(%rbp)
	jmp	.L2
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L4
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
.L4:
	cmpl	$39998, -8(%rbp)
	jle	.L5
.L3:
	addl	$1, -4(%rbp)
.L2:
	cmpl	$39998, -4(%rbp)
	jle	.L6
	movl	$2, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L7
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L8
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	t(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L8:
	addl	$1, -4(%rbp)
.L7:
	cmpl	$39998, -4(%rbp)
	jle	.L9
	jmp	.L10
.L17:
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L11
.L16:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L15:
	movl	-16(%rbp), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	t(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	t(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -12(%rbp)
	jle	.L14
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L14
	addl	$1, -20(%rbp)
.L14:
	addl	$1, -8(%rbp)
	jmp	.L15
.L19:
	nop
	addl	$1, -4(%rbp)
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L16
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$2, %edx
	leaq	T(%rip), %r13
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movl	%ecx, 12(%rsp)
	movl	$4, %ecx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$1, %rdx
	addq	$2, %rcx
	cmpq	$39999, %rdx
	je	.L21
.L4:
	movl	0(%r13,%rdx,4), %r8d
	testl	%r8d, %r8d
	jne	.L2
	cmpq	$39998, %rcx
	ja	.L2
	movq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$1, 0(%r13,%rax,4)
	addq	%rdx, %rax
	cmpl	$39998, %eax
	jle	.L3
	jmp	.L2
.L21:
	movl	$2, %eax
	xorl	%edx, %edx
	leaq	t(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movl	0(%r13,%rax,4), %edi
	testl	%edi, %edi
	jne	.L5
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%eax, (%rsi,%rcx,4)
.L5:
	addq	$1, %rax
	cmpq	$39999, %rax
	jne	.L6
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %r11d
	testl	%r11d, %r11d
	je	.L12
	movl	t(%rip), %r8d
	cmpl	%r11d, %r8d
	jge	.L14
	leaq	t(%rip), %r9
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r11d, %edi
	movl	(%r9), %eax
	subl	%r8d, %edi
	movl	%edi, %edx
	subl	%eax, %edx
	cmpl	%eax, %edx
	jl	.L11
	movq	%r9, %rcx
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%edx, %rsi
	movl	0(%r13,%rsi,4), %esi
	testl	%esi, %esi
	jne	.L8
	movl	%eax, %esi
	subl	%r8d, %esi
	cmpl	%esi, %edx
	jle	.L8
	addl	%r8d, %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %eax
	addl	%eax, %r10d
.L8:
	movl	4(%rcx), %eax
	movl	%edi, %edx
	addq	$4, %rcx
	subl	%eax, %edx
	cmpl	%edx, %eax
	jle	.L9
.L11:
	movl	4(%r9), %r8d
	addq	$4, %r9
	cmpl	%r11d, %r8d
	jl	.L13
	movl	%r10d, %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L7
.L12:
	xorl	%edi, %edi
	call	exit@PLT
.L14:
	xorl	%r10d, %r10d
	movq	%r12, %rdi
	xorl	%eax, %eax
	movl	%r10d, %esi
	call	printf@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 159996
t:
	.zero	159996
	.globl	T
	.align 32
	.type	T, @object
	.size	T, 159996
T:
	.zero	159996
	.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:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$2, %edx
	leaq	T(%rip), %r13
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movl	%ecx, 12(%rsp)
	movl	$4, %ecx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	addq	$1, %rdx
	addq	$2, %rcx
	cmpq	$39999, %rdx
	je	.L21
.L4:
	movl	0(%r13,%rdx,4), %r8d
	testl	%r8d, %r8d
	jne	.L2
	cmpq	$39998, %rcx
	ja	.L2
	movq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$1, 0(%r13,%rax,4)
	addq	%rdx, %rax
	cmpl	$39998, %eax
	jle	.L3
	jmp	.L2
.L21:
	movl	$2, %eax
	xorl	%edx, %edx
	leaq	t(%rip), %rsi
	.p2align 4,,10
	.p2align 3
.L6:
	movl	0(%r13,%rax,4), %edi
	testl	%edi, %edi
	jne	.L5
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%eax, (%rsi,%rcx,4)
.L5:
	addq	$1, %rax
	cmpq	$39999, %rax
	jne	.L6
	leaq	12(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %r11d
	testl	%r11d, %r11d
	je	.L12
	movl	t(%rip), %r8d
	cmpl	%r11d, %r8d
	jge	.L14
	leaq	t(%rip), %r9
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r11d, %edi
	movl	(%r9), %eax
	subl	%r8d, %edi
	movl	%edi, %edx
	subl	%eax, %edx
	cmpl	%eax, %edx
	jl	.L11
	movq	%r9, %rcx
	.p2align 4,,10
	.p2align 3
.L9:
	movslq	%edx, %rsi
	movl	0(%r13,%rsi,4), %esi
	testl	%esi, %esi
	jne	.L8
	movl	%eax, %esi
	subl	%r8d, %esi
	cmpl	%esi, %edx
	jle	.L8
	addl	%r8d, %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %eax
	addl	%eax, %r10d
.L8:
	movl	4(%rcx), %eax
	movl	%edi, %edx
	addq	$4, %rcx
	subl	%eax, %edx
	cmpl	%edx, %eax
	jle	.L9
.L11:
	movl	4(%r9), %r8d
	addq	$4, %r9
	cmpl	%r11d, %r8d
	jl	.L13
	movl	%r10d, %esi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L7
.L12:
	xorl	%edi, %edi
	call	exit@PLT
.L14:
	xorl	%r10d, %r10d
	movq	%r12, %rdi
	xorl	%eax, %eax
	movl	%r10d, %esi
	call	printf@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 159996
t:
	.zero	159996
	.globl	T
	.align 32
	.type	T, @object
	.size	T, 159996
T:
	.zero	159996
	.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:

#define M 39999
T[M],t[M];main(i,j,k,L,r){
for(i=2;i<M;i++)if(!T[i])for(j=i*2;j<M;j+=i)T[j]=1;
for(i=2,j=0;i<M;i++)if(!T[i])t[j++]=i;
for(;scanf("%d",&L),L;printf("%d\n",r))for(r=i=0;t[i]<L;i++)for(j=i;;j++){
	k=L-t[i]-t[j];
	if(k<t[j])break;
	if(!T[k]&&t[j]-t[i]<k&&k<t[j]+t[i])r++;
}exit(0);}
10
12
15
777
7180
5000
0
 10
2
15
777
7180
5000
0
 10
1
15
149
7180
5000
0
 10
1
15
149
7180
2901
0
 10
1
15
149
7180
6275
0
 10
1
15
149
7180
10757
0
 10
1
42
149
7180
2924
0
 10
1
42
149
635
3334
0
 10
12
15
777
4999
232
0
 10
12
15
1177
7180
5000
0

0
1
2
110
0
0
 0
0
2
110
0
0
 0
0
2
20
0
0
 0
0
2
20
0
791
 0
0
2
20
0
4041
 0
0
2
20
0
9902
 0
0
0
20
0
0
 0
0
0
20
133
0
 0
1
2
110
2780
0
 0
1
2
277
0
0

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

```c
#define M 39999
T[M],t[M];main(i,j,k,L,r){
for(i=2;i<M;i++)if(!T[i])for(j=i*2;j<M;j+=i)T[j]=1;
for(i=2,j=0;i<M;i++)if(!T[i])t[j++]=i;
for(;scanf("%d",&L),L;printf("%d\n",r))for(r=i=0;t[i]<L;i++)for(j=i;;j++){
	k=L-t[i]-t[j];
	if(k<t[j])break;
	if(!T[k]&&t[j]-t[i]<k&&k<t[j]+t[i])r++;
}exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	T
	.bss
	.align 32
	.type	T, @object
	.size	T, 159996
T:
	.zero	159996
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 159996
t:
	.zero	159996
	.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
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	movl	$2, -4(%rbp)
	jmp	.L2
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L4
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
.L4:
	cmpl	$39998, -8(%rbp)
	jle	.L5
.L3:
	addl	$1, -4(%rbp)
.L2:
	cmpl	$39998, -4(%rbp)
	jle	.L6
	movl	$2, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L7
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L8
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	t(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L8:
	addl	$1, -4(%rbp)
.L7:
	cmpl	$39998, -4(%rbp)
	jle	.L9
	jmp	.L10
.L17:
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L11
.L16:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L15:
	movl	-16(%rbp), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	t(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	t(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -12(%rbp)
	jle	.L14
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L14
	addl	$1, -20(%rbp)
.L14:
	addl	$1, -8(%rbp)
	jmp	.L15
.L19:
	nop
	addl	$1, -4(%rbp)
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L16
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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
	.globl	T
	.bss
	.align 32
	.type	T, @object
	.size	T, 159996
T:
	.zero	159996
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 159996
t:
	.zero	159996
	.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
	subq	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	movl	$2, -4(%rbp)
	jmp	.L2
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L3
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -8(%rbp)
	jmp	.L4
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-4(%rbp), %eax
	addl	%eax, -8(%rbp)
.L4:
	cmpl	$39998, -8(%rbp)
	jle	.L5
.L3:
	addl	$1, -4(%rbp)
.L2:
	cmpl	$39998, -4(%rbp)
	jle	.L6
	movl	$2, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L7
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L8
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	t(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L8:
	addl	$1, -4(%rbp)
.L7:
	cmpl	$39998, -4(%rbp)
	jle	.L9
	jmp	.L10
.L17:
	movl	$0, -4(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L11
.L16:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L15:
	movl	-16(%rbp), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	t(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	T(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L14
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	t(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	cmpl	%eax, -12(%rbp)
	jle	.L14
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L14
	addl	$1, -20(%rbp)
.L14:
	addl	$1, -8(%rbp)
	jmp	.L15
.L19:
	nop
	addl	$1, -4(%rbp)
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L16
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-16(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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:
