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>
#include <limits.h>

long long int chmin(long long int a,long long int b){
  //b -> min
  if(a < b){
    b = a;
  }
  return b;
}

int main(){
  int n,max_w;
  scanf("%d%d",&n,&max_w);
  int w[n],v[n],max_v=0;
  for(int i=0; i<n; i++){
    scanf("%d%d",&w[i],&v[i]);
    max_v += v[i];
  }
  long long int dp[n+1][max_v+1];
  for(int i=0; i<=n; i++){
    for(int j=0; j<=max_v; j++){
      dp[i][j]= 1LL << 62;
    }
  }
  dp[0][0] = 0;
  
  for(int i=0; i<n; i++){
    for(int value=0; value<=max_v; value++){
      if(value - v[i] >= 0){
        dp[i+1][value] = chmin(dp[i+1][value], dp[i][value-v[i]] + w[i]);
      }
      dp[i+1][value] = chmin(dp[i+1][value],dp[i][value]);
    }
  }
  
  for(int check=max_v; check>=0; check--){
    if(dp[n][check] <= max_w){
      printf("%d",check);
      break;
    }
  }
  
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jge	.L2
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L2:
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	chmin, .-chmin
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$248, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -280(%rbp)
	leaq	-144(%rbp), %rdx
	leaq	-148(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-148(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	movslq	%edx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L7
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -104(%rbp)
	movl	-148(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	$0, -140(%rbp)
	movl	$0, -136(%rbp)
	jmp	.L11
.L12:
	movl	-136(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rax, %rdx
	movl	-136(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-104(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	movl	-136(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, -140(%rbp)
	addl	$1, -136(%rbp)
.L11:
	movl	-148(%rbp), %eax
	cmpl	%eax, -136(%rbp)
	jl	.L12
	movl	-140(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-148(%rbp), %eax
	leal	1(%rax), %esi
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movslq	%ecx, %rax
	leaq	0(,%rax,8), %rbx
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%esi, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	-192(%rbp), %r9
	movq	-184(%rbp), %r10
	movq	%r10, %rdx
	imulq	-176(%rbp), %rdx
	movq	-168(%rbp), %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r9, %rax
	mulq	-176(%rbp)
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%esi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rdx
	movslq	%esi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -132(%rbp)
	jmp	.L16
.L19:
	movl	$0, -128(%rbp)
	jmp	.L17
.L18:
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rsi
	movl	-132(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movabsq	$4611686018427387904, %rdi
	movq	%rdi, (%rax,%rdx,8)
	addl	$1, -128(%rbp)
.L17:
	movl	-128(%rbp), %eax
	cmpl	-140(%rbp), %eax
	jle	.L18
	addl	$1, -132(%rbp)
.L16:
	movl	-148(%rbp), %eax
	cmpl	%eax, -132(%rbp)
	jle	.L19
	movq	-64(%rbp), %rax
	movq	$0, (%rax)
	movl	$0, -124(%rbp)
	jmp	.L20
.L24:
	movl	$0, -120(%rbp)
	jmp	.L21
.L23:
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-120(%rbp), %eax
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L22
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %esi
	movl	-120(%rbp), %eax
	subl	%esi, %eax
	movl	%eax, %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rsi
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	leaq	(%rcx,%rax), %rdx
	movq	%rbx, %rsi
	shrq	$3, %rsi
	movl	-124(%rbp), %eax
	leal	1(%rax), %edi
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %ecx
	movslq	%ecx, %r8
	movslq	%edi, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rbx, %r12
	shrq	$3, %r12
	movl	-124(%rbp), %ecx
	leal	1(%rcx), %r13d
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	chmin
	movq	-64(%rbp), %rdx
	movl	-120(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%r13d, %rcx
	imulq	%r12, %rcx
	addq	%rsi, %rcx
	movq	%rax, (%rdx,%rcx,8)
.L22:
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rsi
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rbx, %rsi
	shrq	$3, %rsi
	movl	-124(%rbp), %eax
	leal	1(%rax), %edi
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %ecx
	movslq	%ecx, %r8
	movslq	%edi, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rbx, %r12
	shrq	$3, %r12
	movl	-124(%rbp), %ecx
	leal	1(%rcx), %r13d
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	chmin
	movq	-64(%rbp), %rdx
	movl	-120(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%r13d, %rcx
	imulq	%r12, %rcx
	addq	%rsi, %rcx
	movq	%rax, (%rdx,%rcx,8)
	addl	$1, -120(%rbp)
.L21:
	movl	-120(%rbp), %eax
	cmpl	-140(%rbp), %eax
	jle	.L23
	addl	$1, -124(%rbp)
.L20:
	movl	-148(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L24
	movl	-140(%rbp), %eax
	movl	%eax, -116(%rbp)
	jmp	.L25
.L28:
	movq	%rbx, %rsi
	shrq	$3, %rsi
	movl	-148(%rbp), %edx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %ecx
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rcx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movl	-144(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jg	.L26
	movl	-116(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L27
.L26:
	subl	$1, -116(%rbp)
.L25:
	cmpl	$0, -116(%rbp)
	jns	.L28
.L27:
	movl	$0, %eax
	movq	-280(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	chmin
	.type	chmin, @function
chmin:
.LFB23:
	.cfi_startproc
	endbr64
	cmpq	%rsi, %rdi
	movq	%rsi, %rax
	cmovle	%rdi, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %r8
	leaq	15(,%rax,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
	cmpq	%rcx, %rsp
	je	.L5
.L60:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L60
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L61
.L6:
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	movq	%rsp, %r12
	andq	$-16, %rdx
	subq	%rax, %rcx
.L7:
	cmpq	%rcx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L61:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L8:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L62
.L9:
	movq	%rsp, %r14
	movq	%r14, -96(%rbp)
	testl	%r8d, %r8d
	jle	.L10
	movq	%r12, %r13
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%r14, %rdx
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r14), %eax
	movl	-64(%rbp), %r8d
	addl	$1, %r15d
	addq	$4, %r13
	addq	$4, %r14
	addl	%ebx, %eax
	movslq	%eax, %rbx
	cmpl	%r15d, %r8d
	jg	.L11
	leal	1(%r8), %r14d
	leal	1(%rbx), %edx
	movq	%rsp, %rsi
	movslq	%edx, %rdx
	movslq	%r14d, %rcx
	leaq	0(,%rdx,8), %rdi
	imulq	%rcx, %rdx
	movq	%rdi, -72(%rbp)
	leaq	15(,%rdx,8), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	andq	$-16, %rcx
	subq	%rdx, %rsi
.L12:
	cmpq	%rsi, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	je	.L14
	orq	$0, -8(%rsp,%rcx)
.L14:
	movq	-72(%rbp), %r9
	movq	%rsp, %r11
	shrq	$3, %r9
	testl	%r8d, %r8d
	js	.L15
	testl	%eax, %eax
	js	.L16
.L36:
	leal	1(%rbx), %r15d
	movl	%r8d, -80(%rbp)
	movq	-72(%rbp), %r8
	movq	%r11, %rdi
	movl	%r15d, %eax
	movl	%r15d, %r10d
	movdqa	.LC1(%rip), %xmm0
	xorl	%ecx, %ecx
	movabsq	$4611686018427387904, %rsi
	shrl	%eax
	andl	$-2, %r10d
	leal	-1(%rax), %r13d
	addq	$1, %r13
	salq	$4, %r13
	.p2align 4,,10
	.p2align 3
.L17:
	leaq	0(%r13,%rdi), %rdx
	movq	%rdi, %rax
	testl	%ebx, %ebx
	je	.L63
	.p2align 4,,10
	.p2align 3
.L18:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L18
	movslq	%r10d, %rax
	cmpl	%r15d, %r10d
	je	.L19
.L22:
	movslq	%ecx, %rdx
	imulq	%r9, %rdx
	addq	%rdx, %rax
	movq	%rsi, (%r11,%rax,8)
.L19:
	addl	$1, %ecx
	addq	%r8, %rdi
	cmpl	%r14d, %ecx
	jne	.L17
	movl	-80(%rbp), %r8d
.L16:
	movq	$0, (%r11)
	testl	%r8d, %r8d
	jle	.L21
	testl	%ebx, %ebx
	js	.L24
	leal	1(%rbx), %esi
	movq	-72(%rbp), %rax
	movslq	%r8d, %rdi
	xorl	%ecx, %ecx
	movl	%esi, -84(%rbp)
	movq	%r9, %r14
	movl	$1, %r13d
	addq	%r11, %rax
	movq	%rdi, -80(%rbp)
	xorl	%edi, %edi
	movq	%r11, -104(%rbp)
	movq	%rax, %r11
	movl	%ebx, -88(%rbp)
	movq	%rcx, %rbx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	-96(%rbp), %rax
	movq	%rdi, %rsi
	movl	-84(%rbp), %r8d
	movq	%rbx, %r10
	subq	%r13, %rsi
	subq	%r14, %r10
	movl	(%rax,%rdi,4), %eax
	imulq	%r9, %rsi
	movl	%eax, %ecx
	subl	%eax, %r8d
	movq	%r11, %rax
	negl	%ecx
	movslq	%ecx, %rdx
	addq	%rdx, %r10
	.p2align 4,,10
	.p2align 3
.L30:
	movq	(%rax), %r15
	testl	%ecx, %ecx
	js	.L26
	movslq	(%r12,%rdi,4), %rdx
	addq	(%rax,%r10,8), %rdx
	cmpq	%r15, %rdx
	cmovg	%r15, %rdx
	movq	%rdx, (%rax)
	movq	(%rax,%rsi,8), %r15
	cmpq	%rdx, %r15
	cmovg	%rdx, %r15
	addl	$1, %ecx
	addq	$8, %rax
	movq	%r15, -8(%rax)
	cmpl	%r8d, %ecx
	jne	.L30
.L28:
	addq	$1, %rdi
	addq	$1, %r13
	addq	-72(%rbp), %r11
	addq	%r9, %rbx
	addq	%r9, %r14
	cmpq	-80(%rbp), %rdi
	jne	.L25
	movq	-104(%rbp), %r11
	movslq	-88(%rbp), %rbx
.L29:
	movq	-80(%rbp), %rax
	movslq	-60(%rbp), %rdx
	imulq	%r9, %rax
	leaq	(%r11,%rax,8), %rax
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L31:
	subq	$1, %rbx
	testl	%ebx, %ebx
	js	.L24
.L32:
	cmpq	%rdx, (%rax,%rbx,8)
	jg	.L31
	movl	%ebx, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L24:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L64
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	movq	(%rax,%rsi,8), %rdx
	cmpq	%r15, %rdx
	cmovg	%r15, %rdx
	addl	$1, %ecx
	addq	$8, %rax
	movq	%rdx, -8(%rax)
	cmpl	%r8d, %ecx
	jne	.L30
	jmp	.L28
.L63:
	xorl	%eax, %eax
	jmp	.L22
.L65:
	movl	$1, %r9d
	xorl	%ebx, %ebx
.L15:
	movq	$0, (%r11)
.L21:
	testl	%ebx, %ebx
	js	.L24
	movslq	%r8d, %rax
	movq	%rax, -80(%rbp)
	jmp	.L29
.L10:
	leal	1(%r8), %r14d
	movq	%rsp, %rcx
	movslq	%r14d, %rax
	leaq	15(,%rax,8), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L33:
	cmpq	%rcx, %rsp
	je	.L34
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L33
.L62:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L9
.L34:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L35
	orq	$0, -8(%rsp,%rax)
.L35:
	movq	%rsp, %r11
	testl	%r8d, %r8d
	jne	.L65
	movq	$8, -72(%rbp)
	xorl	%ebx, %ebx
	movl	$1, %r9d
	jmp	.L36
.L64:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.quad	4611686018427387904
	.quad	4611686018427387904
	.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	chmin
	.type	chmin, @function
chmin:
.LFB23:
	.cfi_startproc
	endbr64
	cmpq	%rsi, %rdi
	movq	%rsi, %rax
	cmovle	%rdi, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %r8
	leaq	15(,%rax,4), %rax
	movq	%rax, %rsi
	movq	%rax, %rdx
	andq	$-4096, %rsi
	andq	$-16, %rdx
	subq	%rsi, %rcx
	cmpq	%rcx, %rsp
	je	.L5
.L60:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L60
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L61
.L6:
	movq	%rax, %rdx
	movq	%rsp, %rcx
	andq	$-4096, %rax
	movq	%rsp, %r12
	andq	$-16, %rdx
	subq	%rax, %rcx
.L7:
	cmpq	%rcx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L61:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L8:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L62
.L9:
	movq	%rsp, %r14
	movq	%r14, -96(%rbp)
	testl	%r8d, %r8d
	jle	.L10
	movq	%r12, %r13
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%r14, %rdx
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r14), %eax
	movl	-64(%rbp), %r8d
	addl	$1, %r15d
	addq	$4, %r13
	addq	$4, %r14
	addl	%ebx, %eax
	movslq	%eax, %rbx
	cmpl	%r15d, %r8d
	jg	.L11
	leal	1(%r8), %r14d
	leal	1(%rbx), %edx
	movq	%rsp, %rsi
	movslq	%edx, %rdx
	movslq	%r14d, %rcx
	leaq	0(,%rdx,8), %rdi
	imulq	%rcx, %rdx
	movq	%rdi, -72(%rbp)
	leaq	15(,%rdx,8), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	andq	$-16, %rcx
	subq	%rdx, %rsi
.L12:
	cmpq	%rsi, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	je	.L14
	orq	$0, -8(%rsp,%rcx)
.L14:
	movq	-72(%rbp), %r9
	movq	%rsp, %r11
	shrq	$3, %r9
	testl	%r8d, %r8d
	js	.L15
	testl	%eax, %eax
	js	.L16
.L36:
	leal	1(%rbx), %r15d
	movl	%r8d, -80(%rbp)
	movq	-72(%rbp), %r8
	movq	%r11, %rdi
	movl	%r15d, %eax
	movl	%r15d, %r10d
	movdqa	.LC1(%rip), %xmm0
	xorl	%ecx, %ecx
	movabsq	$4611686018427387904, %rsi
	shrl	%eax
	andl	$-2, %r10d
	leal	-1(%rax), %r13d
	addq	$1, %r13
	salq	$4, %r13
	.p2align 4,,10
	.p2align 3
.L17:
	leaq	0(%r13,%rdi), %rdx
	movq	%rdi, %rax
	testl	%ebx, %ebx
	je	.L63
	.p2align 4,,10
	.p2align 3
.L18:
	movups	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L18
	movslq	%r10d, %rax
	cmpl	%r15d, %r10d
	je	.L19
.L22:
	movslq	%ecx, %rdx
	imulq	%r9, %rdx
	addq	%rdx, %rax
	movq	%rsi, (%r11,%rax,8)
.L19:
	addl	$1, %ecx
	addq	%r8, %rdi
	cmpl	%r14d, %ecx
	jne	.L17
	movl	-80(%rbp), %r8d
.L16:
	movq	$0, (%r11)
	testl	%r8d, %r8d
	jle	.L21
	testl	%ebx, %ebx
	js	.L24
	leal	1(%rbx), %esi
	movq	-72(%rbp), %rax
	movslq	%r8d, %rdi
	xorl	%ecx, %ecx
	movl	%esi, -84(%rbp)
	movq	%r9, %r14
	movl	$1, %r13d
	addq	%r11, %rax
	movq	%rdi, -80(%rbp)
	xorl	%edi, %edi
	movq	%r11, -104(%rbp)
	movq	%rax, %r11
	movl	%ebx, -88(%rbp)
	movq	%rcx, %rbx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	-96(%rbp), %rax
	movq	%rdi, %rsi
	movl	-84(%rbp), %r8d
	movq	%rbx, %r10
	subq	%r13, %rsi
	subq	%r14, %r10
	movl	(%rax,%rdi,4), %eax
	imulq	%r9, %rsi
	movl	%eax, %ecx
	subl	%eax, %r8d
	movq	%r11, %rax
	negl	%ecx
	movslq	%ecx, %rdx
	addq	%rdx, %r10
	.p2align 4,,10
	.p2align 3
.L30:
	movq	(%rax), %r15
	testl	%ecx, %ecx
	js	.L26
	movslq	(%r12,%rdi,4), %rdx
	addq	(%rax,%r10,8), %rdx
	cmpq	%r15, %rdx
	cmovg	%r15, %rdx
	movq	%rdx, (%rax)
	movq	(%rax,%rsi,8), %r15
	cmpq	%rdx, %r15
	cmovg	%rdx, %r15
	addl	$1, %ecx
	addq	$8, %rax
	movq	%r15, -8(%rax)
	cmpl	%r8d, %ecx
	jne	.L30
.L28:
	addq	$1, %rdi
	addq	$1, %r13
	addq	-72(%rbp), %r11
	addq	%r9, %rbx
	addq	%r9, %r14
	cmpq	-80(%rbp), %rdi
	jne	.L25
	movq	-104(%rbp), %r11
	movslq	-88(%rbp), %rbx
.L29:
	movq	-80(%rbp), %rax
	movslq	-60(%rbp), %rdx
	imulq	%r9, %rax
	leaq	(%r11,%rax,8), %rax
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L31:
	subq	$1, %rbx
	testl	%ebx, %ebx
	js	.L24
.L32:
	cmpq	%rdx, (%rax,%rbx,8)
	jg	.L31
	movl	%ebx, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L24:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L64
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	movq	(%rax,%rsi,8), %rdx
	cmpq	%r15, %rdx
	cmovg	%r15, %rdx
	addl	$1, %ecx
	addq	$8, %rax
	movq	%rdx, -8(%rax)
	cmpl	%r8d, %ecx
	jne	.L30
	jmp	.L28
.L63:
	xorl	%eax, %eax
	jmp	.L22
.L65:
	movl	$1, %r9d
	xorl	%ebx, %ebx
.L15:
	movq	$0, (%r11)
.L21:
	testl	%ebx, %ebx
	js	.L24
	movslq	%r8d, %rax
	movq	%rax, -80(%rbp)
	jmp	.L29
.L10:
	leal	1(%r8), %r14d
	movq	%rsp, %rcx
	movslq	%r14d, %rax
	leaq	15(,%rax,8), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L33:
	cmpq	%rcx, %rsp
	je	.L34
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L33
.L62:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L9
.L34:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L35
	orq	$0, -8(%rsp,%rax)
.L35:
	movq	%rsp, %r11
	testl	%r8d, %r8d
	jne	.L65
	movq	$8, -72(%rbp)
	xorl	%ebx, %ebx
	movl	$1, %r9d
	jmp	.L36
.L64:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.quad	4611686018427387904
	.quad	4611686018427387904
	.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>
#include <limits.h>

long long int chmin(long long int a,long long int b){
  //b -> min
  if(a < b){
    b = a;
  }
  return b;
}

int main(){
  int n,max_w;
  scanf("%d%d",&n,&max_w);
  int w[n],v[n],max_v=0;
  for(int i=0; i<n; i++){
    scanf("%d%d",&w[i],&v[i]);
    max_v += v[i];
  }
  long long int dp[n+1][max_v+1];
  for(int i=0; i<=n; i++){
    for(int j=0; j<=max_v; j++){
      dp[i][j]= 1LL << 62;
    }
  }
  dp[0][0] = 0;
  
  for(int i=0; i<n; i++){
    for(int value=0; value<=max_v; value++){
      if(value - v[i] >= 0){
        dp[i+1][value] = chmin(dp[i+1][value], dp[i][value-v[i]] + w[i]);
      }
      dp[i+1][value] = chmin(dp[i+1][value],dp[i][value]);
    }
  }
  
  for(int check=max_v; check>=0; check--){
    if(dp[n][check] <= max_w){
      printf("%d",check);
      break;
    }
  }
  
  return 0;
}

1 1000000000
0000000000 10
 6 15
6 5
5 6
3 4
6 6
3 5
7 2
 3 8
3 30
4 35
5 60
 3 8
3 30
4 35
5 78
 6 15
6 5
0 6
3 4
6 6
3 5
7 3
 3 8
3 30
0 35
5 78
 2 8
3 30
4 50
5 60
 1 1000000000
0000000000 7
 6 15
6 5
5 5
3 4
6 6
3 5
7 3
 6 8
6 5
5 6
3 3
6 6
3 5
7 2

10 17 90 108 22 143 80 7 16 11
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>
#include <limits.h>

long long int chmin(long long int a,long long int b){
  //b -> min
  if(a < b){
    b = a;
  }
  return b;
}

int main(){
  int n,max_w;
  scanf("%d%d",&n,&max_w);
  int w[n],v[n],max_v=0;
  for(int i=0; i<n; i++){
    scanf("%d%d",&w[i],&v[i]);
    max_v += v[i];
  }
  long long int dp[n+1][max_v+1];
  for(int i=0; i<=n; i++){
    for(int j=0; j<=max_v; j++){
      dp[i][j]= 1LL << 62;
    }
  }
  dp[0][0] = 0;
  
  for(int i=0; i<n; i++){
    for(int value=0; value<=max_v; value++){
      if(value - v[i] >= 0){
        dp[i+1][value] = chmin(dp[i+1][value], dp[i][value-v[i]] + w[i]);
      }
      dp[i+1][value] = chmin(dp[i+1][value],dp[i][value]);
    }
  }
  
  for(int check=max_v; check>=0; check--){
    if(dp[n][check] <= max_w){
      printf("%d",check);
      break;
    }
  }
  
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jge	.L2
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L2:
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	chmin, .-chmin
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$248, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -280(%rbp)
	leaq	-144(%rbp), %rdx
	leaq	-148(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-148(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	movslq	%edx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L7
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -104(%rbp)
	movl	-148(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	$0, -140(%rbp)
	movl	$0, -136(%rbp)
	jmp	.L11
.L12:
	movl	-136(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rax, %rdx
	movl	-136(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-104(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	movl	-136(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, -140(%rbp)
	addl	$1, -136(%rbp)
.L11:
	movl	-148(%rbp), %eax
	cmpl	%eax, -136(%rbp)
	jl	.L12
	movl	-140(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-148(%rbp), %eax
	leal	1(%rax), %esi
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movslq	%ecx, %rax
	leaq	0(,%rax,8), %rbx
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%esi, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	-192(%rbp), %r9
	movq	-184(%rbp), %r10
	movq	%r10, %rdx
	imulq	-176(%rbp), %rdx
	movq	-168(%rbp), %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r9, %rax
	mulq	-176(%rbp)
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%esi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rdx
	movslq	%esi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -132(%rbp)
	jmp	.L16
.L19:
	movl	$0, -128(%rbp)
	jmp	.L17
.L18:
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rsi
	movl	-132(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movabsq	$4611686018427387904, %rdi
	movq	%rdi, (%rax,%rdx,8)
	addl	$1, -128(%rbp)
.L17:
	movl	-128(%rbp), %eax
	cmpl	-140(%rbp), %eax
	jle	.L18
	addl	$1, -132(%rbp)
.L16:
	movl	-148(%rbp), %eax
	cmpl	%eax, -132(%rbp)
	jle	.L19
	movq	-64(%rbp), %rax
	movq	$0, (%rax)
	movl	$0, -124(%rbp)
	jmp	.L20
.L24:
	movl	$0, -120(%rbp)
	jmp	.L21
.L23:
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-120(%rbp), %eax
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L22
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %esi
	movl	-120(%rbp), %eax
	subl	%esi, %eax
	movl	%eax, %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rsi
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	leaq	(%rcx,%rax), %rdx
	movq	%rbx, %rsi
	shrq	$3, %rsi
	movl	-124(%rbp), %eax
	leal	1(%rax), %edi
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %ecx
	movslq	%ecx, %r8
	movslq	%edi, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rbx, %r12
	shrq	$3, %r12
	movl	-124(%rbp), %ecx
	leal	1(%rcx), %r13d
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	chmin
	movq	-64(%rbp), %rdx
	movl	-120(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%r13d, %rcx
	imulq	%r12, %rcx
	addq	%rsi, %rcx
	movq	%rax, (%rdx,%rcx,8)
.L22:
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rsi
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rbx, %rsi
	shrq	$3, %rsi
	movl	-124(%rbp), %eax
	leal	1(%rax), %edi
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %ecx
	movslq	%ecx, %r8
	movslq	%edi, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rbx, %r12
	shrq	$3, %r12
	movl	-124(%rbp), %ecx
	leal	1(%rcx), %r13d
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	chmin
	movq	-64(%rbp), %rdx
	movl	-120(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%r13d, %rcx
	imulq	%r12, %rcx
	addq	%rsi, %rcx
	movq	%rax, (%rdx,%rcx,8)
	addl	$1, -120(%rbp)
.L21:
	movl	-120(%rbp), %eax
	cmpl	-140(%rbp), %eax
	jle	.L23
	addl	$1, -124(%rbp)
.L20:
	movl	-148(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L24
	movl	-140(%rbp), %eax
	movl	%eax, -116(%rbp)
	jmp	.L25
.L28:
	movq	%rbx, %rsi
	shrq	$3, %rsi
	movl	-148(%rbp), %edx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %ecx
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rcx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movl	-144(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jg	.L26
	movl	-116(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L27
.L26:
	subl	$1, -116(%rbp)
.L25:
	cmpl	$0, -116(%rbp)
	jns	.L28
.L27:
	movl	$0, %eax
	movq	-280(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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.
val
	.file	"temp.c"
	.text
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jge	.L2
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L2:
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	chmin, .-chmin
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$248, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, -280(%rbp)
	leaq	-144(%rbp), %rdx
	leaq	-148(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-148(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -112(%rbp)
	movslq	%edx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L5:
	cmpq	%rcx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L7
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -104(%rbp)
	movl	-148(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -96(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	movq	%rax, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -88(%rbp)
	movl	$0, -140(%rbp)
	movl	$0, -136(%rbp)
	jmp	.L11
.L12:
	movl	-136(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-88(%rbp), %rax
	addq	%rax, %rdx
	movl	-136(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-104(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	movl	-136(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, -140(%rbp)
	addl	$1, -136(%rbp)
.L11:
	movl	-148(%rbp), %eax
	cmpl	%eax, -136(%rbp)
	jl	.L12
	movl	-140(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-148(%rbp), %eax
	leal	1(%rax), %esi
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -80(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -272(%rbp)
	movq	$0, -264(%rbp)
	movslq	%ecx, %rax
	leaq	0(,%rax,8), %rbx
	movslq	%esi, %rax
	subq	$1, %rax
	movq	%rax, -72(%rbp)
	movslq	%ecx, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%esi, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movq	-192(%rbp), %r9
	movq	-184(%rbp), %r10
	movq	%r10, %rdx
	imulq	-176(%rbp), %rdx
	movq	-168(%rbp), %rax
	imulq	%r9, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r9, %rax
	mulq	-176(%rbp)
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%esi, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movq	%r15, %rdx
	imulq	%r12, %rdx
	movq	%r13, %rax
	imulq	%r14, %rax
	leaq	(%rdx,%rax), %rdi
	movq	%r14, %rax
	mulq	%r12
	addq	%rdx, %rdi
	movq	%rdi, %rdx
	movslq	%ecx, %rdx
	movslq	%esi, %rax
	imulq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -132(%rbp)
	jmp	.L16
.L19:
	movl	$0, -128(%rbp)
	jmp	.L17
.L18:
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rsi
	movl	-132(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movabsq	$4611686018427387904, %rdi
	movq	%rdi, (%rax,%rdx,8)
	addl	$1, -128(%rbp)
.L17:
	movl	-128(%rbp), %eax
	cmpl	-140(%rbp), %eax
	jle	.L18
	addl	$1, -132(%rbp)
.L16:
	movl	-148(%rbp), %eax
	cmpl	%eax, -132(%rbp)
	jle	.L19
	movq	-64(%rbp), %rax
	movq	$0, (%rax)
	movl	$0, -124(%rbp)
	jmp	.L20
.L24:
	movl	$0, -120(%rbp)
	jmp	.L21
.L23:
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-120(%rbp), %eax
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L22
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-88(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %esi
	movl	-120(%rbp), %eax
	subl	%esi, %eax
	movl	%eax, %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rsi
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-104(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	leaq	(%rcx,%rax), %rdx
	movq	%rbx, %rsi
	shrq	$3, %rsi
	movl	-124(%rbp), %eax
	leal	1(%rax), %edi
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %ecx
	movslq	%ecx, %r8
	movslq	%edi, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rbx, %r12
	shrq	$3, %r12
	movl	-124(%rbp), %ecx
	leal	1(%rcx), %r13d
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	chmin
	movq	-64(%rbp), %rdx
	movl	-120(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%r13d, %rcx
	imulq	%r12, %rcx
	addq	%rsi, %rcx
	movq	%rax, (%rdx,%rcx,8)
.L22:
	movq	%rbx, %rcx
	shrq	$3, %rcx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rsi
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rbx, %rsi
	shrq	$3, %rsi
	movl	-124(%rbp), %eax
	leal	1(%rax), %edi
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %ecx
	movslq	%ecx, %r8
	movslq	%edi, %rcx
	imulq	%rsi, %rcx
	addq	%r8, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rbx, %r12
	shrq	$3, %r12
	movl	-124(%rbp), %ecx
	leal	1(%rcx), %r13d
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	chmin
	movq	-64(%rbp), %rdx
	movl	-120(%rbp), %ecx
	movslq	%ecx, %rsi
	movslq	%r13d, %rcx
	imulq	%r12, %rcx
	addq	%rsi, %rcx
	movq	%rax, (%rdx,%rcx,8)
	addl	$1, -120(%rbp)
.L21:
	movl	-120(%rbp), %eax
	cmpl	-140(%rbp), %eax
	jle	.L23
	addl	$1, -124(%rbp)
.L20:
	movl	-148(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L24
	movl	-140(%rbp), %eax
	movl	%eax, -116(%rbp)
	jmp	.L25
.L28:
	movq	%rbx, %rsi
	shrq	$3, %rsi
	movl	-148(%rbp), %edx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %ecx
	movslq	%ecx, %rcx
	movslq	%edx, %rdx
	imulq	%rsi, %rdx
	addq	%rcx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movl	-144(%rbp), %eax
	cltq
	cmpq	%rax, %rdx
	jg	.L26
	movl	-116(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L27
.L26:
	subl	$1, -116(%rbp)
.L25:
	cmpl	$0, -116(%rbp)
	jns	.L28
.L27:
	movl	$0, %eax
	movq	-280(%rbp), %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
