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

```c
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	char *p[2]={"No","Yes"};
	int n, i;
	scanf("%d", &n);
	if(n%3!=0){
		int a;
		char f=1;
		for(i=0; i<n; i++){
			scanf("%d", &a);
			if(a!=0){f=0; break;}
		}
		puts(p[f]);
	}else{
		int a;
		int k[3]={-1,-1,-1};
		int l[3]={0,0,0};
		char f=1;
		for(i=0; i<n; i++){
			scanf("%d", &a);
			if(k[0]<0||k[0]==a) {k[0]=a; l[0]++;}
			else if(k[1]<0||k[1]==a) {k[1]=a; l[1]++;}
			else if(k[2]<0||k[2]==a) {k[2]=a; l[2]++;}
			else {f=0; break;}
		}
		n=n/3;
		if(k[1]<0){
			if(k[0]!=0) f=0;
		}else if(k[2]<0){
			if(k[0]==0){
				if(l[0]!=n||l[1]!=n*2) f=0;
			}else if(k[1]==0){
				if(l[1]!=n||l[0]!=n*2) f=0;
			}else{
				f=0;
			}
		}else{
			if((k[0]^k[1]^k[2])!=0) f=0;
			if(l[0]!=n||l[1]!=n||l[2]!=n) f=0;
		}
		puts(p[f]);
	}
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"No"
.LC1:
	.string	"Yes"
.LC2:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, -32(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -24(%rbp)
	leaq	-68(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L2
	movb	$1, -70(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L3
.L6:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L4
	movb	$0, -70(%rbp)
	jmp	.L5
.L4:
	addl	$1, -60(%rbp)
.L3:
	movl	-68(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L6
.L5:
	movsbl	-70(%rbp), %eax
	cltq
	movq	-32(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L2:
	movl	$-1, -56(%rbp)
	movl	$-1, -52(%rbp)
	movl	$-1, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	$0, -36(%rbp)
	movb	$1, -69(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L8
.L17:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	js	.L9
	movl	-56(%rbp), %edx
	movl	-64(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
.L9:
	movl	-64(%rbp), %eax
	movl	%eax, -56(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -44(%rbp)
	jmp	.L11
.L10:
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	js	.L12
	movl	-52(%rbp), %edx
	movl	-64(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L13
.L12:
	movl	-64(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40(%rbp)
	jmp	.L11
.L13:
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	js	.L14
	movl	-48(%rbp), %edx
	movl	-64(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L15
.L14:
	movl	-64(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L11
.L15:
	movb	$0, -69(%rbp)
	jmp	.L16
.L11:
	addl	$1, -60(%rbp)
.L8:
	movl	-68(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L17
.L16:
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jns	.L18
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	je	.L19
	movb	$0, -69(%rbp)
	jmp	.L19
.L18:
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	jns	.L20
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	-44(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L22
	movl	-40(%rbp), %eax
	movl	-68(%rbp), %edx
	addl	%edx, %edx
	cmpl	%edx, %eax
	je	.L19
.L22:
	movb	$0, -69(%rbp)
	jmp	.L19
.L21:
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L23
	movl	-40(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L24
	movl	-44(%rbp), %eax
	movl	-68(%rbp), %edx
	addl	%edx, %edx
	cmpl	%edx, %eax
	je	.L19
.L24:
	movb	$0, -69(%rbp)
	jmp	.L19
.L23:
	movb	$0, -69(%rbp)
	jmp	.L19
.L20:
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %eax
	xorl	%eax, %edx
	movl	-48(%rbp), %eax
	cmpl	%eax, %edx
	je	.L25
	movb	$0, -69(%rbp)
.L25:
	movl	-44(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L26
	movl	-40(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L26
	movl	-36(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	je	.L19
.L26:
	movb	$0, -69(%rbp)
.L19:
	movsbl	-69(%rbp), %eax
	cltq
	movq	-32(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rcx, %xmm0
	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
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	leaq	.LC1(%rip), %rax
	leaq	24(%rsp), %rsi
	movq	%rax, %xmm1
	xorl	%eax, %eax
	punpcklqdq	%xmm1, %xmm0
	movaps	%xmm0, 32(%rsp)
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rbx
	movq	%rbx, %rax
	imulq	$1431655766, %rbx, %rbx
	cltd
	shrq	$32, %rbx
	subl	%edx, %ebx
	leal	(%rbx,%rbx,2), %edx
	movl	%eax, %ebx
	subl	%edx, %ebx
	jne	.L2
	testl	%eax, %eax
	jle	.L42
	movl	$0, 12(%rsp)
	xorl	%r14d, %r14d
	orl	$-1, %r13d
	orl	$-1, %r15d
	movl	$0, 8(%rsp)
	leaq	28(%rsp), %r12
	movl	$-1, 4(%rsp)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L36:
	cmpl	%r15d, %eax
	je	.L9
	cmpl	%r13d, %eax
	je	.L29
	testl	%r13d, %r13d
	js	.L29
	movl	4(%rsp), %edx
	cmpl	%edx, %eax
	je	.L30
	testl	%edx, %edx
	jns	.L14
.L30:
	addl	$1, 12(%rsp)
	movl	%eax, 4(%rsp)
.L11:
	movl	24(%rsp), %eax
	addl	$1, %r14d
	cmpl	%r14d, %eax
	jle	.L43
.L3:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%r15d, %r15d
	jns	.L36
.L9:
	movl	%eax, %r15d
	movl	24(%rsp), %eax
	addl	$1, %r14d
	addl	$1, %ebx
	cmpl	%r14d, %eax
	jg	.L3
.L43:
	movl	$3, %esi
	cltd
	idivl	%esi
	movl	%eax, 24(%rsp)
	movl	%eax, %esi
	testl	%r13d, %r13d
	js	.L23
	cmpl	$0, 4(%rsp)
	movl	$1, %edx
	js	.L44
.L18:
	movl	%r13d, %ecx
	xorl	%eax, %eax
	xorl	%r15d, %ecx
	cmpl	4(%rsp), %ecx
	cmovne	%eax, %edx
	cmpl	%esi, 8(%rsp)
	setne	%al
	cmpl	%esi, %ebx
	setne	%cl
	orb	%cl, %al
	jne	.L21
	cmpl	12(%rsp), %esi
	je	.L17
.L21:
	xorl	%edx, %edx
	jmp	.L17
.L2:
	xorl	%ebx, %ebx
	leaq	28(%rsp), %r12
	testl	%eax, %eax
	jg	.L5
.L7:
	movl	$1, %eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L45:
	addl	$1, %ebx
	cmpl	%ebx, 24(%rsp)
	jle	.L7
.L5:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L45
	xorl	%eax, %eax
.L6:
	andl	$1, %eax
	movq	32(%rsp,%rax,8), %rdi
	call	puts@PLT
.L8:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$72, %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
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	addl	$1, 8(%rsp)
	movl	%eax, %r13d
	jmp	.L11
.L42:
	movl	$3, %ecx
	cltd
	orl	$-1, %r15d
	idivl	%ecx
	movl	%eax, 24(%rsp)
.L23:
	testl	%r15d, %r15d
	sete	%dl
.L17:
	movsbq	%dl, %rdx
	movq	32(%rsp,%rdx,8), %rdi
	call	puts@PLT
	jmp	.L8
.L44:
	testl	%r15d, %r15d
	jne	.L19
	cmpl	%ebx, %eax
	jne	.L21
	addl	%ebx, %ebx
	cmpl	8(%rsp), %ebx
	je	.L17
	xorl	%edx, %edx
	jmp	.L17
.L19:
	testl	%r13d, %r13d
	jne	.L21
	cmpl	8(%rsp), %eax
	jne	.L21
	movl	8(%rsp), %r14d
	addl	%r14d, %r14d
	cmpl	%ebx, %r14d
	je	.L17
	xorl	%edx, %edx
	jmp	.L17
.L14:
	movl	24(%rsp), %eax
	movl	$3, %esi
	cltd
	idivl	%esi
	xorl	%edx, %edx
	movl	%eax, 24(%rsp)
	movl	%eax, %esi
	jmp	.L18
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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	"No"
.LC1:
	.string	"Yes"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rcx, %xmm0
	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
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	leaq	.LC1(%rip), %rax
	leaq	24(%rsp), %rsi
	movq	%rax, %xmm1
	xorl	%eax, %eax
	punpcklqdq	%xmm1, %xmm0
	movaps	%xmm0, 32(%rsp)
	call	__isoc99_scanf@PLT
	movslq	24(%rsp), %rbx
	movq	%rbx, %rax
	imulq	$1431655766, %rbx, %rbx
	cltd
	shrq	$32, %rbx
	subl	%edx, %ebx
	leal	(%rbx,%rbx,2), %edx
	movl	%eax, %ebx
	subl	%edx, %ebx
	jne	.L2
	testl	%eax, %eax
	jle	.L42
	movl	$0, 12(%rsp)
	xorl	%r14d, %r14d
	orl	$-1, %r13d
	orl	$-1, %r15d
	movl	$0, 8(%rsp)
	leaq	28(%rsp), %r12
	movl	$-1, 4(%rsp)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L36:
	cmpl	%r15d, %eax
	je	.L9
	cmpl	%r13d, %eax
	je	.L29
	testl	%r13d, %r13d
	js	.L29
	movl	4(%rsp), %edx
	cmpl	%edx, %eax
	je	.L30
	testl	%edx, %edx
	jns	.L14
.L30:
	addl	$1, 12(%rsp)
	movl	%eax, 4(%rsp)
.L11:
	movl	24(%rsp), %eax
	addl	$1, %r14d
	cmpl	%r14d, %eax
	jle	.L43
.L3:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%r15d, %r15d
	jns	.L36
.L9:
	movl	%eax, %r15d
	movl	24(%rsp), %eax
	addl	$1, %r14d
	addl	$1, %ebx
	cmpl	%r14d, %eax
	jg	.L3
.L43:
	movl	$3, %esi
	cltd
	idivl	%esi
	movl	%eax, 24(%rsp)
	movl	%eax, %esi
	testl	%r13d, %r13d
	js	.L23
	cmpl	$0, 4(%rsp)
	movl	$1, %edx
	js	.L44
.L18:
	movl	%r13d, %ecx
	xorl	%eax, %eax
	xorl	%r15d, %ecx
	cmpl	4(%rsp), %ecx
	cmovne	%eax, %edx
	cmpl	%esi, 8(%rsp)
	setne	%al
	cmpl	%esi, %ebx
	setne	%cl
	orb	%cl, %al
	jne	.L21
	cmpl	12(%rsp), %esi
	je	.L17
.L21:
	xorl	%edx, %edx
	jmp	.L17
.L2:
	xorl	%ebx, %ebx
	leaq	28(%rsp), %r12
	testl	%eax, %eax
	jg	.L5
.L7:
	movl	$1, %eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L45:
	addl	$1, %ebx
	cmpl	%ebx, 24(%rsp)
	jle	.L7
.L5:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L45
	xorl	%eax, %eax
.L6:
	andl	$1, %eax
	movq	32(%rsp,%rax,8), %rdi
	call	puts@PLT
.L8:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$72, %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
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	addl	$1, 8(%rsp)
	movl	%eax, %r13d
	jmp	.L11
.L42:
	movl	$3, %ecx
	cltd
	orl	$-1, %r15d
	idivl	%ecx
	movl	%eax, 24(%rsp)
.L23:
	testl	%r15d, %r15d
	sete	%dl
.L17:
	movsbq	%dl, %rdx
	movq	32(%rsp,%rdx,8), %rdi
	call	puts@PLT
	jmp	.L8
.L44:
	testl	%r15d, %r15d
	jne	.L19
	cmpl	%ebx, %eax
	jne	.L21
	addl	%ebx, %ebx
	cmpl	8(%rsp), %ebx
	je	.L17
	xorl	%edx, %edx
	jmp	.L17
.L19:
	testl	%r13d, %r13d
	jne	.L21
	cmpl	8(%rsp), %eax
	jne	.L21
	movl	8(%rsp), %r14d
	addl	%r14d, %r14d
	cmpl	%ebx, %r14d
	je	.L17
	xorl	%edx, %edx
	jmp	.L17
.L14:
	movl	24(%rsp), %eax
	movl	$3, %esi
	cltd
	idivl	%esi
	xorl	%edx, %edx
	movl	%eax, 24(%rsp)
	movl	%eax, %esi
	jmp	.L18
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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 <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	char *p[2]={"No","Yes"};
	int n, i;
	scanf("%d", &n);
	if(n%3!=0){
		int a;
		char f=1;
		for(i=0; i<n; i++){
			scanf("%d", &a);
			if(a!=0){f=0; break;}
		}
		puts(p[f]);
	}else{
		int a;
		int k[3]={-1,-1,-1};
		int l[3]={0,0,0};
		char f=1;
		for(i=0; i<n; i++){
			scanf("%d", &a);
			if(k[0]<0||k[0]==a) {k[0]=a; l[0]++;}
			else if(k[1]<0||k[1]==a) {k[1]=a; l[1]++;}
			else if(k[2]<0||k[2]==a) {k[2]=a; l[2]++;}
			else {f=0; break;}
		}
		n=n/3;
		if(k[1]<0){
			if(k[0]!=0) f=0;
		}else if(k[2]<0){
			if(k[0]==0){
				if(l[0]!=n||l[1]!=n*2) f=0;
			}else if(k[1]==0){
				if(l[1]!=n||l[0]!=n*2) f=0;
			}else{
				f=0;
			}
		}else{
			if((k[0]^k[1]^k[2])!=0) f=0;
			if(l[0]!=n||l[1]!=n||l[2]!=n) f=0;
		}
		puts(p[f]);
	}
}


3
1 2 0
 3
3 2 1
 4
1 2 4 11
 3
0 2 0
 4
0 2 4 11
 3
0 1 0
 4
0 4 4 11
 3
0 1 -1
 4
0 4 4 20
 3
1 2 1

No
 Yes
 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
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	char *p[2]={"No","Yes"};
	int n, i;
	scanf("%d", &n);
	if(n%3!=0){
		int a;
		char f=1;
		for(i=0; i<n; i++){
			scanf("%d", &a);
			if(a!=0){f=0; break;}
		}
		puts(p[f]);
	}else{
		int a;
		int k[3]={-1,-1,-1};
		int l[3]={0,0,0};
		char f=1;
		for(i=0; i<n; i++){
			scanf("%d", &a);
			if(k[0]<0||k[0]==a) {k[0]=a; l[0]++;}
			else if(k[1]<0||k[1]==a) {k[1]=a; l[1]++;}
			else if(k[2]<0||k[2]==a) {k[2]=a; l[2]++;}
			else {f=0; break;}
		}
		n=n/3;
		if(k[1]<0){
			if(k[0]!=0) f=0;
		}else if(k[2]<0){
			if(k[0]==0){
				if(l[0]!=n||l[1]!=n*2) f=0;
			}else if(k[1]==0){
				if(l[1]!=n||l[0]!=n*2) f=0;
			}else{
				f=0;
			}
		}else{
			if((k[0]^k[1]^k[2])!=0) f=0;
			if(l[0]!=n||l[1]!=n||l[2]!=n) f=0;
		}
		puts(p[f]);
	}
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"No"
.LC1:
	.string	"Yes"
.LC2:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, -32(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -24(%rbp)
	leaq	-68(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L2
	movb	$1, -70(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L3
.L6:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L4
	movb	$0, -70(%rbp)
	jmp	.L5
.L4:
	addl	$1, -60(%rbp)
.L3:
	movl	-68(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L6
.L5:
	movsbl	-70(%rbp), %eax
	cltq
	movq	-32(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L2:
	movl	$-1, -56(%rbp)
	movl	$-1, -52(%rbp)
	movl	$-1, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	$0, -36(%rbp)
	movb	$1, -69(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L8
.L17:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	js	.L9
	movl	-56(%rbp), %edx
	movl	-64(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
.L9:
	movl	-64(%rbp), %eax
	movl	%eax, -56(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -44(%rbp)
	jmp	.L11
.L10:
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	js	.L12
	movl	-52(%rbp), %edx
	movl	-64(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L13
.L12:
	movl	-64(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40(%rbp)
	jmp	.L11
.L13:
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	js	.L14
	movl	-48(%rbp), %edx
	movl	-64(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L15
.L14:
	movl	-64(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L11
.L15:
	movb	$0, -69(%rbp)
	jmp	.L16
.L11:
	addl	$1, -60(%rbp)
.L8:
	movl	-68(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L17
.L16:
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jns	.L18
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	je	.L19
	movb	$0, -69(%rbp)
	jmp	.L19
.L18:
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	jns	.L20
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	-44(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L22
	movl	-40(%rbp), %eax
	movl	-68(%rbp), %edx
	addl	%edx, %edx
	cmpl	%edx, %eax
	je	.L19
.L22:
	movb	$0, -69(%rbp)
	jmp	.L19
.L21:
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L23
	movl	-40(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L24
	movl	-44(%rbp), %eax
	movl	-68(%rbp), %edx
	addl	%edx, %edx
	cmpl	%edx, %eax
	je	.L19
.L24:
	movb	$0, -69(%rbp)
	jmp	.L19
.L23:
	movb	$0, -69(%rbp)
	jmp	.L19
.L20:
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %eax
	xorl	%eax, %edx
	movl	-48(%rbp), %eax
	cmpl	%eax, %edx
	je	.L25
	movb	$0, -69(%rbp)
.L25:
	movl	-44(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L26
	movl	-40(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L26
	movl	-36(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	je	.L19
.L26:
	movb	$0, -69(%rbp)
.L19:
	movsbl	-69(%rbp), %eax
	cltq
	movq	-32(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"No"
.LC1:
	.string	"Yes"
.LC2:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rax
	movq	%rax, -32(%rbp)
	leaq	.LC1(%rip), %rax
	movq	%rax, -24(%rbp)
	leaq	-68(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L2
	movb	$1, -70(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L3
.L6:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	je	.L4
	movb	$0, -70(%rbp)
	jmp	.L5
.L4:
	addl	$1, -60(%rbp)
.L3:
	movl	-68(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L6
.L5:
	movsbl	-70(%rbp), %eax
	cltq
	movq	-32(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L2:
	movl	$-1, -56(%rbp)
	movl	$-1, -52(%rbp)
	movl	$-1, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -40(%rbp)
	movl	$0, -36(%rbp)
	movb	$1, -69(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L8
.L17:
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	js	.L9
	movl	-56(%rbp), %edx
	movl	-64(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
.L9:
	movl	-64(%rbp), %eax
	movl	%eax, -56(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -44(%rbp)
	jmp	.L11
.L10:
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	js	.L12
	movl	-52(%rbp), %edx
	movl	-64(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L13
.L12:
	movl	-64(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	-40(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40(%rbp)
	jmp	.L11
.L13:
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	js	.L14
	movl	-48(%rbp), %edx
	movl	-64(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L15
.L14:
	movl	-64(%rbp), %eax
	movl	%eax, -48(%rbp)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -36(%rbp)
	jmp	.L11
.L15:
	movb	$0, -69(%rbp)
	jmp	.L16
.L11:
	addl	$1, -60(%rbp)
.L8:
	movl	-68(%rbp), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L17
.L16:
	movl	-68(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -68(%rbp)
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jns	.L18
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	je	.L19
	movb	$0, -69(%rbp)
	jmp	.L19
.L18:
	movl	-48(%rbp), %eax
	testl	%eax, %eax
	jns	.L20
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	-44(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L22
	movl	-40(%rbp), %eax
	movl	-68(%rbp), %edx
	addl	%edx, %edx
	cmpl	%edx, %eax
	je	.L19
.L22:
	movb	$0, -69(%rbp)
	jmp	.L19
.L21:
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L23
	movl	-40(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L24
	movl	-44(%rbp), %eax
	movl	-68(%rbp), %edx
	addl	%edx, %edx
	cmpl	%edx, %eax
	je	.L19
.L24:
	movb	$0, -69(%rbp)
	jmp	.L19
.L23:
	movb	$0, -69(%rbp)
	jmp	.L19
.L20:
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %eax
	xorl	%eax, %edx
	movl	-48(%rbp), %eax
	cmpl	%eax, %edx
	je	.L25
	movb	$0, -69(%rbp)
.L25:
	movl	-44(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L26
	movl	-40(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L26
	movl	-36(%rbp), %edx
	movl	-68(%rbp), %eax
	cmpl	%eax, %edx
	je	.L19
.L26:
	movb	$0, -69(%rbp)
.L19:
	movsbl	-69(%rbp), %eax
	cltq
	movq	-32(%rbp,%rax,8), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
