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

```c
n,t,k[999];main(i){for(;scanf("%d",&i)*i;puts(n?"No":"Yes")){for(;n=t=i--;k[n]+=t)scanf("%d%d",&t,&n);for(;++i<999;n|=t>i)t+=k[i],k[i]=0;}}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	k
	.align 32
	.type	k, @object
	.size	k, 3996
k:
	.zero	3996
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"No"
.LC2:
	.string	"Yes"
.LC3:
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L2
.L4:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	t(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	t(%rip), %edx
	movl	n(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L3:
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	movl	%eax, t(%rip)
	movl	t(%rip), %eax
	movl	%eax, n(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L4
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	t(%rip), %eax
	addl	%edx, %eax
	movl	%eax, t(%rip)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	t(%rip), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %edx
	movl	n(%rip), %eax
	orl	%edx, %eax
	movl	%eax, n(%rip)
.L5:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cmpl	$998, %eax
	jle	.L6
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L7
	leaq	.LC1(%rip), %rax
	jmp	.L8
.L7:
	leaq	.LC2(%rip), %rax
.L8:
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	$0, %eax
	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	"No"
.LC1:
	.string	"Yes"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	k(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC3(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	n(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	t(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L6
	leal	-1(%rdx), %eax
	movl	%edx, t(%rip)
	movl	%eax, 12(%rsp)
	movl	%edx, n(%rip)
	testl	%edx, %edx
	je	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %rax
	movl	t(%rip), %edx
	addl	%edx, (%r15,%rax,4)
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%eax, t(%rip)
	movl	%edx, 12(%rsp)
	movl	%eax, n(%rip)
	testl	%eax, %eax
	jne	.L3
.L7:
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	%eax, %rcx
	addl	(%r15,%rcx,4), %edx
	movl	$0, (%r15,%rcx,4)
	xorl	%ecx, %ecx
	cmpl	%eax, %edx
	setg	%cl
	addl	$1, %eax
	orl	%ecx, %esi
	cmpl	$999, %eax
	jne	.L4
	testl	%esi, %esi
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %rax
	movl	%edx, t(%rip)
	cmove	%rax, %rdi
	movl	%esi, n(%rip)
	movl	$999, 12(%rsp)
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	k
	.bss
	.align 32
	.type	k, @object
	.size	k, 3996
k:
	.zero	3996
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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	"No"
.LC1:
	.string	"Yes"
.LC2:
	.string	"%d%d"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	k(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC3(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	n(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	t(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L6
	leal	-1(%rdx), %eax
	movl	%edx, t(%rip)
	movl	%eax, 12(%rsp)
	movl	%edx, n(%rip)
	testl	%edx, %edx
	je	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %rax
	movl	t(%rip), %edx
	addl	%edx, (%r15,%rax,4)
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%eax, t(%rip)
	movl	%edx, 12(%rsp)
	movl	%eax, n(%rip)
	testl	%eax, %eax
	jne	.L3
.L7:
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	%eax, %rcx
	addl	(%r15,%rcx,4), %edx
	movl	$0, (%r15,%rcx,4)
	xorl	%ecx, %ecx
	cmpl	%eax, %edx
	setg	%cl
	addl	$1, %eax
	orl	%ecx, %esi
	cmpl	$999, %eax
	jne	.L4
	testl	%esi, %esi
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %rax
	movl	%edx, t(%rip)
	cmove	%rax, %rdi
	movl	%esi, n(%rip)
	movl	$999, 12(%rsp)
	call	puts@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	k
	.bss
	.align 32
	.type	k, @object
	.size	k, 3996
k:
	.zero	3996
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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:

n,t,k[999];main(i){for(;scanf("%d",&i)*i;puts(n?"No":"Yes")){for(;n=t=i--;k[n]+=t)scanf("%d%d",&t,&n);for(;++i<999;n|=t>i)t+=k[i],k[i]=0;}}
3
2 3
3 6
1 2
3
2 3
3 5
2 2
0
 3
2 3
3 6
2 2
3
3 3
3 6
2 2
0
 3
2 1
3 6
1 2
3
2 3
3 5
0 2
0
 3
2 5
0 9
4 1
0
2 0
3 10
2 3
0
 3
4 5
3 8
1 2
0
7 3
3 5
2 1
0
 3
2 3
3 6
1 2
3
0 3
3 5
1 2
0
 3
2 3
3 6
1 2
3
3 3
3 5
2 2
0
 3
2 3
3 6
1 2
3
3 3
3 6
2 2
0
 3
2 3
3 8
2 2
3
3 3
3 6
2 2
0
 3
2 3
3 8
2 2
3
3 3
3 6
2 3
0

Yes
No
 No
No
 No
Yes
 No
 Yes
 Yes
Yes
 Yes
No
 Yes
No
 No
No
 No
No

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

```c
n,t,k[999];main(i){for(;scanf("%d",&i)*i;puts(n?"No":"Yes")){for(;n=t=i--;k[n]+=t)scanf("%d%d",&t,&n);for(;++i<999;n|=t>i)t+=k[i],k[i]=0;}}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	k
	.align 32
	.type	k, @object
	.size	k, 3996
k:
	.zero	3996
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"No"
.LC2:
	.string	"Yes"
.LC3:
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L2
.L4:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	t(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	t(%rip), %edx
	movl	n(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L3:
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	movl	%eax, t(%rip)
	movl	t(%rip), %eax
	movl	%eax, n(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L4
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	t(%rip), %eax
	addl	%edx, %eax
	movl	%eax, t(%rip)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	t(%rip), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %edx
	movl	n(%rip), %eax
	orl	%edx, %eax
	movl	%eax, n(%rip)
.L5:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cmpl	$998, %eax
	jle	.L6
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L7
	leaq	.LC1(%rip), %rax
	jmp	.L8
.L7:
	leaq	.LC2(%rip), %rax
.L8:
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	$0, %eax
	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
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	k
	.align 32
	.type	k, @object
	.size	k, 3996
k:
	.zero	3996
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"No"
.LC2:
	.string	"Yes"
.LC3:
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L2
.L4:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	t(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	t(%rip), %edx
	movl	n(%rip), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L3:
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	movl	%eax, t(%rip)
	movl	t(%rip), %eax
	movl	%eax, n(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L4
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	t(%rip), %eax
	addl	%edx, %eax
	movl	%eax, t(%rip)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	k(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	t(%rip), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %edx
	movl	n(%rip), %eax
	orl	%edx, %eax
	movl	%eax, n(%rip)
.L5:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cmpl	$998, %eax
	jle	.L6
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L7
	leaq	.LC1(%rip), %rax
	jmp	.L8
.L7:
	leaq	.LC2(%rip), %rax
.L8:
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	movl	$0, %eax
	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:
