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	D, G;
int	p[11] = {0};
int	c[11] = {0};

void	culc_min(int state[11], int score, int *num, int temp)
{
	int	i, j;
	int	now_score;
	int	now_num;

	if (score >= G)
	{
		if (temp < *num)
		{
			*num = temp;
		}
		return ;
	}
	for (i = 0; i < D; i++)
	{
		if (state[i] == 1)
			continue ;
		state[i]++;
		now_score = score;
		now_num = temp;
		for (j = 0; j < p[i] - 1; j++)
		{
			now_score += (i + 1) * 100;
			now_num++;
			if (now_score >= G)
			{
				culc_min(state, now_score, num, now_num);
			}
		}
		now_score += (i + 1) * 100 + c[i];
		now_num++;
		culc_min(state, now_score, num, now_num);
		state[i]--;
	}
}

int		main(void)
{
	int	state[11] = {0};
	int	score = 0;
	int	num = 10000;
	int	i;

	//入力
	scanf("%d%d", &D, &G);
	for (i = 0; i < D; i++)
	{
		scanf("%d%d", &p[i], &c[i]);
	}
	//処理
	culc_min(state, score, &num, 0);
	printf("%d\n", num);
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	D
	.bss
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	G
	.align 4
	.type	G, @object
	.size	G, 4
G:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 44
p:
	.zero	44
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 44
c:
	.zero	44
	.text
	.globl	culc_min
	.type	culc_min, @function
culc_min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	movl	%ecx, -32(%rbp)
	movl	G(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L2
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jge	.L12
	movq	-40(%rbp), %rax
	movl	-32(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L12
.L2:
	movl	$0, -16(%rbp)
	jmp	.L5
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	je	.L13
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	addl	$1, %eax
	imull	$100, %eax, %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
	movl	G(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L9
	movl	-4(%rbp), %ecx
	movq	-40(%rbp), %rdx
	movl	-8(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	culc_min
.L9:
	addl	$1, -12(%rbp)
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L10
	movl	-16(%rbp), %eax
	addl	$1, %eax
	imull	$100, %eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
	movl	-4(%rbp), %ecx
	movq	-40(%rbp), %rdx
	movl	-8(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	culc_min
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	jmp	.L7
.L13:
	nop
.L7:
	addl	$1, -16(%rbp)
.L5:
	movl	D(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	culc_min, .-culc_min
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -68(%rbp)
	movl	$10000, -76(%rbp)
	leaq	G(%rip), %rax
	movq	%rax, %rdx
	leaq	D(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -72(%rbp)
	jmp	.L15
.L16:
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	addq	%rax, %rdx
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -72(%rbp)
.L15:
	movl	D(%rip), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L16
	leaq	-76(%rbp), %rdx
	movl	-68(%rbp), %esi
	leaq	-64(%rbp), %rax
	movl	$0, %ecx
	movq	%rax, %rdi
	call	culc_min
	movl	-76(%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	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.type	culc_min.part.0, @function
culc_min.part.0:
.LFB25:
	.cfi_startproc
	movq	%rdx, %r9
	movl	D(%rip), %edx
	testl	%edx, %edx
	jle	.L19
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	c(%rip), %r8
	leaq	p(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%ecx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$100, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L2:
	movl	(%r12,%rbx,4), %eax
	cmpl	$1, %eax
	jne	.L23
.L3:
	addq	$1, %rbx
	addl	$100, %ebp
	cmpl	%ebx, %edx
	jg	.L2
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L23:
	.cfi_restore_state
	addl	$1, %eax
	movl	%eax, (%r12,%rbx,4)
	movl	(%r15,%rbx,4), %r10d
	movl	G(%rip), %r11d
	cmpl	$1, %r10d
	jle	.L4
	leal	1(%r13), %eax
	movl	%r14d, %edi
.L6:
	addl	%ebp, %edi
	movl	%eax, %ecx
	cmpl	%r11d, %edi
	jge	.L24
.L5:
	addl	$1, %eax
	leal	-1(%r10), %esi
	movl	%eax, %edx
	subl	%r13d, %edx
	subl	$1, %edx
	cmpl	%edx, %esi
	jg	.L6
.L7:
	movl	(%r8,%rbx,4), %esi
	addl	$1, %ecx
	addl	%ebp, %esi
	addl	%edi, %esi
	cmpl	%r11d, %esi
	jge	.L25
	movq	%r9, %rdx
	movq	%r12, %rdi
	movq	%r9, 8(%rsp)
	call	culc_min.part.0
	movq	8(%rsp), %r9
	leaq	c(%rip), %r8
.L9:
	subl	$1, (%r12,%rbx,4)
	movl	D(%rip), %edx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L24:
	cmpl	(%r9), %eax
	jge	.L5
	movl	%eax, (%r9)
	movl	(%r15,%rbx,4), %r10d
	movl	G(%rip), %r11d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L25:
	cmpl	(%r9), %ecx
	jge	.L9
	movl	%ecx, (%r9)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%r13d, %ecx
	movl	%r14d, %edi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE25:
	.size	culc_min.part.0, .-culc_min.part.0
	.p2align 4
	.globl	culc_min
	.type	culc_min, @function
culc_min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, G(%rip)
	jle	.L29
	jmp	culc_min.part.0
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	%ecx, (%rdx)
	jle	.L26
	movl	%ecx, (%rdx)
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	ret
	.cfi_endproc
.LFE23:
	.size	culc_min, .-culc_min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pxor	%xmm0, %xmm0
	leaq	G(%rip), %rdx
	leaq	D(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	leaq	c(%rip), %r13
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	leaq	p(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$88, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	movl	$0, 56(%rsp)
	movq	$0, 48(%rsp)
	movl	$10000, 12(%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	call	__isoc99_scanf@PLT
	movl	D(%rip), %edx
	testl	%edx, %edx
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L34:
	leaq	0(%r13,%rbx,4), %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, D(%rip)
	jg	.L34
.L35:
	movl	G(%rip), %eax
	testl	%eax, %eax
	jle	.L43
	leaq	12(%rsp), %rdx
	leaq	16(%rsp), %rdi
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	call	culc_min.part.0
.L36:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$88, %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
.L43:
	.cfi_restore_state
	cmpl	$0, 12(%rsp)
	jle	.L36
	movl	$0, 12(%rsp)
	jmp	.L36
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 44
c:
	.zero	44
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 44
p:
	.zero	44
	.globl	G
	.align 4
	.type	G, @object
	.size	G, 4
G:
	.zero	4
	.globl	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.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
	.type	culc_min.part.0, @function
culc_min.part.0:
.LFB25:
	.cfi_startproc
	movq	%rdx, %r9
	movl	D(%rip), %edx
	testl	%edx, %edx
	jle	.L19
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	c(%rip), %r8
	leaq	p(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%ecx, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$100, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
.L2:
	movl	(%r12,%rbx,4), %eax
	cmpl	$1, %eax
	jne	.L23
.L3:
	addq	$1, %rbx
	addl	$100, %ebp
	cmpl	%ebx, %edx
	jg	.L2
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L23:
	.cfi_restore_state
	addl	$1, %eax
	movl	%eax, (%r12,%rbx,4)
	movl	(%r15,%rbx,4), %r10d
	movl	G(%rip), %r11d
	cmpl	$1, %r10d
	jle	.L4
	leal	1(%r13), %eax
	movl	%r14d, %edi
.L6:
	addl	%ebp, %edi
	movl	%eax, %ecx
	cmpl	%r11d, %edi
	jge	.L24
.L5:
	addl	$1, %eax
	leal	-1(%r10), %esi
	movl	%eax, %edx
	subl	%r13d, %edx
	subl	$1, %edx
	cmpl	%edx, %esi
	jg	.L6
.L7:
	movl	(%r8,%rbx,4), %esi
	addl	$1, %ecx
	addl	%ebp, %esi
	addl	%edi, %esi
	cmpl	%r11d, %esi
	jge	.L25
	movq	%r9, %rdx
	movq	%r12, %rdi
	movq	%r9, 8(%rsp)
	call	culc_min.part.0
	movq	8(%rsp), %r9
	leaq	c(%rip), %r8
.L9:
	subl	$1, (%r12,%rbx,4)
	movl	D(%rip), %edx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L24:
	cmpl	(%r9), %eax
	jge	.L5
	movl	%eax, (%r9)
	movl	(%r15,%rbx,4), %r10d
	movl	G(%rip), %r11d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L25:
	cmpl	(%r9), %ecx
	jge	.L9
	movl	%ecx, (%r9)
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%r13d, %ecx
	movl	%r14d, %edi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE25:
	.size	culc_min.part.0, .-culc_min.part.0
	.p2align 4
	.globl	culc_min
	.type	culc_min, @function
culc_min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, G(%rip)
	jle	.L29
	jmp	culc_min.part.0
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	%ecx, (%rdx)
	jle	.L26
	movl	%ecx, (%rdx)
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	ret
	.cfi_endproc
.LFE23:
	.size	culc_min, .-culc_min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pxor	%xmm0, %xmm0
	leaq	G(%rip), %rdx
	leaq	D(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	leaq	c(%rip), %r13
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	leaq	p(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$88, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	movl	$0, 56(%rsp)
	movq	$0, 48(%rsp)
	movl	$10000, 12(%rsp)
	movaps	%xmm0, 16(%rsp)
	movaps	%xmm0, 32(%rsp)
	call	__isoc99_scanf@PLT
	movl	D(%rip), %edx
	testl	%edx, %edx
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L34:
	leaq	0(%r13,%rbx,4), %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, D(%rip)
	jg	.L34
.L35:
	movl	G(%rip), %eax
	testl	%eax, %eax
	jle	.L43
	leaq	12(%rsp), %rdx
	leaq	16(%rsp), %rdi
	xorl	%ecx, %ecx
	xorl	%esi, %esi
	call	culc_min.part.0
.L36:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$88, %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
.L43:
	.cfi_restore_state
	cmpl	$0, 12(%rsp)
	jle	.L36
	movl	$0, 12(%rsp)
	jmp	.L36
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	c
	.bss
	.align 32
	.type	c, @object
	.size	c, 44
c:
	.zero	44
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 44
p:
	.zero	44
	.globl	G
	.align 4
	.type	G, @object
	.size	G, 4
G:
	.zero	4
	.globl	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.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	D, G;
int	p[11] = {0};
int	c[11] = {0};

void	culc_min(int state[11], int score, int *num, int temp)
{
	int	i, j;
	int	now_score;
	int	now_num;

	if (score >= G)
	{
		if (temp < *num)
		{
			*num = temp;
		}
		return ;
	}
	for (i = 0; i < D; i++)
	{
		if (state[i] == 1)
			continue ;
		state[i]++;
		now_score = score;
		now_num = temp;
		for (j = 0; j < p[i] - 1; j++)
		{
			now_score += (i + 1) * 100;
			now_num++;
			if (now_score >= G)
			{
				culc_min(state, now_score, num, now_num);
			}
		}
		now_score += (i + 1) * 100 + c[i];
		now_num++;
		culc_min(state, now_score, num, now_num);
		state[i]--;
	}
}

int		main(void)
{
	int	state[11] = {0};
	int	score = 0;
	int	num = 10000;
	int	i;

	//入力
	scanf("%d%d", &D, &G);
	for (i = 0; i < D; i++)
	{
		scanf("%d%d", &p[i], &c[i]);
	}
	//処理
	culc_min(state, score, &num, 0);
	printf("%d\n", num);
	return (0);
}
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
 3
 5
 7
 60
 25
 4
 37
 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	D, G;
int	p[11] = {0};
int	c[11] = {0};

void	culc_min(int state[11], int score, int *num, int temp)
{
	int	i, j;
	int	now_score;
	int	now_num;

	if (score >= G)
	{
		if (temp < *num)
		{
			*num = temp;
		}
		return ;
	}
	for (i = 0; i < D; i++)
	{
		if (state[i] == 1)
			continue ;
		state[i]++;
		now_score = score;
		now_num = temp;
		for (j = 0; j < p[i] - 1; j++)
		{
			now_score += (i + 1) * 100;
			now_num++;
			if (now_score >= G)
			{
				culc_min(state, now_score, num, now_num);
			}
		}
		now_score += (i + 1) * 100 + c[i];
		now_num++;
		culc_min(state, now_score, num, now_num);
		state[i]--;
	}
}

int		main(void)
{
	int	state[11] = {0};
	int	score = 0;
	int	num = 10000;
	int	i;

	//入力
	scanf("%d%d", &D, &G);
	for (i = 0; i < D; i++)
	{
		scanf("%d%d", &p[i], &c[i]);
	}
	//処理
	culc_min(state, score, &num, 0);
	printf("%d\n", num);
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	D
	.bss
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	G
	.align 4
	.type	G, @object
	.size	G, 4
G:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 44
p:
	.zero	44
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 44
c:
	.zero	44
	.text
	.globl	culc_min
	.type	culc_min, @function
culc_min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	movl	%ecx, -32(%rbp)
	movl	G(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L2
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jge	.L12
	movq	-40(%rbp), %rax
	movl	-32(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L12
.L2:
	movl	$0, -16(%rbp)
	jmp	.L5
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	je	.L13
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	addl	$1, %eax
	imull	$100, %eax, %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
	movl	G(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L9
	movl	-4(%rbp), %ecx
	movq	-40(%rbp), %rdx
	movl	-8(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	culc_min
.L9:
	addl	$1, -12(%rbp)
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L10
	movl	-16(%rbp), %eax
	addl	$1, %eax
	imull	$100, %eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
	movl	-4(%rbp), %ecx
	movq	-40(%rbp), %rdx
	movl	-8(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	culc_min
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	jmp	.L7
.L13:
	nop
.L7:
	addl	$1, -16(%rbp)
.L5:
	movl	D(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	culc_min, .-culc_min
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -68(%rbp)
	movl	$10000, -76(%rbp)
	leaq	G(%rip), %rax
	movq	%rax, %rdx
	leaq	D(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -72(%rbp)
	jmp	.L15
.L16:
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	addq	%rax, %rdx
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -72(%rbp)
.L15:
	movl	D(%rip), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L16
	leaq	-76(%rbp), %rdx
	movl	-68(%rbp), %esi
	leaq	-64(%rbp), %rax
	movl	$0, %ecx
	movq	%rax, %rdi
	call	culc_min
	movl	-76(%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	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	D
	.bss
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	G
	.align 4
	.type	G, @object
	.size	G, 4
G:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 44
p:
	.zero	44
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 44
c:
	.zero	44
	.text
	.globl	culc_min
	.type	culc_min, @function
culc_min:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movq	%rdx, -40(%rbp)
	movl	%ecx, -32(%rbp)
	movl	G(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L2
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jge	.L12
	movq	-40(%rbp), %rax
	movl	-32(%rbp), %edx
	movl	%edx, (%rax)
	jmp	.L12
.L2:
	movl	$0, -16(%rbp)
	jmp	.L5
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$1, %eax
	je	.L13
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L8
.L10:
	movl	-16(%rbp), %eax
	addl	$1, %eax
	imull	$100, %eax, %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
	movl	G(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L9
	movl	-4(%rbp), %ecx
	movq	-40(%rbp), %rdx
	movl	-8(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	culc_min
.L9:
	addl	$1, -12(%rbp)
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	cmpl	%eax, -12(%rbp)
	jl	.L10
	movl	-16(%rbp), %eax
	addl	$1, %eax
	imull	$100, %eax, %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
	movl	-4(%rbp), %ecx
	movq	-40(%rbp), %rdx
	movl	-8(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	culc_min
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	subl	$1, %edx
	movl	%edx, (%rax)
	jmp	.L7
.L13:
	nop
.L7:
	addl	$1, -16(%rbp)
.L5:
	movl	D(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	jmp	.L1
.L12:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	culc_min, .-culc_min
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -68(%rbp)
	movl	$10000, -76(%rbp)
	leaq	G(%rip), %rax
	movq	%rax, %rdx
	leaq	D(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -72(%rbp)
	jmp	.L15
.L16:
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	addq	%rax, %rdx
	movl	-72(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -72(%rbp)
.L15:
	movl	D(%rip), %eax
	cmpl	%eax, -72(%rbp)
	jl	.L16
	leaq	-76(%rbp), %rdx
	movl	-68(%rbp), %esi
	leaq	-64(%rbp), %rax
	movl	$0, %ecx
	movq	%rax, %rdi
	call	culc_min
	movl	-76(%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	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
