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>
int main(void){
    int N;
    scanf("%d",&N);
    int a[13]={};
    int ans=0;
    for(int i=0;i<N;i++){
        int kari;
        scanf("%d",&kari);
        a[kari]++;
    }
    for(int i=0;i<=12;i++){
        if(a[i]>2){printf("0");return 0;}
    }
    if(a[0]>0){printf("0");return 0;}
    if(a[12]>1){printf("0");return 0;}
    for(int j=0;j<(1<<12);j++){
        int time[25]={};
        time[0]=1;
        time[24]=1;
        for(int i=0;i<=12;i++){
            if(a[i]==2){time[i]=1;time[24-i]=1;}
            if(a[i]==1){int unko=((j>>i)%2);unko=(unko==1)?i:(24-i);time[unko]=1;}
        }
        int s=1919;
        int mae=0;
        for(int i=1;i<=24;i++){
            if(time[i]==1){s=s>(i-mae)?(i-mae):s;mae=i;}
        }
        if(ans<s){ans=s;/*for(int i=0;i<=24;i++)printf("%d:%d\n",i,time[i]);*/}
    //    printf("%d\n",s);
    }
    printf("%d",ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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	$224, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-220(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	$0, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	$0, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	$0, -128(%rbp)
	movl	$0, -212(%rbp)
	movl	$0, -208(%rbp)
	jmp	.L2
.L3:
	leaq	-216(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-216(%rbp), %eax
	movslq	%eax, %rdx
	movl	-176(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -176(%rbp,%rax,4)
	addl	$1, -208(%rbp)
.L2:
	movl	-220(%rbp), %eax
	cmpl	%eax, -208(%rbp)
	jl	.L3
	movl	$0, -204(%rbp)
	jmp	.L4
.L7:
	movl	-204(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jle	.L5
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L22
.L5:
	addl	$1, -204(%rbp)
.L4:
	cmpl	$12, -204(%rbp)
	jle	.L7
	movl	-176(%rbp), %eax
	testl	%eax, %eax
	jle	.L8
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L22
.L8:
	movl	-128(%rbp), %eax
	cmpl	$1, %eax
	jle	.L9
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L22
.L9:
	movl	$0, -200(%rbp)
	jmp	.L10
.L21:
	leaq	-112(%rbp), %rdx
	movl	$0, %eax
	movl	$12, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$1, -112(%rbp)
	movl	$1, -16(%rbp)
	movl	$0, -196(%rbp)
	jmp	.L11
.L16:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L12
	movl	-196(%rbp), %eax
	cltq
	movl	$1, -112(%rbp,%rax,4)
	movl	$24, %eax
	subl	-196(%rbp), %eax
	cltq
	movl	$1, -112(%rbp,%rax,4)
.L12:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	-196(%rbp), %eax
	movl	-200(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, -180(%rbp)
	cmpl	$1, -180(%rbp)
	je	.L14
	movl	$24, %eax
	subl	-196(%rbp), %eax
	jmp	.L15
.L14:
	movl	-196(%rbp), %eax
.L15:
	movl	%eax, -180(%rbp)
	movl	-180(%rbp), %eax
	cltq
	movl	$1, -112(%rbp,%rax,4)
.L13:
	addl	$1, -196(%rbp)
.L11:
	cmpl	$12, -196(%rbp)
	jle	.L16
	movl	$1919, -192(%rbp)
	movl	$0, -188(%rbp)
	movl	$1, -184(%rbp)
	jmp	.L17
.L19:
	movl	-184(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	-184(%rbp), %eax
	subl	-188(%rbp), %eax
	movl	-192(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -192(%rbp)
	movl	-184(%rbp), %eax
	movl	%eax, -188(%rbp)
.L18:
	addl	$1, -184(%rbp)
.L17:
	cmpl	$24, -184(%rbp)
	jle	.L19
	movl	-212(%rbp), %eax
	cmpl	-192(%rbp), %eax
	jge	.L20
	movl	-192(%rbp), %eax
	movl	%eax, -212(%rbp)
.L20:
	addl	$1, -200(%rbp)
.L10:
	cmpl	$4095, -200(%rbp)
	jle	.L21
	movl	-212(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L22:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	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	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	leaq	28(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	pxor	%xmm0, %xmm0
	movl	$0, 80(%rsp)
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rax
	addl	$1, 32(%rsp,%rax,4)
	cmpl	%ebx, 24(%rsp)
	jg	.L2
.L5:
	movl	32(%rsp), %eax
	cmpl	$2, %eax
	jg	.L3
	movl	36(%rsp), %ebx
	movl	%ebx, 8(%rsp)
	cmpl	$2, %ebx
	jg	.L3
	movl	40(%rsp), %r13d
	cmpl	$2, %r13d
	jg	.L3
	movl	44(%rsp), %ebx
	movl	%ebx, (%rsp)
	cmpl	$2, %ebx
	jg	.L3
	movl	48(%rsp), %r11d
	cmpl	$2, %r11d
	jg	.L3
	movl	52(%rsp), %ebx
	cmpl	$2, %ebx
	jg	.L3
	movl	56(%rsp), %ebp
	cmpl	$2, %ebp
	jg	.L3
	movl	60(%rsp), %r12d
	cmpl	$2, %r12d
	jg	.L3
	movl	64(%rsp), %esi
	movl	%esi, 4(%rsp)
	cmpl	$2, %esi
	jg	.L3
	movl	68(%rsp), %r10d
	cmpl	$2, %r10d
	jg	.L3
	movl	72(%rsp), %r14d
	cmpl	$2, %r14d
	jg	.L3
	movl	76(%rsp), %r9d
	cmpl	$2, %r9d
	jg	.L3
	movl	80(%rsp), %esi
	movl	%esi, 12(%rsp)
	testl	%eax, %eax
	jg	.L3
	cmpl	$1, 12(%rsp)
	jg	.L3
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	leaq	96(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L42:
	xorl	%eax, %eax
	movl	$12, %ecx
	movq	%rdx, %rdi
	cmpl	$2, 8(%rsp)
	rep stosq
	movl	$1, 192(%rsp)
	je	.L68
	cmpl	$1, 8(%rsp)
	jne	.L8
	movl	%esi, %eax
	andl	$2, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$22, %eax
	addl	$1, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L8:
	cmpl	$2, %r13d
	je	.L69
	cmpl	$1, %r13d
	jne	.L11
	movl	%esi, %eax
	andl	$4, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$20, %eax
	addl	$2, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L11:
	cmpl	$2, (%rsp)
	je	.L70
	cmpl	$1, (%rsp)
	jne	.L14
	movl	%esi, %eax
	andl	$8, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$18, %eax
	addl	$3, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L14:
	cmpl	$2, %r11d
	je	.L71
	cmpl	$1, %r11d
	jne	.L17
	movl	%esi, %eax
	andl	$16, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$16, %eax
	addl	$4, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L17:
	cmpl	$2, %ebx
	je	.L72
	cmpl	$1, %ebx
	jne	.L20
	movl	%esi, %eax
	andl	$32, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$14, %eax
	addl	$5, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L20:
	cmpl	$2, %ebp
	je	.L73
	cmpl	$1, %ebp
	jne	.L23
	movl	%esi, %eax
	andl	$64, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$12, %eax
	addl	$6, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L23:
	cmpl	$2, %r12d
	je	.L74
	cmpl	$1, %r12d
	jne	.L26
	movl	%esi, %eax
	andl	$128, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$10, %eax
	addl	$7, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L26:
	cmpl	$2, 4(%rsp)
	je	.L75
	cmpl	$1, 4(%rsp)
	jne	.L29
	movl	%esi, %eax
	andl	$256, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$8, %eax
	addl	$8, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L29:
	cmpl	$2, %r10d
	je	.L76
	cmpl	$1, %r10d
	jne	.L32
	movl	%esi, %eax
	andl	$512, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$6, %eax
	addl	$9, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L32:
	cmpl	$2, %r14d
	je	.L77
	cmpl	$1, %r14d
	jne	.L35
	movl	%esi, %eax
	andl	$1024, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$4, %eax
	addl	$10, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L35:
	cmpl	$2, %r9d
	je	.L78
	cmpl	$1, %r9d
	jne	.L38
	movl	%esi, %eax
	sarl	$11, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$2, %eax
	addl	$11, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L38:
	cmpl	$1, 12(%rsp)
	movl	$1, %eax
	movl	$1919, %ecx
	cmovne	144(%rsp), %eax
	xorl	%r15d, %r15d
	movl	%eax, 144(%rsp)
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L41:
	cmpl	$1, (%rdx,%rax,4)
	jne	.L40
	movl	%eax, %edi
	subl	%r15d, %edi
	movl	%eax, %r15d
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
.L40:
	addq	$1, %rax
	cmpq	$25, %rax
	jne	.L41
	cmpl	%ecx, %r8d
	cmovl	%ecx, %r8d
	addl	$1, %esi
	cmpl	$4096, %esi
	jne	.L42
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
.L3:
	movl	$48, %edi
	call	putchar@PLT
.L6:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L79
	addq	$216, %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
.L78:
	.cfi_restore_state
	movl	$1, 140(%rsp)
	movl	$1, 148(%rsp)
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L77:
	movl	$1, 136(%rsp)
	movl	$1, 152(%rsp)
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L76:
	movl	$1, 132(%rsp)
	movl	$1, 156(%rsp)
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L75:
	movl	$1, 128(%rsp)
	movl	$1, 160(%rsp)
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L74:
	movl	$1, 124(%rsp)
	movl	$1, 164(%rsp)
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L73:
	movl	$1, 120(%rsp)
	movl	$1, 168(%rsp)
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L72:
	movl	$1, 116(%rsp)
	movl	$1, 172(%rsp)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L71:
	movl	$1, 112(%rsp)
	movl	$1, 176(%rsp)
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L70:
	movl	$1, 108(%rsp)
	movl	$1, 180(%rsp)
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L69:
	movl	$1, 104(%rsp)
	movl	$1, 184(%rsp)
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L68:
	movl	$1, 100(%rsp)
	movl	$1, 188(%rsp)
	jmp	.L8
.L79:
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$216, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	leaq	28(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	pxor	%xmm0, %xmm0
	movl	$0, 80(%rsp)
	movaps	%xmm0, 32(%rsp)
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rax
	addl	$1, 32(%rsp,%rax,4)
	cmpl	%ebx, 24(%rsp)
	jg	.L2
.L5:
	movl	32(%rsp), %eax
	cmpl	$2, %eax
	jg	.L3
	movl	36(%rsp), %ebx
	movl	%ebx, 8(%rsp)
	cmpl	$2, %ebx
	jg	.L3
	movl	40(%rsp), %r13d
	cmpl	$2, %r13d
	jg	.L3
	movl	44(%rsp), %ebx
	movl	%ebx, (%rsp)
	cmpl	$2, %ebx
	jg	.L3
	movl	48(%rsp), %r11d
	cmpl	$2, %r11d
	jg	.L3
	movl	52(%rsp), %ebx
	cmpl	$2, %ebx
	jg	.L3
	movl	56(%rsp), %ebp
	cmpl	$2, %ebp
	jg	.L3
	movl	60(%rsp), %r12d
	cmpl	$2, %r12d
	jg	.L3
	movl	64(%rsp), %esi
	movl	%esi, 4(%rsp)
	cmpl	$2, %esi
	jg	.L3
	movl	68(%rsp), %r10d
	cmpl	$2, %r10d
	jg	.L3
	movl	72(%rsp), %r14d
	cmpl	$2, %r14d
	jg	.L3
	movl	76(%rsp), %r9d
	cmpl	$2, %r9d
	jg	.L3
	movl	80(%rsp), %esi
	movl	%esi, 12(%rsp)
	testl	%eax, %eax
	jg	.L3
	cmpl	$1, 12(%rsp)
	jg	.L3
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	leaq	96(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L42:
	xorl	%eax, %eax
	movl	$12, %ecx
	movq	%rdx, %rdi
	cmpl	$2, 8(%rsp)
	rep stosq
	movl	$1, 192(%rsp)
	je	.L68
	cmpl	$1, 8(%rsp)
	jne	.L8
	movl	%esi, %eax
	andl	$2, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$22, %eax
	addl	$1, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L8:
	cmpl	$2, %r13d
	je	.L69
	cmpl	$1, %r13d
	jne	.L11
	movl	%esi, %eax
	andl	$4, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$20, %eax
	addl	$2, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L11:
	cmpl	$2, (%rsp)
	je	.L70
	cmpl	$1, (%rsp)
	jne	.L14
	movl	%esi, %eax
	andl	$8, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$18, %eax
	addl	$3, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L14:
	cmpl	$2, %r11d
	je	.L71
	cmpl	$1, %r11d
	jne	.L17
	movl	%esi, %eax
	andl	$16, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$16, %eax
	addl	$4, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L17:
	cmpl	$2, %ebx
	je	.L72
	cmpl	$1, %ebx
	jne	.L20
	movl	%esi, %eax
	andl	$32, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$14, %eax
	addl	$5, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L20:
	cmpl	$2, %ebp
	je	.L73
	cmpl	$1, %ebp
	jne	.L23
	movl	%esi, %eax
	andl	$64, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$12, %eax
	addl	$6, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L23:
	cmpl	$2, %r12d
	je	.L74
	cmpl	$1, %r12d
	jne	.L26
	movl	%esi, %eax
	andl	$128, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$10, %eax
	addl	$7, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L26:
	cmpl	$2, 4(%rsp)
	je	.L75
	cmpl	$1, 4(%rsp)
	jne	.L29
	movl	%esi, %eax
	andl	$256, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$8, %eax
	addl	$8, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L29:
	cmpl	$2, %r10d
	je	.L76
	cmpl	$1, %r10d
	jne	.L32
	movl	%esi, %eax
	andl	$512, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$6, %eax
	addl	$9, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L32:
	cmpl	$2, %r14d
	je	.L77
	cmpl	$1, %r14d
	jne	.L35
	movl	%esi, %eax
	andl	$1024, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$4, %eax
	addl	$10, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L35:
	cmpl	$2, %r9d
	je	.L78
	cmpl	$1, %r9d
	jne	.L38
	movl	%esi, %eax
	sarl	$11, %eax
	cmpl	$1, %eax
	sbbl	%eax, %eax
	andl	$2, %eax
	addl	$11, %eax
	cltq
	movl	$1, 96(%rsp,%rax,4)
.L38:
	cmpl	$1, 12(%rsp)
	movl	$1, %eax
	movl	$1919, %ecx
	cmovne	144(%rsp), %eax
	xorl	%r15d, %r15d
	movl	%eax, 144(%rsp)
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L41:
	cmpl	$1, (%rdx,%rax,4)
	jne	.L40
	movl	%eax, %edi
	subl	%r15d, %edi
	movl	%eax, %r15d
	cmpl	%edi, %ecx
	cmovg	%edi, %ecx
.L40:
	addq	$1, %rax
	cmpq	$25, %rax
	jne	.L41
	cmpl	%ecx, %r8d
	cmovl	%ecx, %r8d
	addl	$1, %esi
	cmpl	$4096, %esi
	jne	.L42
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
.L3:
	movl	$48, %edi
	call	putchar@PLT
.L6:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L79
	addq	$216, %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
.L78:
	.cfi_restore_state
	movl	$1, 140(%rsp)
	movl	$1, 148(%rsp)
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L77:
	movl	$1, 136(%rsp)
	movl	$1, 152(%rsp)
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L76:
	movl	$1, 132(%rsp)
	movl	$1, 156(%rsp)
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L75:
	movl	$1, 128(%rsp)
	movl	$1, 160(%rsp)
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L74:
	movl	$1, 124(%rsp)
	movl	$1, 164(%rsp)
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L73:
	movl	$1, 120(%rsp)
	movl	$1, 168(%rsp)
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L72:
	movl	$1, 116(%rsp)
	movl	$1, 172(%rsp)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L71:
	movl	$1, 112(%rsp)
	movl	$1, 176(%rsp)
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L70:
	movl	$1, 108(%rsp)
	movl	$1, 180(%rsp)
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L69:
	movl	$1, 104(%rsp)
	movl	$1, 184(%rsp)
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L68:
	movl	$1, 100(%rsp)
	movl	$1, 188(%rsp)
	jmp	.L8
.L79:
	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:

#include <stdio.h>
int main(void){
    int N;
    scanf("%d",&N);
    int a[13]={};
    int ans=0;
    for(int i=0;i<N;i++){
        int kari;
        scanf("%d",&kari);
        a[kari]++;
    }
    for(int i=0;i<=12;i++){
        if(a[i]>2){printf("0");return 0;}
    }
    if(a[0]>0){printf("0");return 0;}
    if(a[12]>1){printf("0");return 0;}
    for(int j=0;j<(1<<12);j++){
        int time[25]={};
        time[0]=1;
        time[24]=1;
        for(int i=0;i<=12;i++){
            if(a[i]==2){time[i]=1;time[24-i]=1;}
            if(a[i]==1){int unko=((j>>i)%2);unko=(unko==1)?i:(24-i);time[unko]=1;}
        }
        int s=1919;
        int mae=0;
        for(int i=1;i<=24;i++){
            if(time[i]==1){s=s>(i-mae)?(i-mae):s;mae=i;}
        }
        if(ans<s){ans=s;/*for(int i=0;i<=24;i++)printf("%d:%d\n",i,time[i]);*/}
    //    printf("%d\n",s);
    }
    printf("%d",ans);
    return 0;
}
3
7 12 8

4
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>
int main(void){
    int N;
    scanf("%d",&N);
    int a[13]={};
    int ans=0;
    for(int i=0;i<N;i++){
        int kari;
        scanf("%d",&kari);
        a[kari]++;
    }
    for(int i=0;i<=12;i++){
        if(a[i]>2){printf("0");return 0;}
    }
    if(a[0]>0){printf("0");return 0;}
    if(a[12]>1){printf("0");return 0;}
    for(int j=0;j<(1<<12);j++){
        int time[25]={};
        time[0]=1;
        time[24]=1;
        for(int i=0;i<=12;i++){
            if(a[i]==2){time[i]=1;time[24-i]=1;}
            if(a[i]==1){int unko=((j>>i)%2);unko=(unko==1)?i:(24-i);time[unko]=1;}
        }
        int s=1919;
        int mae=0;
        for(int i=1;i<=24;i++){
            if(time[i]==1){s=s>(i-mae)?(i-mae):s;mae=i;}
        }
        if(ans<s){ans=s;/*for(int i=0;i<=24;i++)printf("%d:%d\n",i,time[i]);*/}
    //    printf("%d\n",s);
    }
    printf("%d",ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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	$224, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-220(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	$0, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	$0, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	$0, -128(%rbp)
	movl	$0, -212(%rbp)
	movl	$0, -208(%rbp)
	jmp	.L2
.L3:
	leaq	-216(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-216(%rbp), %eax
	movslq	%eax, %rdx
	movl	-176(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -176(%rbp,%rax,4)
	addl	$1, -208(%rbp)
.L2:
	movl	-220(%rbp), %eax
	cmpl	%eax, -208(%rbp)
	jl	.L3
	movl	$0, -204(%rbp)
	jmp	.L4
.L7:
	movl	-204(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jle	.L5
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L22
.L5:
	addl	$1, -204(%rbp)
.L4:
	cmpl	$12, -204(%rbp)
	jle	.L7
	movl	-176(%rbp), %eax
	testl	%eax, %eax
	jle	.L8
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L22
.L8:
	movl	-128(%rbp), %eax
	cmpl	$1, %eax
	jle	.L9
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L22
.L9:
	movl	$0, -200(%rbp)
	jmp	.L10
.L21:
	leaq	-112(%rbp), %rdx
	movl	$0, %eax
	movl	$12, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$1, -112(%rbp)
	movl	$1, -16(%rbp)
	movl	$0, -196(%rbp)
	jmp	.L11
.L16:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L12
	movl	-196(%rbp), %eax
	cltq
	movl	$1, -112(%rbp,%rax,4)
	movl	$24, %eax
	subl	-196(%rbp), %eax
	cltq
	movl	$1, -112(%rbp,%rax,4)
.L12:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	-196(%rbp), %eax
	movl	-200(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, -180(%rbp)
	cmpl	$1, -180(%rbp)
	je	.L14
	movl	$24, %eax
	subl	-196(%rbp), %eax
	jmp	.L15
.L14:
	movl	-196(%rbp), %eax
.L15:
	movl	%eax, -180(%rbp)
	movl	-180(%rbp), %eax
	cltq
	movl	$1, -112(%rbp,%rax,4)
.L13:
	addl	$1, -196(%rbp)
.L11:
	cmpl	$12, -196(%rbp)
	jle	.L16
	movl	$1919, -192(%rbp)
	movl	$0, -188(%rbp)
	movl	$1, -184(%rbp)
	jmp	.L17
.L19:
	movl	-184(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	-184(%rbp), %eax
	subl	-188(%rbp), %eax
	movl	-192(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -192(%rbp)
	movl	-184(%rbp), %eax
	movl	%eax, -188(%rbp)
.L18:
	addl	$1, -184(%rbp)
.L17:
	cmpl	$24, -184(%rbp)
	jle	.L19
	movl	-212(%rbp), %eax
	cmpl	-192(%rbp), %eax
	jge	.L20
	movl	-192(%rbp), %eax
	movl	%eax, -212(%rbp)
.L20:
	addl	$1, -200(%rbp)
.L10:
	cmpl	$4095, -200(%rbp)
	jle	.L21
	movl	-212(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L22:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	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
	.section	.rodata
.LC0:
	.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	$224, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-220(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	$0, -160(%rbp)
	movq	$0, -152(%rbp)
	movq	$0, -144(%rbp)
	movq	$0, -136(%rbp)
	movl	$0, -128(%rbp)
	movl	$0, -212(%rbp)
	movl	$0, -208(%rbp)
	jmp	.L2
.L3:
	leaq	-216(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-216(%rbp), %eax
	movslq	%eax, %rdx
	movl	-176(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -176(%rbp,%rax,4)
	addl	$1, -208(%rbp)
.L2:
	movl	-220(%rbp), %eax
	cmpl	%eax, -208(%rbp)
	jl	.L3
	movl	$0, -204(%rbp)
	jmp	.L4
.L7:
	movl	-204(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jle	.L5
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L22
.L5:
	addl	$1, -204(%rbp)
.L4:
	cmpl	$12, -204(%rbp)
	jle	.L7
	movl	-176(%rbp), %eax
	testl	%eax, %eax
	jle	.L8
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L22
.L8:
	movl	-128(%rbp), %eax
	cmpl	$1, %eax
	jle	.L9
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L22
.L9:
	movl	$0, -200(%rbp)
	jmp	.L10
.L21:
	leaq	-112(%rbp), %rdx
	movl	$0, %eax
	movl	$12, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$1, -112(%rbp)
	movl	$1, -16(%rbp)
	movl	$0, -196(%rbp)
	jmp	.L11
.L16:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L12
	movl	-196(%rbp), %eax
	cltq
	movl	$1, -112(%rbp,%rax,4)
	movl	$24, %eax
	subl	-196(%rbp), %eax
	cltq
	movl	$1, -112(%rbp,%rax,4)
.L12:
	movl	-196(%rbp), %eax
	cltq
	movl	-176(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L13
	movl	-196(%rbp), %eax
	movl	-200(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, -180(%rbp)
	cmpl	$1, -180(%rbp)
	je	.L14
	movl	$24, %eax
	subl	-196(%rbp), %eax
	jmp	.L15
.L14:
	movl	-196(%rbp), %eax
.L15:
	movl	%eax, -180(%rbp)
	movl	-180(%rbp), %eax
	cltq
	movl	$1, -112(%rbp,%rax,4)
.L13:
	addl	$1, -196(%rbp)
.L11:
	cmpl	$12, -196(%rbp)
	jle	.L16
	movl	$1919, -192(%rbp)
	movl	$0, -188(%rbp)
	movl	$1, -184(%rbp)
	jmp	.L17
.L19:
	movl	-184(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	-184(%rbp), %eax
	subl	-188(%rbp), %eax
	movl	-192(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -192(%rbp)
	movl	-184(%rbp), %eax
	movl	%eax, -188(%rbp)
.L18:
	addl	$1, -184(%rbp)
.L17:
	cmpl	$24, -184(%rbp)
	jle	.L19
	movl	-212(%rbp), %eax
	cmpl	-192(%rbp), %eax
	jge	.L20
	movl	-192(%rbp), %eax
	movl	%eax, -212(%rbp)
.L20:
	addl	$1, -200(%rbp)
.L10:
	cmpl	$4095, -200(%rbp)
	jle	.L21
	movl	-212(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L22:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	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:
