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 d,g,p[11],c[11],x=1<<29,t,i,j,s,n;
  scanf("%d%d",&d,&g);g/=100;
  for(i=1;i<=d;i++){scanf("%d%d",&p[i],&c[i]);c[i]/=100;}
  for(i=0;i<1<<d;i++){
    s=n=0;for(j=1;j<=d;j++)if((1<<(j-1))&i){n+=p[j];s+=j*p[j]+c[j];}
    if(s<g){
      for(j=d;j>0;j--)if(((1<<(j-1))&i)==0){
        if(j*(p[j]-1)>=g-s)n+=(g-s)/j+((g-s)%j!=0);
        else n=1<<29;
        j=0;
      }
    }
    x=n<x?n:x;
  }
  printf("%d",x);
}
```

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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$536870912, -132(%rbp)
	leaq	-136(%rbp), %rdx
	leaq	-140(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -136(%rbp)
	movl	$1, -128(%rbp)
	jmp	.L2
.L3:
	leaq	-64(%rbp), %rdx
	movl	-128(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-112(%rbp), %rcx
	movl	-128(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-128(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
	addl	$1, -128(%rbp)
.L2:
	movl	-140(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jle	.L3
	movl	$0, -128(%rbp)
	jmp	.L4
.L14:
	movl	$0, -116(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -120(%rbp)
	movl	$1, -124(%rbp)
	jmp	.L5
.L7:
	movl	-124(%rbp), %eax
	subl	$1, %eax
	movl	-128(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L6
	movl	-124(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	addl	%eax, -116(%rbp)
	movl	-124(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	imull	-124(%rbp), %eax
	movl	%eax, %edx
	movl	-124(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	addl	%edx, %eax
	addl	%eax, -120(%rbp)
.L6:
	addl	$1, -124(%rbp)
.L5:
	movl	-140(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jle	.L7
	movl	-136(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jge	.L8
	movl	-140(%rbp), %eax
	movl	%eax, -124(%rbp)
	jmp	.L9
.L13:
	movl	-124(%rbp), %eax
	subl	$1, %eax
	movl	-128(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L10
	movl	-124(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	subl	$1, %eax
	imull	-124(%rbp), %eax
	movl	%eax, %edx
	movl	-136(%rbp), %eax
	subl	-120(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	-136(%rbp), %eax
	subl	-120(%rbp), %eax
	cltd
	idivl	-124(%rbp)
	movl	%eax, %ecx
	movl	-136(%rbp), %eax
	subl	-120(%rbp), %eax
	cltd
	idivl	-124(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	setne	%al
	movzbl	%al, %eax
	addl	%ecx, %eax
	addl	%eax, -116(%rbp)
	jmp	.L12
.L11:
	movl	$536870912, -116(%rbp)
.L12:
	movl	$0, -124(%rbp)
.L10:
	subl	$1, -124(%rbp)
.L9:
	cmpl	$0, -124(%rbp)
	jg	.L13
.L8:
	movl	-132(%rbp), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -132(%rbp)
	addl	$1, -128(%rbp)
.L4:
	movl	-140(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -128(%rbp)
	jl	.L14
	movl	-132(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$280, %rsp
	.cfi_def_cfa_offset 336
	movq	%fs:40, %rax
	movq	%rax, 264(%rsp)
	xorl	%eax, %eax
	leaq	152(%rsp), %rsi
	leaq	156(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movslq	156(%rsp), %rax
	movl	152(%rsp), %esi
	movq	%rax, %r8
	imulq	$1374389535, %rax, %rax
	sarl	$31, %r8d
	sarq	$37, %rax
	subl	%r8d, %eax
	movl	%eax, 156(%rsp)
	testl	%esi, %esi
	jle	.L91
	leaq	212(%rsp), %r12
	movl	$1, %r13d
	leaq	160(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	0(%rbp,%r13,4), %rsi
	movq	%r12, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	(%r12), %rax
	movl	152(%rsp), %esi
	addq	$1, %r13
	addq	$4, %r12
	movq	%rax, %rdx
	imulq	$1374389535, %rax, %rax
	sarl	$31, %edx
	sarq	$37, %rax
	subl	%edx, %eax
	movl	%eax, -4(%r12)
	cmpl	%r13d, %esi
	jge	.L3
	movl	156(%rsp), %r8d
.L2:
	movl	212(%rsp), %ebx
	movl	216(%rsp), %edx
	movl	$1, %eax
	movl	%esi, %ecx
	movl	164(%rsp), %r11d
	movl	168(%rsp), %ebp
	movl	%eax, %r9d
	movl	$536870912, %r14d
	movl	172(%rsp), %r10d
	movl	184(%rsp), %r12d
	sall	%cl, %r9d
	addl	%r11d, %ebx
	movl	188(%rsp), %r13d
	movl	192(%rsp), %edi
	movl	%ebx, 12(%rsp)
	leal	(%rdx,%rbp,2), %ebx
	leal	(%r10,%r10,2), %edx
	addl	220(%rsp), %edx
	movl	%ebx, 16(%rsp)
	movl	176(%rsp), %ebx
	leal	(%r12,%r12,2), %ecx
	movl	%edx, 20(%rsp)
	movl	224(%rsp), %edx
	movl	%ebx, 28(%rsp)
	leal	(%rdx,%rbx,4), %ebx
	movl	%edi, 72(%rsp)
	movl	%ebx, 32(%rsp)
	movl	180(%rsp), %ebx
	leal	(%rbx,%rbx,4), %edx
	addl	228(%rsp), %edx
	movl	%edx, 40(%rsp)
	movl	232(%rsp), %edx
	leal	(%rdx,%rcx,2), %ecx
	leal	0(,%r13,8), %edx
	subl	%r13d, %edx
	addl	236(%rsp), %edx
	movl	%ecx, 48(%rsp)
	movl	%edx, 60(%rsp)
	movl	240(%rsp), %edx
	leal	(%rdx,%rdi,8), %ecx
	movl	196(%rsp), %edi
	movl	%ecx, 76(%rsp)
	movl	%edi, 88(%rsp)
	leal	(%rdi,%rdi,8), %edx
	movl	200(%rsp), %edi
	addl	244(%rsp), %edx
	movl	%edi, 104(%rsp)
	leal	(%rdi,%rdi,4), %ecx
	movl	%edx, 92(%rsp)
	movl	248(%rsp), %edx
	leal	(%rdx,%rcx,2), %edi
	leal	-1(%rsi), %ecx
	movl	%eax, %edx
	movl	%edi, 100(%rsp)
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%ecx, 24(%rsp)
	leal	-2(%rsi), %ecx
	movl	%edi, 52(%rsp)
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%ecx, 36(%rsp)
	leal	-3(%rsi), %ecx
	movl	%edi, 64(%rsp)
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%ecx, 44(%rsp)
	leal	-4(%rsi), %ecx
	movl	%edi, 80(%rsp)
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%ecx, 56(%rsp)
	movl	%edi, 96(%rsp)
	leal	-5(%rsi), %edi
	movl	%edi, %ecx
	movl	%edi, 68(%rsp)
	movl	%eax, %edi
	sall	%cl, %edx
	leal	-6(%rsi), %ecx
	sall	%cl, %edi
	movl	%ecx, 84(%rsp)
	leal	-7(%rsi), %ecx
	movl	%edi, 120(%rsp)
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%edx, 112(%rsp)
	movl	%eax, %edx
	movl	%edi, 124(%rsp)
	leal	-8(%rsi), %edi
	movl	%ecx, 108(%rsp)
	movl	%edi, %ecx
	sall	%cl, %edx
	movl	%edi, 116(%rsp)
	leal	-9(%rsi), %ecx
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%ecx, 136(%rsp)
	leal	-10(%rsi), %ecx
	sall	%cl, %eax
	movl	%edx, 128(%rsp)
	xorl	%ecx, %ecx
	movl	%edi, 132(%rsp)
	movl	%eax, 140(%rsp)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	%edi, %r14d
	cmovg	%edi, %r14d
	addl	$1, %ecx
	cmpl	%ecx, %r9d
	je	.L19
.L4:
	xorl	%edi, %edi
	testl	%esi, %esi
	jle	.L17
	movl	%ecx, %edi
	xorl	%edx, %edx
	andl	$1, %edi
	je	.L5
	movl	12(%rsp), %edx
	movl	%r11d, %edi
.L5:
	cmpl	$1, %esi
	je	.L6
	testb	$2, %cl
	je	.L7
	addl	%ebp, %edi
	addl	16(%rsp), %edx
.L7:
	cmpl	$2, %esi
	je	.L6
	testb	$4, %cl
	je	.L8
	addl	%r10d, %edi
	addl	20(%rsp), %edx
.L8:
	cmpl	$3, %esi
	je	.L6
	testb	$8, %cl
	je	.L9
	addl	28(%rsp), %edi
	addl	32(%rsp), %edx
.L9:
	cmpl	$4, %esi
	je	.L6
	testb	$16, %cl
	je	.L10
	addl	%ebx, %edi
	addl	40(%rsp), %edx
.L10:
	cmpl	$5, %esi
	je	.L6
	testb	$32, %cl
	je	.L11
	addl	%r12d, %edi
	addl	48(%rsp), %edx
.L11:
	cmpl	$6, %esi
	je	.L6
	testb	$64, %cl
	je	.L12
	addl	%r13d, %edi
	addl	60(%rsp), %edx
.L12:
	cmpl	$7, %esi
	je	.L6
	testb	$-128, %cl
	je	.L13
	addl	72(%rsp), %edi
	addl	76(%rsp), %edx
.L13:
	cmpl	$8, %esi
	je	.L6
	testb	$1, %ch
	je	.L14
	addl	88(%rsp), %edi
	addl	92(%rsp), %edx
.L14:
	cmpl	$9, %esi
	je	.L6
	testb	$2, %ch
	je	.L6
	addl	104(%rsp), %edi
	addl	100(%rsp), %edx
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%edx, %r8d
	jle	.L17
	testl	%ecx, 52(%rsp)
	jne	.L94
	movl	%esi, %r15d
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%r8d, %eax
	subl	%edx, %eax
	movslq	%r15d, %rdx
	movl	160(%rsp,%rdx,4), %edx
	subl	$1, %edx
	imull	%r15d, %edx
	cmpl	%eax, %edx
	jl	.L33
	cltd
	idivl	%r15d
	cmpl	$1, %edx
	sbbl	$-1, %eax
	addl	%eax, %edi
	cmpl	%edi, %r14d
	cmovg	%edi, %r14d
	addl	$1, %ecx
	cmpl	%ecx, %r9d
	jne	.L4
.L19:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	264(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L95
	addq	$280, %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
.L33:
	.cfi_restore_state
	movl	$536870912, %edi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L94:
	movl	24(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L17
	testl	%ecx, 64(%rsp)
	jne	.L96
	movl	24(%rsp), %r15d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L96:
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 80(%rsp)
	jne	.L97
	movl	36(%rsp), %r15d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L97:
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 96(%rsp)
	jne	.L98
	movl	44(%rsp), %r15d
	jmp	.L16
.L98:
	movl	56(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 112(%rsp)
	jne	.L99
	movl	56(%rsp), %r15d
	jmp	.L16
.L99:
	movl	68(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 120(%rsp)
	jne	.L100
	movl	68(%rsp), %r15d
	jmp	.L16
.L100:
	movl	84(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 124(%rsp)
	je	.L30
	movl	108(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L17
	testl	%ecx, 128(%rsp)
	je	.L31
	movl	116(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 132(%rsp)
	je	.L32
	movl	136(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L17
	testl	%ecx, 140(%rsp)
	jne	.L17
	jmp	.L16
.L30:
	movl	84(%rsp), %r15d
	jmp	.L16
.L31:
	movl	108(%rsp), %r15d
	jmp	.L16
.L32:
	movl	116(%rsp), %r15d
	jmp	.L16
.L91:
	movl	%eax, %r8d
	jmp	.L2
.L95:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$280, %rsp
	.cfi_def_cfa_offset 336
	movq	%fs:40, %rax
	movq	%rax, 264(%rsp)
	xorl	%eax, %eax
	leaq	152(%rsp), %rsi
	leaq	156(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movslq	156(%rsp), %rax
	movl	152(%rsp), %esi
	movq	%rax, %r8
	imulq	$1374389535, %rax, %rax
	sarl	$31, %r8d
	sarq	$37, %rax
	subl	%r8d, %eax
	movl	%eax, 156(%rsp)
	testl	%esi, %esi
	jle	.L91
	leaq	212(%rsp), %r12
	movl	$1, %r13d
	leaq	160(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	0(%rbp,%r13,4), %rsi
	movq	%r12, %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	(%r12), %rax
	movl	152(%rsp), %esi
	addq	$1, %r13
	addq	$4, %r12
	movq	%rax, %rdx
	imulq	$1374389535, %rax, %rax
	sarl	$31, %edx
	sarq	$37, %rax
	subl	%edx, %eax
	movl	%eax, -4(%r12)
	cmpl	%r13d, %esi
	jge	.L3
	movl	156(%rsp), %r8d
.L2:
	movl	212(%rsp), %ebx
	movl	216(%rsp), %edx
	movl	$1, %eax
	movl	%esi, %ecx
	movl	164(%rsp), %r11d
	movl	168(%rsp), %ebp
	movl	%eax, %r9d
	movl	$536870912, %r14d
	movl	172(%rsp), %r10d
	movl	184(%rsp), %r12d
	sall	%cl, %r9d
	addl	%r11d, %ebx
	movl	188(%rsp), %r13d
	movl	192(%rsp), %edi
	movl	%ebx, 12(%rsp)
	leal	(%rdx,%rbp,2), %ebx
	leal	(%r10,%r10,2), %edx
	addl	220(%rsp), %edx
	movl	%ebx, 16(%rsp)
	movl	176(%rsp), %ebx
	leal	(%r12,%r12,2), %ecx
	movl	%edx, 20(%rsp)
	movl	224(%rsp), %edx
	movl	%ebx, 28(%rsp)
	leal	(%rdx,%rbx,4), %ebx
	movl	%edi, 72(%rsp)
	movl	%ebx, 32(%rsp)
	movl	180(%rsp), %ebx
	leal	(%rbx,%rbx,4), %edx
	addl	228(%rsp), %edx
	movl	%edx, 40(%rsp)
	movl	232(%rsp), %edx
	leal	(%rdx,%rcx,2), %ecx
	leal	0(,%r13,8), %edx
	subl	%r13d, %edx
	addl	236(%rsp), %edx
	movl	%ecx, 48(%rsp)
	movl	%edx, 60(%rsp)
	movl	240(%rsp), %edx
	leal	(%rdx,%rdi,8), %ecx
	movl	196(%rsp), %edi
	movl	%ecx, 76(%rsp)
	movl	%edi, 88(%rsp)
	leal	(%rdi,%rdi,8), %edx
	movl	200(%rsp), %edi
	addl	244(%rsp), %edx
	movl	%edi, 104(%rsp)
	leal	(%rdi,%rdi,4), %ecx
	movl	%edx, 92(%rsp)
	movl	248(%rsp), %edx
	leal	(%rdx,%rcx,2), %edi
	leal	-1(%rsi), %ecx
	movl	%eax, %edx
	movl	%edi, 100(%rsp)
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%ecx, 24(%rsp)
	leal	-2(%rsi), %ecx
	movl	%edi, 52(%rsp)
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%ecx, 36(%rsp)
	leal	-3(%rsi), %ecx
	movl	%edi, 64(%rsp)
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%ecx, 44(%rsp)
	leal	-4(%rsi), %ecx
	movl	%edi, 80(%rsp)
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%ecx, 56(%rsp)
	movl	%edi, 96(%rsp)
	leal	-5(%rsi), %edi
	movl	%edi, %ecx
	movl	%edi, 68(%rsp)
	movl	%eax, %edi
	sall	%cl, %edx
	leal	-6(%rsi), %ecx
	sall	%cl, %edi
	movl	%ecx, 84(%rsp)
	leal	-7(%rsi), %ecx
	movl	%edi, 120(%rsp)
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%edx, 112(%rsp)
	movl	%eax, %edx
	movl	%edi, 124(%rsp)
	leal	-8(%rsi), %edi
	movl	%ecx, 108(%rsp)
	movl	%edi, %ecx
	sall	%cl, %edx
	movl	%edi, 116(%rsp)
	leal	-9(%rsi), %ecx
	movl	%eax, %edi
	sall	%cl, %edi
	movl	%ecx, 136(%rsp)
	leal	-10(%rsi), %ecx
	sall	%cl, %eax
	movl	%edx, 128(%rsp)
	xorl	%ecx, %ecx
	movl	%edi, 132(%rsp)
	movl	%eax, 140(%rsp)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L17:
	cmpl	%edi, %r14d
	cmovg	%edi, %r14d
	addl	$1, %ecx
	cmpl	%ecx, %r9d
	je	.L19
.L4:
	xorl	%edi, %edi
	testl	%esi, %esi
	jle	.L17
	movl	%ecx, %edi
	xorl	%edx, %edx
	andl	$1, %edi
	je	.L5
	movl	12(%rsp), %edx
	movl	%r11d, %edi
.L5:
	cmpl	$1, %esi
	je	.L6
	testb	$2, %cl
	je	.L7
	addl	%ebp, %edi
	addl	16(%rsp), %edx
.L7:
	cmpl	$2, %esi
	je	.L6
	testb	$4, %cl
	je	.L8
	addl	%r10d, %edi
	addl	20(%rsp), %edx
.L8:
	cmpl	$3, %esi
	je	.L6
	testb	$8, %cl
	je	.L9
	addl	28(%rsp), %edi
	addl	32(%rsp), %edx
.L9:
	cmpl	$4, %esi
	je	.L6
	testb	$16, %cl
	je	.L10
	addl	%ebx, %edi
	addl	40(%rsp), %edx
.L10:
	cmpl	$5, %esi
	je	.L6
	testb	$32, %cl
	je	.L11
	addl	%r12d, %edi
	addl	48(%rsp), %edx
.L11:
	cmpl	$6, %esi
	je	.L6
	testb	$64, %cl
	je	.L12
	addl	%r13d, %edi
	addl	60(%rsp), %edx
.L12:
	cmpl	$7, %esi
	je	.L6
	testb	$-128, %cl
	je	.L13
	addl	72(%rsp), %edi
	addl	76(%rsp), %edx
.L13:
	cmpl	$8, %esi
	je	.L6
	testb	$1, %ch
	je	.L14
	addl	88(%rsp), %edi
	addl	92(%rsp), %edx
.L14:
	cmpl	$9, %esi
	je	.L6
	testb	$2, %ch
	je	.L6
	addl	104(%rsp), %edi
	addl	100(%rsp), %edx
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%edx, %r8d
	jle	.L17
	testl	%ecx, 52(%rsp)
	jne	.L94
	movl	%esi, %r15d
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%r8d, %eax
	subl	%edx, %eax
	movslq	%r15d, %rdx
	movl	160(%rsp,%rdx,4), %edx
	subl	$1, %edx
	imull	%r15d, %edx
	cmpl	%eax, %edx
	jl	.L33
	cltd
	idivl	%r15d
	cmpl	$1, %edx
	sbbl	$-1, %eax
	addl	%eax, %edi
	cmpl	%edi, %r14d
	cmovg	%edi, %r14d
	addl	$1, %ecx
	cmpl	%ecx, %r9d
	jne	.L4
.L19:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	264(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L95
	addq	$280, %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
.L33:
	.cfi_restore_state
	movl	$536870912, %edi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L94:
	movl	24(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L17
	testl	%ecx, 64(%rsp)
	jne	.L96
	movl	24(%rsp), %r15d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L96:
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 80(%rsp)
	jne	.L97
	movl	36(%rsp), %r15d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L97:
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 96(%rsp)
	jne	.L98
	movl	44(%rsp), %r15d
	jmp	.L16
.L98:
	movl	56(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 112(%rsp)
	jne	.L99
	movl	56(%rsp), %r15d
	jmp	.L16
.L99:
	movl	68(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 120(%rsp)
	jne	.L100
	movl	68(%rsp), %r15d
	jmp	.L16
.L100:
	movl	84(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 124(%rsp)
	je	.L30
	movl	108(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L17
	testl	%ecx, 128(%rsp)
	je	.L31
	movl	116(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	testl	%ecx, 132(%rsp)
	je	.L32
	movl	136(%rsp), %r15d
	testl	%r15d, %r15d
	jle	.L17
	testl	%ecx, 140(%rsp)
	jne	.L17
	jmp	.L16
.L30:
	movl	84(%rsp), %r15d
	jmp	.L16
.L31:
	movl	108(%rsp), %r15d
	jmp	.L16
.L32:
	movl	116(%rsp), %r15d
	jmp	.L16
.L91:
	movl	%eax, %r8d
	jmp	.L2
.L95:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
int main(){
  int d,g,p[11],c[11],x=1<<29,t,i,j,s,n;
  scanf("%d%d",&d,&g);g/=100;
  for(i=1;i<=d;i++){scanf("%d%d",&p[i],&c[i]);c[i]/=100;}
  for(i=0;i<1<<d;i++){
    s=n=0;for(j=1;j<=d;j++)if((1<<(j-1))&i){n+=p[j];s+=j*p[j]+c[j];}
    if(s<g){
      for(j=d;j>0;j--)if(((1<<(j-1))&i)==0){
        if(j*(p[j]-1)>=g-s)n+=(g-s)/j+((g-s)%j!=0);
        else n=1<<29;
        j=0;
      }
    }
    x=n<x?n:x;
  }
  printf("%d",x);
}

5 25000
20 0000
40 1000
50 1000
30 1000
1 1000
 2 431
3 500
5 800
 2 1328
3 500
5 800
 2 2000
3 500
7 800
 5 25000
20 0010
40 1000
50 1000
60 1000
1 1000
 5 10847
20 0010
40 1000
50 1000
60 1000
1 1000
 2 1328
3 890
10 800
 3 10847
26 0010
40 0100
61 1000
60 1000
1 1000
 3 10847
26 0010
40 0100
6 1000
60 1000
1 1000
 3 10847
15 0110
50 0100
7 0000
14 1001
1 1000

66 2 5 7 60 25 4 36 46 51
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 d,g,p[11],c[11],x=1<<29,t,i,j,s,n;
  scanf("%d%d",&d,&g);g/=100;
  for(i=1;i<=d;i++){scanf("%d%d",&p[i],&c[i]);c[i]/=100;}
  for(i=0;i<1<<d;i++){
    s=n=0;for(j=1;j<=d;j++)if((1<<(j-1))&i){n+=p[j];s+=j*p[j]+c[j];}
    if(s<g){
      for(j=d;j>0;j--)if(((1<<(j-1))&i)==0){
        if(j*(p[j]-1)>=g-s)n+=(g-s)/j+((g-s)%j!=0);
        else n=1<<29;
        j=0;
      }
    }
    x=n<x?n:x;
  }
  printf("%d",x);
}
```

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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$536870912, -132(%rbp)
	leaq	-136(%rbp), %rdx
	leaq	-140(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -136(%rbp)
	movl	$1, -128(%rbp)
	jmp	.L2
.L3:
	leaq	-64(%rbp), %rdx
	movl	-128(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-112(%rbp), %rcx
	movl	-128(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-128(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
	addl	$1, -128(%rbp)
.L2:
	movl	-140(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jle	.L3
	movl	$0, -128(%rbp)
	jmp	.L4
.L14:
	movl	$0, -116(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -120(%rbp)
	movl	$1, -124(%rbp)
	jmp	.L5
.L7:
	movl	-124(%rbp), %eax
	subl	$1, %eax
	movl	-128(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L6
	movl	-124(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	addl	%eax, -116(%rbp)
	movl	-124(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	imull	-124(%rbp), %eax
	movl	%eax, %edx
	movl	-124(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	addl	%edx, %eax
	addl	%eax, -120(%rbp)
.L6:
	addl	$1, -124(%rbp)
.L5:
	movl	-140(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jle	.L7
	movl	-136(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jge	.L8
	movl	-140(%rbp), %eax
	movl	%eax, -124(%rbp)
	jmp	.L9
.L13:
	movl	-124(%rbp), %eax
	subl	$1, %eax
	movl	-128(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L10
	movl	-124(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	subl	$1, %eax
	imull	-124(%rbp), %eax
	movl	%eax, %edx
	movl	-136(%rbp), %eax
	subl	-120(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	-136(%rbp), %eax
	subl	-120(%rbp), %eax
	cltd
	idivl	-124(%rbp)
	movl	%eax, %ecx
	movl	-136(%rbp), %eax
	subl	-120(%rbp), %eax
	cltd
	idivl	-124(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	setne	%al
	movzbl	%al, %eax
	addl	%ecx, %eax
	addl	%eax, -116(%rbp)
	jmp	.L12
.L11:
	movl	$536870912, -116(%rbp)
.L12:
	movl	$0, -124(%rbp)
.L10:
	subl	$1, -124(%rbp)
.L9:
	cmpl	$0, -124(%rbp)
	jg	.L13
.L8:
	movl	-132(%rbp), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -132(%rbp)
	addl	$1, -128(%rbp)
.L4:
	movl	-140(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -128(%rbp)
	jl	.L14
	movl	-132(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.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	$144, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$536870912, -132(%rbp)
	leaq	-136(%rbp), %rdx
	leaq	-140(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-136(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -136(%rbp)
	movl	$1, -128(%rbp)
	jmp	.L2
.L3:
	leaq	-64(%rbp), %rdx
	movl	-128(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-112(%rbp), %rcx
	movl	-128(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-128(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-128(%rbp), %eax
	cltq
	movl	%edx, -64(%rbp,%rax,4)
	addl	$1, -128(%rbp)
.L2:
	movl	-140(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jle	.L3
	movl	$0, -128(%rbp)
	jmp	.L4
.L14:
	movl	$0, -116(%rbp)
	movl	-116(%rbp), %eax
	movl	%eax, -120(%rbp)
	movl	$1, -124(%rbp)
	jmp	.L5
.L7:
	movl	-124(%rbp), %eax
	subl	$1, %eax
	movl	-128(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L6
	movl	-124(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	addl	%eax, -116(%rbp)
	movl	-124(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	imull	-124(%rbp), %eax
	movl	%eax, %edx
	movl	-124(%rbp), %eax
	cltq
	movl	-64(%rbp,%rax,4), %eax
	addl	%edx, %eax
	addl	%eax, -120(%rbp)
.L6:
	addl	$1, -124(%rbp)
.L5:
	movl	-140(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jle	.L7
	movl	-136(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jge	.L8
	movl	-140(%rbp), %eax
	movl	%eax, -124(%rbp)
	jmp	.L9
.L13:
	movl	-124(%rbp), %eax
	subl	$1, %eax
	movl	-128(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L10
	movl	-124(%rbp), %eax
	cltq
	movl	-112(%rbp,%rax,4), %eax
	subl	$1, %eax
	imull	-124(%rbp), %eax
	movl	%eax, %edx
	movl	-136(%rbp), %eax
	subl	-120(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L11
	movl	-136(%rbp), %eax
	subl	-120(%rbp), %eax
	cltd
	idivl	-124(%rbp)
	movl	%eax, %ecx
	movl	-136(%rbp), %eax
	subl	-120(%rbp), %eax
	cltd
	idivl	-124(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	setne	%al
	movzbl	%al, %eax
	addl	%ecx, %eax
	addl	%eax, -116(%rbp)
	jmp	.L12
.L11:
	movl	$536870912, -116(%rbp)
.L12:
	movl	$0, -124(%rbp)
.L10:
	subl	$1, -124(%rbp)
.L9:
	cmpl	$0, -124(%rbp)
	jg	.L13
.L8:
	movl	-132(%rbp), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -132(%rbp)
	addl	$1, -128(%rbp)
.L4:
	movl	-140(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -128(%rbp)
	jl	.L14
	movl	-132(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
