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 SIMPLE_INTEREST = 0; /* 単利 */
int COMPOUND_INTEREST = 1; /* 複利 */
int RATE_DIVISION = 8192; /* 年利率の単位の逆数 (1/x) */

/* 最終資金をシミュレートする */
long simulate(long f, int y, int interestType, double interestRate, int annualFee) {
	double interest = 0;
	int r, i;
	long long lf = f;
	r = (int)(interestRate * RATE_DIVISION + 0.5); /* 整数での計算用に変換した年利率 */
	/* 年毎のシミュレーション */
	for (i = 0; i < y; i++) {
		interest += lf * r / RATE_DIVISION; /* 利子をつける */
		if (interestType == COMPOUND_INTEREST) {
			lf += interest;
			interest = 0;
		}
		lf -= annualFee; /* 年間手数料をとる */
	}
	lf += interest;
	return (long)lf;
}

int main(void) {
	int m; /* データセット数 */
	int i, j;

	if (scanf("%d", &m) != 1) return 0;

	/* データセット毎の処理 */
	for (i = 0; i < m; i++) {
		long f; /* 初期資金 */
		int y; /* 運用年数 */
		int n; /* 運用方法の種類数 */
		long max; /* 最大の最終資金 */

		if (scanf("%ld%d%d", &f, &y, &n) != 3) return 0;
		if (f <= 0 || f > 100000000 || y <= 0 || y > 10 || n <= 0 || n > 100) return 0;
		max = f;

		/* データセット毎の処理 */
		for (j = 0; j < n; j++) {
			int it; double ir; int af; /* 入力 */
			long r;
			if (scanf("%d%lf%d", &it, &ir, &af) != 3) return 0;
			/* シミュレーション */
			r = simulate(f, y, it, ir, af);
			if (r > max) max = r; /* 最大値を記録する */
		}

		printf("%ld\n", max); /* 出力 */
	}

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	SIMPLE_INTEREST
	.bss
	.align 4
	.type	SIMPLE_INTEREST, @object
	.size	SIMPLE_INTEREST, 4
SIMPLE_INTEREST:
	.zero	4
	.globl	COMPOUND_INTEREST
	.data
	.align 4
	.type	COMPOUND_INTEREST, @object
	.size	COMPOUND_INTEREST, 4
COMPOUND_INTEREST:
	.long	1
	.globl	RATE_DIVISION
	.align 4
	.type	RATE_DIVISION, @object
	.size	RATE_DIVISION, 4
RATE_DIVISION:
	.long	8192
	.text
	.globl	simulate
	.type	simulate, @function
simulate:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movsd	%xmm0, -56(%rbp)
	movl	%ecx, -60(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -16(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -8(%rbp)
	movl	RATE_DIVISION(%rip), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movapd	%xmm0, %xmm1
	mulsd	-56(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L2
.L4:
	movl	-20(%rbp), %eax
	cltq
	imulq	-8(%rbp), %rax
	movl	RATE_DIVISION(%rip), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	movsd	-16(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	COMPOUND_INTEREST(%rip), %eax
	cmpl	%eax, -48(%rbp)
	jne	.L3
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-8(%rbp), %xmm0
	addsd	-16(%rbp), %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -16(%rbp)
.L3:
	movl	-60(%rbp), %eax
	cltq
	subq	%rax, -8(%rbp)
	addl	$1, -24(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L4
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-8(%rbp), %xmm0
	addsd	-16(%rbp), %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	simulate, .-simulate
	.section	.rodata
.LC2:
	.string	"%d"
.LC3:
	.string	"%ld%d%d"
.LC4:
	.string	"%d%lf%d"
.LC5:
	.string	"%ld\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
	leaq	-68(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L7
	movl	$0, %eax
	jmp	.L19
.L7:
	movl	$0, -48(%rbp)
	jmp	.L9
.L18:
	leaq	-60(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L10
	movl	$0, %eax
	jmp	.L19
.L10:
	movq	-40(%rbp), %rax
	testq	%rax, %rax
	jle	.L12
	movq	-40(%rbp), %rax
	cmpq	$100000000, %rax
	jg	.L12
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	jle	.L12
	movl	-64(%rbp), %eax
	cmpl	$10, %eax
	jg	.L12
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jle	.L12
	movl	-60(%rbp), %eax
	cmpl	$100, %eax
	jle	.L13
.L12:
	movl	$0, %eax
	jmp	.L19
.L13:
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L14
.L17:
	leaq	-52(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L15
	movl	$0, %eax
	jmp	.L19
.L15:
	movl	-52(%rbp), %ecx
	movq	-32(%rbp), %rdi
	movl	-56(%rbp), %edx
	movl	-64(%rbp), %esi
	movq	-40(%rbp), %rax
	movq	%rdi, %xmm0
	movq	%rax, %rdi
	call	simulate
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jle	.L16
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
.L16:
	addl	$1, -44(%rbp)
.L14:
	movl	-60(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L17
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -48(%rbp)
.L9:
	movl	-68(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L18
	movl	$0, %eax
.L19:
	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
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1071644672
	.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	simulate
	.type	simulate, @function
simulate:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	RATE_DIVISION(%rip), %r8
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	movl	%esi, %r9d
	cvtsi2sdl	%r8d, %xmm0
	mulsd	%xmm1, %xmm0
	addsd	.LC1(%rip), %xmm0
	testl	%esi, %esi
	jle	.L6
	cvttsd2sil	%xmm0, %esi
	cmpl	%edx, COMPOUND_INTEREST(%rip)
	movslq	%ecx, %r10
	movslq	%esi, %rsi
	je	.L7
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%r10, %rbx
	xorl	%ecx, %ecx
	pxor	%xmm0, %xmm0
	negq	%rbx
	movq	%rbx, %r11
	imulq	%rsi, %r11
	imulq	%rdi, %rsi
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %rax
	pxor	%xmm1, %xmm1
	addq	%r11, %rsi
	cqto
	idivq	%r8
	cvtsi2sdq	%rax, %xmm1
	movl	%ecx, %eax
	addl	$1, %ecx
	addsd	%xmm1, %xmm0
	cmpl	%ecx, %r9d
	jne	.L4
	imulq	%rbx, %rax
	subq	%r10, %rdi
	pxor	%xmm1, %xmm1
	popq	%rbx
	.cfi_def_cfa_offset 8
	addq	%rax, %rdi
	cvtsi2sdq	%rdi, %xmm1
	addsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore 3
	xorl	%ecx, %ecx
	pxor	%xmm1, %xmm1
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rdi, %rax
	pxor	%xmm0, %xmm0
	pxor	%xmm2, %xmm2
	addl	$1, %ecx
	imulq	%rsi, %rax
	cvtsi2sdq	%rdi, %xmm2
	cqto
	idivq	%r8
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm1, %xmm0
	addsd	%xmm2, %xmm0
	cvttsd2siq	%xmm0, %rdi
	subq	%r10, %rdi
	cmpl	%ecx, %r9d
	jne	.L3
	movapd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rdi, %xmm1
	addsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rdi, %xmm1
	addsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	simulate, .-simulate
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d"
.LC3:
	.string	"%ld%d%d"
.LC4:
	.string	"%d%lf%d"
.LC5:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %rdi
	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	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L17
	cmpl	$0, 52(%rsp)
	jle	.L17
	leaq	60(%rsp), %rax
	movl	$0, 20(%rsp)
	leaq	.LC4(%rip), %r15
	movq	%rax, 32(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	72(%rsp), %rax
	movq	%rax, 40(%rsp)
.L25:
	movq	32(%rsp), %rcx
	movq	24(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	movq	40(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L17
	movq	72(%rsp), %r12
	leaq	-1(%r12), %rax
	cmpq	$99999999, %rax
	ja	.L17
	movl	56(%rsp), %eax
	subl	$1, %eax
	cmpl	$9, %eax
	ja	.L17
	movl	60(%rsp), %eax
	subl	$1, %eax
	cmpl	$99, %eax
	ja	.L17
	xorl	%r13d, %r13d
	leaq	68(%rsp), %rbp
	leaq	80(%rsp), %rbx
	leaq	64(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L24:
	xorl	%eax, %eax
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L17
	movslq	RATE_DIVISION(%rip), %rsi
	pxor	%xmm0, %xmm0
	movl	56(%rsp), %r9d
	pxor	%xmm2, %xmm2
	movslq	68(%rsp), %r10
	movl	64(%rsp), %eax
	cvtsi2sdl	%esi, %xmm0
	mulsd	80(%rsp), %xmm0
	testl	%r9d, %r9d
	movq	72(%rsp), %rdi
	addsd	.LC1(%rip), %xmm0
	cvttsd2sil	%xmm0, %ecx
	jle	.L28
	cmpl	COMPOUND_INTEREST(%rip), %eax
	movslq	%ecx, %rcx
	je	.L29
	movq	%r10, %rax
	xorl	%r8d, %r8d
	pxor	%xmm0, %xmm0
	negq	%rax
	movq	%rax, %r11
	movq	%rax, 8(%rsp)
	imulq	%rcx, %r11
	imulq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rcx, %rax
	pxor	%xmm1, %xmm1
	addl	$1, %r8d
	addq	%r11, %rcx
	cqto
	idivq	%rsi
	cvtsi2sdq	%rax, %xmm1
	addsd	%xmm1, %xmm0
	cmpl	%r8d, %r9d
	jne	.L22
	leal	-1(%r9), %eax
	subq	%r10, %rdi
	imulq	8(%rsp), %rax
	addq	%rax, %rdi
.L20:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rdi, %xmm1
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	cmpq	%rax, %r12
	cmovl	%rax, %r12
	addl	$1, %r13d
	cmpl	%r13d, 60(%rsp)
	jg	.L24
	movq	%r12, %rdx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, 20(%rsp)
	movl	20(%rsp), %eax
	cmpl	%eax, 52(%rsp)
	jg	.L25
	.p2align 4,,10
	.p2align 3
.L17:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$104, %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
.L29:
	.cfi_restore_state
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rdi, %rax
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %r8d
	imulq	%rcx, %rax
	cvtsi2sdq	%rdi, %xmm1
	cqto
	idivq	%rsi
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rdi
	subq	%r10, %rdi
	cmpl	%r8d, %r9d
	jne	.L21
	movapd	%xmm2, %xmm0
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L28:
	pxor	%xmm0, %xmm0
	jmp	.L20
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	RATE_DIVISION
	.data
	.align 4
	.type	RATE_DIVISION, @object
	.size	RATE_DIVISION, 4
RATE_DIVISION:
	.long	8192
	.globl	COMPOUND_INTEREST
	.align 4
	.type	COMPOUND_INTEREST, @object
	.size	COMPOUND_INTEREST, 4
COMPOUND_INTEREST:
	.long	1
	.globl	SIMPLE_INTEREST
	.bss
	.align 4
	.type	SIMPLE_INTEREST, @object
	.size	SIMPLE_INTEREST, 4
SIMPLE_INTEREST:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1071644672
	.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	simulate
	.type	simulate, @function
simulate:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	RATE_DIVISION(%rip), %r8
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	movl	%esi, %r9d
	cvtsi2sdl	%r8d, %xmm0
	mulsd	%xmm1, %xmm0
	addsd	.LC1(%rip), %xmm0
	testl	%esi, %esi
	jle	.L6
	cvttsd2sil	%xmm0, %esi
	cmpl	%edx, COMPOUND_INTEREST(%rip)
	movslq	%ecx, %r10
	movslq	%esi, %rsi
	je	.L7
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%r10, %rbx
	xorl	%ecx, %ecx
	pxor	%xmm0, %xmm0
	negq	%rbx
	movq	%rbx, %r11
	imulq	%rsi, %r11
	imulq	%rdi, %rsi
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %rax
	pxor	%xmm1, %xmm1
	addq	%r11, %rsi
	cqto
	idivq	%r8
	cvtsi2sdq	%rax, %xmm1
	movl	%ecx, %eax
	addl	$1, %ecx
	addsd	%xmm1, %xmm0
	cmpl	%ecx, %r9d
	jne	.L4
	imulq	%rbx, %rax
	subq	%r10, %rdi
	pxor	%xmm1, %xmm1
	popq	%rbx
	.cfi_def_cfa_offset 8
	addq	%rax, %rdi
	cvtsi2sdq	%rdi, %xmm1
	addsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore 3
	xorl	%ecx, %ecx
	pxor	%xmm1, %xmm1
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rdi, %rax
	pxor	%xmm0, %xmm0
	pxor	%xmm2, %xmm2
	addl	$1, %ecx
	imulq	%rsi, %rax
	cvtsi2sdq	%rdi, %xmm2
	cqto
	idivq	%r8
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm1, %xmm0
	addsd	%xmm2, %xmm0
	cvttsd2siq	%xmm0, %rdi
	subq	%r10, %rdi
	cmpl	%ecx, %r9d
	jne	.L3
	movapd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rdi, %xmm1
	addsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm1, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rdi, %xmm1
	addsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	simulate, .-simulate
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d"
.LC3:
	.string	"%ld%d%d"
.LC4:
	.string	"%d%lf%d"
.LC5:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %rdi
	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	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L17
	cmpl	$0, 52(%rsp)
	jle	.L17
	leaq	60(%rsp), %rax
	movl	$0, 20(%rsp)
	leaq	.LC4(%rip), %r15
	movq	%rax, 32(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	72(%rsp), %rax
	movq	%rax, 40(%rsp)
.L25:
	movq	32(%rsp), %rcx
	movq	24(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rdi
	movq	40(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L17
	movq	72(%rsp), %r12
	leaq	-1(%r12), %rax
	cmpq	$99999999, %rax
	ja	.L17
	movl	56(%rsp), %eax
	subl	$1, %eax
	cmpl	$9, %eax
	ja	.L17
	movl	60(%rsp), %eax
	subl	$1, %eax
	cmpl	$99, %eax
	ja	.L17
	xorl	%r13d, %r13d
	leaq	68(%rsp), %rbp
	leaq	80(%rsp), %rbx
	leaq	64(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L24:
	xorl	%eax, %eax
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L17
	movslq	RATE_DIVISION(%rip), %rsi
	pxor	%xmm0, %xmm0
	movl	56(%rsp), %r9d
	pxor	%xmm2, %xmm2
	movslq	68(%rsp), %r10
	movl	64(%rsp), %eax
	cvtsi2sdl	%esi, %xmm0
	mulsd	80(%rsp), %xmm0
	testl	%r9d, %r9d
	movq	72(%rsp), %rdi
	addsd	.LC1(%rip), %xmm0
	cvttsd2sil	%xmm0, %ecx
	jle	.L28
	cmpl	COMPOUND_INTEREST(%rip), %eax
	movslq	%ecx, %rcx
	je	.L29
	movq	%r10, %rax
	xorl	%r8d, %r8d
	pxor	%xmm0, %xmm0
	negq	%rax
	movq	%rax, %r11
	movq	%rax, 8(%rsp)
	imulq	%rcx, %r11
	imulq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rcx, %rax
	pxor	%xmm1, %xmm1
	addl	$1, %r8d
	addq	%r11, %rcx
	cqto
	idivq	%rsi
	cvtsi2sdq	%rax, %xmm1
	addsd	%xmm1, %xmm0
	cmpl	%r8d, %r9d
	jne	.L22
	leal	-1(%r9), %eax
	subq	%r10, %rdi
	imulq	8(%rsp), %rax
	addq	%rax, %rdi
.L20:
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rdi, %xmm1
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	cmpq	%rax, %r12
	cmovl	%rax, %r12
	addl	$1, %r13d
	cmpl	%r13d, 60(%rsp)
	jg	.L24
	movq	%r12, %rdx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, 20(%rsp)
	movl	20(%rsp), %eax
	cmpl	%eax, 52(%rsp)
	jg	.L25
	.p2align 4,,10
	.p2align 3
.L17:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$104, %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
.L29:
	.cfi_restore_state
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rdi, %rax
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %r8d
	imulq	%rcx, %rax
	cvtsi2sdq	%rdi, %xmm1
	cqto
	idivq	%rsi
	cvtsi2sdq	%rax, %xmm0
	addsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rdi
	subq	%r10, %rdi
	cmpl	%r8d, %r9d
	jne	.L21
	movapd	%xmm2, %xmm0
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L28:
	pxor	%xmm0, %xmm0
	jmp	.L20
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	RATE_DIVISION
	.data
	.align 4
	.type	RATE_DIVISION, @object
	.size	RATE_DIVISION, 4
RATE_DIVISION:
	.long	8192
	.globl	COMPOUND_INTEREST
	.align 4
	.type	COMPOUND_INTEREST, @object
	.size	COMPOUND_INTEREST, 4
COMPOUND_INTEREST:
	.long	1
	.globl	SIMPLE_INTEREST
	.bss
	.align 4
	.type	SIMPLE_INTEREST, @object
	.size	SIMPLE_INTEREST, 4
SIMPLE_INTEREST:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1071644672
	.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 SIMPLE_INTEREST = 0; /* 単利 */
int COMPOUND_INTEREST = 1; /* 複利 */
int RATE_DIVISION = 8192; /* 年利率の単位の逆数 (1/x) */

/* 最終資金をシミュレートする */
long simulate(long f, int y, int interestType, double interestRate, int annualFee) {
	double interest = 0;
	int r, i;
	long long lf = f;
	r = (int)(interestRate * RATE_DIVISION + 0.5); /* 整数での計算用に変換した年利率 */
	/* 年毎のシミュレーション */
	for (i = 0; i < y; i++) {
		interest += lf * r / RATE_DIVISION; /* 利子をつける */
		if (interestType == COMPOUND_INTEREST) {
			lf += interest;
			interest = 0;
		}
		lf -= annualFee; /* 年間手数料をとる */
	}
	lf += interest;
	return (long)lf;
}

int main(void) {
	int m; /* データセット数 */
	int i, j;

	if (scanf("%d", &m) != 1) return 0;

	/* データセット毎の処理 */
	for (i = 0; i < m; i++) {
		long f; /* 初期資金 */
		int y; /* 運用年数 */
		int n; /* 運用方法の種類数 */
		long max; /* 最大の最終資金 */

		if (scanf("%ld%d%d", &f, &y, &n) != 3) return 0;
		if (f <= 0 || f > 100000000 || y <= 0 || y > 10 || n <= 0 || n > 100) return 0;
		max = f;

		/* データセット毎の処理 */
		for (j = 0; j < n; j++) {
			int it; double ir; int af; /* 入力 */
			long r;
			if (scanf("%d%lf%d", &it, &ir, &af) != 3) return 0;
			/* シミュレーション */
			r = simulate(f, y, it, ir, af);
			if (r > max) max = r; /* 最大値を記録する */
		}

		printf("%ld\n", max); /* 出力 */
	}

    return 0;
}
4
1000000
5
2
0 0.03125 3000
1 0.03125 3000
6620000
7
2
0 0.0732421875 42307
0 0.0740966796875 40942
39677000
4
4
0 0.0709228515625 30754
1 0.00634765625 26165
0 0.03662109375 79468
0 0.0679931640625 10932
10585000
6
4
1 0.0054931640625 59759
1 0.12353515625 56464
0 0.0496826171875 98193
0 0.0887451171875 78966
 4
1000000
5
2
0 0.03125 3000
1 0.03125 3000
6620000
7
2
0 0.0732421875 42307
0 0.0740966796875 40942
39677000
4
4
0 0.19624457693261887 30754
1 0.00634765625 26165
0 0.03662109375 79468
0 0.0679931640625 10932
10585000
6
4
1 0.0054931640625 59759
1 0.12353515625 56464
0 0.0496826171875 98193
0 0.0887451171875 78966
 4
1000000
5
2
0 0.03125 3000
1 0.03125 3825
6620000
7
2
0 0.0732421875 42307
0 0.0740966796875 40942
39677000
4
4
0 0.19624457693261887 30754
1 0.00634765625 26165
0 0.03662109375 79468
0 0.0679931640625 10932
10585000
6
4
1 0.0054931640625 59759
1 0.12353515625 56464
0 0.0496826171875 98193
0 0.0887451171875 78966
 4
1000000
5
2
0 0.03125 3000
1 0.03125 3825
6620000
7
2
0 0.0732421875 42307
0 0.0740966796875 40942
56271855
4
4
0 0.19624457693261887 30754
1 0.00634765625 26165
0 0.03662109375 79468
0 0.0679931640625 10932
10585000
6
4
1 0.0054931640625 59759
1 0.12353515625 56464
0 0.0496826171875 98193
0 0.0887451171875 78966
 4
1000000
5
2
0 0.03125 3000
1 0.17615020446016216 3825
6620000
7
2
0 0.0732421875 42307
0 0.0740966796875 40942
56271855
4
4
0 0.19624457693261887 30754
1 0.00634765625 26165
0 0.03662109375 79468
0 0.0679931640625 10932
10585000
6
4
1 0.0054931640625 59759
1 0.12353515625 56464
0 0.0496826171875 44107
0 0.0887451171875 78966
 4
1000000
5
2
0 0.03125 3000
1 0.17615020446016216 3825
6620000
7
2
0 0.0732421875 42307
0 0.0740966796875 40942
56271855
4
4
0 0.19624457693261887 30754
1 0.00634765625 26165
0 0.03662109375 79468
0 0.0679931640625 10932
10585000
6
4
1 0.0054931640625 59759
1 0.12353515625 56464
0 0.0496826171875 44107
0 0.3973222802879146 78966
 4
1000000
5
2
0 0.03125 3000
1 0.17615020446016216 3825
6620000
7
2
0 0.0732421875 42307
0 0.0740966796875 40942
56271855
4
4
0 0.19624457693261887 30754
1 0.00634765625 26165
0 0.03662109375 79468
0 0.583712682805818 10932
10585000
6
4
1 0.0054931640625 59759
1 0.12353515625 56464
0 0.0496826171875 44107
0 0.3973222802879146 78966
 4
1000000
5
2
0 0.03125 3000
1 0.17615020446016216 3825
6620000
7
2
0 0.0732421875 42307
0 0.0740966796875 40942
56271855
4
4
0 0.19624457693261887 30754
1 0.00634765625 26165
0 0.03662109375 79468
1 0.583712682805818 10932
10585000
6
4
1 0.0054931640625 59759
1 0.12353515625 56464
0 0.0496826171875 44107
0 0.3973222802879146 78966
 4
1000000
5
2
0 0.03125 4950
1 0.03125 3000
6620000
7
2
0 0.0732421875 42307
1 0.0740966796875 40942
39677000
4
4
0 0.0709228515625 30754
1 0.00634765625 26165
0 0.03662109375 79468
0 0.0679931640625 10932
10585000
6
4
1 0.0054931640625 59759
1 0.12353515625 56464
0 0.0496826171875 98193
0 0.0887451171875 78966
 4
1000000
5
2
0 0.03125 3000
1 0.03125 3825
6620000
7
2
0 0.0732421875 42307
0 0.0740966796875 40942
56271855
4
4
0 0.19624457693261887 30754
1 0.00634765625 26165
0 0.03662109375 79468
0 0.0679931640625 10932
10585000
6
4
1 0.0054931640625 59759
1 0.12353515625 56464
0 1.0362451886969601 44107
0 0.0887451171875 78966

1150357
9703337
50796918
20829397
 1150357
9703337
70670407
20829397
 1145966
9703337
70670407
20829397
 1145966
9703337
100294815
20829397
 2223493
9703337
100294815
20829397
 2223493
9703337
100294815
34875548
 2223493
9703337
187582419
34875548
 2223493
9703337
353920278
34875548
 1150357
10559683
50796918
20829397
 1145966
9703337
100294815
75447310

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 SIMPLE_INTEREST = 0; /* 単利 */
int COMPOUND_INTEREST = 1; /* 複利 */
int RATE_DIVISION = 8192; /* 年利率の単位の逆数 (1/x) */

/* 最終資金をシミュレートする */
long simulate(long f, int y, int interestType, double interestRate, int annualFee) {
	double interest = 0;
	int r, i;
	long long lf = f;
	r = (int)(interestRate * RATE_DIVISION + 0.5); /* 整数での計算用に変換した年利率 */
	/* 年毎のシミュレーション */
	for (i = 0; i < y; i++) {
		interest += lf * r / RATE_DIVISION; /* 利子をつける */
		if (interestType == COMPOUND_INTEREST) {
			lf += interest;
			interest = 0;
		}
		lf -= annualFee; /* 年間手数料をとる */
	}
	lf += interest;
	return (long)lf;
}

int main(void) {
	int m; /* データセット数 */
	int i, j;

	if (scanf("%d", &m) != 1) return 0;

	/* データセット毎の処理 */
	for (i = 0; i < m; i++) {
		long f; /* 初期資金 */
		int y; /* 運用年数 */
		int n; /* 運用方法の種類数 */
		long max; /* 最大の最終資金 */

		if (scanf("%ld%d%d", &f, &y, &n) != 3) return 0;
		if (f <= 0 || f > 100000000 || y <= 0 || y > 10 || n <= 0 || n > 100) return 0;
		max = f;

		/* データセット毎の処理 */
		for (j = 0; j < n; j++) {
			int it; double ir; int af; /* 入力 */
			long r;
			if (scanf("%d%lf%d", &it, &ir, &af) != 3) return 0;
			/* シミュレーション */
			r = simulate(f, y, it, ir, af);
			if (r > max) max = r; /* 最大値を記録する */
		}

		printf("%ld\n", max); /* 出力 */
	}

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	SIMPLE_INTEREST
	.bss
	.align 4
	.type	SIMPLE_INTEREST, @object
	.size	SIMPLE_INTEREST, 4
SIMPLE_INTEREST:
	.zero	4
	.globl	COMPOUND_INTEREST
	.data
	.align 4
	.type	COMPOUND_INTEREST, @object
	.size	COMPOUND_INTEREST, 4
COMPOUND_INTEREST:
	.long	1
	.globl	RATE_DIVISION
	.align 4
	.type	RATE_DIVISION, @object
	.size	RATE_DIVISION, 4
RATE_DIVISION:
	.long	8192
	.text
	.globl	simulate
	.type	simulate, @function
simulate:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movsd	%xmm0, -56(%rbp)
	movl	%ecx, -60(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -16(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -8(%rbp)
	movl	RATE_DIVISION(%rip), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movapd	%xmm0, %xmm1
	mulsd	-56(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L2
.L4:
	movl	-20(%rbp), %eax
	cltq
	imulq	-8(%rbp), %rax
	movl	RATE_DIVISION(%rip), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	movsd	-16(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	COMPOUND_INTEREST(%rip), %eax
	cmpl	%eax, -48(%rbp)
	jne	.L3
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-8(%rbp), %xmm0
	addsd	-16(%rbp), %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -16(%rbp)
.L3:
	movl	-60(%rbp), %eax
	cltq
	subq	%rax, -8(%rbp)
	addl	$1, -24(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L4
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-8(%rbp), %xmm0
	addsd	-16(%rbp), %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	simulate, .-simulate
	.section	.rodata
.LC2:
	.string	"%d"
.LC3:
	.string	"%ld%d%d"
.LC4:
	.string	"%d%lf%d"
.LC5:
	.string	"%ld\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
	leaq	-68(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L7
	movl	$0, %eax
	jmp	.L19
.L7:
	movl	$0, -48(%rbp)
	jmp	.L9
.L18:
	leaq	-60(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L10
	movl	$0, %eax
	jmp	.L19
.L10:
	movq	-40(%rbp), %rax
	testq	%rax, %rax
	jle	.L12
	movq	-40(%rbp), %rax
	cmpq	$100000000, %rax
	jg	.L12
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	jle	.L12
	movl	-64(%rbp), %eax
	cmpl	$10, %eax
	jg	.L12
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jle	.L12
	movl	-60(%rbp), %eax
	cmpl	$100, %eax
	jle	.L13
.L12:
	movl	$0, %eax
	jmp	.L19
.L13:
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L14
.L17:
	leaq	-52(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L15
	movl	$0, %eax
	jmp	.L19
.L15:
	movl	-52(%rbp), %ecx
	movq	-32(%rbp), %rdi
	movl	-56(%rbp), %edx
	movl	-64(%rbp), %esi
	movq	-40(%rbp), %rax
	movq	%rdi, %xmm0
	movq	%rax, %rdi
	call	simulate
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jle	.L16
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
.L16:
	addl	$1, -44(%rbp)
.L14:
	movl	-60(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L17
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -48(%rbp)
.L9:
	movl	-68(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L18
	movl	$0, %eax
.L19:
	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
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1071644672
	.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	SIMPLE_INTEREST
	.bss
	.align 4
	.type	SIMPLE_INTEREST, @object
	.size	SIMPLE_INTEREST, 4
SIMPLE_INTEREST:
	.zero	4
	.globl	COMPOUND_INTEREST
	.data
	.align 4
	.type	COMPOUND_INTEREST, @object
	.size	COMPOUND_INTEREST, 4
COMPOUND_INTEREST:
	.long	1
	.globl	RATE_DIVISION
	.align 4
	.type	RATE_DIVISION, @object
	.size	RATE_DIVISION, 4
RATE_DIVISION:
	.long	8192
	.text
	.globl	simulate
	.type	simulate, @function
simulate:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	%esi, -44(%rbp)
	movl	%edx, -48(%rbp)
	movsd	%xmm0, -56(%rbp)
	movl	%ecx, -60(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -16(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -8(%rbp)
	movl	RATE_DIVISION(%rip), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movapd	%xmm0, %xmm1
	mulsd	-56(%rbp), %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L2
.L4:
	movl	-20(%rbp), %eax
	cltq
	imulq	-8(%rbp), %rax
	movl	RATE_DIVISION(%rip), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	movsd	-16(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -16(%rbp)
	movl	COMPOUND_INTEREST(%rip), %eax
	cmpl	%eax, -48(%rbp)
	jne	.L3
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-8(%rbp), %xmm0
	addsd	-16(%rbp), %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -16(%rbp)
.L3:
	movl	-60(%rbp), %eax
	cltq
	subq	%rax, -8(%rbp)
	addl	$1, -24(%rbp)
.L2:
	movl	-24(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jl	.L4
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-8(%rbp), %xmm0
	addsd	-16(%rbp), %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	simulate, .-simulate
	.section	.rodata
.LC2:
	.string	"%d"
.LC3:
	.string	"%ld%d%d"
.LC4:
	.string	"%d%lf%d"
.LC5:
	.string	"%ld\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
	leaq	-68(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L7
	movl	$0, %eax
	jmp	.L19
.L7:
	movl	$0, -48(%rbp)
	jmp	.L9
.L18:
	leaq	-60(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L10
	movl	$0, %eax
	jmp	.L19
.L10:
	movq	-40(%rbp), %rax
	testq	%rax, %rax
	jle	.L12
	movq	-40(%rbp), %rax
	cmpq	$100000000, %rax
	jg	.L12
	movl	-64(%rbp), %eax
	testl	%eax, %eax
	jle	.L12
	movl	-64(%rbp), %eax
	cmpl	$10, %eax
	jg	.L12
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jle	.L12
	movl	-60(%rbp), %eax
	cmpl	$100, %eax
	jle	.L13
.L12:
	movl	$0, %eax
	jmp	.L19
.L13:
	movq	-40(%rbp), %rax
	movq	%rax, -24(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L14
.L17:
	leaq	-52(%rbp), %rcx
	leaq	-32(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	je	.L15
	movl	$0, %eax
	jmp	.L19
.L15:
	movl	-52(%rbp), %ecx
	movq	-32(%rbp), %rdi
	movl	-56(%rbp), %edx
	movl	-64(%rbp), %esi
	movq	-40(%rbp), %rax
	movq	%rdi, %xmm0
	movq	%rax, %rdi
	call	simulate
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jle	.L16
	movq	-16(%rbp), %rax
	movq	%rax, -24(%rbp)
.L16:
	addl	$1, -44(%rbp)
.L14:
	movl	-60(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L17
	movq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -48(%rbp)
.L9:
	movl	-68(%rbp), %eax
	cmpl	%eax, -48(%rbp)
	jl	.L18
	movl	$0, %eax
.L19:
	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
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1071644672
	.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:
