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

```c
#include<stdio.h>
int main()
{
    int n,i,max=0,a[10],sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    max=a[0];
    for(i=1;i<n;i++){
        if(max<a[i])
            max=a[i];
    }
    for(i=0;i<n;i++){
            sum=sum+a[i];
    }
    if(sum-max>max)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;

}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	movl	16(%rsp), %r8d
	movl	%r8d, %ecx
	cmpl	$1, %eax
	jle	.L4
	leal	-2(%rax), %edx
	leal	-1(%rax), %esi
	cmpl	$2, %edx
	jbe	.L18
	movdqu	20(%rsp), %xmm1
	movd	%r8d, %xmm3
	movl	%esi, %edx
	pshufd	$0, %xmm3, %xmm2
	shrl	$2, %edx
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	cmpl	$1, %edx
	je	.L6
	movdqu	36(%rsp), %xmm1
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm1, %xmm2
	movdqa	%xmm2, %xmm0
.L6:
	movdqa	%xmm0, %xmm2
	movl	%esi, %edi
	psrldq	$8, %xmm2
	andl	$-4, %edi
	movdqa	%xmm2, %xmm1
	leal	1(%rdi), %edx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %ecx
	cmpl	%edi, %esi
	je	.L9
.L5:
	movslq	%edx, %rsi
	movl	16(%rsp,%rsi,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	leal	1(%rdx), %esi
	cmpl	%esi, %eax
	jle	.L9
	movslq	%esi, %rsi
	movl	16(%rsp,%rsi,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	addl	$2, %edx
	cmpl	%edx, %eax
	jle	.L9
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %edx
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
.L9:
	testl	%eax, %eax
	movl	$1, %edi
	cmovg	%eax, %edi
	cmpl	$3, %eax
	jle	.L30
	movl	%edi, %edx
	movdqa	16(%rsp), %xmm0
	shrl	$2, %edx
	cmpl	$1, %edx
	je	.L12
	paddd	32(%rsp), %xmm0
.L12:
	movdqa	%xmm0, %xmm1
	movl	%edi, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	andl	$3, %edi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L11
	movslq	%esi, %rdi
	addl	$1, %esi
	addl	16(%rsp,%rdi,4), %edx
	cmpl	%esi, %eax
	jle	.L11
.L16:
	movslq	%esi, %rdi
	addl	$1, %esi
	addl	16(%rsp,%rdi,4), %edx
	cmpl	%esi, %eax
	jle	.L11
	movslq	%esi, %rsi
	addl	16(%rsp,%rsi,4), %edx
.L11:
	subl	%ecx, %edx
	cmpl	%ecx, %edx
	jle	.L14
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L15:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L15
.L2:
	movl	16(%rsp), %r8d
	movl	%r8d, %ecx
.L4:
	xorl	%edx, %edx
	subl	$1, %eax
	cmove	%r8d, %edx
	jmp	.L11
.L18:
	movl	$1, %edx
	jmp	.L5
.L30:
	movl	%r8d, %edx
	movl	$1, %esi
	jmp	.L16
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	movl	16(%rsp), %r8d
	movl	%r8d, %ecx
	cmpl	$1, %eax
	jle	.L4
	leal	-2(%rax), %edx
	leal	-1(%rax), %esi
	cmpl	$2, %edx
	jbe	.L18
	movdqu	20(%rsp), %xmm1
	movd	%r8d, %xmm3
	movl	%esi, %edx
	pshufd	$0, %xmm3, %xmm2
	shrl	$2, %edx
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	cmpl	$1, %edx
	je	.L6
	movdqu	36(%rsp), %xmm1
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm1, %xmm2
	movdqa	%xmm2, %xmm0
.L6:
	movdqa	%xmm0, %xmm2
	movl	%esi, %edi
	psrldq	$8, %xmm2
	andl	$-4, %edi
	movdqa	%xmm2, %xmm1
	leal	1(%rdi), %edx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %ecx
	cmpl	%edi, %esi
	je	.L9
.L5:
	movslq	%edx, %rsi
	movl	16(%rsp,%rsi,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	leal	1(%rdx), %esi
	cmpl	%esi, %eax
	jle	.L9
	movslq	%esi, %rsi
	movl	16(%rsp,%rsi,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	addl	$2, %edx
	cmpl	%edx, %eax
	jle	.L9
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %edx
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
.L9:
	testl	%eax, %eax
	movl	$1, %edi
	cmovg	%eax, %edi
	cmpl	$3, %eax
	jle	.L30
	movl	%edi, %edx
	movdqa	16(%rsp), %xmm0
	shrl	$2, %edx
	cmpl	$1, %edx
	je	.L12
	paddd	32(%rsp), %xmm0
.L12:
	movdqa	%xmm0, %xmm1
	movl	%edi, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	andl	$3, %edi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L11
	movslq	%esi, %rdi
	addl	$1, %esi
	addl	16(%rsp,%rdi,4), %edx
	cmpl	%esi, %eax
	jle	.L11
.L16:
	movslq	%esi, %rdi
	addl	$1, %esi
	addl	16(%rsp,%rdi,4), %edx
	cmpl	%esi, %eax
	jle	.L11
	movslq	%esi, %rsi
	addl	16(%rsp,%rsi,4), %edx
.L11:
	subl	%ecx, %edx
	cmpl	%ecx, %edx
	jle	.L14
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L15:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L15
.L2:
	movl	16(%rsp), %r8d
	movl	%r8d, %ecx
.L4:
	xorl	%edx, %edx
	subl	$1, %eax
	cmove	%r8d, %edx
	jmp	.L11
.L18:
	movl	$1, %edx
	jmp	.L5
.L30:
	movl	%r8d, %edx
	movl	$1, %esi
	jmp	.L16
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	movl	16(%rsp), %r8d
	movl	%r8d, %ecx
	cmpl	$1, %eax
	jle	.L4
	leal	-2(%rax), %edx
	leal	-1(%rax), %esi
	cmpl	$2, %edx
	jbe	.L18
	movdqu	20(%rsp), %xmm1
	movd	%r8d, %xmm3
	movl	%esi, %edx
	pshufd	$0, %xmm3, %xmm2
	shrl	$2, %edx
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	cmpl	$1, %edx
	je	.L6
	movdqu	36(%rsp), %xmm1
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm1, %xmm2
	movdqa	%xmm2, %xmm0
.L6:
	movdqa	%xmm0, %xmm2
	movl	%esi, %edi
	psrldq	$8, %xmm2
	andl	$-4, %edi
	movdqa	%xmm2, %xmm1
	leal	1(%rdi), %edx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %ecx
	cmpl	%edi, %esi
	je	.L9
.L5:
	movslq	%edx, %rsi
	movl	16(%rsp,%rsi,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	leal	1(%rdx), %esi
	cmpl	%esi, %eax
	jle	.L9
	movslq	%esi, %rsi
	movl	16(%rsp,%rsi,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	addl	$2, %edx
	cmpl	%edx, %eax
	jle	.L9
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %edx
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
.L9:
	testl	%eax, %eax
	movl	$1, %edi
	cmovg	%eax, %edi
	cmpl	$3, %eax
	jle	.L30
	movl	%edi, %edx
	movdqa	16(%rsp), %xmm0
	shrl	$2, %edx
	cmpl	$1, %edx
	je	.L12
	paddd	32(%rsp), %xmm0
.L12:
	movdqa	%xmm0, %xmm1
	movl	%edi, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	andl	$3, %edi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L11
	movslq	%esi, %rdi
	addl	$1, %esi
	addl	16(%rsp,%rdi,4), %edx
	cmpl	%esi, %eax
	jle	.L11
.L16:
	movslq	%esi, %rdi
	addl	$1, %esi
	addl	16(%rsp,%rdi,4), %edx
	cmpl	%esi, %eax
	jle	.L11
	movslq	%esi, %rsi
	addl	16(%rsp,%rsi,4), %edx
.L11:
	subl	%ecx, %edx
	cmpl	%ecx, %edx
	jle	.L14
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L15:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L15
.L2:
	movl	16(%rsp), %r8d
	movl	%r8d, %ecx
.L4:
	xorl	%edx, %edx
	subl	$1, %eax
	cmove	%r8d, %edx
	jmp	.L11
.L18:
	movl	$1, %edx
	jmp	.L5
.L30:
	movl	%r8d, %edx
	movl	$1, %esi
	jmp	.L16
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#include<stdio.h>
int main()
{
    int n,i,max=0,a[10],sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    max=a[0];
    for(i=1;i<n;i++){
        if(max<a[i])
            max=a[i];
    }
    for(i=0;i<n;i++){
            sum=sum+a[i];
    }
    if(sum-max>max)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;

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

```c
#include<stdio.h>
int main()
{
    int n,i,max=0,a[10],sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    max=a[0];
    for(i=1;i<n;i++){
        if(max<a[i])
            max=a[i];
    }
    for(i=0;i<n;i++){
            sum=sum+a[i];
    }
    if(sum-max>max)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;

}
```

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.
Optimized Assembly Code:

4
3 5 5 1
 10
1 0 10 5 8 12 34 100 11 3
 4
3 3 4 1
 4
3 5 6 1
 4
4 3 4 1
 10
1 0 10 10 8 12 34 100 11 3
 4
3 5 0 1
 4
4 1 4 1
 10
1 0 10 10 8 12 34 110 11 3
 4
3 5 0 0

Yes
 No
 Yes
 Yes
 Yes
 No
 No
 Yes
 No
 No

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

```c
#include<stdio.h>
int main()
{
    int n,i,max=0,a[10],sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    max=a[0];
    for(i=1;i<n;i++){
        if(max<a[i])
            max=a[i];
    }
    for(i=0;i<n;i++){
            sum=sum+a[i];
    }
    if(sum-max>max)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;

}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	movl	16(%rsp), %r8d
	movl	%r8d, %ecx
	cmpl	$1, %eax
	jle	.L4
	leal	-2(%rax), %edx
	leal	-1(%rax), %esi
	cmpl	$2, %edx
	jbe	.L18
	movdqu	20(%rsp), %xmm1
	movd	%r8d, %xmm3
	movl	%esi, %edx
	pshufd	$0, %xmm3, %xmm2
	shrl	$2, %edx
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	cmpl	$1, %edx
	je	.L6
	movdqu	36(%rsp), %xmm1
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm1, %xmm2
	movdqa	%xmm2, %xmm0
.L6:
	movdqa	%xmm0, %xmm2
	movl	%esi, %edi
	psrldq	$8, %xmm2
	andl	$-4, %edi
	movdqa	%xmm2, %xmm1
	leal	1(%rdi), %edx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %ecx
	cmpl	%edi, %esi
	je	.L9
.L5:
	movslq	%edx, %rsi
	movl	16(%rsp,%rsi,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	leal	1(%rdx), %esi
	cmpl	%esi, %eax
	jle	.L9
	movslq	%esi, %rsi
	movl	16(%rsp,%rsi,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	addl	$2, %edx
	cmpl	%edx, %eax
	jle	.L9
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %edx
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
.L9:
	testl	%eax, %eax
	movl	$1, %edi
	cmovg	%eax, %edi
	cmpl	$3, %eax
	jle	.L30
	movl	%edi, %edx
	movdqa	16(%rsp), %xmm0
	shrl	$2, %edx
	cmpl	$1, %edx
	je	.L12
	paddd	32(%rsp), %xmm0
.L12:
	movdqa	%xmm0, %xmm1
	movl	%edi, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	andl	$3, %edi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L11
	movslq	%esi, %rdi
	addl	$1, %esi
	addl	16(%rsp,%rdi,4), %edx
	cmpl	%esi, %eax
	jle	.L11
.L16:
	movslq	%esi, %rdi
	addl	$1, %esi
	addl	16(%rsp,%rdi,4), %edx
	cmpl	%esi, %eax
	jle	.L11
	movslq	%esi, %rsi
	addl	16(%rsp,%rsi,4), %edx
.L11:
	subl	%ecx, %edx
	cmpl	%ecx, %edx
	jle	.L14
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L15:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L15
.L2:
	movl	16(%rsp), %r8d
	movl	%r8d, %ecx
.L4:
	xorl	%edx, %edx
	subl	$1, %eax
	cmove	%r8d, %edx
	jmp	.L11
.L18:
	movl	$1, %edx
	jmp	.L5
.L30:
	movl	%r8d, %edx
	movl	$1, %esi
	jmp	.L16
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	movl	16(%rsp), %r8d
	movl	%r8d, %ecx
	cmpl	$1, %eax
	jle	.L4
	leal	-2(%rax), %edx
	leal	-1(%rax), %esi
	cmpl	$2, %edx
	jbe	.L18
	movdqu	20(%rsp), %xmm1
	movd	%r8d, %xmm3
	movl	%esi, %edx
	pshufd	$0, %xmm3, %xmm2
	shrl	$2, %edx
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	cmpl	$1, %edx
	je	.L6
	movdqu	36(%rsp), %xmm1
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm1, %xmm2
	movdqa	%xmm2, %xmm0
.L6:
	movdqa	%xmm0, %xmm2
	movl	%esi, %edi
	psrldq	$8, %xmm2
	andl	$-4, %edi
	movdqa	%xmm2, %xmm1
	leal	1(%rdi), %edx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %ecx
	cmpl	%edi, %esi
	je	.L9
.L5:
	movslq	%edx, %rsi
	movl	16(%rsp,%rsi,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	leal	1(%rdx), %esi
	cmpl	%esi, %eax
	jle	.L9
	movslq	%esi, %rsi
	movl	16(%rsp,%rsi,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	addl	$2, %edx
	cmpl	%edx, %eax
	jle	.L9
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %edx
	cmpl	%edx, %ecx
	cmovl	%edx, %ecx
.L9:
	testl	%eax, %eax
	movl	$1, %edi
	cmovg	%eax, %edi
	cmpl	$3, %eax
	jle	.L30
	movl	%edi, %edx
	movdqa	16(%rsp), %xmm0
	shrl	$2, %edx
	cmpl	$1, %edx
	je	.L12
	paddd	32(%rsp), %xmm0
.L12:
	movdqa	%xmm0, %xmm1
	movl	%edi, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	andl	$3, %edi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	je	.L11
	movslq	%esi, %rdi
	addl	$1, %esi
	addl	16(%rsp,%rdi,4), %edx
	cmpl	%esi, %eax
	jle	.L11
.L16:
	movslq	%esi, %rdi
	addl	$1, %esi
	addl	16(%rsp,%rdi,4), %edx
	cmpl	%esi, %eax
	jle	.L11
	movslq	%esi, %rsi
	addl	16(%rsp,%rsi,4), %edx
.L11:
	subl	%ecx, %edx
	cmpl	%ecx, %edx
	jle	.L14
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L15:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$64, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L15
.L2:
	movl	16(%rsp), %r8d
	movl	%r8d, %ecx
.L4:
	xorl	%edx, %edx
	subl	$1, %eax
	cmove	%r8d, %edx
	jmp	.L11
.L18:
	movl	$1, %edx
	jmp	.L5
.L30:
	movl	%r8d, %edx
	movl	$1, %esi
	jmp	.L16
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```