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>

#define N_MAX 1000

void solve(int n, int x, int m[]);
int findMin(int size, int intArray[]);

int main()
{
  int n, x, m[N_MAX];
  int i;
  int start, end;
  int total = 0;

  scanf("%d %d", &n, &x);
  for (i = 0; i < n; i++)
    {
      scanf("%d", &m[i]);
    }
  solve(n, x, m);

  return 0;
}

void solve(int n, int x, int m[])
{
  int i, sumOfAllKind, rest, maxCanMadeByRest;

  sumOfAllKind = 0;
  for (i = 0; i < n; i++)
    {
      sumOfAllKind += m[i];
    }

  rest = x - sumOfAllKind;
  maxCanMadeByRest = rest / findMin(n, m);

  printf("%d\n", n + maxCanMadeByRest);
}

int findMin(int size, int intArray[])
{
  int i, min;

  min = intArray[0];
  for (i = 0; i < size; i++)
    {
      if (min > intArray[i])
	{
	  min = intArray[i];
	}
    }

  return min;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.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	$4032, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4020(%rbp)
	leaq	-4028(%rbp), %rdx
	leaq	-4032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4024(%rbp)
	jmp	.L2
.L3:
	leaq	-4016(%rbp), %rdx
	movl	-4024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4024(%rbp)
.L2:
	movl	-4032(%rbp), %eax
	cmpl	%eax, -4024(%rbp)
	jl	.L3
	movl	-4028(%rbp), %ecx
	movl	-4032(%rbp), %eax
	leaq	-4016(%rbp), %rdx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	solve
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.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)
	movq	%rdx, -32(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -12(%rbp)
	addl	$1, -16(%rbp)
.L7:
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L8
	movl	-24(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	findMin
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.globl	findMin
	.type	findMin, @function
findMin:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L10
.L12:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L11
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
.L11:
	addl	$1, -8(%rbp)
.L10:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L12
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	findMin, .-findMin
	.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\n"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %eax
	movl	(%rdx), %ecx
	movq	%rdx, %rsi
	testl	%edi, %edi
	jle	.L2
	leal	-1(%rdi), %r10d
	cmpl	$2, %r10d
	jbe	.L12
	movl	%edi, %r8d
	leaq	16(%rdx), %r9
	pxor	%xmm0, %xmm0
	shrl	$2, %r8d
	subl	$1, %r8d
	salq	$4, %r8
	addq	%r9, %r8
	.p2align 4,,10
	.p2align 3
.L4:
	movdqu	(%rdx), %xmm3
	addq	$16, %rdx
	paddd	%xmm3, %xmm0
	cmpq	%r8, %rdx
	jne	.L4
	movdqa	%xmm0, %xmm1
	movl	%edi, %r8d
	psrldq	$8, %xmm1
	andl	$-4, %r8d
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%r8d, %edi
	je	.L18
.L3:
	movslq	%r8d, %r9
	leaq	0(,%r9,4), %r11
	addl	(%rsi,%r9,4), %edx
	leal	1(%r8), %r9d
	cmpl	%r9d, %edi
	jle	.L6
	addl	$2, %r8d
	addl	4(%rsi,%r11), %edx
	cmpl	%r8d, %edi
	jle	.L6
	addl	8(%rsi,%r11), %edx
.L6:
	subl	%edx, %eax
	cmpl	$2, %r10d
	jbe	.L13
	leaq	16(%rsi), %r9
.L11:
	movd	%ecx, %xmm5
	movl	%edi, %ecx
	movq	%rsi, %rdx
	shrl	$2, %ecx
	pshufd	$0, %xmm5, %xmm0
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%r9, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	(%rdx), %xmm1
	movdqu	(%rdx), %xmm4
	addq	$16, %rdx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm4, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rdx, %rcx
	jne	.L8
	movdqa	%xmm0, %xmm2
	movl	%edi, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %ecx
	testb	$3, %dil
	je	.L2
.L10:
	movslq	%edx, %r8
	leaq	0(,%r8,4), %r9
	movl	(%rsi,%r8,4), %r8d
	cmpl	%r8d, %ecx
	cmovg	%r8d, %ecx
	leal	1(%rdx), %r8d
	cmpl	%r8d, %edi
	jle	.L2
	movl	4(%rsi,%r9), %r8d
	cmpl	%r8d, %ecx
	cmovg	%r8d, %ecx
	addl	$2, %edx
	cmpl	%edx, %edi
	jle	.L2
	movl	8(%rsi,%r9), %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
.L2:
	cltd
	leaq	.LC0(%rip), %rsi
	idivl	%ecx
	leal	(%rax,%rdi), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L18:
	subl	%edx, %eax
	jmp	.L11
.L12:
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	jmp	.L3
.L13:
	xorl	%edx, %edx
	jmp	.L10
	.cfi_endproc
.LFE24:
	.size	solve, .-solve
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d"
	.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	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4080
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %r13
	movq	%r13, %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edi
	testl	%edi, %edi
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edi
	addq	$4, %rbp
	cmpl	%ebx, %edi
	jg	.L21
.L20:
	movl	12(%rsp), %esi
	movq	%r13, %rdx
	call	solve
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$4040, %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
.L27:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	findMin
	.type	findMin, @function
findMin:
.LFB25:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	movl	%edi, %edx
	movq	%rsi, %rcx
	testl	%edi, %edi
	jle	.L28
	leal	-1(%rdi), %esi
	cmpl	$2, %esi
	jbe	.L34
	movl	%edi, %esi
	movd	%eax, %xmm4
	movq	%rcx, %rax
	shrl	$2, %esi
	pshufd	$0, %xmm4, %xmm0
	subl	$1, %esi
	salq	$4, %rsi
	leaq	16(%rcx,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L31:
	movdqu	(%rax), %xmm1
	movdqu	(%rax), %xmm3
	addq	$16, %rax
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm3, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rsi, %rax
	jne	.L31
	movdqa	%xmm0, %xmm2
	movl	%edx, %esi
	psrldq	$8, %xmm2
	andl	$-4, %esi
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$3, %dl
	je	.L36
.L30:
	movslq	%esi, %rdi
	leaq	0(,%rdi,4), %r8
	movl	(%rcx,%rdi,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	leal	1(%rsi), %edi
	cmpl	%edi, %edx
	jle	.L28
	movl	4(%rcx,%r8), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	addl	$2, %esi
	cmpl	%esi, %edx
	jle	.L28
	movl	8(%rcx,%r8), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
.L28:
	ret
	.p2align 4,,10
	.p2align 3
.L36:
	ret
.L34:
	xorl	%esi, %esi
	jmp	.L30
	.cfi_endproc
.LFE25:
	.size	findMin, .-findMin
	.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\n"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %eax
	movl	(%rdx), %ecx
	movq	%rdx, %rsi
	testl	%edi, %edi
	jle	.L2
	leal	-1(%rdi), %r10d
	cmpl	$2, %r10d
	jbe	.L12
	movl	%edi, %r8d
	leaq	16(%rdx), %r9
	pxor	%xmm0, %xmm0
	shrl	$2, %r8d
	subl	$1, %r8d
	salq	$4, %r8
	addq	%r9, %r8
	.p2align 4,,10
	.p2align 3
.L4:
	movdqu	(%rdx), %xmm3
	addq	$16, %rdx
	paddd	%xmm3, %xmm0
	cmpq	%r8, %rdx
	jne	.L4
	movdqa	%xmm0, %xmm1
	movl	%edi, %r8d
	psrldq	$8, %xmm1
	andl	$-4, %r8d
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%r8d, %edi
	je	.L18
.L3:
	movslq	%r8d, %r9
	leaq	0(,%r9,4), %r11
	addl	(%rsi,%r9,4), %edx
	leal	1(%r8), %r9d
	cmpl	%r9d, %edi
	jle	.L6
	addl	$2, %r8d
	addl	4(%rsi,%r11), %edx
	cmpl	%r8d, %edi
	jle	.L6
	addl	8(%rsi,%r11), %edx
.L6:
	subl	%edx, %eax
	cmpl	$2, %r10d
	jbe	.L13
	leaq	16(%rsi), %r9
.L11:
	movd	%ecx, %xmm5
	movl	%edi, %ecx
	movq	%rsi, %rdx
	shrl	$2, %ecx
	pshufd	$0, %xmm5, %xmm0
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%r9, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	(%rdx), %xmm1
	movdqu	(%rdx), %xmm4
	addq	$16, %rdx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm4, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rdx, %rcx
	jne	.L8
	movdqa	%xmm0, %xmm2
	movl	%edi, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %ecx
	testb	$3, %dil
	je	.L2
.L10:
	movslq	%edx, %r8
	leaq	0(,%r8,4), %r9
	movl	(%rsi,%r8,4), %r8d
	cmpl	%r8d, %ecx
	cmovg	%r8d, %ecx
	leal	1(%rdx), %r8d
	cmpl	%r8d, %edi
	jle	.L2
	movl	4(%rsi,%r9), %r8d
	cmpl	%r8d, %ecx
	cmovg	%r8d, %ecx
	addl	$2, %edx
	cmpl	%edx, %edi
	jle	.L2
	movl	8(%rsi,%r9), %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
.L2:
	cltd
	leaq	.LC0(%rip), %rsi
	idivl	%ecx
	leal	(%rax,%rdi), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L18:
	subl	%edx, %eax
	jmp	.L11
.L12:
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	jmp	.L3
.L13:
	xorl	%edx, %edx
	jmp	.L10
	.cfi_endproc
.LFE24:
	.size	solve, .-solve
	.section	.rodata.str1.1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d"
	.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	.LC1(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4080
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %r13
	movq	%r13, %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edi
	testl	%edi, %edi
	jle	.L20
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edi
	addq	$4, %rbp
	cmpl	%ebx, %edi
	jg	.L21
.L20:
	movl	12(%rsp), %esi
	movq	%r13, %rdx
	call	solve
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$4040, %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
.L27:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	findMin
	.type	findMin, @function
findMin:
.LFB25:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	movl	%edi, %edx
	movq	%rsi, %rcx
	testl	%edi, %edi
	jle	.L28
	leal	-1(%rdi), %esi
	cmpl	$2, %esi
	jbe	.L34
	movl	%edi, %esi
	movd	%eax, %xmm4
	movq	%rcx, %rax
	shrl	$2, %esi
	pshufd	$0, %xmm4, %xmm0
	subl	$1, %esi
	salq	$4, %rsi
	leaq	16(%rcx,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L31:
	movdqu	(%rax), %xmm1
	movdqu	(%rax), %xmm3
	addq	$16, %rax
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm3, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rsi, %rax
	jne	.L31
	movdqa	%xmm0, %xmm2
	movl	%edx, %esi
	psrldq	$8, %xmm2
	andl	$-4, %esi
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$3, %dl
	je	.L36
.L30:
	movslq	%esi, %rdi
	leaq	0(,%rdi,4), %r8
	movl	(%rcx,%rdi,4), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	leal	1(%rsi), %edi
	cmpl	%edi, %edx
	jle	.L28
	movl	4(%rcx,%r8), %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	addl	$2, %esi
	cmpl	%esi, %edx
	jle	.L28
	movl	8(%rcx,%r8), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
.L28:
	ret
	.p2align 4,,10
	.p2align 3
.L36:
	ret
.L34:
	xorl	%esi, %esi
	jmp	.L30
	.cfi_endproc
.LFE25:
	.size	findMin, .-findMin
	.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>

#define N_MAX 1000

void solve(int n, int x, int m[]);
int findMin(int size, int intArray[]);

int main()
{
  int n, x, m[N_MAX];
  int i;
  int start, end;
  int total = 0;

  scanf("%d %d", &n, &x);
  for (i = 0; i < n; i++)
    {
      scanf("%d", &m[i]);
    }
  solve(n, x, m);

  return 0;
}

void solve(int n, int x, int m[])
{
  int i, sumOfAllKind, rest, maxCanMadeByRest;

  sumOfAllKind = 0;
  for (i = 0; i < n; i++)
    {
      sumOfAllKind += m[i];
    }

  rest = x - sumOfAllKind;
  maxCanMadeByRest = rest / findMin(n, m);

  printf("%d\n", n + maxCanMadeByRest);
}

int findMin(int size, int intArray[])
{
  int i, min;

  min = intArray[0];
  for (i = 0; i < size; i++)
    {
      if (min > intArray[i])
	{
	  min = intArray[i];
	}
    }

  return min;
}

3 1001
120
100
140
 5 3000
150
130
150
130
100
 3 1001
120
110
140
 4 360
90
13
126
90
 4 293
90
13
126
90
 4 293
144
13
126
90
 4 293
144
13
41
90
 3 0111
129
110
140
 4 293
144
13
17
90
 4 293
144
13
27
90

9
 28
 8
 7
 2
 -2
 4
 1
 6
 5

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>

#define N_MAX 1000

void solve(int n, int x, int m[]);
int findMin(int size, int intArray[]);

int main()
{
  int n, x, m[N_MAX];
  int i;
  int start, end;
  int total = 0;

  scanf("%d %d", &n, &x);
  for (i = 0; i < n; i++)
    {
      scanf("%d", &m[i]);
    }
  solve(n, x, m);

  return 0;
}

void solve(int n, int x, int m[])
{
  int i, sumOfAllKind, rest, maxCanMadeByRest;

  sumOfAllKind = 0;
  for (i = 0; i < n; i++)
    {
      sumOfAllKind += m[i];
    }

  rest = x - sumOfAllKind;
  maxCanMadeByRest = rest / findMin(n, m);

  printf("%d\n", n + maxCanMadeByRest);
}

int findMin(int size, int intArray[])
{
  int i, min;

  min = intArray[0];
  for (i = 0; i < size; i++)
    {
      if (min > intArray[i])
	{
	  min = intArray[i];
	}
    }

  return min;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.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	$4032, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4020(%rbp)
	leaq	-4028(%rbp), %rdx
	leaq	-4032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4024(%rbp)
	jmp	.L2
.L3:
	leaq	-4016(%rbp), %rdx
	movl	-4024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4024(%rbp)
.L2:
	movl	-4032(%rbp), %eax
	cmpl	%eax, -4024(%rbp)
	jl	.L3
	movl	-4028(%rbp), %ecx
	movl	-4032(%rbp), %eax
	leaq	-4016(%rbp), %rdx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	solve
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.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)
	movq	%rdx, -32(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -12(%rbp)
	addl	$1, -16(%rbp)
.L7:
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L8
	movl	-24(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	findMin
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.globl	findMin
	.type	findMin, @function
findMin:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L10
.L12:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L11
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
.L11:
	addl	$1, -8(%rbp)
.L10:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L12
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	findMin, .-findMin
	.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"
.LC1:
	.string	"%d"
	.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	$4032, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4020(%rbp)
	leaq	-4028(%rbp), %rdx
	leaq	-4032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4024(%rbp)
	jmp	.L2
.L3:
	leaq	-4016(%rbp), %rdx
	movl	-4024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4024(%rbp)
.L2:
	movl	-4032(%rbp), %eax
	cmpl	%eax, -4024(%rbp)
	jl	.L3
	movl	-4028(%rbp), %ecx
	movl	-4032(%rbp), %eax
	leaq	-4016(%rbp), %rdx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	solve
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
.LC2:
	.string	"%d\n"
	.text
	.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)
	movq	%rdx, -32(%rbp)
	movl	$0, -12(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -12(%rbp)
	addl	$1, -16(%rbp)
.L7:
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L8
	movl	-24(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rdx
	movl	-20(%rbp), %eax
	movq	%rdx, %rsi
	movl	%eax, %edi
	call	findMin
	movl	%eax, %ecx
	movl	-8(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.globl	findMin
	.type	findMin, @function
findMin:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L10
.L12:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L11
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
.L11:
	addl	$1, -8(%rbp)
.L10:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L12
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	findMin, .-findMin
	.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:
