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

double shop(int n,int i){
	const int tanka[3] = {380,550,850};
	const int per[3] = {5,4,3};
	const double wari[3] = {0.8,0.85,0.88};
	return tanka[i] * (n - n % per[i]) * wari[i] + (double)tanka[i] * (n % per[i]);
}
int main(void){
	int i, j, k, n;
	int const wei[3] = {200,300,500};
	double kingaku, *dp;
	scanf("%d",&n);
	n /= 100;
	while(n != 0){
		dp = (double *)malloc(sizeof(double) * (n + 1));
		for(i = 0;i <= n;i++)
			*(dp + i) = 0x7FFFFFFF;
		*dp = 0;
		for(i = 0;i < 3;i++){
			for(j = n;j >= 0;j--){
				if(*(dp + j) != 0x7FFFFFFF){
					for(k = 0;wei[i] * k + j * 100 <= n * 100;k++){
						kingaku = shop(k,i) + dp[j];
						if(kingaku < dp[(wei[i] * k) / 100 + j])
							dp[(wei[i] * k) / 100 + j] = kingaku;
					}
				}
			}
		}
		printf("%d\n",(int)dp[n]);
		scanf("%d",&n);
		n /= 100;
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	shop
	.type	shop, @function
shop:
.LFB6:
	.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
	movl	%edi, -68(%rbp)
	movl	%esi, -72(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$380, -56(%rbp)
	movl	$550, -52(%rbp)
	movl	$850, -48(%rbp)
	movl	$5, -44(%rbp)
	movl	$4, -40(%rbp)
	movl	$3, -36(%rbp)
	movsd	.LC0(%rip), %xmm0
	movsd	%xmm0, -32(%rbp)
	movsd	.LC1(%rip), %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-72(%rbp), %eax
	cltq
	movl	-56(%rbp,%rax,4), %ecx
	movl	-72(%rbp), %eax
	cltq
	movl	-44(%rbp,%rax,4), %esi
	movl	-68(%rbp), %eax
	cltd
	idivl	%esi
	movl	-68(%rbp), %eax
	subl	%edx, %eax
	imull	%ecx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movl	-72(%rbp), %eax
	cltq
	movsd	-32(%rbp,%rax,8), %xmm0
	mulsd	%xmm0, %xmm1
	movl	-72(%rbp), %eax
	cltq
	movl	-56(%rbp,%rax,4), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movl	-72(%rbp), %eax
	cltq
	movl	-44(%rbp,%rax,4), %ecx
	movl	-68(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	shop, .-shop
	.section	.rodata
.LC3:
	.string	"%d"
.LC6:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$200, -20(%rbp)
	movl	$300, -16(%rbp)
	movl	$500, -12(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%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, -56(%rbp)
	jmp	.L5
.L18:
	movl	-56(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L6
.L7:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	.LC4(%rip), %xmm0
	movsd	%xmm0, (%rax)
	addl	$1, -52(%rbp)
.L6:
	movl	-56(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jle	.L7
	movq	-40(%rbp), %rax
	pxor	%xmm0, %xmm0
	movsd	%xmm0, (%rax)
	movl	$0, -52(%rbp)
	jmp	.L8
.L17:
	movl	-56(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L9
.L16:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm0
	ucomisd	.LC4(%rip), %xmm0
	jp	.L21
	ucomisd	.LC4(%rip), %xmm0
	je	.L10
.L21:
	movl	$0, -44(%rbp)
	jmp	.L12
.L15:
	movl	-52(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	shop
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movl	-20(%rbp,%rax,4), %eax
	imull	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm0
	comisd	-32(%rbp), %xmm0
	jbe	.L13
	movl	-52(%rbp), %eax
	cltq
	movl	-20(%rbp,%rax,4), %eax
	imull	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	-32(%rbp), %xmm0
	movsd	%xmm0, (%rax)
.L13:
	addl	$1, -44(%rbp)
.L12:
	movl	-52(%rbp), %eax
	cltq
	movl	-20(%rbp,%rax,4), %eax
	imull	-44(%rbp), %eax
	movl	%eax, %edx
	movl	-48(%rbp), %eax
	imull	$100, %eax, %eax
	addl	%eax, %edx
	movl	-56(%rbp), %eax
	imull	$100, %eax, %eax
	cmpl	%eax, %edx
	jle	.L15
.L10:
	subl	$1, -48(%rbp)
.L9:
	cmpl	$0, -48(%rbp)
	jns	.L16
	addl	$1, -52(%rbp)
.L8:
	cmpl	$2, -52(%rbp)
	jle	.L17
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%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, -56(%rbp)
.L5:
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	-1717986918
	.long	1072273817
	.align 8
.LC1:
	.long	858993459
	.long	1072378675
	.align 8
.LC2:
	.long	-1030792151
	.long	1072441589
	.align 8
.LC4:
	.long	-4194304
	.long	1105199103
	.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	shop
	.type	shop, @function
shop:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	pxor	%xmm1, %xmm1
	pxor	%xmm2, %xmm2
	movslq	%esi, %rsi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	.LC0(%rip), %rax
	movl	$3, 24(%rsp)
	movl	$850, 8(%rsp)
	movapd	.LC2(%rip), %xmm0
	movq	%rax, (%rsp)
	movq	.LC1(%rip), %rax
	movl	(%rsp,%rsi,4), %ecx
	movaps	%xmm0, 32(%rsp)
	pxor	%xmm0, %xmm0
	movq	%rax, 16(%rsp)
	movq	.LC3(%rip), %rax
	cvtsi2sdl	%ecx, %xmm1
	movq	%rax, 48(%rsp)
	movl	%edi, %eax
	cltd
	idivl	16(%rsp,%rsi,4)
	cvtsi2sdl	%edx, %xmm2
	subl	%edx, %edi
	imull	%ecx, %edi
	mulsd	%xmm2, %xmm1
	cvtsi2sdl	%edi, %xmm0
	mulsd	32(%rsp,%rsi,8), %xmm0
	addsd	%xmm1, %xmm0
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	shop, .-shop
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC5:
	.string	"%d"
.LC9:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	movq	.LC4(%rip), %rax
	movl	$500, 56(%rsp)
	movq	%rax, 48(%rsp)
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	movq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L36:
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rdi
	call	__isoc99_scanf@PLT
	movslq	44(%rsp), %rbx
	movq	%rbx, %rax
	imulq	$1374389535, %rbx, %rbx
	sarl	$31, %eax
	sarq	$37, %rbx
	subl	%eax, %ebx
	movl	%ebx, 44(%rsp)
	je	.L38
	leal	1(%rbx), %ebp
	movslq	%ebp, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
	call	malloc@PLT
	testl	%ebx, %ebx
	movapd	.LC6(%rip), %xmm10
	movapd	.LC2(%rip), %xmm8
	movq	%rax, %r9
	js	.L8
	movl	%ebp, %edx
	shrl	%edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%rax,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movups	%xmm10, (%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L9
	movsd	.LC8(%rip), %xmm9
	movl	%ebp, %eax
	andl	$-2, %eax
	andl	$1, %ebp
	je	.L12
	cltq
	movsd	%xmm9, (%r9,%rax,8)
.L12:
	movq	$0x000000000, (%r9)
	leaq	76(%rsp), %rax
	movq	.LC0(%rip), %xmm7
	leaq	64(%rsp), %rbp
	movq	%rax, (%rsp)
	movslq	%ebx, %rax
	imull	$100, %ebx, %r14d
	movq	.LC1(%rip), %xmm6
	movq	%rax, 8(%rsp)
	leaq	80(%rsp), %r10
	leaq	96(%rsp), %r13
	movsd	.LC3(%rip), %xmm5
	leaq	48(%rsp), %r15
.L11:
	movq	8(%rsp), %rdi
	movl	%r14d, %r11d
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L13:
	subq	$1, %rdi
	subl	$100, %r11d
	testl	%edi, %edi
	js	.L39
.L18:
	movsd	(%r9,%rdi,8), %xmm0
	movl	%edi, %r8d
	ucomisd	%xmm9, %xmm0
	jp	.L22
	je	.L13
.L22:
	movl	(%r15), %ebx
	movapd	%xmm0, %xmm3
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L40:
	movslq	%ecx, %rax
	movl	%ecx, %edx
	movsd	(%r9,%rdi,8), %xmm0
	imulq	$1374389535, %rax, %rax
	sarl	$31, %edx
	sarq	$37, %rax
	subl	%edx, %eax
	addl	%r8d, %eax
	cltq
	movsd	(%r9,%rax,8), %xmm3
.L17:
	movl	$3, 88(%rsp)
	movl	%esi, %eax
	pxor	%xmm2, %xmm2
	pxor	%xmm4, %xmm4
	cltd
	movq	%xmm6, 80(%rsp)
	pxor	%xmm1, %xmm1
	movl	$850, 72(%rsp)
	idivl	(%r10)
	movq	%xmm7, 64(%rsp)
	movl	0(%rbp), %r12d
	movaps	%xmm8, 96(%rsp)
	movsd	%xmm5, 112(%rsp)
	movl	%esi, %eax
	cvtsi2sdl	%r12d, %xmm4
	subl	%edx, %eax
	cvtsi2sdl	%edx, %xmm2
	imull	%r12d, %eax
	mulsd	%xmm4, %xmm2
	cvtsi2sdl	%eax, %xmm1
	mulsd	0(%r13), %xmm1
	addsd	%xmm2, %xmm1
	addsd	%xmm1, %xmm0
	comisd	%xmm0, %xmm3
	jbe	.L15
	movslq	%ecx, %rax
	movl	%ecx, %edx
	imulq	$1374389535, %rax, %rax
	sarl	$31, %edx
	sarq	$37, %rax
	subl	%edx, %eax
	addl	%r8d, %eax
	cltq
	movsd	%xmm0, (%r9,%rax,8)
.L15:
	addl	%ebx, %ecx
	addl	$1, %esi
	leal	(%rcx,%r11), %eax
	cmpl	%r14d, %eax
	jle	.L40
	subq	$1, %rdi
	subl	$100, %r11d
	testl	%edi, %edi
	jns	.L18
.L39:
	addq	$4, %rbp
	addq	$4, %r10
	addq	$8, %r13
	addq	$4, %r15
	cmpq	(%rsp), %rbp
	jne	.L11
.L19:
	movq	16(%rsp), %rax
	leaq	.LC9(%rip), %rsi
	movl	$1, %edi
	cvttsd2sil	-8(%r9,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rsi
	jmp	.L36
.L38:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$136, %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
.L8:
	.cfi_restore_state
	movq	$0x000000000, (%rax)
	jmp	.L19
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	380
	.long	550
	.align 8
.LC1:
	.long	5
	.long	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	-1717986918
	.long	1072273817
	.long	858993459
	.long	1072378675
	.section	.rodata.cst8
	.align 8
.LC3:
	.long	-1030792151
	.long	1072441589
	.align 8
.LC4:
	.long	200
	.long	300
	.section	.rodata.cst16
	.align 16
.LC6:
	.long	-4194304
	.long	1105199103
	.long	-4194304
	.long	1105199103
	.set	.LC8,.LC6
	.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	shop
	.type	shop, @function
shop:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$72, %rsp
	.cfi_def_cfa_offset 80
	pxor	%xmm1, %xmm1
	pxor	%xmm2, %xmm2
	movslq	%esi, %rsi
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	movq	.LC0(%rip), %rax
	movl	$3, 24(%rsp)
	movl	$850, 8(%rsp)
	movapd	.LC2(%rip), %xmm0
	movq	%rax, (%rsp)
	movq	.LC1(%rip), %rax
	movl	(%rsp,%rsi,4), %ecx
	movaps	%xmm0, 32(%rsp)
	pxor	%xmm0, %xmm0
	movq	%rax, 16(%rsp)
	movq	.LC3(%rip), %rax
	cvtsi2sdl	%ecx, %xmm1
	movq	%rax, 48(%rsp)
	movl	%edi, %eax
	cltd
	idivl	16(%rsp,%rsi,4)
	cvtsi2sdl	%edx, %xmm2
	subl	%edx, %edi
	imull	%ecx, %edi
	mulsd	%xmm2, %xmm1
	cvtsi2sdl	%edi, %xmm0
	mulsd	32(%rsp,%rsi,8), %xmm0
	addsd	%xmm1, %xmm0
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	shop, .-shop
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC5:
	.string	"%d"
.LC9:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	movq	.LC4(%rip), %rax
	movl	$500, 56(%rsp)
	movq	%rax, 48(%rsp)
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	movq	%rax, %rsi
	.p2align 4,,10
	.p2align 3
.L36:
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rdi
	call	__isoc99_scanf@PLT
	movslq	44(%rsp), %rbx
	movq	%rbx, %rax
	imulq	$1374389535, %rbx, %rbx
	sarl	$31, %eax
	sarq	$37, %rbx
	subl	%eax, %ebx
	movl	%ebx, 44(%rsp)
	je	.L38
	leal	1(%rbx), %ebp
	movslq	%ebp, %rax
	salq	$3, %rax
	movq	%rax, %rdi
	movq	%rax, 16(%rsp)
	call	malloc@PLT
	testl	%ebx, %ebx
	movapd	.LC6(%rip), %xmm10
	movapd	.LC2(%rip), %xmm8
	movq	%rax, %r9
	js	.L8
	movl	%ebp, %edx
	shrl	%edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%rax,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movups	%xmm10, (%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L9
	movsd	.LC8(%rip), %xmm9
	movl	%ebp, %eax
	andl	$-2, %eax
	andl	$1, %ebp
	je	.L12
	cltq
	movsd	%xmm9, (%r9,%rax,8)
.L12:
	movq	$0x000000000, (%r9)
	leaq	76(%rsp), %rax
	movq	.LC0(%rip), %xmm7
	leaq	64(%rsp), %rbp
	movq	%rax, (%rsp)
	movslq	%ebx, %rax
	imull	$100, %ebx, %r14d
	movq	.LC1(%rip), %xmm6
	movq	%rax, 8(%rsp)
	leaq	80(%rsp), %r10
	leaq	96(%rsp), %r13
	movsd	.LC3(%rip), %xmm5
	leaq	48(%rsp), %r15
.L11:
	movq	8(%rsp), %rdi
	movl	%r14d, %r11d
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L13:
	subq	$1, %rdi
	subl	$100, %r11d
	testl	%edi, %edi
	js	.L39
.L18:
	movsd	(%r9,%rdi,8), %xmm0
	movl	%edi, %r8d
	ucomisd	%xmm9, %xmm0
	jp	.L22
	je	.L13
.L22:
	movl	(%r15), %ebx
	movapd	%xmm0, %xmm3
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L40:
	movslq	%ecx, %rax
	movl	%ecx, %edx
	movsd	(%r9,%rdi,8), %xmm0
	imulq	$1374389535, %rax, %rax
	sarl	$31, %edx
	sarq	$37, %rax
	subl	%edx, %eax
	addl	%r8d, %eax
	cltq
	movsd	(%r9,%rax,8), %xmm3
.L17:
	movl	$3, 88(%rsp)
	movl	%esi, %eax
	pxor	%xmm2, %xmm2
	pxor	%xmm4, %xmm4
	cltd
	movq	%xmm6, 80(%rsp)
	pxor	%xmm1, %xmm1
	movl	$850, 72(%rsp)
	idivl	(%r10)
	movq	%xmm7, 64(%rsp)
	movl	0(%rbp), %r12d
	movaps	%xmm8, 96(%rsp)
	movsd	%xmm5, 112(%rsp)
	movl	%esi, %eax
	cvtsi2sdl	%r12d, %xmm4
	subl	%edx, %eax
	cvtsi2sdl	%edx, %xmm2
	imull	%r12d, %eax
	mulsd	%xmm4, %xmm2
	cvtsi2sdl	%eax, %xmm1
	mulsd	0(%r13), %xmm1
	addsd	%xmm2, %xmm1
	addsd	%xmm1, %xmm0
	comisd	%xmm0, %xmm3
	jbe	.L15
	movslq	%ecx, %rax
	movl	%ecx, %edx
	imulq	$1374389535, %rax, %rax
	sarl	$31, %edx
	sarq	$37, %rax
	subl	%edx, %eax
	addl	%r8d, %eax
	cltq
	movsd	%xmm0, (%r9,%rax,8)
.L15:
	addl	%ebx, %ecx
	addl	$1, %esi
	leal	(%rcx,%r11), %eax
	cmpl	%r14d, %eax
	jle	.L40
	subq	$1, %rdi
	subl	$100, %r11d
	testl	%edi, %edi
	jns	.L18
.L39:
	addq	$4, %rbp
	addq	$4, %r10
	addq	$8, %r13
	addq	$4, %r15
	cmpq	(%rsp), %rbp
	jne	.L11
.L19:
	movq	16(%rsp), %rax
	leaq	.LC9(%rip), %rsi
	movl	$1, %edi
	cvttsd2sil	-8(%r9,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	24(%rsp), %rsi
	jmp	.L36
.L38:
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$136, %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
.L8:
	.cfi_restore_state
	movq	$0x000000000, (%rax)
	jmp	.L19
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	380
	.long	550
	.align 8
.LC1:
	.long	5
	.long	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	-1717986918
	.long	1072273817
	.long	858993459
	.long	1072378675
	.section	.rodata.cst8
	.align 8
.LC3:
	.long	-1030792151
	.long	1072441589
	.align 8
.LC4:
	.long	200
	.long	300
	.section	.rodata.cst16
	.align 16
.LC6:
	.long	-4194304
	.long	1105199103
	.long	-4194304
	.long	1105199103
	.set	.LC8,.LC6
	.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 <stdlib.h>
#include <string.h>

double shop(int n,int i){
	const int tanka[3] = {380,550,850};
	const int per[3] = {5,4,3};
	const double wari[3] = {0.8,0.85,0.88};
	return tanka[i] * (n - n % per[i]) * wari[i] + (double)tanka[i] * (n % per[i]);
}
int main(void){
	int i, j, k, n;
	int const wei[3] = {200,300,500};
	double kingaku, *dp;
	scanf("%d",&n);
	n /= 100;
	while(n != 0){
		dp = (double *)malloc(sizeof(double) * (n + 1));
		for(i = 0;i <= n;i++)
			*(dp + i) = 0x7FFFFFFF;
		*dp = 0;
		for(i = 0;i < 3;i++){
			for(j = n;j >= 0;j--){
				if(*(dp + j) != 0x7FFFFFFF){
					for(k = 0;wei[i] * k + j * 100 <= n * 100;k++){
						kingaku = shop(k,i) + dp[j];
						if(kingaku < dp[(wei[i] * k) / 100 + j])
							dp[(wei[i] * k) / 100 + j] = kingaku;
					}
				}
			}
		}
		printf("%d\n",(int)dp[n]);
		scanf("%d",&n);
		n /= 100;
	}
	return 0;
}
500
1000
0
 500
0000
0
 500
1100
0
 500
0000
1
 500
0000
2
 500
0000
-1
 500
0000
4
 500
0000
8
 500
0000
-2
 500
0000
3

850
1520
 850
 850
1950
 850
 850
 850
 850
 850
 850
 850

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

double shop(int n,int i){
	const int tanka[3] = {380,550,850};
	const int per[3] = {5,4,3};
	const double wari[3] = {0.8,0.85,0.88};
	return tanka[i] * (n - n % per[i]) * wari[i] + (double)tanka[i] * (n % per[i]);
}
int main(void){
	int i, j, k, n;
	int const wei[3] = {200,300,500};
	double kingaku, *dp;
	scanf("%d",&n);
	n /= 100;
	while(n != 0){
		dp = (double *)malloc(sizeof(double) * (n + 1));
		for(i = 0;i <= n;i++)
			*(dp + i) = 0x7FFFFFFF;
		*dp = 0;
		for(i = 0;i < 3;i++){
			for(j = n;j >= 0;j--){
				if(*(dp + j) != 0x7FFFFFFF){
					for(k = 0;wei[i] * k + j * 100 <= n * 100;k++){
						kingaku = shop(k,i) + dp[j];
						if(kingaku < dp[(wei[i] * k) / 100 + j])
							dp[(wei[i] * k) / 100 + j] = kingaku;
					}
				}
			}
		}
		printf("%d\n",(int)dp[n]);
		scanf("%d",&n);
		n /= 100;
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	shop
	.type	shop, @function
shop:
.LFB6:
	.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
	movl	%edi, -68(%rbp)
	movl	%esi, -72(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$380, -56(%rbp)
	movl	$550, -52(%rbp)
	movl	$850, -48(%rbp)
	movl	$5, -44(%rbp)
	movl	$4, -40(%rbp)
	movl	$3, -36(%rbp)
	movsd	.LC0(%rip), %xmm0
	movsd	%xmm0, -32(%rbp)
	movsd	.LC1(%rip), %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-72(%rbp), %eax
	cltq
	movl	-56(%rbp,%rax,4), %ecx
	movl	-72(%rbp), %eax
	cltq
	movl	-44(%rbp,%rax,4), %esi
	movl	-68(%rbp), %eax
	cltd
	idivl	%esi
	movl	-68(%rbp), %eax
	subl	%edx, %eax
	imull	%ecx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movl	-72(%rbp), %eax
	cltq
	movsd	-32(%rbp,%rax,8), %xmm0
	mulsd	%xmm0, %xmm1
	movl	-72(%rbp), %eax
	cltq
	movl	-56(%rbp,%rax,4), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movl	-72(%rbp), %eax
	cltq
	movl	-44(%rbp,%rax,4), %ecx
	movl	-68(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	shop, .-shop
	.section	.rodata
.LC3:
	.string	"%d"
.LC6:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$200, -20(%rbp)
	movl	$300, -16(%rbp)
	movl	$500, -12(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%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, -56(%rbp)
	jmp	.L5
.L18:
	movl	-56(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L6
.L7:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	.LC4(%rip), %xmm0
	movsd	%xmm0, (%rax)
	addl	$1, -52(%rbp)
.L6:
	movl	-56(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jle	.L7
	movq	-40(%rbp), %rax
	pxor	%xmm0, %xmm0
	movsd	%xmm0, (%rax)
	movl	$0, -52(%rbp)
	jmp	.L8
.L17:
	movl	-56(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L9
.L16:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm0
	ucomisd	.LC4(%rip), %xmm0
	jp	.L21
	ucomisd	.LC4(%rip), %xmm0
	je	.L10
.L21:
	movl	$0, -44(%rbp)
	jmp	.L12
.L15:
	movl	-52(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	shop
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movl	-20(%rbp,%rax,4), %eax
	imull	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm0
	comisd	-32(%rbp), %xmm0
	jbe	.L13
	movl	-52(%rbp), %eax
	cltq
	movl	-20(%rbp,%rax,4), %eax
	imull	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	-32(%rbp), %xmm0
	movsd	%xmm0, (%rax)
.L13:
	addl	$1, -44(%rbp)
.L12:
	movl	-52(%rbp), %eax
	cltq
	movl	-20(%rbp,%rax,4), %eax
	imull	-44(%rbp), %eax
	movl	%eax, %edx
	movl	-48(%rbp), %eax
	imull	$100, %eax, %eax
	addl	%eax, %edx
	movl	-56(%rbp), %eax
	imull	$100, %eax, %eax
	cmpl	%eax, %edx
	jle	.L15
.L10:
	subl	$1, -48(%rbp)
.L9:
	cmpl	$0, -48(%rbp)
	jns	.L16
	addl	$1, -52(%rbp)
.L8:
	cmpl	$2, -52(%rbp)
	jle	.L17
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%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, -56(%rbp)
.L5:
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	-1717986918
	.long	1072273817
	.align 8
.LC1:
	.long	858993459
	.long	1072378675
	.align 8
.LC2:
	.long	-1030792151
	.long	1072441589
	.align 8
.LC4:
	.long	-4194304
	.long	1105199103
	.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	shop
	.type	shop, @function
shop:
.LFB6:
	.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
	movl	%edi, -68(%rbp)
	movl	%esi, -72(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$380, -56(%rbp)
	movl	$550, -52(%rbp)
	movl	$850, -48(%rbp)
	movl	$5, -44(%rbp)
	movl	$4, -40(%rbp)
	movl	$3, -36(%rbp)
	movsd	.LC0(%rip), %xmm0
	movsd	%xmm0, -32(%rbp)
	movsd	.LC1(%rip), %xmm0
	movsd	%xmm0, -24(%rbp)
	movsd	.LC2(%rip), %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	-72(%rbp), %eax
	cltq
	movl	-56(%rbp,%rax,4), %ecx
	movl	-72(%rbp), %eax
	cltq
	movl	-44(%rbp,%rax,4), %esi
	movl	-68(%rbp), %eax
	cltd
	idivl	%esi
	movl	-68(%rbp), %eax
	subl	%edx, %eax
	imull	%ecx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movl	-72(%rbp), %eax
	cltq
	movsd	-32(%rbp,%rax,8), %xmm0
	mulsd	%xmm0, %xmm1
	movl	-72(%rbp), %eax
	cltq
	movl	-56(%rbp,%rax,4), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movl	-72(%rbp), %eax
	cltq
	movl	-44(%rbp,%rax,4), %ecx
	movl	-68(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	movq	%rax, %xmm0
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	shop, .-shop
	.section	.rodata
.LC3:
	.string	"%d"
.LC6:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$200, -20(%rbp)
	movl	$300, -16(%rbp)
	movl	$500, -12(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%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, -56(%rbp)
	jmp	.L5
.L18:
	movl	-56(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L6
.L7:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	.LC4(%rip), %xmm0
	movsd	%xmm0, (%rax)
	addl	$1, -52(%rbp)
.L6:
	movl	-56(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jle	.L7
	movq	-40(%rbp), %rax
	pxor	%xmm0, %xmm0
	movsd	%xmm0, (%rax)
	movl	$0, -52(%rbp)
	jmp	.L8
.L17:
	movl	-56(%rbp), %eax
	movl	%eax, -48(%rbp)
	jmp	.L9
.L16:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm0
	ucomisd	.LC4(%rip), %xmm0
	jp	.L21
	ucomisd	.LC4(%rip), %xmm0
	je	.L10
.L21:
	movl	$0, -44(%rbp)
	jmp	.L12
.L15:
	movl	-52(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	shop
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -32(%rbp)
	movl	-52(%rbp), %eax
	cltq
	movl	-20(%rbp,%rax,4), %eax
	imull	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm0
	comisd	-32(%rbp), %xmm0
	jbe	.L13
	movl	-52(%rbp), %eax
	cltq
	movl	-20(%rbp,%rax,4), %eax
	imull	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-48(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	-32(%rbp), %xmm0
	movsd	%xmm0, (%rax)
.L13:
	addl	$1, -44(%rbp)
.L12:
	movl	-52(%rbp), %eax
	cltq
	movl	-20(%rbp,%rax,4), %eax
	imull	-44(%rbp), %eax
	movl	%eax, %edx
	movl	-48(%rbp), %eax
	imull	$100, %eax, %eax
	addl	%eax, %edx
	movl	-56(%rbp), %eax
	imull	$100, %eax, %eax
	cmpl	%eax, %edx
	jle	.L15
.L10:
	subl	$1, -48(%rbp)
.L9:
	cmpl	$0, -48(%rbp)
	jns	.L16
	addl	$1, -52(%rbp)
.L8:
	cmpl	$2, -52(%rbp)
	jle	.L17
	movl	-56(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movsd	(%rax), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, %esi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-56(%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, -56(%rbp)
.L5:
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	-1717986918
	.long	1072273817
	.align 8
.LC1:
	.long	858993459
	.long	1072378675
	.align 8
.LC2:
	.long	-1030792151
	.long	1072441589
	.align 8
.LC4:
	.long	-4194304
	.long	1105199103
	.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:
