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];
	scanf("%d %d %d %d", &n[0], &n[1], &n[2], &n[3]);
	for(int i = 0; i < 4; i++){
		for(int j = i+1; j < 4; j++){
			if(n[i] > n[j]){
				int tmp = n[i];
				n[i] = n[j];
				n[j] = tmp;
			}
		}
	}
	
	//printf("%d %d %d %d", n[0], n[1], n[2], n[3]);
	if(n[0] == 1 && n[1] == 4 && n[2] == 7 && n[3] == 9) puts("YES");
	else puts("NO");
			
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d %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
	leaq	-32(%rbp), %rax
	leaq	12(%rax), %rsi
	leaq	-32(%rbp), %rax
	leaq	8(%rax), %rcx
	leaq	-32(%rbp), %rax
	leaq	4(%rax), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L2
.L6:
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40(%rbp)
	jmp	.L3
.L5:
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-44(%rbp), %eax
	cltq
	movl	%edx, -32(%rbp,%rax,4)
	movl	-40(%rbp), %eax
	cltq
	movl	-36(%rbp), %edx
	movl	%edx, -32(%rbp,%rax,4)
.L4:
	addl	$1, -40(%rbp)
.L3:
	cmpl	$3, -40(%rbp)
	jle	.L5
	addl	$1, -44(%rbp)
.L2:
	cmpl	$3, -44(%rbp)
	jle	.L6
	movl	-32(%rbp), %eax
	cmpl	$1, %eax
	jne	.L7
	movl	-28(%rbp), %eax
	cmpl	$4, %eax
	jne	.L7
	movl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L7
	movl	-20(%rbp), %eax
	cmpl	$9, %eax
	jne	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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 %d %d %d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r8
	movq	%rsp, %rsi
	leaq	8(%rsp), %rcx
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	$1, %r8d
	movl	$1, %eax
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L2:
	movslq	%eax, %rdx
	movl	(%rsp,%rdi,4), %ecx
	movl	(%rsp,%rdx,4), %esi
	cmpl	%esi, %ecx
	jle	.L3
	movl	%esi, (%rsp,%rdi,4)
	movl	%ecx, (%rsp,%rdx,4)
.L3:
	addl	$1, %eax
	cmpl	$4, %eax
	jne	.L2
	leal	1(%r8), %eax
	cmpl	$3, %r8d
	je	.L17
	movslq	%r8d, %rdi
	movl	%eax, %r8d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	$1, (%rsp)
	jne	.L6
	cmpl	$4, 4(%rsp)
	je	.L18
.L6:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L7:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cmpl	$7, 8(%rsp)
	jne	.L6
	cmpl	$9, 12(%rsp)
	jne	.L6
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L7
.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 %d %d %d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r8
	movq	%rsp, %rsi
	leaq	8(%rsp), %rcx
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	$1, %r8d
	movl	$1, %eax
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L2:
	movslq	%eax, %rdx
	movl	(%rsp,%rdi,4), %ecx
	movl	(%rsp,%rdx,4), %esi
	cmpl	%esi, %ecx
	jle	.L3
	movl	%esi, (%rsp,%rdi,4)
	movl	%ecx, (%rsp,%rdx,4)
.L3:
	addl	$1, %eax
	cmpl	$4, %eax
	jne	.L2
	leal	1(%r8), %eax
	cmpl	$3, %r8d
	je	.L17
	movslq	%r8d, %rdi
	movl	%eax, %r8d
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	$1, (%rsp)
	jne	.L6
	cmpl	$4, 4(%rsp)
	je	.L18
.L6:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L7:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cmpl	$7, 8(%rsp)
	jne	.L6
	cmpl	$9, 12(%rsp)
	jne	.L6
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L7
.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>

int main(){
	int n[4];
	scanf("%d %d %d %d", &n[0], &n[1], &n[2], &n[3]);
	for(int i = 0; i < 4; i++){
		for(int j = i+1; j < 4; j++){
			if(n[i] > n[j]){
				int tmp = n[i];
				n[i] = n[j];
				n[j] = tmp;
			}
		}
	}
	
	//printf("%d %d %d %d", n[0], n[1], n[2], n[3]);
	if(n[0] == 1 && n[1] == 4 && n[2] == 7 && n[3] == 9) puts("YES");
	else 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 n[4];
	scanf("%d %d %d %d", &n[0], &n[1], &n[2], &n[3]);
	for(int i = 0; i < 4; i++){
		for(int j = i+1; j < 4; j++){
			if(n[i] > n[j]){
				int tmp = n[i];
				n[i] = n[j];
				n[j] = tmp;
			}
		}
	}
	
	//printf("%d %d %d %d", n[0], n[1], n[2], n[3]);
	if(n[0] == 1 && n[1] == 4 && n[2] == 7 && n[3] == 9) puts("YES");
	else puts("NO");
			
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d %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
	leaq	-32(%rbp), %rax
	leaq	12(%rax), %rsi
	leaq	-32(%rbp), %rax
	leaq	8(%rax), %rcx
	leaq	-32(%rbp), %rax
	leaq	4(%rax), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L2
.L6:
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40(%rbp)
	jmp	.L3
.L5:
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-44(%rbp), %eax
	cltq
	movl	%edx, -32(%rbp,%rax,4)
	movl	-40(%rbp), %eax
	cltq
	movl	-36(%rbp), %edx
	movl	%edx, -32(%rbp,%rax,4)
.L4:
	addl	$1, -40(%rbp)
.L3:
	cmpl	$3, -40(%rbp)
	jle	.L5
	addl	$1, -44(%rbp)
.L2:
	cmpl	$3, -44(%rbp)
	jle	.L6
	movl	-32(%rbp), %eax
	cmpl	$1, %eax
	jne	.L7
	movl	-28(%rbp), %eax
	cmpl	$4, %eax
	jne	.L7
	movl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L7
	movl	-20(%rbp), %eax
	cmpl	$9, %eax
	jne	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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 %d %d %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
	leaq	-32(%rbp), %rax
	leaq	12(%rax), %rsi
	leaq	-32(%rbp), %rax
	leaq	8(%rax), %rcx
	leaq	-32(%rbp), %rax
	leaq	4(%rax), %rdx
	leaq	-32(%rbp), %rax
	movq	%rsi, %r8
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L2
.L6:
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -40(%rbp)
	jmp	.L3
.L5:
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	-44(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %edx
	movl	-44(%rbp), %eax
	cltq
	movl	%edx, -32(%rbp,%rax,4)
	movl	-40(%rbp), %eax
	cltq
	movl	-36(%rbp), %edx
	movl	%edx, -32(%rbp,%rax,4)
.L4:
	addl	$1, -40(%rbp)
.L3:
	cmpl	$3, -40(%rbp)
	jle	.L5
	addl	$1, -44(%rbp)
.L2:
	cmpl	$3, -44(%rbp)
	jle	.L6
	movl	-32(%rbp), %eax
	cmpl	$1, %eax
	jne	.L7
	movl	-28(%rbp), %eax
	cmpl	$4, %eax
	jne	.L7
	movl	-24(%rbp), %eax
	cmpl	$7, %eax
	jne	.L7
	movl	-20(%rbp), %eax
	cmpl	$9, %eax
	jne	.L7
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L8
.L7:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L8:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
