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(){
  int a[5];
  for(int i=0;i<4;i++)scanf("%d",&a[i]);
  for(int i=0;i<4;i++){
    if(a[i]==1)for(int j=0;j<4;j++){
      if(a[j]==9)for(int k=0;k<4;k++){
        if(a[k]==7)for(int l=0;l<4;l++){
          if(a[l]==4){
            puts("YES");
            return 0;
          }
        }
      }
    }
  }
  puts("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
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -52(%rbp)
	jmp	.L2
.L3:
	leaq	-32(%rbp), %rdx
	movl	-52(%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
	addl	$1, -52(%rbp)
.L2:
	cmpl	$3, -52(%rbp)
	jle	.L3
	movl	$0, -48(%rbp)
	jmp	.L4
.L16:
	movl	-48(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L5
	movl	$0, -44(%rbp)
	jmp	.L6
.L15:
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$9, %eax
	jne	.L7
	movl	$0, -40(%rbp)
	jmp	.L8
.L14:
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	jne	.L9
	movl	$0, -36(%rbp)
	jmp	.L10
.L13:
	movl	-36(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$4, %eax
	jne	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L11:
	addl	$1, -36(%rbp)
.L10:
	cmpl	$3, -36(%rbp)
	jle	.L13
.L9:
	addl	$1, -40(%rbp)
.L8:
	cmpl	$3, -40(%rbp)
	jle	.L14
.L7:
	addl	$1, -44(%rbp)
.L6:
	cmpl	$3, -44(%rbp)
	jle	.L15
.L5:
	addl	$1, -48(%rbp)
.L4:
	cmpl	$3, -48(%rbp)
	jle	.L16
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	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
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	16(%rsp), %r12
	movq	%rbx, %rbp
.L2:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	cmpq	%rbp, %r12
	jne	.L2
	movl	4(%rsp), %edi
	movl	(%rsp), %esi
	movl	8(%rsp), %r8d
	movl	12(%rsp), %r9d
	cmpl	$4, %edi
	sete	%al
	cmpl	$4, %esi
	sete	%cl
	cmpl	$4, %r8d
	movl	%eax, %r10d
	sete	%dl
	orl	%ecx, %eax
	orl	%edx, %r10d
	orl	%ecx, %edx
.L23:
	cmpl	$1, (%rbx)
	je	.L129
.L3:
	addq	$4, %rbx
	cmpq	%r12, %rbx
	jne	.L23
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L22:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L130
	addq	$40, %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
.L129:
	.cfi_restore_state
	cmpl	$9, %esi
	je	.L131
	cmpl	$9, %edi
	je	.L132
.L9:
	cmpl	$9, %r8d
	je	.L34
.L15:
	cmpl	$9, %r9d
	jne	.L3
	cmpl	$7, %esi
	je	.L20
	cmpl	$7, %edi
	je	.L21
	cmpl	$7, %r8d
	jne	.L3
	cmpl	$4, %esi
	je	.L6
	cmpl	$4, %edi
	jne	.L3
.L6:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L22
.L132:
	cmpl	$7, %esi
	je	.L10
	cmpl	$7, %r8d
	je	.L11
.L29:
	cmpl	$7, %r9d
	jne	.L9
	cmpl	$4, %esi
	je	.L6
	cmpl	$4, %r8d
	je	.L6
	cmpl	$9, %r8d
	jne	.L3
.L34:
	cmpl	$7, %esi
	je	.L16
.L33:
	cmpl	$7, %edi
	je	.L17
.L18:
	cmpl	$7, %r9d
	jne	.L15
	testb	%al, %al
	je	.L3
	jmp	.L6
.L131:
	cmpl	$7, %edi
	je	.L133
	cmpl	$7, %r8d
	je	.L134
.L8:
	cmpl	$7, %r9d
	je	.L135
.L7:
	cmpl	$9, %edi
	je	.L136
	cmpl	$9, %r8d
	jne	.L15
	jmp	.L33
.L11:
	cmpl	$4, %esi
	je	.L6
.L35:
	cmpl	$4, %r9d
	je	.L6
.L13:
	cmpl	$7, %r9d
	jne	.L15
	jmp	.L3
.L16:
	cmpl	$4, %edi
	je	.L6
	cmpl	$4, %r9d
	je	.L6
	cmpl	$7, %edi
	je	.L18
	cmpl	$7, %r9d
	je	.L3
	cmpl	$9, %r9d
	jne	.L3
.L20:
	testb	%r10b, %r10b
	je	.L3
	jmp	.L6
.L136:
	cmpl	$7, %r8d
	jne	.L29
	jmp	.L35
.L135:
	testb	%r10b, %r10b
	je	.L7
	jmp	.L6
.L133:
	cmpl	$4, %r8d
	je	.L6
.L127:
	cmpl	$4, %r9d
	jne	.L8
	jmp	.L6
.L10:
	cmpl	$4, %r8d
	je	.L6
	cmpl	$4, %r9d
	je	.L6
	cmpl	$7, %r8d
	jne	.L29
	jmp	.L13
.L17:
	cmpl	$4, %esi
	je	.L6
	cmpl	$4, %r9d
	jne	.L18
	jmp	.L6
.L134:
	cmpl	$4, %edi
	jne	.L127
	jmp	.L6
.L21:
	testb	%dl, %dl
	je	.L3
	jmp	.L6
.L130:
	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	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	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
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	leaq	16(%rsp), %r12
	movq	%rbx, %rbp
.L2:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	cmpq	%rbp, %r12
	jne	.L2
	movl	4(%rsp), %edi
	movl	(%rsp), %esi
	movl	8(%rsp), %r8d
	movl	12(%rsp), %r9d
	cmpl	$4, %edi
	sete	%al
	cmpl	$4, %esi
	sete	%cl
	cmpl	$4, %r8d
	movl	%eax, %r10d
	sete	%dl
	orl	%ecx, %eax
	orl	%edx, %r10d
	orl	%ecx, %edx
.L23:
	cmpl	$1, (%rbx)
	je	.L129
.L3:
	addq	$4, %rbx
	cmpq	%r12, %rbx
	jne	.L23
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L22:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L130
	addq	$40, %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
.L129:
	.cfi_restore_state
	cmpl	$9, %esi
	je	.L131
	cmpl	$9, %edi
	je	.L132
.L9:
	cmpl	$9, %r8d
	je	.L34
.L15:
	cmpl	$9, %r9d
	jne	.L3
	cmpl	$7, %esi
	je	.L20
	cmpl	$7, %edi
	je	.L21
	cmpl	$7, %r8d
	jne	.L3
	cmpl	$4, %esi
	je	.L6
	cmpl	$4, %edi
	jne	.L3
.L6:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L22
.L132:
	cmpl	$7, %esi
	je	.L10
	cmpl	$7, %r8d
	je	.L11
.L29:
	cmpl	$7, %r9d
	jne	.L9
	cmpl	$4, %esi
	je	.L6
	cmpl	$4, %r8d
	je	.L6
	cmpl	$9, %r8d
	jne	.L3
.L34:
	cmpl	$7, %esi
	je	.L16
.L33:
	cmpl	$7, %edi
	je	.L17
.L18:
	cmpl	$7, %r9d
	jne	.L15
	testb	%al, %al
	je	.L3
	jmp	.L6
.L131:
	cmpl	$7, %edi
	je	.L133
	cmpl	$7, %r8d
	je	.L134
.L8:
	cmpl	$7, %r9d
	je	.L135
.L7:
	cmpl	$9, %edi
	je	.L136
	cmpl	$9, %r8d
	jne	.L15
	jmp	.L33
.L11:
	cmpl	$4, %esi
	je	.L6
.L35:
	cmpl	$4, %r9d
	je	.L6
.L13:
	cmpl	$7, %r9d
	jne	.L15
	jmp	.L3
.L16:
	cmpl	$4, %edi
	je	.L6
	cmpl	$4, %r9d
	je	.L6
	cmpl	$7, %edi
	je	.L18
	cmpl	$7, %r9d
	je	.L3
	cmpl	$9, %r9d
	jne	.L3
.L20:
	testb	%r10b, %r10b
	je	.L3
	jmp	.L6
.L136:
	cmpl	$7, %r8d
	jne	.L29
	jmp	.L35
.L135:
	testb	%r10b, %r10b
	je	.L7
	jmp	.L6
.L133:
	cmpl	$4, %r8d
	je	.L6
.L127:
	cmpl	$4, %r9d
	jne	.L8
	jmp	.L6
.L10:
	cmpl	$4, %r8d
	je	.L6
	cmpl	$4, %r9d
	je	.L6
	cmpl	$7, %r8d
	jne	.L29
	jmp	.L13
.L17:
	cmpl	$4, %esi
	je	.L6
	cmpl	$4, %r9d
	jne	.L18
	jmp	.L6
.L134:
	cmpl	$4, %edi
	jne	.L127
	jmp	.L6
.L21:
	testb	%dl, %dl
	je	.L3
	jmp	.L6
.L130:
	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(){
  int a[5];
  for(int i=0;i<4;i++)scanf("%d",&a[i]);
  for(int i=0;i<4;i++){
    if(a[i]==1)for(int j=0;j<4;j++){
      if(a[j]==9)for(int k=0;k<4;k++){
        if(a[k]==7)for(int l=0;l<4;l++){
          if(a[l]==4){
            puts("YES");
            return 0;
          }
        }
      }
    }
  }
  puts("NO");
  return 0;
}
1 9 13 4
 1 2 3 1
 4 9 0 13
 0 7 9 4
 1 9 13 3
 1 3 3 1
 3 9 0 13
 1 12 9 4
 1 9 13 0
 1 2 3 2

NO
 NO
 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>
int main(){
  int a[5];
  for(int i=0;i<4;i++)scanf("%d",&a[i]);
  for(int i=0;i<4;i++){
    if(a[i]==1)for(int j=0;j<4;j++){
      if(a[j]==9)for(int k=0;k<4;k++){
        if(a[k]==7)for(int l=0;l<4;l++){
          if(a[l]==4){
            puts("YES");
            return 0;
          }
        }
      }
    }
  }
  puts("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
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -52(%rbp)
	jmp	.L2
.L3:
	leaq	-32(%rbp), %rdx
	movl	-52(%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
	addl	$1, -52(%rbp)
.L2:
	cmpl	$3, -52(%rbp)
	jle	.L3
	movl	$0, -48(%rbp)
	jmp	.L4
.L16:
	movl	-48(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L5
	movl	$0, -44(%rbp)
	jmp	.L6
.L15:
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$9, %eax
	jne	.L7
	movl	$0, -40(%rbp)
	jmp	.L8
.L14:
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	jne	.L9
	movl	$0, -36(%rbp)
	jmp	.L10
.L13:
	movl	-36(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$4, %eax
	jne	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L11:
	addl	$1, -36(%rbp)
.L10:
	cmpl	$3, -36(%rbp)
	jle	.L13
.L9:
	addl	$1, -40(%rbp)
.L8:
	cmpl	$3, -40(%rbp)
	jle	.L14
.L7:
	addl	$1, -44(%rbp)
.L6:
	cmpl	$3, -44(%rbp)
	jle	.L15
.L5:
	addl	$1, -48(%rbp)
.L4:
	cmpl	$3, -48(%rbp)
	jle	.L16
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -52(%rbp)
	jmp	.L2
.L3:
	leaq	-32(%rbp), %rdx
	movl	-52(%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
	addl	$1, -52(%rbp)
.L2:
	cmpl	$3, -52(%rbp)
	jle	.L3
	movl	$0, -48(%rbp)
	jmp	.L4
.L16:
	movl	-48(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L5
	movl	$0, -44(%rbp)
	jmp	.L6
.L15:
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$9, %eax
	jne	.L7
	movl	$0, -40(%rbp)
	jmp	.L8
.L14:
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	jne	.L9
	movl	$0, -36(%rbp)
	jmp	.L10
.L13:
	movl	-36(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$4, %eax
	jne	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L17
.L11:
	addl	$1, -36(%rbp)
.L10:
	cmpl	$3, -36(%rbp)
	jle	.L13
.L9:
	addl	$1, -40(%rbp)
.L8:
	cmpl	$3, -40(%rbp)
	jle	.L14
.L7:
	addl	$1, -44(%rbp)
.L6:
	cmpl	$3, -44(%rbp)
	jle	.L15
.L5:
	addl	$1, -48(%rbp)
.L4:
	cmpl	$3, -48(%rbp)
	jle	.L16
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L17:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	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:
