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 c10, c50, c100, c500;
int a10, a50, a100, a500;
int b_mon;
int a_mon;
int price;

int main(void) 
{
	scanf("%d",&price);

	while (price) {
		scanf("%d %d %d %d", &c10, &c50, &c100, &c500);
		b_mon = c10 * 10 + c50 * 50 + c100 * 100 + c500 * 500;
		a_mon = b_mon - price;

		a500 = a_mon / 500;
		a_mon %= 500;
		a100 = a_mon / 100;
		a_mon %= 100;
		a50 = a_mon / 50;
		a_mon %= 50;
		a10 = a_mon / 10;
		a_mon %= 10;

		if (a10 < c10) {
			printf("10 %d\n",c10 - a10);
		}
		if (a50 < c50) {
			printf("50 %d\n",c50 - a50);
		}
		if (a100 < c100) {
			printf("100 %d\n",c100 - a100);
		}
		if (a500 < c500) {
			printf("500 %d\n",c500 - a500);
		}
		scanf("%d",&price);
if (price) { puts(""); }
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c10
	.bss
	.align 4
	.type	c10, @object
	.size	c10, 4
c10:
	.zero	4
	.globl	c50
	.align 4
	.type	c50, @object
	.size	c50, 4
c50:
	.zero	4
	.globl	c100
	.align 4
	.type	c100, @object
	.size	c100, 4
c100:
	.zero	4
	.globl	c500
	.align 4
	.type	c500, @object
	.size	c500, 4
c500:
	.zero	4
	.globl	a10
	.align 4
	.type	a10, @object
	.size	a10, 4
a10:
	.zero	4
	.globl	a50
	.align 4
	.type	a50, @object
	.size	a50, 4
a50:
	.zero	4
	.globl	a100
	.align 4
	.type	a100, @object
	.size	a100, 4
a100:
	.zero	4
	.globl	a500
	.align 4
	.type	a500, @object
	.size	a500, 4
a500:
	.zero	4
	.globl	b_mon
	.align 4
	.type	b_mon, @object
	.size	b_mon, 4
b_mon:
	.zero	4
	.globl	a_mon
	.align 4
	.type	a_mon, @object
	.size	a_mon, 4
a_mon:
	.zero	4
	.globl	price
	.align 4
	.type	price, @object
	.size	price, 4
price:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"10 %d\n"
.LC3:
	.string	"50 %d\n"
.LC4:
	.string	"100 %d\n"
.LC5:
	.string	"500 %d\n"
.LC6:
	.string	""
	.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
	leaq	price(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L7:
	leaq	c500(%rip), %r8
	leaq	c100(%rip), %rax
	movq	%rax, %rcx
	leaq	c50(%rip), %rax
	movq	%rax, %rdx
	leaq	c10(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	c10(%rip), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	c50(%rip), %eax
	imull	$50, %eax, %eax
	addl	%eax, %edx
	movl	c100(%rip), %eax
	imull	$100, %eax, %eax
	addl	%eax, %edx
	movl	c500(%rip), %eax
	imull	$500, %eax, %eax
	addl	%edx, %eax
	movl	%eax, b_mon(%rip)
	movl	b_mon(%rip), %eax
	movl	price(%rip), %edx
	subl	%edx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a500(%rip)
	movl	a_mon(%rip), %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$500, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %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, a100(%rip)
	movl	a_mon(%rip), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$4, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a50(%rip)
	movl	a_mon(%rip), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$4, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$50, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a10(%rip)
	movl	a_mon(%rip), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	%edx, a_mon(%rip)
	movl	a10(%rip), %edx
	movl	c10(%rip), %eax
	cmpl	%eax, %edx
	jge	.L3
	movl	c10(%rip), %eax
	movl	a10(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L3:
	movl	a50(%rip), %edx
	movl	c50(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	c50(%rip), %eax
	movl	a50(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L4:
	movl	a100(%rip), %edx
	movl	c100(%rip), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	c100(%rip), %eax
	movl	a100(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	a500(%rip), %edx
	movl	c500(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	c500(%rip), %eax
	movl	a500(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	price(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	price(%rip), %eax
	testl	%eax, %eax
	je	.L2
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	movl	price(%rip), %eax
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	popq	%rbp
	.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"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"10 %d\n"
.LC3:
	.string	"50 %d\n"
.LC4:
	.string	"100 %d\n"
.LC5:
	.string	"500 %d\n"
.LC6:
	.string	""
	.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
	xorl	%eax, %eax
	leaq	c100(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	c50(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	c10(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	price(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
.L2:
	movl	price(%rip), %eax
	testl	%eax, %eax
	je	.L9
	leaq	c500(%rip), %r8
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	c50(%rip), %esi
	movl	c10(%rip), %edx
	imull	$50, %esi, %eax
	leal	(%rdx,%rdx,4), %ecx
	leal	(%rax,%rcx,2), %eax
	imull	$100, c100(%rip), %ecx
	addl	%ecx, %eax
	imull	$500, c500(%rip), %ecx
	addl	%ecx, %eax
	movl	%eax, b_mon(%rip)
	subl	price(%rip), %eax
	movslq	%eax, %rcx
	movl	%eax, %edi
	imulq	$274877907, %rcx, %rcx
	sarl	$31, %edi
	sarq	$37, %rcx
	subl	%edi, %ecx
	movl	%ecx, a500(%rip)
	imull	$500, %ecx, %ecx
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movl	%eax, %edi
	imulq	$1374389535, %rcx, %rcx
	sarl	$31, %edi
	sarq	$37, %rcx
	subl	%edi, %ecx
	movl	%ecx, a100(%rip)
	imull	$100, %ecx, %ecx
	subl	%ecx, %eax
	movslq	%eax, %rdi
	movl	%eax, %ecx
	imulq	$1374389535, %rdi, %rdi
	sarl	$31, %ecx
	sarq	$36, %rdi
	subl	%ecx, %edi
	imull	$50, %edi, %ecx
	movl	%edi, a50(%rip)
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movl	%eax, %r8d
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %r8d
	sarq	$34, %rcx
	subl	%r8d, %ecx
	leal	(%rcx,%rcx,4), %r8d
	movl	%ecx, a10(%rip)
	addl	%r8d, %r8d
	subl	%r8d, %eax
	movl	%eax, a_mon(%rip)
	cmpl	%ecx, %edx
	jg	.L14
.L3:
	cmpl	%edi, %esi
	jg	.L15
.L4:
	movl	a100(%rip), %eax
	movl	c100(%rip), %edx
	cmpl	%edx, %eax
	jl	.L16
.L5:
	movl	a500(%rip), %eax
	movl	c500(%rip), %edx
	cmpl	%edx, %eax
	jl	.L17
.L6:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	price(%rip), %edx
	testl	%edx, %edx
	jne	.L18
.L9:
	addq	$8, %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
.L17:
	.cfi_restore_state
	subl	%eax, %edx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L16:
	subl	%eax, %edx
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	subl	%edi, %esi
	xorl	%eax, %eax
	movl	$1, %edi
	movl	%esi, %edx
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	subl	%ecx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	a50(%rip), %edi
	movl	c50(%rip), %esi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	.LC6(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	price
	.bss
	.align 4
	.type	price, @object
	.size	price, 4
price:
	.zero	4
	.globl	a_mon
	.align 4
	.type	a_mon, @object
	.size	a_mon, 4
a_mon:
	.zero	4
	.globl	b_mon
	.align 4
	.type	b_mon, @object
	.size	b_mon, 4
b_mon:
	.zero	4
	.globl	a500
	.align 4
	.type	a500, @object
	.size	a500, 4
a500:
	.zero	4
	.globl	a100
	.align 4
	.type	a100, @object
	.size	a100, 4
a100:
	.zero	4
	.globl	a50
	.align 4
	.type	a50, @object
	.size	a50, 4
a50:
	.zero	4
	.globl	a10
	.align 4
	.type	a10, @object
	.size	a10, 4
a10:
	.zero	4
	.globl	c500
	.align 4
	.type	c500, @object
	.size	c500, 4
c500:
	.zero	4
	.globl	c100
	.align 4
	.type	c100, @object
	.size	c100, 4
c100:
	.zero	4
	.globl	c50
	.align 4
	.type	c50, @object
	.size	c50, 4
c50:
	.zero	4
	.globl	c10
	.align 4
	.type	c10, @object
	.size	c10, 4
c10:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"10 %d\n"
.LC3:
	.string	"50 %d\n"
.LC4:
	.string	"100 %d\n"
.LC5:
	.string	"500 %d\n"
.LC6:
	.string	""
	.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
	xorl	%eax, %eax
	leaq	c100(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	c50(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	c10(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	price(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
.L2:
	movl	price(%rip), %eax
	testl	%eax, %eax
	je	.L9
	leaq	c500(%rip), %r8
	movq	%r15, %rcx
	movq	%r14, %rdx
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	c50(%rip), %esi
	movl	c10(%rip), %edx
	imull	$50, %esi, %eax
	leal	(%rdx,%rdx,4), %ecx
	leal	(%rax,%rcx,2), %eax
	imull	$100, c100(%rip), %ecx
	addl	%ecx, %eax
	imull	$500, c500(%rip), %ecx
	addl	%ecx, %eax
	movl	%eax, b_mon(%rip)
	subl	price(%rip), %eax
	movslq	%eax, %rcx
	movl	%eax, %edi
	imulq	$274877907, %rcx, %rcx
	sarl	$31, %edi
	sarq	$37, %rcx
	subl	%edi, %ecx
	movl	%ecx, a500(%rip)
	imull	$500, %ecx, %ecx
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movl	%eax, %edi
	imulq	$1374389535, %rcx, %rcx
	sarl	$31, %edi
	sarq	$37, %rcx
	subl	%edi, %ecx
	movl	%ecx, a100(%rip)
	imull	$100, %ecx, %ecx
	subl	%ecx, %eax
	movslq	%eax, %rdi
	movl	%eax, %ecx
	imulq	$1374389535, %rdi, %rdi
	sarl	$31, %ecx
	sarq	$36, %rdi
	subl	%ecx, %edi
	imull	$50, %edi, %ecx
	movl	%edi, a50(%rip)
	subl	%ecx, %eax
	movslq	%eax, %rcx
	movl	%eax, %r8d
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %r8d
	sarq	$34, %rcx
	subl	%r8d, %ecx
	leal	(%rcx,%rcx,4), %r8d
	movl	%ecx, a10(%rip)
	addl	%r8d, %r8d
	subl	%r8d, %eax
	movl	%eax, a_mon(%rip)
	cmpl	%ecx, %edx
	jg	.L14
.L3:
	cmpl	%edi, %esi
	jg	.L15
.L4:
	movl	a100(%rip), %eax
	movl	c100(%rip), %edx
	cmpl	%edx, %eax
	jl	.L16
.L5:
	movl	a500(%rip), %eax
	movl	c500(%rip), %edx
	cmpl	%edx, %eax
	jl	.L17
.L6:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	price(%rip), %edx
	testl	%edx, %edx
	jne	.L18
.L9:
	addq	$8, %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
.L17:
	.cfi_restore_state
	subl	%eax, %edx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L16:
	subl	%eax, %edx
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L15:
	subl	%edi, %esi
	xorl	%eax, %eax
	movl	$1, %edi
	movl	%esi, %edx
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	subl	%ecx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	a50(%rip), %edi
	movl	c50(%rip), %esi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	.LC6(%rip), %rdi
	call	puts@PLT
	jmp	.L2
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	price
	.bss
	.align 4
	.type	price, @object
	.size	price, 4
price:
	.zero	4
	.globl	a_mon
	.align 4
	.type	a_mon, @object
	.size	a_mon, 4
a_mon:
	.zero	4
	.globl	b_mon
	.align 4
	.type	b_mon, @object
	.size	b_mon, 4
b_mon:
	.zero	4
	.globl	a500
	.align 4
	.type	a500, @object
	.size	a500, 4
a500:
	.zero	4
	.globl	a100
	.align 4
	.type	a100, @object
	.size	a100, 4
a100:
	.zero	4
	.globl	a50
	.align 4
	.type	a50, @object
	.size	a50, 4
a50:
	.zero	4
	.globl	a10
	.align 4
	.type	a10, @object
	.size	a10, 4
a10:
	.zero	4
	.globl	c500
	.align 4
	.type	c500, @object
	.size	c500, 4
c500:
	.zero	4
	.globl	c100
	.align 4
	.type	c100, @object
	.size	c100, 4
c100:
	.zero	4
	.globl	c50
	.align 4
	.type	c50, @object
	.size	c50, 4
c50:
	.zero	4
	.globl	c10
	.align 4
	.type	c10, @object
	.size	c10, 4
c10:
	.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 c10, c50, c100, c500;
int a10, a50, a100, a500;
int b_mon;
int a_mon;
int price;

int main(void) 
{
	scanf("%d",&price);

	while (price) {
		scanf("%d %d %d %d", &c10, &c50, &c100, &c500);
		b_mon = c10 * 10 + c50 * 50 + c100 * 100 + c500 * 500;
		a_mon = b_mon - price;

		a500 = a_mon / 500;
		a_mon %= 500;
		a100 = a_mon / 100;
		a_mon %= 100;
		a50 = a_mon / 50;
		a_mon %= 50;
		a10 = a_mon / 10;
		a_mon %= 10;

		if (a10 < c10) {
			printf("10 %d\n",c10 - a10);
		}
		if (a50 < c50) {
			printf("50 %d\n",c50 - a50);
		}
		if (a100 < c100) {
			printf("100 %d\n",c100 - a100);
		}
		if (a500 < c500) {
			printf("500 %d\n",c500 - a500);
		}
		scanf("%d",&price);
if (price) { puts(""); }
	}
	return 0;
}
160
1 1 4 0
160
1 0 2 10
0
 160
1 1 4 0
58
2 0 4 10
0
 160
1 1 4 0
46
2 0 4 10
0
 160
1 1 4 0
160
0 0 2 10
0
 160
1 1 2 0
160
1 -1 1 10
0
 160
1 1 4 0
109
2 0 7 10
0
 160
0 1 4 0
160
0 1 2 10
0
 160
1 1 4 0
46
2 1 1 10
0
 160
1 0 4 0
109
2 0 3 10
0
 160
1 0 4 0
46
2 1 1 10
0

10 1
50 1
100 1

10 1
100 2
 10 1
50 1
100 1

10 1
100 1
 10 1
50 1
100 1

100 1
 10 1
50 1
100 1

100 2
 10 1
50 1
100 1

10 1
500 1
 10 1
50 1
100 1

10 1
100 6
 100 2

100 2
 10 1
50 1
100 1

50 1
 10 1
100 2

10 1
100 1
 10 1
100 2

50 1

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 c10, c50, c100, c500;
int a10, a50, a100, a500;
int b_mon;
int a_mon;
int price;

int main(void) 
{
	scanf("%d",&price);

	while (price) {
		scanf("%d %d %d %d", &c10, &c50, &c100, &c500);
		b_mon = c10 * 10 + c50 * 50 + c100 * 100 + c500 * 500;
		a_mon = b_mon - price;

		a500 = a_mon / 500;
		a_mon %= 500;
		a100 = a_mon / 100;
		a_mon %= 100;
		a50 = a_mon / 50;
		a_mon %= 50;
		a10 = a_mon / 10;
		a_mon %= 10;

		if (a10 < c10) {
			printf("10 %d\n",c10 - a10);
		}
		if (a50 < c50) {
			printf("50 %d\n",c50 - a50);
		}
		if (a100 < c100) {
			printf("100 %d\n",c100 - a100);
		}
		if (a500 < c500) {
			printf("500 %d\n",c500 - a500);
		}
		scanf("%d",&price);
if (price) { puts(""); }
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c10
	.bss
	.align 4
	.type	c10, @object
	.size	c10, 4
c10:
	.zero	4
	.globl	c50
	.align 4
	.type	c50, @object
	.size	c50, 4
c50:
	.zero	4
	.globl	c100
	.align 4
	.type	c100, @object
	.size	c100, 4
c100:
	.zero	4
	.globl	c500
	.align 4
	.type	c500, @object
	.size	c500, 4
c500:
	.zero	4
	.globl	a10
	.align 4
	.type	a10, @object
	.size	a10, 4
a10:
	.zero	4
	.globl	a50
	.align 4
	.type	a50, @object
	.size	a50, 4
a50:
	.zero	4
	.globl	a100
	.align 4
	.type	a100, @object
	.size	a100, 4
a100:
	.zero	4
	.globl	a500
	.align 4
	.type	a500, @object
	.size	a500, 4
a500:
	.zero	4
	.globl	b_mon
	.align 4
	.type	b_mon, @object
	.size	b_mon, 4
b_mon:
	.zero	4
	.globl	a_mon
	.align 4
	.type	a_mon, @object
	.size	a_mon, 4
a_mon:
	.zero	4
	.globl	price
	.align 4
	.type	price, @object
	.size	price, 4
price:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"10 %d\n"
.LC3:
	.string	"50 %d\n"
.LC4:
	.string	"100 %d\n"
.LC5:
	.string	"500 %d\n"
.LC6:
	.string	""
	.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
	leaq	price(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L7:
	leaq	c500(%rip), %r8
	leaq	c100(%rip), %rax
	movq	%rax, %rcx
	leaq	c50(%rip), %rax
	movq	%rax, %rdx
	leaq	c10(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	c10(%rip), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	c50(%rip), %eax
	imull	$50, %eax, %eax
	addl	%eax, %edx
	movl	c100(%rip), %eax
	imull	$100, %eax, %eax
	addl	%eax, %edx
	movl	c500(%rip), %eax
	imull	$500, %eax, %eax
	addl	%edx, %eax
	movl	%eax, b_mon(%rip)
	movl	b_mon(%rip), %eax
	movl	price(%rip), %edx
	subl	%edx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a500(%rip)
	movl	a_mon(%rip), %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$500, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %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, a100(%rip)
	movl	a_mon(%rip), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$4, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a50(%rip)
	movl	a_mon(%rip), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$4, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$50, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a10(%rip)
	movl	a_mon(%rip), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	%edx, a_mon(%rip)
	movl	a10(%rip), %edx
	movl	c10(%rip), %eax
	cmpl	%eax, %edx
	jge	.L3
	movl	c10(%rip), %eax
	movl	a10(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L3:
	movl	a50(%rip), %edx
	movl	c50(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	c50(%rip), %eax
	movl	a50(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L4:
	movl	a100(%rip), %edx
	movl	c100(%rip), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	c100(%rip), %eax
	movl	a100(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	a500(%rip), %edx
	movl	c500(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	c500(%rip), %eax
	movl	a500(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	price(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	price(%rip), %eax
	testl	%eax, %eax
	je	.L2
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	movl	price(%rip), %eax
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	popq	%rbp
	.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
	.globl	c10
	.bss
	.align 4
	.type	c10, @object
	.size	c10, 4
c10:
	.zero	4
	.globl	c50
	.align 4
	.type	c50, @object
	.size	c50, 4
c50:
	.zero	4
	.globl	c100
	.align 4
	.type	c100, @object
	.size	c100, 4
c100:
	.zero	4
	.globl	c500
	.align 4
	.type	c500, @object
	.size	c500, 4
c500:
	.zero	4
	.globl	a10
	.align 4
	.type	a10, @object
	.size	a10, 4
a10:
	.zero	4
	.globl	a50
	.align 4
	.type	a50, @object
	.size	a50, 4
a50:
	.zero	4
	.globl	a100
	.align 4
	.type	a100, @object
	.size	a100, 4
a100:
	.zero	4
	.globl	a500
	.align 4
	.type	a500, @object
	.size	a500, 4
a500:
	.zero	4
	.globl	b_mon
	.align 4
	.type	b_mon, @object
	.size	b_mon, 4
b_mon:
	.zero	4
	.globl	a_mon
	.align 4
	.type	a_mon, @object
	.size	a_mon, 4
a_mon:
	.zero	4
	.globl	price
	.align 4
	.type	price, @object
	.size	price, 4
price:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d %d %d"
.LC2:
	.string	"10 %d\n"
.LC3:
	.string	"50 %d\n"
.LC4:
	.string	"100 %d\n"
.LC5:
	.string	"500 %d\n"
.LC6:
	.string	""
	.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
	leaq	price(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L2
.L7:
	leaq	c500(%rip), %r8
	leaq	c100(%rip), %rax
	movq	%rax, %rcx
	leaq	c50(%rip), %rax
	movq	%rax, %rdx
	leaq	c10(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	c10(%rip), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	c50(%rip), %eax
	imull	$50, %eax, %eax
	addl	%eax, %edx
	movl	c100(%rip), %eax
	imull	$100, %eax, %eax
	addl	%eax, %edx
	movl	c500(%rip), %eax
	imull	$500, %eax, %eax
	addl	%edx, %eax
	movl	%eax, b_mon(%rip)
	movl	b_mon(%rip), %eax
	movl	price(%rip), %edx
	subl	%edx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$5, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a500(%rip)
	movl	a_mon(%rip), %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$500, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %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, a100(%rip)
	movl	a_mon(%rip), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %eax
	movslq	%eax, %rdx
	imulq	$1374389535, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$4, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a50(%rip)
	movl	a_mon(%rip), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$4, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$50, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a_mon(%rip)
	movl	a_mon(%rip), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, a10(%rip)
	movl	a_mon(%rip), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	%edx, a_mon(%rip)
	movl	a10(%rip), %edx
	movl	c10(%rip), %eax
	cmpl	%eax, %edx
	jge	.L3
	movl	c10(%rip), %eax
	movl	a10(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L3:
	movl	a50(%rip), %edx
	movl	c50(%rip), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	c50(%rip), %eax
	movl	a50(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L4:
	movl	a100(%rip), %edx
	movl	c100(%rip), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	c100(%rip), %eax
	movl	a100(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	a500(%rip), %edx
	movl	c500(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	c500(%rip), %eax
	movl	a500(%rip), %edx
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	leaq	price(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	price(%rip), %eax
	testl	%eax, %eax
	je	.L2
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	movl	price(%rip), %eax
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	popq	%rbp
	.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:
