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<stdlib.h>

int compare_ascending(const void* a, const void* b){
    return *(int*)a-*(int*)b;
}

int main(){
    int n;
    scanf("%d", &n);
    int a[n];
    for(int i=0; i<n; i++){
        scanf("%d", &a[i]);
    }
    if(n%3 == 0){
        qsort(a, n, sizeof(int), compare_ascending);
        int c=1;
        for(int i=1; i<n; i++){
            if(a[i-1] != a[i]){
                c++;
            }
        }
        if(c == 1 || c > 3){
            if(c==1 && a[0]==0){
                printf("Yes");
            }else{
                printf("No");
            }
        }else{
            int d[3], e[3] = {0};
            d[0] = a[0];
            e[0] = 1;
            int x = 0;
            for(int i=1; i<n; i++){
                if(a[i] != a[i-1]){
                    x++;
                    d[x] = a[i];
                }
                e[x]++;
            }
            int t = n/3;
            if((d[0]==0&&e[0]==t&&e[1]==2*t&&c==2)){
                printf("Yes");
            }else if(e[0]==t&&e[1]==t&&e[2]==t&&c==3){
                if((d[0]^d[1]) == d[2]){
                    printf("Yes");
                }else{
                    printf("No");
                }
            }else{
                printf("No");
            }
        }
    }else{
        int f=1;
        for(int i=0; i<n; i++){
            if(a[i] != 0){
                f=0;
                break;
            }
        }
        if(f){
            printf("Yes");
        }else{
            printf("No");
        }
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_ascending
	.type	compare_ascending, @function
compare_ascending:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_ascending, .-compare_ascending
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L7
.L8:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -128(%rbp)
.L7:
	movl	-132(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L8
	movl	-132(%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
	jne	.L9
	movl	-132(%rbp), %eax
	movslq	%eax, %rsi
	movq	-88(%rbp), %rax
	leaq	compare_ascending(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$1, -124(%rbp)
	movl	$1, -120(%rbp)
	jmp	.L10
.L12:
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-88(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-88(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	je	.L11
	addl	$1, -124(%rbp)
.L11:
	addl	$1, -120(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L12
	cmpl	$1, -124(%rbp)
	je	.L13
	cmpl	$3, -124(%rbp)
	jle	.L14
.L13:
	cmpl	$1, -124(%rbp)
	jne	.L15
	movq	-88(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L15
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L15:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L14:
	movq	$0, -68(%rbp)
	movl	$0, -60(%rbp)
	movq	-88(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movl	$1, -68(%rbp)
	movl	$0, -116(%rbp)
	movl	$1, -112(%rbp)
	jmp	.L18
.L20:
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movl	-112(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-88(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	je	.L19
	addl	$1, -116(%rbp)
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -80(%rbp,%rax,4)
.L19:
	movl	-116(%rbp), %eax
	cltq
	movl	-68(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -68(%rbp,%rax,4)
	addl	$1, -112(%rbp)
.L18:
	movl	-132(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L20
	movl	-132(%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, -100(%rbp)
	movl	-80(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	-68(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L21
	movl	-64(%rbp), %eax
	movl	-100(%rbp), %edx
	addl	%edx, %edx
	cmpl	%edx, %eax
	jne	.L21
	cmpl	$2, -124(%rbp)
	jne	.L21
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L21:
	movl	-68(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L23
	movl	-64(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L23
	movl	-60(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L23
	cmpl	$3, -124(%rbp)
	jne	.L23
	movl	-80(%rbp), %edx
	movl	-76(%rbp), %eax
	xorl	%eax, %edx
	movl	-72(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L24
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L24:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L23:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L9:
	movl	$1, -108(%rbp)
	movl	$0, -104(%rbp)
	jmp	.L27
.L30:
	movq	-88(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	je	.L28
	movl	$0, -108(%rbp)
	jmp	.L29
.L28:
	addl	$1, -104(%rbp)
.L27:
	movl	-132(%rbp), %eax
	cmpl	%eax, -104(%rbp)
	jl	.L30
.L29:
	cmpl	$0, -108(%rbp)
	je	.L31
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L31:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L26:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.p2align 4
	.globl	compare_ascending
	.type	compare_ascending, @function
compare_ascending:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare_ascending, .-compare_ascending
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-84(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-84(%rbp), %rsi
	movq	%rsp, %rdi
	leaq	15(,%rsi,4), %rdx
	movq	%rsi, %rax
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rdi
	andq	$-16, %rcx
	cmpq	%rdi, %rsp
	je	.L5
.L79:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L79
.L5:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L80
.L6:
	leaq	3(%rsp), %r14
	movq	%r14, %rcx
	andq	$-4, %r14
	shrq	$2, %rcx
	movq	%rcx, -104(%rbp)
	testl	%eax, %eax
	jle	.L7
	movq	%r14, %r15
	movq	%r14, %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	addq	$4, %r12
	cmpl	%ebx, %eax
	jg	.L8
	imull	$-1431655765, %eax, %ecx
	movslq	%eax, %rsi
	addl	$715827882, %ecx
	cmpl	$1431655764, %ecx
	jbe	.L9
	testl	%eax, %eax
	jle	.L35
	movl	%eax, %eax
	leaq	(%r14,%rax,4), %rax
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L81:
	addq	$4, %r15
	cmpq	%rax, %r15
	je	.L35
.L36:
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L81
.L32:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L22:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L82
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L7:
	.cfi_restore_state
	movl	$3, %ecx
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L9
.L35:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L22
.L9:
	leaq	compare_ascending(%rip), %rcx
	movl	$4, %edx
	movq	%r14, %rdi
	call	qsort@PLT
	movl	-84(%rbp), %eax
	cmpl	$1, %eax
	jle	.L12
	leal	-2(%rax), %edx
	leal	-1(%rax), %edi
	cmpl	$2, %edx
	jbe	.L44
	movl	%edi, %ecx
	pxor	%xmm1, %xmm1
	movq	%r14, %rdx
	shrl	$2, %ecx
	movdqa	%xmm1, %xmm2
	salq	$4, %rcx
	addq	%r14, %rcx
	.p2align 4,,10
	.p2align 3
.L14:
	movdqu	(%rdx), %xmm0
	movdqu	4(%rdx), %xmm3
	addq	$16, %rdx
	pcmpeqd	%xmm3, %xmm0
	pcmpeqd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rdx, %rcx
	jne	.L14
	movdqa	%xmm1, %xmm0
	movl	%edi, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm1
	leal	1(%rsi), %edx
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %ecx
	addl	$1, %ecx
	cmpl	%edi, %esi
	je	.L15
.L13:
	movslq	%edx, %rsi
	salq	$2, %rsi
	leaq	(%r14,%rsi), %r8
	movl	(%r8), %r9d
	cmpl	%r9d, -4(%r14,%rsi)
	je	.L16
	addl	$1, %ecx
.L16:
	leal	1(%rdx), %esi
	cmpl	%esi, %eax
	jle	.L17
	movl	4(%r8), %esi
	cmpl	%esi, %r9d
	je	.L18
	addl	$1, %ecx
.L18:
	addl	$2, %edx
	cmpl	%edx, %eax
	jle	.L17
	cmpl	%esi, 8(%r8)
	je	.L15
	addl	$1, %ecx
.L15:
	cmpl	$1, %ecx
	sete	%dl
	movl	%edx, %esi
	cmpl	$3, %ecx
	jg	.L40
	testb	%dl, %dl
	jne	.L12
	movq	-104(%rbp), %rbx
	movq	$0, -64(%rbp)
	movl	$1, -68(%rbp)
	movl	0(,%rbx,4), %r9d
	movl	%r9d, %r11d
.L38:
	movl	$3, %r8d
	xorl	%esi, %esi
.L23:
	movl	-8(%r14,%r8,4), %r10d
	movslq	%esi, %rdx
	cmpl	%r9d, %r10d
	je	.L28
	addl	$1, %esi
	movslq	%esi, %rdx
	movl	%r10d, -80(%rbp,%rdx,4)
.L28:
	movl	-4(%r14,%r8,4), %r9d
	addl	$1, -68(%rbp,%rdx,4)
	cmpl	%r9d, %r10d
	je	.L30
	addl	$1, %esi
	movslq	%esi, %rdx
	movl	%r9d, -80(%rbp,%rdx,4)
.L30:
	addl	$1, -68(%rbp,%rdx,4)
	movslq	%r8d, %rdx
	addq	$2, %r8
	leal	-1(%r8), %r10d
	cmpl	%r10d, %edi
	jg	.L23
	movl	%r11d, %r9d
	jmp	.L27
.L80:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L6
.L17:
	cmpl	$1, %ecx
	sete	%dl
	movl	%edx, %esi
	cmpl	$3, %ecx
	jg	.L40
	testb	%dl, %dl
	jne	.L12
	movq	-104(%rbp), %rbx
	movq	$0, -64(%rbp)
	movl	$1, -68(%rbp)
	movl	0(,%rbx,4), %r9d
	cmpl	$3, %eax
	jg	.L45
	movl	$1, %edx
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L27:
	movl	(%r14,%rdx,4), %edi
	cmpl	-4(%r14,%rdx,4), %edi
	je	.L24
	addl	$1, %esi
	addq	$1, %rdx
	movslq	%esi, %r8
	addl	$1, -68(%rbp,%r8,4)
	movl	%edi, -80(%rbp,%r8,4)
	cmpl	%edx, %eax
	jg	.L27
.L26:
	movl	$3, %esi
	cltd
	idivl	%esi
	movl	-68(%rbp), %edx
	testl	%r9d, %r9d
	jne	.L31
	cmpl	%eax, %edx
	jne	.L32
	leal	(%rax,%rax), %edx
	cmpl	%edx, -64(%rbp)
	jne	.L33
	cmpl	$2, %ecx
	je	.L35
.L33:
	cmpl	%eax, -64(%rbp)
	jne	.L32
	cmpl	%eax, -60(%rbp)
	jne	.L32
	cmpl	$3, %ecx
	jne	.L32
	xorl	-76(%rbp), %r9d
	cmpl	-72(%rbp), %r9d
	jne	.L32
	jmp	.L35
.L40:
	testb	%sil, %sil
	je	.L32
.L12:
	movq	-104(%rbp), %rax
	cmpl	$0, 0(,%rax,4)
	jne	.L32
	jmp	.L35
.L24:
	movslq	%esi, %rdi
	addq	$1, %rdx
	addl	$1, -68(%rbp,%rdi,4)
	cmpl	%edx, %eax
	jg	.L27
	jmp	.L26
.L31:
	cmpl	%eax, %edx
	je	.L33
	jmp	.L32
.L44:
	movl	$1, %edx
	movl	$1, %ecx
	jmp	.L13
.L45:
	movl	%r9d, %r11d
	jmp	.L38
.L82:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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
	.p2align 4
	.globl	compare_ascending
	.type	compare_ascending, @function
compare_ascending:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare_ascending, .-compare_ascending
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-84(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-84(%rbp), %rsi
	movq	%rsp, %rdi
	leaq	15(,%rsi,4), %rdx
	movq	%rsi, %rax
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rdi
	andq	$-16, %rcx
	cmpq	%rdi, %rsp
	je	.L5
.L79:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L79
.L5:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L80
.L6:
	leaq	3(%rsp), %r14
	movq	%r14, %rcx
	andq	$-4, %r14
	shrq	$2, %rcx
	movq	%rcx, -104(%rbp)
	testl	%eax, %eax
	jle	.L7
	movq	%r14, %r15
	movq	%r14, %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-84(%rbp), %eax
	addq	$4, %r12
	cmpl	%ebx, %eax
	jg	.L8
	imull	$-1431655765, %eax, %ecx
	movslq	%eax, %rsi
	addl	$715827882, %ecx
	cmpl	$1431655764, %ecx
	jbe	.L9
	testl	%eax, %eax
	jle	.L35
	movl	%eax, %eax
	leaq	(%r14,%rax,4), %rax
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L81:
	addq	$4, %r15
	cmpq	%rax, %r15
	je	.L35
.L36:
	movl	(%r15), %edx
	testl	%edx, %edx
	je	.L81
.L32:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L22:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L82
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L7:
	.cfi_restore_state
	movl	$3, %ecx
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L9
.L35:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L22
.L9:
	leaq	compare_ascending(%rip), %rcx
	movl	$4, %edx
	movq	%r14, %rdi
	call	qsort@PLT
	movl	-84(%rbp), %eax
	cmpl	$1, %eax
	jle	.L12
	leal	-2(%rax), %edx
	leal	-1(%rax), %edi
	cmpl	$2, %edx
	jbe	.L44
	movl	%edi, %ecx
	pxor	%xmm1, %xmm1
	movq	%r14, %rdx
	shrl	$2, %ecx
	movdqa	%xmm1, %xmm2
	salq	$4, %rcx
	addq	%r14, %rcx
	.p2align 4,,10
	.p2align 3
.L14:
	movdqu	(%rdx), %xmm0
	movdqu	4(%rdx), %xmm3
	addq	$16, %rdx
	pcmpeqd	%xmm3, %xmm0
	pcmpeqd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rdx, %rcx
	jne	.L14
	movdqa	%xmm1, %xmm0
	movl	%edi, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm1
	leal	1(%rsi), %edx
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %ecx
	addl	$1, %ecx
	cmpl	%edi, %esi
	je	.L15
.L13:
	movslq	%edx, %rsi
	salq	$2, %rsi
	leaq	(%r14,%rsi), %r8
	movl	(%r8), %r9d
	cmpl	%r9d, -4(%r14,%rsi)
	je	.L16
	addl	$1, %ecx
.L16:
	leal	1(%rdx), %esi
	cmpl	%esi, %eax
	jle	.L17
	movl	4(%r8), %esi
	cmpl	%esi, %r9d
	je	.L18
	addl	$1, %ecx
.L18:
	addl	$2, %edx
	cmpl	%edx, %eax
	jle	.L17
	cmpl	%esi, 8(%r8)
	je	.L15
	addl	$1, %ecx
.L15:
	cmpl	$1, %ecx
	sete	%dl
	movl	%edx, %esi
	cmpl	$3, %ecx
	jg	.L40
	testb	%dl, %dl
	jne	.L12
	movq	-104(%rbp), %rbx
	movq	$0, -64(%rbp)
	movl	$1, -68(%rbp)
	movl	0(,%rbx,4), %r9d
	movl	%r9d, %r11d
.L38:
	movl	$3, %r8d
	xorl	%esi, %esi
.L23:
	movl	-8(%r14,%r8,4), %r10d
	movslq	%esi, %rdx
	cmpl	%r9d, %r10d
	je	.L28
	addl	$1, %esi
	movslq	%esi, %rdx
	movl	%r10d, -80(%rbp,%rdx,4)
.L28:
	movl	-4(%r14,%r8,4), %r9d
	addl	$1, -68(%rbp,%rdx,4)
	cmpl	%r9d, %r10d
	je	.L30
	addl	$1, %esi
	movslq	%esi, %rdx
	movl	%r9d, -80(%rbp,%rdx,4)
.L30:
	addl	$1, -68(%rbp,%rdx,4)
	movslq	%r8d, %rdx
	addq	$2, %r8
	leal	-1(%r8), %r10d
	cmpl	%r10d, %edi
	jg	.L23
	movl	%r11d, %r9d
	jmp	.L27
.L80:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L6
.L17:
	cmpl	$1, %ecx
	sete	%dl
	movl	%edx, %esi
	cmpl	$3, %ecx
	jg	.L40
	testb	%dl, %dl
	jne	.L12
	movq	-104(%rbp), %rbx
	movq	$0, -64(%rbp)
	movl	$1, -68(%rbp)
	movl	0(,%rbx,4), %r9d
	cmpl	$3, %eax
	jg	.L45
	movl	$1, %edx
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L27:
	movl	(%r14,%rdx,4), %edi
	cmpl	-4(%r14,%rdx,4), %edi
	je	.L24
	addl	$1, %esi
	addq	$1, %rdx
	movslq	%esi, %r8
	addl	$1, -68(%rbp,%r8,4)
	movl	%edi, -80(%rbp,%r8,4)
	cmpl	%edx, %eax
	jg	.L27
.L26:
	movl	$3, %esi
	cltd
	idivl	%esi
	movl	-68(%rbp), %edx
	testl	%r9d, %r9d
	jne	.L31
	cmpl	%eax, %edx
	jne	.L32
	leal	(%rax,%rax), %edx
	cmpl	%edx, -64(%rbp)
	jne	.L33
	cmpl	$2, %ecx
	je	.L35
.L33:
	cmpl	%eax, -64(%rbp)
	jne	.L32
	cmpl	%eax, -60(%rbp)
	jne	.L32
	cmpl	$3, %ecx
	jne	.L32
	xorl	-76(%rbp), %r9d
	cmpl	-72(%rbp), %r9d
	jne	.L32
	jmp	.L35
.L40:
	testb	%sil, %sil
	je	.L32
.L12:
	movq	-104(%rbp), %rax
	cmpl	$0, 0(,%rax,4)
	jne	.L32
	jmp	.L35
.L24:
	movslq	%esi, %rdi
	addq	$1, %rdx
	addl	$1, -68(%rbp,%rdi,4)
	cmpl	%edx, %eax
	jg	.L27
	jmp	.L26
.L31:
	cmpl	%eax, %edx
	je	.L33
	jmp	.L32
.L44:
	movl	$1, %edx
	movl	$1, %ecx
	jmp	.L13
.L45:
	movl	%r9d, %r11d
	jmp	.L38
.L82:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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<stdlib.h>

int compare_ascending(const void* a, const void* b){
    return *(int*)a-*(int*)b;
}

int main(){
    int n;
    scanf("%d", &n);
    int a[n];
    for(int i=0; i<n; i++){
        scanf("%d", &a[i]);
    }
    if(n%3 == 0){
        qsort(a, n, sizeof(int), compare_ascending);
        int c=1;
        for(int i=1; i<n; i++){
            if(a[i-1] != a[i]){
                c++;
            }
        }
        if(c == 1 || c > 3){
            if(c==1 && a[0]==0){
                printf("Yes");
            }else{
                printf("No");
            }
        }else{
            int d[3], e[3] = {0};
            d[0] = a[0];
            e[0] = 1;
            int x = 0;
            for(int i=1; i<n; i++){
                if(a[i] != a[i-1]){
                    x++;
                    d[x] = a[i];
                }
                e[x]++;
            }
            int t = n/3;
            if((d[0]==0&&e[0]==t&&e[1]==2*t&&c==2)){
                printf("Yes");
            }else if(e[0]==t&&e[1]==t&&e[2]==t&&c==3){
                if((d[0]^d[1]) == d[2]){
                    printf("Yes");
                }else{
                    printf("No");
                }
            }else{
                printf("No");
            }
        }
    }else{
        int f=1;
        for(int i=0; i<n; i++){
            if(a[i] != 0){
                f=0;
                break;
            }
        }
        if(f){
            printf("Yes");
        }else{
            printf("No");
        }
    }

    return 0;
}
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<stdio.h>
#include<stdlib.h>

int compare_ascending(const void* a, const void* b){
    return *(int*)a-*(int*)b;
}

int main(){
    int n;
    scanf("%d", &n);
    int a[n];
    for(int i=0; i<n; i++){
        scanf("%d", &a[i]);
    }
    if(n%3 == 0){
        qsort(a, n, sizeof(int), compare_ascending);
        int c=1;
        for(int i=1; i<n; i++){
            if(a[i-1] != a[i]){
                c++;
            }
        }
        if(c == 1 || c > 3){
            if(c==1 && a[0]==0){
                printf("Yes");
            }else{
                printf("No");
            }
        }else{
            int d[3], e[3] = {0};
            d[0] = a[0];
            e[0] = 1;
            int x = 0;
            for(int i=1; i<n; i++){
                if(a[i] != a[i-1]){
                    x++;
                    d[x] = a[i];
                }
                e[x]++;
            }
            int t = n/3;
            if((d[0]==0&&e[0]==t&&e[1]==2*t&&c==2)){
                printf("Yes");
            }else if(e[0]==t&&e[1]==t&&e[2]==t&&c==3){
                if((d[0]^d[1]) == d[2]){
                    printf("Yes");
                }else{
                    printf("No");
                }
            }else{
                printf("No");
            }
        }
    }else{
        int f=1;
        for(int i=0; i<n; i++){
            if(a[i] != 0){
                f=0;
                break;
            }
        }
        if(f){
            printf("Yes");
        }else{
            printf("No");
        }
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_ascending
	.type	compare_ascending, @function
compare_ascending:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_ascending, .-compare_ascending
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L7
.L8:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -128(%rbp)
.L7:
	movl	-132(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L8
	movl	-132(%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
	jne	.L9
	movl	-132(%rbp), %eax
	movslq	%eax, %rsi
	movq	-88(%rbp), %rax
	leaq	compare_ascending(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$1, -124(%rbp)
	movl	$1, -120(%rbp)
	jmp	.L10
.L12:
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-88(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-88(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	je	.L11
	addl	$1, -124(%rbp)
.L11:
	addl	$1, -120(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L12
	cmpl	$1, -124(%rbp)
	je	.L13
	cmpl	$3, -124(%rbp)
	jle	.L14
.L13:
	cmpl	$1, -124(%rbp)
	jne	.L15
	movq	-88(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L15
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L15:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L14:
	movq	$0, -68(%rbp)
	movl	$0, -60(%rbp)
	movq	-88(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movl	$1, -68(%rbp)
	movl	$0, -116(%rbp)
	movl	$1, -112(%rbp)
	jmp	.L18
.L20:
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movl	-112(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-88(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	je	.L19
	addl	$1, -116(%rbp)
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -80(%rbp,%rax,4)
.L19:
	movl	-116(%rbp), %eax
	cltq
	movl	-68(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -68(%rbp,%rax,4)
	addl	$1, -112(%rbp)
.L18:
	movl	-132(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L20
	movl	-132(%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, -100(%rbp)
	movl	-80(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	-68(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L21
	movl	-64(%rbp), %eax
	movl	-100(%rbp), %edx
	addl	%edx, %edx
	cmpl	%edx, %eax
	jne	.L21
	cmpl	$2, -124(%rbp)
	jne	.L21
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L21:
	movl	-68(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L23
	movl	-64(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L23
	movl	-60(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L23
	cmpl	$3, -124(%rbp)
	jne	.L23
	movl	-80(%rbp), %edx
	movl	-76(%rbp), %eax
	xorl	%eax, %edx
	movl	-72(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L24
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L24:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L23:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L9:
	movl	$1, -108(%rbp)
	movl	$0, -104(%rbp)
	jmp	.L27
.L30:
	movq	-88(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	je	.L28
	movl	$0, -108(%rbp)
	jmp	.L29
.L28:
	addl	$1, -104(%rbp)
.L27:
	movl	-132(%rbp), %eax
	cmpl	%eax, -104(%rbp)
	jl	.L30
.L29:
	cmpl	$0, -108(%rbp)
	je	.L31
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L31:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L26:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	compare_ascending
	.type	compare_ascending, @function
compare_ascending:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_ascending, .-compare_ascending
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -96(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L7
.L8:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -128(%rbp)
.L7:
	movl	-132(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L8
	movl	-132(%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
	jne	.L9
	movl	-132(%rbp), %eax
	movslq	%eax, %rsi
	movq	-88(%rbp), %rax
	leaq	compare_ascending(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$1, -124(%rbp)
	movl	$1, -120(%rbp)
	jmp	.L10
.L12:
	movl	-120(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-88(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-88(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	je	.L11
	addl	$1, -124(%rbp)
.L11:
	addl	$1, -120(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L12
	cmpl	$1, -124(%rbp)
	je	.L13
	cmpl	$3, -124(%rbp)
	jle	.L14
.L13:
	cmpl	$1, -124(%rbp)
	jne	.L15
	movq	-88(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L15
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L15:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L14:
	movq	$0, -68(%rbp)
	movl	$0, -60(%rbp)
	movq	-88(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movl	$1, -68(%rbp)
	movl	$0, -116(%rbp)
	movl	$1, -112(%rbp)
	jmp	.L18
.L20:
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movl	-112(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-88(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	je	.L19
	addl	$1, -116(%rbp)
	movq	-88(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -80(%rbp,%rax,4)
.L19:
	movl	-116(%rbp), %eax
	cltq
	movl	-68(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-116(%rbp), %eax
	cltq
	movl	%edx, -68(%rbp,%rax,4)
	addl	$1, -112(%rbp)
.L18:
	movl	-132(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L20
	movl	-132(%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, -100(%rbp)
	movl	-80(%rbp), %eax
	testl	%eax, %eax
	jne	.L21
	movl	-68(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L21
	movl	-64(%rbp), %eax
	movl	-100(%rbp), %edx
	addl	%edx, %edx
	cmpl	%edx, %eax
	jne	.L21
	cmpl	$2, -124(%rbp)
	jne	.L21
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L21:
	movl	-68(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L23
	movl	-64(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L23
	movl	-60(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jne	.L23
	cmpl	$3, -124(%rbp)
	jne	.L23
	movl	-80(%rbp), %edx
	movl	-76(%rbp), %eax
	xorl	%eax, %edx
	movl	-72(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L24
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L24:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L23:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L9:
	movl	$1, -108(%rbp)
	movl	$0, -104(%rbp)
	jmp	.L27
.L30:
	movq	-88(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	testl	%eax, %eax
	je	.L28
	movl	$0, -108(%rbp)
	jmp	.L29
.L28:
	addl	$1, -104(%rbp)
.L27:
	movl	-132(%rbp), %eax
	cmpl	%eax, -104(%rbp)
	jl	.L30
.L29:
	cmpl	$0, -108(%rbp)
	je	.L31
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L31:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L26:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
