Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/*
 * ID: 3039
 * Problem: Special Chat
 */

#include <stdio.h>

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

    int given_point = 0;
    int unit[4] = {10000, 5000, 1000, 500};
    int i;
    for (i = 0; i < 4; i++) {
        given_point += (point / unit[i]) * unit[i];
        point %= unit[i];
    }
    printf("%d\n", given_point);

    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -40(%rbp)
	movl	$10000, -32(%rbp)
	movl	$5000, -28(%rbp)
	movl	$1000, -24(%rbp)
	movl	$500, -20(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	movl	-32(%rbp,%rdx,4), %ecx
	cltd
	idivl	%ecx
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	imull	%edx, %eax
	addl	%eax, -40(%rbp)
	movl	-44(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	movl	-32(%rbp,%rdx,4), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	movl	%eax, -44(%rbp)
	addl	$1, -36(%rbp)
.L2:
	cmpl	$3, -36(%rbp)
	jle	.L3
	movl	-40(%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	.L5
	call	__stack_chk_fail@PLT
.L5:
	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"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	movl	$1, %edi
	movq	%rax, %rdx
	imulq	$1759218605, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	sarq	$44, %rax
	subl	%ecx, %eax
	imull	$10000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%eax, %rdx
	movl	%eax, %esi
	imulq	$1759218605, %rdx, %rdx
	sarl	$31, %esi
	sarq	$43, %rdx
	subl	%esi, %edx
	imull	$5000, %edx, %edx
	subl	%edx, %eax
	addl	%edx, %ecx
	movslq	%eax, %rdx
	movl	%eax, %esi
	imulq	$274877907, %rdx, %rdx
	sarl	$31, %esi
	sarq	$38, %rdx
	subl	%esi, %edx
	imull	$1000, %edx, %edx
	subl	%edx, %eax
	addl	%edx, %ecx
	movslq	%eax, %rdx
	movl	%eax, %esi
	imulq	$274877907, %rdx, %rdx
	sarl	$31, %esi
	sarq	$37, %rdx
	subl	%esi, %edx
	leaq	.LC1(%rip), %rsi
	imull	$500, %edx, %edx
	subl	%edx, %eax
	addl	%ecx, %edx
	movl	%eax, 4(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	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"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	movl	$1, %edi
	movq	%rax, %rdx
	imulq	$1759218605, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	sarq	$44, %rax
	subl	%ecx, %eax
	imull	$10000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%eax, %rdx
	movl	%eax, %esi
	imulq	$1759218605, %rdx, %rdx
	sarl	$31, %esi
	sarq	$43, %rdx
	subl	%esi, %edx
	imull	$5000, %edx, %edx
	subl	%edx, %eax
	addl	%edx, %ecx
	movslq	%eax, %rdx
	movl	%eax, %esi
	imulq	$274877907, %rdx, %rdx
	sarl	$31, %esi
	sarq	$38, %rdx
	subl	%esi, %edx
	imull	$1000, %edx, %edx
	subl	%edx, %eax
	addl	%edx, %ecx
	movslq	%eax, %rdx
	movl	%eax, %esi
	imulq	$274877907, %rdx, %rdx
	sarl	$31, %esi
	sarq	$37, %rdx
	subl	%esi, %edx
	leaq	.LC1(%rip), %rsi
	imull	$500, %edx, %edx
	subl	%edx, %eax
	addl	%ecx, %edx
	movl	%eax, 4(%rsp)
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L5
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	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:

/*
 * ID: 3039
 * Problem: Special Chat
 */

#include <stdio.h>

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

    int given_point = 0;
    int unit[4] = {10000, 5000, 1000, 500};
    int i;
    for (i = 0; i < 4; i++) {
        given_point += (point / unit[i]) * unit[i];
        point %= unit[i];
    }
    printf("%d\n", given_point);

    return 0;
}


2178
 9648
 000000
 1978
 3066
 4226
 2548
 5031
 1305
 110000

2000
 9500
 0
 1500
 3000
 4000
 2500
 5000
 1000
 110000

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/*
 * ID: 3039
 * Problem: Special Chat
 */

#include <stdio.h>

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

    int given_point = 0;
    int unit[4] = {10000, 5000, 1000, 500};
    int i;
    for (i = 0; i < 4; i++) {
        given_point += (point / unit[i]) * unit[i];
        point %= unit[i];
    }
    printf("%d\n", given_point);

    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -40(%rbp)
	movl	$10000, -32(%rbp)
	movl	$5000, -28(%rbp)
	movl	$1000, -24(%rbp)
	movl	$500, -20(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	movl	-32(%rbp,%rdx,4), %ecx
	cltd
	idivl	%ecx
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	imull	%edx, %eax
	addl	%eax, -40(%rbp)
	movl	-44(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	movl	-32(%rbp,%rdx,4), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	movl	%eax, -44(%rbp)
	addl	$1, -36(%rbp)
.L2:
	cmpl	$3, -36(%rbp)
	jle	.L3
	movl	-40(%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	.L5
	call	__stack_chk_fail@PLT
.L5:
	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"
.LC1:
	.string	"%d\n"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -40(%rbp)
	movl	$10000, -32(%rbp)
	movl	$5000, -28(%rbp)
	movl	$1000, -24(%rbp)
	movl	$500, -20(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	movl	-32(%rbp,%rdx,4), %ecx
	cltd
	idivl	%ecx
	movl	%eax, %edx
	movl	-36(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	imull	%edx, %eax
	addl	%eax, -40(%rbp)
	movl	-44(%rbp), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	movl	-32(%rbp,%rdx,4), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	movl	%eax, -44(%rbp)
	addl	$1, -36(%rbp)
.L2:
	cmpl	$3, -36(%rbp)
	jle	.L3
	movl	-40(%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	.L5
	call	__stack_chk_fail@PLT
.L5:
	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:
