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

```c
long a;main(d,c){for(gets(&d);~scanf("%d%s%d",&d,&c,&d);puts(a?"No":"Yes"))a+=c&1?d:-d;exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.section	.rodata
.LC0:
	.string	"No"
.LC1:
	.string	"Yes"
.LC2:
	.string	"%d%s%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)
	movl	%esi, -8(%rbp)
	leaq	-4(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	gets@PLT
	jmp	.L2
.L7:
	movl	-8(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movl	-4(%rbp), %eax
	cltq
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	negl	%eax
	cltq
.L4:
	movq	a(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, a(%rip)
	movq	a(%rip), %rax
	testq	%rax, %rax
	je	.L5
	leaq	.LC0(%rip), %rax
	jmp	.L6
.L5:
	leaq	.LC1(%rip), %rax
.L6:
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-4(%rbp), %rcx
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L7
	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	"No"
.LC1:
	.string	"Yes"
.LC2:
	.string	"%d%s%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	leaq	12(%rsp), %rbx
	movl	%edi, 12(%rsp)
	leaq	8(%rsp), %r12
	movq	%rbx, %rdi
	movl	%esi, 8(%rsp)
	call	gets@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	12(%rsp), %rdx
	movq	%r13, %rdi
	movq	%rdx, %rax
	negl	%eax
	testb	$1, 8(%rsp)
	cltq
	cmovne	%rdx, %rax
	addq	%rax, a(%rip)
	cmovne	%r14, %rdi
	call	puts@PLT
.L2:
	xorl	%eax, %eax
	movq	%rbx, %rcx
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L6
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.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%s%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	leaq	12(%rsp), %rbx
	movl	%edi, 12(%rsp)
	leaq	8(%rsp), %r12
	movq	%rbx, %rdi
	movl	%esi, 8(%rsp)
	call	gets@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	12(%rsp), %rdx
	movq	%r13, %rdi
	movq	%rdx, %rax
	negl	%eax
	testb	$1, 8(%rsp)
	cltq
	cmovne	%rdx, %rax
	addq	%rax, a(%rip)
	cmovne	%r14, %rdi
	call	puts@PLT
.L2:
	xorl	%eax, %eax
	movq	%rbx, %rcx
	movq	%r12, %rdx
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L6
	xorl	%edi, %edi
	call	exit@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.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:

long a;main(d,c){for(gets(&d);~scanf("%d%s%d",&d,&c,&d);puts(a?"No":"Yes"))a+=c&1?d:-d;exit(0);}
3
0 ( 10
10 ) 5
10 ( 5
 3
-1 ( 10
10 ) 5
10 ) 5
 3
-1 ( 9
10 ) 9
20 ( 4
 3
-1 ) 0
8 ( 19
4 ' 2
 3
-2 ) 0
7 ) 0
4 ( 11
 3
-1 ( 0
10 ) 4
20 ( 4
 3
0 ) 0
7 * 0
1 ( 0
 3
0 ) 10
10 ( 5
10 ( 7
 3
-1 ( 10
10 ) 5
10 ( 5
 3
0 ) 10
10 ( 9
10 ( 7

No
No
No
 No
No
Yes
 No
Yes
No
 Yes
No
No
 Yes
Yes
No
 Yes
No
Yes
 Yes
Yes
Yes
 No
No
No
 No
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
long a;main(d,c){for(gets(&d);~scanf("%d%s%d",&d,&c,&d);puts(a?"No":"Yes"))a+=c&1?d:-d;exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.section	.rodata
.LC0:
	.string	"No"
.LC1:
	.string	"Yes"
.LC2:
	.string	"%d%s%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)
	movl	%esi, -8(%rbp)
	leaq	-4(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	gets@PLT
	jmp	.L2
.L7:
	movl	-8(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movl	-4(%rbp), %eax
	cltq
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	negl	%eax
	cltq
.L4:
	movq	a(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, a(%rip)
	movq	a(%rip), %rax
	testq	%rax, %rax
	je	.L5
	leaq	.LC0(%rip), %rax
	jmp	.L6
.L5:
	leaq	.LC1(%rip), %rax
.L6:
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-4(%rbp), %rcx
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L7
	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	a
	.bss
	.align 8
	.type	a, @object
	.size	a, 8
a:
	.zero	8
	.section	.rodata
.LC0:
	.string	"No"
.LC1:
	.string	"Yes"
.LC2:
	.string	"%d%s%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)
	movl	%esi, -8(%rbp)
	leaq	-4(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	gets@PLT
	jmp	.L2
.L7:
	movl	-8(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movl	-4(%rbp), %eax
	cltq
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	negl	%eax
	cltq
.L4:
	movq	a(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, a(%rip)
	movq	a(%rip), %rax
	testq	%rax, %rax
	je	.L5
	leaq	.LC0(%rip), %rax
	jmp	.L6
.L5:
	leaq	.LC1(%rip), %rax
.L6:
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-4(%rbp), %rcx
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L7
	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:
