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<stdbool.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define rep(i,n) for(int i=0; i <(n); i++)
int main(){
  int n;
  long a[100000];
  scanf("%d",&n);
  rep(i,n){
    scanf("%lld",&a[i]);
  }
  int x=0,y=0,z=0;
  rep(j,n){
    if(a[j]%4==0){
      x++;
    }else if(a[j]%2==0){
      y++;
    }else{
      z++;
    }
  }
  if(x==z-1){
    if(n%2==1&&y==0){
      printf("Yes\n");
      return 0;
    }
  }else if(x>z-1){
    printf("Yes\n");
    return 0;
  }
  printf("No\n");
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"Yes"
.LC3:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1328, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800036(%rbp)
	jmp	.L2
.L3:
	leaq	-800016(%rbp), %rdx
	movl	-800036(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800036(%rbp)
.L2:
	movl	-800040(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L3
	movl	$0, -800032(%rbp)
	movl	$0, -800028(%rbp)
	movl	$0, -800024(%rbp)
	movl	$0, -800020(%rbp)
	jmp	.L4
.L8:
	movl	-800020(%rbp), %eax
	cltq
	movq	-800016(%rbp,%rax,8), %rax
	andl	$3, %eax
	testq	%rax, %rax
	jne	.L5
	addl	$1, -800032(%rbp)
	jmp	.L6
.L5:
	movl	-800020(%rbp), %eax
	cltq
	movq	-800016(%rbp,%rax,8), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L7
	addl	$1, -800028(%rbp)
	jmp	.L6
.L7:
	addl	$1, -800024(%rbp)
.L6:
	addl	$1, -800020(%rbp)
.L4:
	movl	-800040(%rbp), %eax
	cmpl	%eax, -800020(%rbp)
	jl	.L8
	movl	-800024(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -800032(%rbp)
	jne	.L9
	movl	-800040(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L10
	cmpl	$0, -800028(%rbp)
	jne	.L10
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L12
.L9:
	movl	-800024(%rbp), %eax
	cmpl	-800032(%rbp), %eax
	jg	.L10
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L12
.L10:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L12:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"Yes"
.LC3:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L12
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$8, %rbp
	cmpl	%ebx, %ecx
	jg	.L3
	testl	%ecx, %ecx
	jle	.L12
	leal	-1(%rcx), %edx
	leaq	8(%r12), %rax
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	leaq	(%rax,%rdx,8), %rdi
	xorl	%esi, %esi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L25:
	addl	$1, %esi
.L5:
	movq	%rax, %r12
	cmpq	%rax, %rdi
	je	.L22
.L26:
	addq	$8, %rax
.L7:
	movq	(%r12), %rdx
	testb	$3, %dl
	je	.L25
	andl	$1, %edx
	jne	.L6
	addl	$1, %r9d
	movq	%rax, %r12
	cmpq	%rax, %rdi
	jne	.L26
.L22:
	leal	-1(%r8), %eax
	cmpl	%esi, %eax
	je	.L27
	cmpl	%r8d, %esi
	jge	.L12
.L9:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L10:
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$800040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	addl	$1, %r8d
	jmp	.L5
.L27:
	testl	%r9d, %r9d
	jne	.L9
	andb	$1, %cl
	je	.L9
.L12:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L10
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"Yes"
.LC3:
	.string	"No"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L12
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$8, %rbp
	cmpl	%ebx, %ecx
	jg	.L3
	testl	%ecx, %ecx
	jle	.L12
	leal	-1(%rcx), %edx
	leaq	8(%r12), %rax
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	leaq	(%rax,%rdx,8), %rdi
	xorl	%esi, %esi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L25:
	addl	$1, %esi
.L5:
	movq	%rax, %r12
	cmpq	%rax, %rdi
	je	.L22
.L26:
	addq	$8, %rax
.L7:
	movq	(%r12), %rdx
	testb	$3, %dl
	je	.L25
	andl	$1, %edx
	jne	.L6
	addl	$1, %r9d
	movq	%rax, %r12
	cmpq	%rax, %rdi
	jne	.L26
.L22:
	leal	-1(%r8), %eax
	cmpl	%esi, %eax
	je	.L27
	cmpl	%r8d, %esi
	jge	.L12
.L9:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L10:
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$800040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	addl	$1, %r8d
	jmp	.L5
.L27:
	testl	%r9d, %r9d
	jne	.L9
	andb	$1, %cl
	je	.L9
.L12:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L10
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<stdbool.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define rep(i,n) for(int i=0; i <(n); i++)
int main(){
  int n;
  long a[100000];
  scanf("%d",&n);
  rep(i,n){
    scanf("%lld",&a[i]);
  }
  int x=0,y=0,z=0;
  rep(j,n){
    if(a[j]%4==0){
      x++;
    }else if(a[j]%2==0){
      y++;
    }else{
      z++;
    }
  }
  if(x==z-1){
    if(n%2==1&&y==0){
      printf("Yes\n");
      return 0;
    }
  }else if(x>z-1){
    printf("Yes\n");
    return 0;
  }
  printf("No\n");
  return 0;
}

6
2 7 2 8 2 8
 3
-1 1 1
 3
0 4 1
 3
2 10 100
 4
2 2 3 4
 6
4 7 2 8 2 8
 3
0 1 1
 3
0 10 100
 4
0 2 3 4
 6
6 7 2 8 2 8

Yes
 No
 Yes
 Yes
 Yes
 Yes
 Yes
 Yes
 Yes
 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>
#include<stdbool.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define rep(i,n) for(int i=0; i <(n); i++)
int main(){
  int n;
  long a[100000];
  scanf("%d",&n);
  rep(i,n){
    scanf("%lld",&a[i]);
  }
  int x=0,y=0,z=0;
  rep(j,n){
    if(a[j]%4==0){
      x++;
    }else if(a[j]%2==0){
      y++;
    }else{
      z++;
    }
  }
  if(x==z-1){
    if(n%2==1&&y==0){
      printf("Yes\n");
      return 0;
    }
  }else if(x>z-1){
    printf("Yes\n");
    return 0;
  }
  printf("No\n");
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"Yes"
.LC3:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1328, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800036(%rbp)
	jmp	.L2
.L3:
	leaq	-800016(%rbp), %rdx
	movl	-800036(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800036(%rbp)
.L2:
	movl	-800040(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L3
	movl	$0, -800032(%rbp)
	movl	$0, -800028(%rbp)
	movl	$0, -800024(%rbp)
	movl	$0, -800020(%rbp)
	jmp	.L4
.L8:
	movl	-800020(%rbp), %eax
	cltq
	movq	-800016(%rbp,%rax,8), %rax
	andl	$3, %eax
	testq	%rax, %rax
	jne	.L5
	addl	$1, -800032(%rbp)
	jmp	.L6
.L5:
	movl	-800020(%rbp), %eax
	cltq
	movq	-800016(%rbp,%rax,8), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L7
	addl	$1, -800028(%rbp)
	jmp	.L6
.L7:
	addl	$1, -800024(%rbp)
.L6:
	addl	$1, -800020(%rbp)
.L4:
	movl	-800040(%rbp), %eax
	cmpl	%eax, -800020(%rbp)
	jl	.L8
	movl	-800024(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -800032(%rbp)
	jne	.L9
	movl	-800040(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L10
	cmpl	$0, -800028(%rbp)
	jne	.L10
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L12
.L9:
	movl	-800024(%rbp), %eax
	cmpl	-800032(%rbp), %eax
	jg	.L10
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L12
.L10:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L12:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"Yes"
.LC3:
	.string	"No"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1328, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800036(%rbp)
	jmp	.L2
.L3:
	leaq	-800016(%rbp), %rdx
	movl	-800036(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800036(%rbp)
.L2:
	movl	-800040(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L3
	movl	$0, -800032(%rbp)
	movl	$0, -800028(%rbp)
	movl	$0, -800024(%rbp)
	movl	$0, -800020(%rbp)
	jmp	.L4
.L8:
	movl	-800020(%rbp), %eax
	cltq
	movq	-800016(%rbp,%rax,8), %rax
	andl	$3, %eax
	testq	%rax, %rax
	jne	.L5
	addl	$1, -800032(%rbp)
	jmp	.L6
.L5:
	movl	-800020(%rbp), %eax
	cltq
	movq	-800016(%rbp,%rax,8), %rax
	andl	$1, %eax
	testq	%rax, %rax
	jne	.L7
	addl	$1, -800028(%rbp)
	jmp	.L6
.L7:
	addl	$1, -800024(%rbp)
.L6:
	addl	$1, -800020(%rbp)
.L4:
	movl	-800040(%rbp), %eax
	cmpl	%eax, -800020(%rbp)
	jl	.L8
	movl	-800024(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -800032(%rbp)
	jne	.L9
	movl	-800040(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L10
	cmpl	$0, -800028(%rbp)
	jne	.L10
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L12
.L9:
	movl	-800024(%rbp), %eax
	cmpl	-800032(%rbp), %eax
	jg	.L10
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L12
.L10:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L12:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
