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 n[4];
	int ans = 1;
	for (int i = 0; i < 4; ++i)
	{
		scanf("%d",&n[i]);
		if(n[i]!=1&&n[i]!=9&&n[i]!=7&&n[i]!=4){
			ans = 0;
		}
	}
	for (int i = 0; i < 4; ++i)
	{
		for (int j = 0; j < 4; ++j)
		{
			if(i!=j&&n[i]==n[j]){
				ans=0;
			}
		}
	}
	if(ans==1){
		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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -48(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L2
.L4:
	leaq	-32(%rbp), %rdx
	movl	-44(%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	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L3
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$9, %eax
	je	.L3
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	je	.L3
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$4, %eax
	je	.L3
	movl	$0, -48(%rbp)
.L3:
	addl	$1, -44(%rbp)
.L2:
	cmpl	$3, -44(%rbp)
	jle	.L4
	movl	$0, -40(%rbp)
	jmp	.L5
.L9:
	movl	$0, -36(%rbp)
	jmp	.L6
.L8:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	je	.L7
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-36(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	$0, -48(%rbp)
.L7:
	addl	$1, -36(%rbp)
.L6:
	cmpl	$3, -36(%rbp)
	jle	.L8
	addl	$1, -40(%rbp)
.L5:
	cmpl	$3, -40(%rbp)
	jle	.L9
	cmpl	$1, -48(%rbp)
	jne	.L10
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L10:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	movl	$0, %eax
	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
.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	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	$-659, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	$1, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	leaq	16(%rsp), %r13
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%rbp), %ecx
	cmpl	$9, %ecx
	ja	.L20
	movq	%r14, %rax
	sarq	%cl, %rax
	testb	$1, %al
	movl	$0, %eax
	cmovne	%eax, %ebx
.L2:
	addq	$4, %rbp
	cmpq	%rbp, %r13
	jne	.L3
	movl	(%rsp), %edx
	movl	4(%rsp), %ecx
	xorl	%eax, %eax
	movl	8(%rsp), %esi
	movl	12(%rsp), %edi
	cmpl	%ecx, %edx
	cmove	%eax, %ebx
	cmpl	%esi, %edx
	cmove	%eax, %ebx
	cmpl	%edi, %edx
	cmove	%eax, %ebx
	cmpl	%ecx, %edx
	cmove	%eax, %ebx
	cmpl	%esi, %ecx
	cmove	%eax, %ebx
	cmpl	%edi, %ecx
	cmove	%eax, %ebx
	cmpl	%esi, %edx
	cmove	%eax, %ebx
	cmpl	%esi, %ecx
	cmove	%eax, %ebx
	cmpl	%edi, %esi
	je	.L13
	cmpl	%edi, %edx
	je	.L13
	cmpl	%edi, %ecx
	je	.L13
	cmpl	$1, %ebx
	jne	.L13
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L13:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	xorl	%ebx, %ebx
	jmp	.L2
.L29:
	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	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	$-659, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	$1, %ebx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbp
	leaq	16(%rsp), %r13
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%rbp), %ecx
	cmpl	$9, %ecx
	ja	.L20
	movq	%r14, %rax
	sarq	%cl, %rax
	testb	$1, %al
	movl	$0, %eax
	cmovne	%eax, %ebx
.L2:
	addq	$4, %rbp
	cmpq	%rbp, %r13
	jne	.L3
	movl	(%rsp), %edx
	movl	4(%rsp), %ecx
	xorl	%eax, %eax
	movl	8(%rsp), %esi
	movl	12(%rsp), %edi
	cmpl	%ecx, %edx
	cmove	%eax, %ebx
	cmpl	%esi, %edx
	cmove	%eax, %ebx
	cmpl	%edi, %edx
	cmove	%eax, %ebx
	cmpl	%ecx, %edx
	cmove	%eax, %ebx
	cmpl	%esi, %ecx
	cmove	%eax, %ebx
	cmpl	%edi, %ecx
	cmove	%eax, %ebx
	cmpl	%esi, %edx
	cmove	%eax, %ebx
	cmpl	%esi, %ecx
	cmove	%eax, %ebx
	cmpl	%edi, %esi
	je	.L13
	cmpl	%edi, %edx
	je	.L13
	cmpl	%edi, %ecx
	je	.L13
	cmpl	$1, %ebx
	jne	.L13
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L13:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	xorl	%ebx, %ebx
	jmp	.L2
.L29:
	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 n[4];
	int ans = 1;
	for (int i = 0; i < 4; ++i)
	{
		scanf("%d",&n[i]);
		if(n[i]!=1&&n[i]!=9&&n[i]!=7&&n[i]!=4){
			ans = 0;
		}
	}
	for (int i = 0; i < 4; ++i)
	{
		for (int j = 0; j < 4; ++j)
		{
			if(i!=j&&n[i]==n[j]){
				ans=0;
			}
		}
	}
	if(ans==1){
		printf("YES");
	}else{
		printf("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 n[4];
	int ans = 1;
	for (int i = 0; i < 4; ++i)
	{
		scanf("%d",&n[i]);
		if(n[i]!=1&&n[i]!=9&&n[i]!=7&&n[i]!=4){
			ans = 0;
		}
	}
	for (int i = 0; i < 4; ++i)
	{
		for (int j = 0; j < 4; ++j)
		{
			if(i!=j&&n[i]==n[j]){
				ans=0;
			}
		}
	}
	if(ans==1){
		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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -48(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L2
.L4:
	leaq	-32(%rbp), %rdx
	movl	-44(%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	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L3
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$9, %eax
	je	.L3
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	je	.L3
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$4, %eax
	je	.L3
	movl	$0, -48(%rbp)
.L3:
	addl	$1, -44(%rbp)
.L2:
	cmpl	$3, -44(%rbp)
	jle	.L4
	movl	$0, -40(%rbp)
	jmp	.L5
.L9:
	movl	$0, -36(%rbp)
	jmp	.L6
.L8:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	je	.L7
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-36(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	$0, -48(%rbp)
.L7:
	addl	$1, -36(%rbp)
.L6:
	cmpl	$3, -36(%rbp)
	jle	.L8
	addl	$1, -40(%rbp)
.L5:
	cmpl	$3, -40(%rbp)
	jle	.L9
	cmpl	$1, -48(%rbp)
	jne	.L10
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L10:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	movl	$0, %eax
	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
.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -48(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L2
.L4:
	leaq	-32(%rbp), %rdx
	movl	-44(%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	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	je	.L3
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$9, %eax
	je	.L3
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$7, %eax
	je	.L3
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	$4, %eax
	je	.L3
	movl	$0, -48(%rbp)
.L3:
	addl	$1, -44(%rbp)
.L2:
	cmpl	$3, -44(%rbp)
	jle	.L4
	movl	$0, -40(%rbp)
	jmp	.L5
.L9:
	movl	$0, -36(%rbp)
	jmp	.L6
.L8:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	je	.L7
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-36(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	$0, -48(%rbp)
.L7:
	addl	$1, -36(%rbp)
.L6:
	cmpl	$3, -36(%rbp)
	jle	.L8
	addl	$1, -40(%rbp)
.L5:
	cmpl	$3, -40(%rbp)
	jle	.L9
	cmpl	$1, -48(%rbp)
	jne	.L10
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L11
.L10:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L11:
	movl	$0, %eax
	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
.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:
