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 a[10];

int solve( int i, int b, int c ) {

	if ( i == 10 ) { return 1; }

	if ( b < a[i] ) { return solve( i + 1, a[i], c ); }
	if ( c < a[i] ) { return solve( i + 1, b, a[i] ); }

	return 0;

}

int main() {

	int n, i;

	scanf( "%d", &n );

	while ( n-- ) {

		for ( i = 0; i < 10; i++ ) {
		
			scanf( "%d", &a[i] );
		
		}

		if ( solve( 0, 0, 0 ) == 1 ) {

			printf ( "YES\n" );

		} else {

			printf( "NO\n" );

		}

	}

	return 0;

}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 40
a:
	.zero	40
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	cmpl	$10, -4(%rbp)
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L4
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	leal	1(%rdx), %ecx
	movl	-12(%rbp), %edx
	movl	%eax, %esi
	movl	%ecx, %edi
	call	solve
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L5
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	solve
	jmp	.L3
.L5:
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L7
.L11:
	movl	$0, -12(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L8:
	cmpl	$9, -12(%rbp)
	jle	.L9
	movl	$0, %edx
	movl	$0, %esi
	movl	$0, %edi
	call	solve
	cmpl	$1, %eax
	jne	.L10
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L10:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.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
.LFE1:
	.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
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edx, %eax
	cmpl	$10, %edi
	je	.L39
	leaq	a(%rip), %rdx
	movslq	%edi, %rcx
	movl	(%rdx,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jl	.L3
	cmpl	%ecx, %eax
	jge	.L38
	movl	%ecx, %eax
	addl	$1, %edi
	movl	%esi, %ecx
.L4:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rsi
	movl	(%rdx,%rsi,4), %esi
	cmpl	%esi, %ecx
	jl	.L5
	cmpl	%esi, %eax
	jge	.L38
	movl	%esi, %eax
	addl	$1, %edi
	movl	%ecx, %esi
.L6:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rcx
	movl	(%rdx,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jl	.L7
	cmpl	%ecx, %eax
	jge	.L38
	movl	%ecx, %eax
	addl	$1, %edi
	movl	%esi, %ecx
.L8:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rsi
	movl	(%rdx,%rsi,4), %esi
	cmpl	%esi, %ecx
	jl	.L9
	cmpl	%esi, %eax
	jge	.L38
	movl	%esi, %eax
	addl	$1, %edi
	movl	%ecx, %esi
.L10:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rcx
	movl	(%rdx,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jl	.L11
	cmpl	%ecx, %eax
	jge	.L38
	movl	%ecx, %eax
	addl	$1, %edi
	movl	%esi, %ecx
.L12:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rsi
	movl	(%rdx,%rsi,4), %esi
	cmpl	%esi, %ecx
	jl	.L13
	cmpl	%esi, %eax
	jge	.L38
	movl	%esi, %eax
	addl	$1, %edi
	movl	%ecx, %esi
.L14:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rcx
	movl	(%rdx,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jl	.L15
	cmpl	%ecx, %eax
	jge	.L38
	movl	%ecx, %eax
	addl	$1, %edi
	movl	%esi, %ecx
.L16:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rsi
	movl	(%rdx,%rsi,4), %esi
	cmpl	%esi, %ecx
	jl	.L17
	cmpl	%esi, %eax
	jge	.L38
	movl	%esi, %eax
	addl	$1, %edi
	movl	%ecx, %esi
.L18:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rcx
	movl	(%rdx,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jl	.L19
	cmpl	%ecx, %eax
	jge	.L38
	movl	%ecx, %eax
	addl	$1, %edi
	movl	%esi, %ecx
.L20:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rdi
	movl	$1, %r8d
	movl	(%rdx,%rdi,4), %edx
	cmpl	%ecx, %edx
	jg	.L1
	xorl	%r8d, %r8d
	cmpl	%eax, %edx
	setg	%r8b
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L39:
	movl	$1, %r8d
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %edi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, %edi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %edi
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	addl	$1, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, %edi
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %edi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L38:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	solve, .-solve
	.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:
.LFB24:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 4(%rsp)
	testl	%eax, %eax
	je	.L43
	leaq	a(%rip), %r13
	leaq	.LC2(%rip), %r14
	leaq	40(%r13), %r12
	leaq	.LC1(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L55:
	leaq	a(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L44:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L44
	movl	0(%r13), %ecx
	testl	%ecx, %ecx
	jg	.L64
.L45:
	movq	%r14, %rdi
	call	puts@PLT
.L54:
	movl	4(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 4(%rsp)
	testl	%eax, %eax
	jne	.L55
.L43:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L65
	addq	$24, %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
.L64:
	.cfi_restore_state
	movl	4+a(%rip), %edx
	cmpl	%edx, %ecx
	jl	.L57
	testl	%edx, %edx
	jle	.L45
	movl	%edx, %eax
	movl	%ecx, %edx
.L46:
	movl	8+a(%rip), %ecx
	cmpl	%ecx, %edx
	jl	.L47
	cmpl	%ecx, %eax
	jge	.L45
	movl	%ecx, %eax
	movl	%edx, %ecx
.L47:
	movl	12+a(%rip), %edx
	cmpl	%edx, %ecx
	jl	.L48
	cmpl	%edx, %eax
	jge	.L45
	movl	%edx, %eax
	movl	%ecx, %edx
.L48:
	movl	16+a(%rip), %ecx
	cmpl	%ecx, %edx
	jl	.L49
	cmpl	%ecx, %eax
	jge	.L45
	movl	%ecx, %eax
	movl	%edx, %ecx
.L49:
	movl	20+a(%rip), %edx
	cmpl	%edx, %ecx
	jl	.L50
	cmpl	%edx, %eax
	jge	.L45
	movl	%edx, %eax
	movl	%ecx, %edx
.L50:
	movl	24+a(%rip), %ecx
	cmpl	%ecx, %edx
	jl	.L51
	cmpl	%ecx, %eax
	jge	.L45
	movl	%ecx, %eax
	movl	%edx, %ecx
.L51:
	movl	28+a(%rip), %esi
	cmpl	%esi, %ecx
	jl	.L52
	cmpl	%esi, %eax
	jge	.L45
	movl	%esi, %eax
	movl	%ecx, %esi
.L52:
	movl	32+a(%rip), %edx
	cmpl	%edx, %esi
	jl	.L53
	cmpl	%edx, %eax
	jge	.L45
	movl	%edx, %eax
	movl	%esi, %edx
.L53:
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	cmpl	36+a(%rip), %edx
	jge	.L45
	movq	%r15, %rdi
	call	puts@PLT
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L57:
	xorl	%eax, %eax
	jmp	.L46
.L65:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 40
a:
	.zero	40
	.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
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edx, %eax
	cmpl	$10, %edi
	je	.L39
	leaq	a(%rip), %rdx
	movslq	%edi, %rcx
	movl	(%rdx,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jl	.L3
	cmpl	%ecx, %eax
	jge	.L38
	movl	%ecx, %eax
	addl	$1, %edi
	movl	%esi, %ecx
.L4:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rsi
	movl	(%rdx,%rsi,4), %esi
	cmpl	%esi, %ecx
	jl	.L5
	cmpl	%esi, %eax
	jge	.L38
	movl	%esi, %eax
	addl	$1, %edi
	movl	%ecx, %esi
.L6:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rcx
	movl	(%rdx,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jl	.L7
	cmpl	%ecx, %eax
	jge	.L38
	movl	%ecx, %eax
	addl	$1, %edi
	movl	%esi, %ecx
.L8:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rsi
	movl	(%rdx,%rsi,4), %esi
	cmpl	%esi, %ecx
	jl	.L9
	cmpl	%esi, %eax
	jge	.L38
	movl	%esi, %eax
	addl	$1, %edi
	movl	%ecx, %esi
.L10:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rcx
	movl	(%rdx,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jl	.L11
	cmpl	%ecx, %eax
	jge	.L38
	movl	%ecx, %eax
	addl	$1, %edi
	movl	%esi, %ecx
.L12:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rsi
	movl	(%rdx,%rsi,4), %esi
	cmpl	%esi, %ecx
	jl	.L13
	cmpl	%esi, %eax
	jge	.L38
	movl	%esi, %eax
	addl	$1, %edi
	movl	%ecx, %esi
.L14:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rcx
	movl	(%rdx,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jl	.L15
	cmpl	%ecx, %eax
	jge	.L38
	movl	%ecx, %eax
	addl	$1, %edi
	movl	%esi, %ecx
.L16:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rsi
	movl	(%rdx,%rsi,4), %esi
	cmpl	%esi, %ecx
	jl	.L17
	cmpl	%esi, %eax
	jge	.L38
	movl	%esi, %eax
	addl	$1, %edi
	movl	%ecx, %esi
.L18:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rcx
	movl	(%rdx,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jl	.L19
	cmpl	%ecx, %eax
	jge	.L38
	movl	%ecx, %eax
	addl	$1, %edi
	movl	%esi, %ecx
.L20:
	cmpl	$10, %edi
	je	.L39
	movslq	%edi, %rdi
	movl	$1, %r8d
	movl	(%rdx,%rdi,4), %edx
	cmpl	%ecx, %edx
	jg	.L1
	xorl	%r8d, %r8d
	cmpl	%eax, %edx
	setg	%r8b
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	addl	$1, %edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %edi
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L39:
	movl	$1, %r8d
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %edi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	addl	$1, %edi
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %edi
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	addl	$1, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, %edi
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %edi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L38:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	solve, .-solve
	.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:
.LFB24:
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 4(%rsp)
	testl	%eax, %eax
	je	.L43
	leaq	a(%rip), %r13
	leaq	.LC2(%rip), %r14
	leaq	40(%r13), %r12
	leaq	.LC1(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L55:
	leaq	a(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L44:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	cmpq	%rbx, %r12
	jne	.L44
	movl	0(%r13), %ecx
	testl	%ecx, %ecx
	jg	.L64
.L45:
	movq	%r14, %rdi
	call	puts@PLT
.L54:
	movl	4(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 4(%rsp)
	testl	%eax, %eax
	jne	.L55
.L43:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L65
	addq	$24, %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
.L64:
	.cfi_restore_state
	movl	4+a(%rip), %edx
	cmpl	%edx, %ecx
	jl	.L57
	testl	%edx, %edx
	jle	.L45
	movl	%edx, %eax
	movl	%ecx, %edx
.L46:
	movl	8+a(%rip), %ecx
	cmpl	%ecx, %edx
	jl	.L47
	cmpl	%ecx, %eax
	jge	.L45
	movl	%ecx, %eax
	movl	%edx, %ecx
.L47:
	movl	12+a(%rip), %edx
	cmpl	%edx, %ecx
	jl	.L48
	cmpl	%edx, %eax
	jge	.L45
	movl	%edx, %eax
	movl	%ecx, %edx
.L48:
	movl	16+a(%rip), %ecx
	cmpl	%ecx, %edx
	jl	.L49
	cmpl	%ecx, %eax
	jge	.L45
	movl	%ecx, %eax
	movl	%edx, %ecx
.L49:
	movl	20+a(%rip), %edx
	cmpl	%edx, %ecx
	jl	.L50
	cmpl	%edx, %eax
	jge	.L45
	movl	%edx, %eax
	movl	%ecx, %edx
.L50:
	movl	24+a(%rip), %ecx
	cmpl	%ecx, %edx
	jl	.L51
	cmpl	%ecx, %eax
	jge	.L45
	movl	%ecx, %eax
	movl	%edx, %ecx
.L51:
	movl	28+a(%rip), %esi
	cmpl	%esi, %ecx
	jl	.L52
	cmpl	%esi, %eax
	jge	.L45
	movl	%esi, %eax
	movl	%ecx, %esi
.L52:
	movl	32+a(%rip), %edx
	cmpl	%edx, %esi
	jl	.L53
	cmpl	%edx, %eax
	jge	.L45
	movl	%edx, %eax
	movl	%esi, %edx
.L53:
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	cmpl	36+a(%rip), %edx
	jge	.L45
	movq	%r15, %rdi
	call	puts@PLT
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L57:
	xorl	%eax, %eax
	jmp	.L46
.L65:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 40
a:
	.zero	40
	.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 a[10];

int solve( int i, int b, int c ) {

	if ( i == 10 ) { return 1; }

	if ( b < a[i] ) { return solve( i + 1, a[i], c ); }
	if ( c < a[i] ) { return solve( i + 1, b, a[i] ); }

	return 0;

}

int main() {

	int n, i;

	scanf( "%d", &n );

	while ( n-- ) {

		for ( i = 0; i < 10; i++ ) {
		
			scanf( "%d", &a[i] );
		
		}

		if ( solve( 0, 0, 0 ) == 1 ) {

			printf ( "YES\n" );

		} else {

			printf( "NO\n" );

		}

	}

	return 0;

}
2
3 1 4 2 5 6 7 8 9 10
11 9 8 7 6 5 4 3 2 1
 2
3 1 4 2 5 6 7 8 1 10
11 9 8 7 6 5 4 3 2 1
 2
3 1 4 2 5 6 7 8 1 10
11 7 8 7 6 5 4 3 2 1
 2
3 1 4 2 5 6 7 5 1 10
11 7 8 7 6 5 4 3 2 1
 2
3 1 4 2 5 6 7 5 1 10
11 10 8 7 6 5 4 3 2 1
 2
3 1 4 2 5 12 7 5 1 10
11 10 8 7 6 5 4 3 2 1
 2
3 1 4 2 5 12 5 5 1 10
11 10 8 7 6 5 4 3 2 1
 2
3 1 4 2 5 12 5 5 1 10
11 10 10 7 6 5 4 3 2 1
 2
3 1 4 2 5 12 5 5 1 10
11 10 10 7 6 5 3 3 2 1
 2
3 1 4 2 5 12 5 5 1 10
18 10 10 7 6 5 3 3 2 1

YES
NO
 NO
NO
 NO
NO
 NO
NO
 NO
NO
 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 a[10];

int solve( int i, int b, int c ) {

	if ( i == 10 ) { return 1; }

	if ( b < a[i] ) { return solve( i + 1, a[i], c ); }
	if ( c < a[i] ) { return solve( i + 1, b, a[i] ); }

	return 0;

}

int main() {

	int n, i;

	scanf( "%d", &n );

	while ( n-- ) {

		for ( i = 0; i < 10; i++ ) {
		
			scanf( "%d", &a[i] );
		
		}

		if ( solve( 0, 0, 0 ) == 1 ) {

			printf ( "YES\n" );

		} else {

			printf( "NO\n" );

		}

	}

	return 0;

}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 40
a:
	.zero	40
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	cmpl	$10, -4(%rbp)
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L4
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	leal	1(%rdx), %ecx
	movl	-12(%rbp), %edx
	movl	%eax, %esi
	movl	%ecx, %edi
	call	solve
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L5
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	solve
	jmp	.L3
.L5:
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L7
.L11:
	movl	$0, -12(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L8:
	cmpl	$9, -12(%rbp)
	jle	.L9
	movl	$0, %edx
	movl	$0, %esi
	movl	$0, %edi
	call	solve
	cmpl	$1, %eax
	jne	.L10
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L10:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.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
.LFE1:
	.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
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 40
a:
	.zero	40
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	cmpl	$10, -4(%rbp)
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L4
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	leal	1(%rdx), %ecx
	movl	-12(%rbp), %edx
	movl	%eax, %esi
	movl	%ecx, %edi
	call	solve
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L5
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	solve
	jmp	.L3
.L5:
	movl	$0, %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"YES"
.LC2:
	.string	"NO"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L7
.L11:
	movl	$0, -12(%rbp)
	jmp	.L8
.L9:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -12(%rbp)
.L8:
	cmpl	$9, -12(%rbp)
	jle	.L9
	movl	$0, %edx
	movl	$0, %esi
	movl	$0, %edi
	call	solve
	cmpl	$1, %eax
	jne	.L10
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L7
.L10:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.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
.LFE1:
	.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:
