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 solve(int, int);
int n,A[50];
int main(){
  int q,m,i;
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&m);
    if(solve(0,m)) printf("yes\n");
    else printf("no\n");
  }
  return 0;
}
int solve(int i,int m){
  int r;
  if(m==0) return 1;
  if(i>=n) return 0;
  r=solve(i+1,m) || solve(i+1,m-A[i]);
  return r;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 200
A:
	.zero	200
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	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)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L3
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L4
.L7:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	solve
	testl	%eax, %eax
	je	.L5
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L6
.L5:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	addl	$1, -12(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	solve
	.type	solve, @function
solve:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L11
	movl	$1, %eax
	jmp	.L12
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L13
	movl	$0, %eax
	jmp	.L12
.L13:
	movl	-20(%rbp), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	solve
	testl	%eax, %eax
	jne	.L14
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	solve
	testl	%eax, %eax
	je	.L15
.L14:
	movl	$1, %eax
	jmp	.L16
.L15:
	movl	$0, %eax
.L16:
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.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:
.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
	movl	$1, %r14d
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	testl	%esi, %esi
	je	.L1
	movl	n(%rip), %eax
	movslq	%edi, %rbx
	xorl	%r14d, %r14d
	cmpl	%ebx, %eax
	jg	.L21
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r14d, %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
.L21:
	.cfi_restore_state
	leal	1(%rbx), %ebp
	movl	%esi, %r13d
	cmpl	%ebp, %eax
	jg	.L22
	leaq	A(%rip), %rax
	xorl	%r14d, %r14d
	cmpl	%esi, (%rax,%rbx,4)
	sete	%r14b
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	leal	2(%rbx), %r15d
	leaq	A(%rip), %r12
	cmpl	%r15d, %eax
	jle	.L4
	leal	3(%rbx), %edi
	movl	$1, %r14d
	movl	%edi, 12(%rsp)
	call	solve
	movl	12(%rsp), %edi
	testl	%eax, %eax
	jne	.L1
	movslq	%r15d, %rax
	movl	%r13d, %esi
	subl	(%r12,%rax,4), %esi
	call	solve
	testl	%eax, %eax
	jne	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	%ebp, %rbp
	movl	%r13d, %esi
	movl	%r15d, %edi
	movl	$1, %r14d
	movl	(%r12,%rbp,4), %ebp
	subl	%ebp, %esi
	call	solve
	testl	%eax, %eax
	jne	.L1
	subl	(%r12,%rbx,4), %r13d
	je	.L1
	movl	%r13d, %esi
	movl	%r15d, %edi
	call	solve
	testl	%eax, %eax
	jne	.L1
	movl	%r13d, %esi
	movl	%r15d, %edi
	xorl	%r14d, %r14d
	subl	%ebp, %esi
	call	solve
	testl	%eax, %eax
	setne	%r14b
	jmp	.L1
	.cfi_endproc
.LFE24:
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	n(%rip), %rsi
	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
	movq	%r12, %rdi
	leaq	A(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L28
	.p2align 4,,10
	.p2align 3
.L27:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, n(%rip)
	jg	.L27
.L28:
	movq	%rsp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	leaq	4(%rsp), %rbp
	leaq	.LC1(%rip), %r13
	leaq	.LC2(%rip), %r14
	testl	%eax, %eax
	jle	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	je	.L29
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L30
	cmpl	$1, %ecx
	je	.L31
	cmpl	$2, %ecx
	jne	.L85
	movl	4+A(%rip), %eax
	cmpl	%eax, %edx
	jne	.L86
	.p2align 4,,10
	.p2align 3
.L29:
	movq	%r13, %rdi
	call	puts@PLT
.L39:
	addl	$1, %ebx
	cmpl	%ebx, (%rsp)
	jg	.L25
.L26:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L87
	addq	$16, %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
.L31:
	.cfi_restore_state
	cmpl	A(%rip), %edx
	je	.L29
	.p2align 4,,10
	.p2align 3
.L30:
	movq	%r14, %rdi
	call	puts@PLT
	jmp	.L39
.L85:
	cmpl	$3, %ecx
	je	.L33
	movl	%edx, %esi
	movl	$4, %edi
	call	solve
	testl	%eax, %eax
	jne	.L29
	movl	%edx, %esi
	movl	$4, %edi
	subl	12+A(%rip), %esi
	call	solve
	testl	%eax, %eax
	jne	.L29
.L33:
	movl	8+A(%rip), %r8d
	movl	%edx, %esi
	movl	$3, %edi
	subl	%r8d, %esi
	call	solve
	testl	%eax, %eax
	jne	.L29
	movl	4+A(%rip), %r10d
	movl	%edx, %r9d
	subl	%r10d, %r9d
	je	.L29
	movl	%r9d, %esi
	movl	$3, %edi
	call	solve
	testl	%eax, %eax
	jne	.L29
	movl	%r9d, %esi
	movl	$3, %edi
	subl	%r8d, %esi
	call	solve
	testl	%eax, %eax
	jne	.L29
	subl	A(%rip), %edx
	je	.L29
	cmpl	$3, %ecx
	je	.L37
	movl	%edx, %esi
	movl	$4, %edi
	call	solve
	testl	%eax, %eax
	jne	.L29
	movl	%edx, %esi
	movl	$4, %edi
	subl	12+A(%rip), %esi
	call	solve
	testl	%eax, %eax
	jne	.L29
.L37:
	movl	%edx, %esi
	movl	$3, %edi
	subl	%r8d, %esi
	call	solve
	testl	%eax, %eax
	jne	.L29
	subl	%r10d, %edx
	je	.L29
	movl	%edx, %esi
	movl	$3, %edi
	call	solve
	testl	%eax, %eax
	jne	.L29
	subl	%r8d, %edx
	movl	$3, %edi
	movl	%edx, %esi
	call	solve
	testl	%eax, %eax
	je	.L30
	jmp	.L29
.L86:
	subl	A(%rip), %edx
	je	.L29
	cmpl	%eax, %edx
	je	.L29
	jmp	.L30
.L87:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 200
A:
	.zero	200
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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:
.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
	movl	$1, %r14d
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	testl	%esi, %esi
	je	.L1
	movl	n(%rip), %eax
	movslq	%edi, %rbx
	xorl	%r14d, %r14d
	cmpl	%ebx, %eax
	jg	.L21
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r14d, %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
.L21:
	.cfi_restore_state
	leal	1(%rbx), %ebp
	movl	%esi, %r13d
	cmpl	%ebp, %eax
	jg	.L22
	leaq	A(%rip), %rax
	xorl	%r14d, %r14d
	cmpl	%esi, (%rax,%rbx,4)
	sete	%r14b
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L22:
	leal	2(%rbx), %r15d
	leaq	A(%rip), %r12
	cmpl	%r15d, %eax
	jle	.L4
	leal	3(%rbx), %edi
	movl	$1, %r14d
	movl	%edi, 12(%rsp)
	call	solve
	movl	12(%rsp), %edi
	testl	%eax, %eax
	jne	.L1
	movslq	%r15d, %rax
	movl	%r13d, %esi
	subl	(%r12,%rax,4), %esi
	call	solve
	testl	%eax, %eax
	jne	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	%ebp, %rbp
	movl	%r13d, %esi
	movl	%r15d, %edi
	movl	$1, %r14d
	movl	(%r12,%rbp,4), %ebp
	subl	%ebp, %esi
	call	solve
	testl	%eax, %eax
	jne	.L1
	subl	(%r12,%rbx,4), %r13d
	je	.L1
	movl	%r13d, %esi
	movl	%r15d, %edi
	call	solve
	testl	%eax, %eax
	jne	.L1
	movl	%r13d, %esi
	movl	%r15d, %edi
	xorl	%r14d, %r14d
	subl	%ebp, %esi
	call	solve
	testl	%eax, %eax
	setne	%r14b
	jmp	.L1
	.cfi_endproc
.LFE24:
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	n(%rip), %rsi
	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
	movq	%r12, %rdi
	leaq	A(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L28
	.p2align 4,,10
	.p2align 3
.L27:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, n(%rip)
	jg	.L27
.L28:
	movq	%rsp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	leaq	4(%rsp), %rbp
	leaq	.LC1(%rip), %r13
	leaq	.LC2(%rip), %r14
	testl	%eax, %eax
	jle	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	je	.L29
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L30
	cmpl	$1, %ecx
	je	.L31
	cmpl	$2, %ecx
	jne	.L85
	movl	4+A(%rip), %eax
	cmpl	%eax, %edx
	jne	.L86
	.p2align 4,,10
	.p2align 3
.L29:
	movq	%r13, %rdi
	call	puts@PLT
.L39:
	addl	$1, %ebx
	cmpl	%ebx, (%rsp)
	jg	.L25
.L26:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L87
	addq	$16, %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
.L31:
	.cfi_restore_state
	cmpl	A(%rip), %edx
	je	.L29
	.p2align 4,,10
	.p2align 3
.L30:
	movq	%r14, %rdi
	call	puts@PLT
	jmp	.L39
.L85:
	cmpl	$3, %ecx
	je	.L33
	movl	%edx, %esi
	movl	$4, %edi
	call	solve
	testl	%eax, %eax
	jne	.L29
	movl	%edx, %esi
	movl	$4, %edi
	subl	12+A(%rip), %esi
	call	solve
	testl	%eax, %eax
	jne	.L29
.L33:
	movl	8+A(%rip), %r8d
	movl	%edx, %esi
	movl	$3, %edi
	subl	%r8d, %esi
	call	solve
	testl	%eax, %eax
	jne	.L29
	movl	4+A(%rip), %r10d
	movl	%edx, %r9d
	subl	%r10d, %r9d
	je	.L29
	movl	%r9d, %esi
	movl	$3, %edi
	call	solve
	testl	%eax, %eax
	jne	.L29
	movl	%r9d, %esi
	movl	$3, %edi
	subl	%r8d, %esi
	call	solve
	testl	%eax, %eax
	jne	.L29
	subl	A(%rip), %edx
	je	.L29
	cmpl	$3, %ecx
	je	.L37
	movl	%edx, %esi
	movl	$4, %edi
	call	solve
	testl	%eax, %eax
	jne	.L29
	movl	%edx, %esi
	movl	$4, %edi
	subl	12+A(%rip), %esi
	call	solve
	testl	%eax, %eax
	jne	.L29
.L37:
	movl	%edx, %esi
	movl	$3, %edi
	subl	%r8d, %esi
	call	solve
	testl	%eax, %eax
	jne	.L29
	subl	%r10d, %edx
	je	.L29
	movl	%edx, %esi
	movl	$3, %edi
	call	solve
	testl	%eax, %eax
	jne	.L29
	subl	%r8d, %edx
	movl	$3, %edi
	movl	%edx, %esi
	call	solve
	testl	%eax, %eax
	je	.L30
	jmp	.L29
.L86:
	subl	A(%rip), %edx
	je	.L29
	cmpl	%eax, %edx
	je	.L29
	jmp	.L30
.L87:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 200
A:
	.zero	200
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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 solve(int, int);
int n,A[50];
int main(){
  int q,m,i;
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&m);
    if(solve(0,m)) printf("yes\n");
    else printf("no\n");
  }
  return 0;
}
int solve(int i,int m){
  int r;
  if(m==0) return 1;
  if(i>=n) return 0;
  r=solve(i+1,m) || solve(i+1,m-A[i]);
  return r;
}


5
1 5 7 10 21
8
2 4 17 10 22 21 100 35
 5
1 5 7 3 21
8
2 4 17 10 22 21 100 42
 5
1 5 7 3 21
8
0 4 17 10 22 21 100 42
 5
1 5 7 3 21
8
0 4 17 11 22 21 010 42
 5
0 5 7 3 21
8
0 4 17 11 22 21 010 42
 5
0 5 10 3 21
8
0 4 17 11 22 14 010 42
 5
0 5 10 3 21
8
1 4 17 11 22 14 010 42
 5
0 5 10 3 21
8
1 4 17 11 22 14 011 42
 5
0 5 10 -1 21
8
1 7 17 11 8 14 011 41
 5
0 5 13 -1 21
8
1 2 17 11 8 14 011 41

no
no
yes
yes
yes
yes
no
no
 no
yes
no
yes
yes
yes
no
no
 yes
yes
no
yes
yes
yes
no
no
 yes
yes
no
yes
yes
yes
yes
no
 yes
no
no
no
no
yes
yes
no
 yes
no
no
no
no
no
yes
no
 no
no
no
no
no
no
yes
no
 no
no
no
no
no
no
no
no
 no
no
no
no
no
yes
no
no
 no
no
yes
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 solve(int, int);
int n,A[50];
int main(){
  int q,m,i;
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&A[i]);
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&m);
    if(solve(0,m)) printf("yes\n");
    else printf("no\n");
  }
  return 0;
}
int solve(int i,int m){
  int r;
  if(m==0) return 1;
  if(i>=n) return 0;
  r=solve(i+1,m) || solve(i+1,m-A[i]);
  return r;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 200
A:
	.zero	200
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	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)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L3
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L4
.L7:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	solve
	testl	%eax, %eax
	je	.L5
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L6
.L5:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	addl	$1, -12(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	solve
	.type	solve, @function
solve:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L11
	movl	$1, %eax
	jmp	.L12
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L13
	movl	$0, %eax
	jmp	.L12
.L13:
	movl	-20(%rbp), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	solve
	testl	%eax, %eax
	jne	.L14
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	solve
	testl	%eax, %eax
	je	.L15
.L14:
	movl	$1, %eax
	jmp	.L16
.L15:
	movl	$0, %eax
.L16:
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.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	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 200
A:
	.zero	200
	.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	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L2
.L3:
	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)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L3
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L4
.L7:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	solve
	testl	%eax, %eax
	je	.L5
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L6
.L5:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	addl	$1, -12(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	solve
	.type	solve, @function
solve:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L11
	movl	$1, %eax
	jmp	.L12
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L13
	movl	$0, %eax
	jmp	.L12
.L13:
	movl	-20(%rbp), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	solve
	testl	%eax, %eax
	jne	.L14
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-24(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	solve
	testl	%eax, %eax
	je	.L15
.L14:
	movl	$1, %eax
	jmp	.L16
.L15:
	movl	$0, %eax
.L16:
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.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:
