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>
#define MAX1 100000
#define MAX2 1000000000
int main(void)
{
    int n,i,a[MAX1],sum4=0,sum2=0,sum1=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        if(a[i]%4==0)
            sum4++;
        else if(a[i]%2==0)
            sum2++;
        else if(a[i]%2)
            sum1++;}
    if(sum2==0&&sum4+1>=sum1)
        printf("Yes");
    else if(sum4>=sum1)
        printf("Yes");
    else printf("No");
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400028(%rbp)
	movl	$0, -400024(%rbp)
	movl	$0, -400020(%rbp)
	leaq	-400036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400032(%rbp)
	jmp	.L2
.L6:
	leaq	-400016(%rbp), %rdx
	movl	-400032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400032(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	andl	$3, %eax
	testl	%eax, %eax
	jne	.L3
	addl	$1, -400028(%rbp)
	jmp	.L4
.L3:
	movl	-400032(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L5
	addl	$1, -400024(%rbp)
	jmp	.L4
.L5:
	movl	-400032(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L4
	addl	$1, -400020(%rbp)
.L4:
	addl	$1, -400032(%rbp)
.L2:
	movl	-400036(%rbp), %eax
	cmpl	%eax, -400032(%rbp)
	jl	.L6
	cmpl	$0, -400024(%rbp)
	jne	.L7
	movl	-400028(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -400020(%rbp)
	jg	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L8
.L7:
	movl	-400028(%rbp), %eax
	cmpl	-400020(%rbp), %eax
	jl	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L8
.L9:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.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
	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
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L3
	leaq	16(%rsp), %rbx
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %r12d
.L5:
	addl	$1, %ebp
	addq	$4, %rbx
	cmpl	%ebp, 12(%rsp)
	jle	.L15
.L7:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	testb	$3, %al
	je	.L16
	testb	$1, %al
	jne	.L6
	addl	$1, %r15d
	addl	$1, %ebp
	addq	$4, %rbx
	cmpl	%ebp, 12(%rsp)
	jg	.L7
.L15:
	testl	%r15d, %r15d
	je	.L17
.L8:
	cmpl	%r14d, %r12d
	jl	.L18
.L3:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L10:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$400040, %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
.L6:
	.cfi_restore_state
	addl	$1, %r14d
	jmp	.L5
.L18:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L17:
	leal	1(%r12), %eax
	cmpl	%r14d, %eax
	jl	.L8
	jmp	.L3
.L19:
	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"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.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
	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
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L3
	leaq	16(%rsp), %rbx
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %r12d
.L5:
	addl	$1, %ebp
	addq	$4, %rbx
	cmpl	%ebp, 12(%rsp)
	jle	.L15
.L7:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	testb	$3, %al
	je	.L16
	testb	$1, %al
	jne	.L6
	addl	$1, %r15d
	addl	$1, %ebp
	addq	$4, %rbx
	cmpl	%ebp, 12(%rsp)
	jg	.L7
.L15:
	testl	%r15d, %r15d
	je	.L17
.L8:
	cmpl	%r14d, %r12d
	jl	.L18
.L3:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L10:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$400040, %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
.L6:
	.cfi_restore_state
	addl	$1, %r14d
	jmp	.L5
.L18:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L17:
	leal	1(%r12), %eax
	cmpl	%r14d, %eax
	jl	.L8
	jmp	.L3
.L19:
	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>
#define MAX1 100000
#define MAX2 1000000000
int main(void)
{
    int n,i,a[MAX1],sum4=0,sum2=0,sum1=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        if(a[i]%4==0)
            sum4++;
        else if(a[i]%2==0)
            sum2++;
        else if(a[i]%2)
            sum1++;}
    if(sum2==0&&sum4+1>=sum1)
        printf("Yes");
    else if(sum4>=sum1)
        printf("Yes");
    else printf("No");
    return 0;
}
3
1 10 100

Yes
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>
#define MAX1 100000
#define MAX2 1000000000
int main(void)
{
    int n,i,a[MAX1],sum4=0,sum2=0,sum1=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
        if(a[i]%4==0)
            sum4++;
        else if(a[i]%2==0)
            sum2++;
        else if(a[i]%2)
            sum1++;}
    if(sum2==0&&sum4+1>=sum1)
        printf("Yes");
    else if(sum4>=sum1)
        printf("Yes");
    else printf("No");
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400028(%rbp)
	movl	$0, -400024(%rbp)
	movl	$0, -400020(%rbp)
	leaq	-400036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400032(%rbp)
	jmp	.L2
.L6:
	leaq	-400016(%rbp), %rdx
	movl	-400032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400032(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	andl	$3, %eax
	testl	%eax, %eax
	jne	.L3
	addl	$1, -400028(%rbp)
	jmp	.L4
.L3:
	movl	-400032(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L5
	addl	$1, -400024(%rbp)
	jmp	.L4
.L5:
	movl	-400032(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L4
	addl	$1, -400020(%rbp)
.L4:
	addl	$1, -400032(%rbp)
.L2:
	movl	-400036(%rbp), %eax
	cmpl	%eax, -400032(%rbp)
	jl	.L6
	cmpl	$0, -400024(%rbp)
	jne	.L7
	movl	-400028(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -400020(%rbp)
	jg	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L8
.L7:
	movl	-400028(%rbp), %eax
	cmpl	-400020(%rbp), %eax
	jl	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L8
.L9:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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"
.LC1:
	.string	"Yes"
.LC2:
	.string	"No"
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400028(%rbp)
	movl	$0, -400024(%rbp)
	movl	$0, -400020(%rbp)
	leaq	-400036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400032(%rbp)
	jmp	.L2
.L6:
	leaq	-400016(%rbp), %rdx
	movl	-400032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400032(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	andl	$3, %eax
	testl	%eax, %eax
	jne	.L3
	addl	$1, -400028(%rbp)
	jmp	.L4
.L3:
	movl	-400032(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L5
	addl	$1, -400024(%rbp)
	jmp	.L4
.L5:
	movl	-400032(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L4
	addl	$1, -400020(%rbp)
.L4:
	addl	$1, -400032(%rbp)
.L2:
	movl	-400036(%rbp), %eax
	cmpl	%eax, -400032(%rbp)
	jl	.L6
	cmpl	$0, -400024(%rbp)
	jne	.L7
	movl	-400028(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -400020(%rbp)
	jg	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L8
.L7:
	movl	-400028(%rbp), %eax
	cmpl	-400020(%rbp), %eax
	jl	.L9
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L8
.L9:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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:
