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(int initial, int year, int charge, double rate){ //単利
  int i, interest = 0;
  for(i = 0; i < year; i++){
    interest += initial * rate;
    initial -= charge;
  }
  return initial + interest;
}

int compound(int initial, int year, int charge, double rate){ //複利
  int i, interest;
  for(i = 0; i < year; i++){
    interest = initial * rate;
    initial = initial + interest - charge;
  }
  return initial;
}

int Max(int a, int b){
  if(a > b)
    return a;
  else
    return b;
}

void solve(){
  int initial, year, n, s_c, charge;
  int i, result = 0, buf;
  double rate;
  
  scanf("%d", &initial);
  scanf("%d", &year);
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d %lf %d", &s_c, &rate, &charge);
    if(s_c == 0) result = Max(result, simple(initial, year, charge, rate));
    else result = Max(result, compound(initial, year, charge, rate));
  }
  printf("%d\n", result);
}

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

  for(i = 0; i < m; i++){
    solve();
  }

  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	simple
	.type	simple, @function
simple:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movsd	%xmm0, -40(%rbp)
	movl	$0, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-4(%rbp), %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-20(%rbp), %xmm0
	mulsd	-40(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%rbp)
	movl	-28(%rbp), %eax
	subl	%eax, -20(%rbp)
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L3
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	simple, .-simple
	.globl	compound
	.type	compound, @function
compound:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movsd	%xmm0, -40(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L6
.L7:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-20(%rbp), %xmm0
	mulsd	-40(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	subl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	addl	$1, -8(%rbp)
.L6:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L7
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	compound, .-compound
	.globl	Max
	.type	Max, @function
Max:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L10
	movl	-4(%rbp), %eax
	jmp	.L11
.L10:
	movl	-8(%rbp), %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	Max, .-Max
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %lf %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB3:
	.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
	movl	$0, -20(%rbp)
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L13
.L16:
	leaq	-28(%rbp), %rcx
	leaq	-16(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movq	-16(%rbp), %rsi
	movl	-28(%rbp), %edx
	movl	-40(%rbp), %ecx
	movl	-44(%rbp), %eax
	movq	%rsi, %xmm0
	movl	%ecx, %esi
	movl	%eax, %edi
	call	simple
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Max
	movl	%eax, -20(%rbp)
	jmp	.L15
.L14:
	movq	-16(%rbp), %rsi
	movl	-28(%rbp), %edx
	movl	-40(%rbp), %ecx
	movl	-44(%rbp), %eax
	movq	%rsi, %xmm0
	movl	%ecx, %esi
	movl	%eax, %edi
	call	compound
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Max
	movl	%eax, -20(%rbp)
.L15:
	addl	$1, -24(%rbp)
.L13:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L16
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	solve, .-solve
	.globl	main
	.type	main, @function
main:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L19
.L20:
	movl	$0, %eax
	call	solve
	addl	$1, -12(%rbp)
.L19:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	simple
	.type	simple, @function
simple:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L4
	movl	%edi, %r8d
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L3:
	pxor	%xmm1, %xmm1
	pxor	%xmm2, %xmm2
	movl	%ecx, %eax
	addl	$1, %ecx
	cvtsi2sdl	%r8d, %xmm1
	subl	%edx, %r8d
	cvtsi2sdl	%r9d, %xmm2
	mulsd	%xmm0, %xmm1
	addsd	%xmm2, %xmm1
	cvttsd2sil	%xmm1, %r9d
	cmpl	%ecx, %esi
	jne	.L3
	subl	%edx, %edi
	imull	%eax, %edx
	subl	%edx, %edi
	leal	(%rdi,%r9), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	simple, .-simple
	.p2align 4
	.globl	compound
	.type	compound, @function
compound:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	testl	%esi, %esi
	jle	.L8
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	pxor	%xmm1, %xmm1
	addl	$1, %ecx
	cvtsi2sdl	%eax, %xmm1
	mulsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %edi
	addl	%edi, %eax
	subl	%edx, %eax
	cmpl	%ecx, %esi
	jne	.L9
.L8:
	ret
	.cfi_endproc
.LFE24:
	.size	compound, .-compound
	.p2align 4
	.globl	Max
	.type	Max, @function
Max:
.LFB25:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	Max, .-Max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %lf %d"
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB26:
	.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
	xorl	%r14d, %r14d
	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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	xorl	%r15d, %r15d
	leaq	28(%rsp), %r13
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L14
	movl	16(%rsp), %esi
	movsd	32(%rsp), %xmm2
	movl	28(%rsp), %edi
	movl	12(%rsp), %r8d
	testl	%esi, %esi
	jle	.L15
	xorl	%edx, %edx
	movl	%r8d, %eax
	.p2align 4,,10
	.p2align 3
.L16:
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %edx
	cvtsi2sdl	%eax, %xmm0
	subl	%edi, %eax
	cvtsi2sdl	%ecx, %xmm1
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %ecx
	cmpl	%edx, %esi
	jne	.L16
	subl	$1, %esi
	subl	%edi, %r8d
	imull	%edi, %esi
	subl	%esi, %r8d
	addl	%ecx, %r8d
.L15:
	cmpl	%r8d, %r14d
	cmovl	%r8d, %r14d
.L17:
	addl	$1, %r15d
	cmpl	%r15d, 20(%rsp)
	jg	.L20
.L13:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	16(%rsp), %esi
	movsd	32(%rsp), %xmm1
	movl	28(%rsp), %edi
	movl	12(%rsp), %eax
	testl	%esi, %esi
	jle	.L18
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L19:
	pxor	%xmm0, %xmm0
	addl	$1, %edx
	cvtsi2sdl	%eax, %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %ecx
	addl	%ecx, %eax
	subl	%edi, %eax
	cmpl	%edx, %esi
	jne	.L19
.L18:
	cmpl	%eax, %r14d
	cmovl	%eax, %r14d
	jmp	.L17
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	solve, .-solve
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L29
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L30:
	xorl	%eax, %eax
	addl	$1, %ebx
	call	solve
	cmpl	%ebx, 4(%rsp)
	jg	.L30
.L29:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L34:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE27:
	.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
	.p2align 4
	.globl	simple
	.type	simple, @function
simple:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L4
	movl	%edi, %r8d
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L3:
	pxor	%xmm1, %xmm1
	pxor	%xmm2, %xmm2
	movl	%ecx, %eax
	addl	$1, %ecx
	cvtsi2sdl	%r8d, %xmm1
	subl	%edx, %r8d
	cvtsi2sdl	%r9d, %xmm2
	mulsd	%xmm0, %xmm1
	addsd	%xmm2, %xmm1
	cvttsd2sil	%xmm1, %r9d
	cmpl	%ecx, %esi
	jne	.L3
	subl	%edx, %edi
	imull	%eax, %edx
	subl	%edx, %edi
	leal	(%rdi,%r9), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	simple, .-simple
	.p2align 4
	.globl	compound
	.type	compound, @function
compound:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	testl	%esi, %esi
	jle	.L8
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	pxor	%xmm1, %xmm1
	addl	$1, %ecx
	cvtsi2sdl	%eax, %xmm1
	mulsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %edi
	addl	%edi, %eax
	subl	%edx, %eax
	cmpl	%ecx, %esi
	jne	.L9
.L8:
	ret
	.cfi_endproc
.LFE24:
	.size	compound, .-compound
	.p2align 4
	.globl	Max
	.type	Max, @function
Max:
.LFB25:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	Max, .-Max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %lf %d"
.LC2:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB26:
	.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
	xorl	%r14d, %r14d
	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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	xorl	%r15d, %r15d
	leaq	28(%rsp), %r13
	leaq	32(%rsp), %r12
	leaq	24(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L14
	movl	16(%rsp), %esi
	movsd	32(%rsp), %xmm2
	movl	28(%rsp), %edi
	movl	12(%rsp), %r8d
	testl	%esi, %esi
	jle	.L15
	xorl	%edx, %edx
	movl	%r8d, %eax
	.p2align 4,,10
	.p2align 3
.L16:
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %edx
	cvtsi2sdl	%eax, %xmm0
	subl	%edi, %eax
	cvtsi2sdl	%ecx, %xmm1
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %ecx
	cmpl	%edx, %esi
	jne	.L16
	subl	$1, %esi
	subl	%edi, %r8d
	imull	%edi, %esi
	subl	%esi, %r8d
	addl	%ecx, %r8d
.L15:
	cmpl	%r8d, %r14d
	cmovl	%r8d, %r14d
.L17:
	addl	$1, %r15d
	cmpl	%r15d, 20(%rsp)
	jg	.L20
.L13:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	16(%rsp), %esi
	movsd	32(%rsp), %xmm1
	movl	28(%rsp), %edi
	movl	12(%rsp), %eax
	testl	%esi, %esi
	jle	.L18
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L19:
	pxor	%xmm0, %xmm0
	addl	$1, %edx
	cvtsi2sdl	%eax, %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %ecx
	addl	%ecx, %eax
	subl	%edi, %eax
	cmpl	%edx, %esi
	jne	.L19
.L18:
	cmpl	%eax, %r14d
	cmovl	%eax, %r14d
	jmp	.L17
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	solve, .-solve
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	.LC0(%rip), %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L29
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L30:
	xorl	%eax, %eax
	addl	$1, %ebx
	call	solve
	cmpl	%ebx, 4(%rsp)
	jg	.L30
.L29:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L34:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE27:
	.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:

#include <stdio.h>

int simple(int initial, int year, int charge, double rate){ //単利
  int i, interest = 0;
  for(i = 0; i < year; i++){
    interest += initial * rate;
    initial -= charge;
  }
  return initial + interest;
}

int compound(int initial, int year, int charge, double rate){ //複利
  int i, interest;
  for(i = 0; i < year; i++){
    interest = initial * rate;
    initial = initial + interest - charge;
  }
  return initial;
}

int Max(int a, int b){
  if(a > b)
    return a;
  else
    return b;
}

void solve(){
  int initial, year, n, s_c, charge;
  int i, result = 0, buf;
  double rate;
  
  scanf("%d", &initial);
  scanf("%d", &year);
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d %lf %d", &s_c, &rate, &charge);
    if(s_c == 0) result = Max(result, simple(initial, year, charge, rate));
    else result = Max(result, compound(initial, year, charge, rate));
  }
  printf("%d\n", result);
}

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

  for(i = 0; i < m; i++){
    solve();
  }

  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
70663355
20829397
 1145966
9703337
70663355
20829397
 1145966
9703337
100284811
20829397
 2223521
9703337
100284811
20829397
 2223521
9703337
100284811
34874515
 2223521
9703337
187576221
34874515
 2223521
9703337
353895649
34874515
 1150357
10559683
50796918
20829397
 1145966
9703337
100284811
75446701

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(int initial, int year, int charge, double rate){ //単利
  int i, interest = 0;
  for(i = 0; i < year; i++){
    interest += initial * rate;
    initial -= charge;
  }
  return initial + interest;
}

int compound(int initial, int year, int charge, double rate){ //複利
  int i, interest;
  for(i = 0; i < year; i++){
    interest = initial * rate;
    initial = initial + interest - charge;
  }
  return initial;
}

int Max(int a, int b){
  if(a > b)
    return a;
  else
    return b;
}

void solve(){
  int initial, year, n, s_c, charge;
  int i, result = 0, buf;
  double rate;
  
  scanf("%d", &initial);
  scanf("%d", &year);
  scanf("%d", &n);
  
  for(i = 0; i < n; i++){
    scanf("%d %lf %d", &s_c, &rate, &charge);
    if(s_c == 0) result = Max(result, simple(initial, year, charge, rate));
    else result = Max(result, compound(initial, year, charge, rate));
  }
  printf("%d\n", result);
}

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

  for(i = 0; i < m; i++){
    solve();
  }

  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	simple
	.type	simple, @function
simple:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movsd	%xmm0, -40(%rbp)
	movl	$0, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-4(%rbp), %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-20(%rbp), %xmm0
	mulsd	-40(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%rbp)
	movl	-28(%rbp), %eax
	subl	%eax, -20(%rbp)
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L3
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	simple, .-simple
	.globl	compound
	.type	compound, @function
compound:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movsd	%xmm0, -40(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L6
.L7:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-20(%rbp), %xmm0
	mulsd	-40(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	subl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	addl	$1, -8(%rbp)
.L6:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L7
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	compound, .-compound
	.globl	Max
	.type	Max, @function
Max:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L10
	movl	-4(%rbp), %eax
	jmp	.L11
.L10:
	movl	-8(%rbp), %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	Max, .-Max
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %lf %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB3:
	.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
	movl	$0, -20(%rbp)
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L13
.L16:
	leaq	-28(%rbp), %rcx
	leaq	-16(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movq	-16(%rbp), %rsi
	movl	-28(%rbp), %edx
	movl	-40(%rbp), %ecx
	movl	-44(%rbp), %eax
	movq	%rsi, %xmm0
	movl	%ecx, %esi
	movl	%eax, %edi
	call	simple
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Max
	movl	%eax, -20(%rbp)
	jmp	.L15
.L14:
	movq	-16(%rbp), %rsi
	movl	-28(%rbp), %edx
	movl	-40(%rbp), %ecx
	movl	-44(%rbp), %eax
	movq	%rsi, %xmm0
	movl	%ecx, %esi
	movl	%eax, %edi
	call	compound
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Max
	movl	%eax, -20(%rbp)
.L15:
	addl	$1, -24(%rbp)
.L13:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L16
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	solve, .-solve
	.globl	main
	.type	main, @function
main:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L19
.L20:
	movl	$0, %eax
	call	solve
	addl	$1, -12(%rbp)
.L19:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.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	simple
	.type	simple, @function
simple:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movsd	%xmm0, -40(%rbp)
	movl	$0, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L3:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-4(%rbp), %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-20(%rbp), %xmm0
	mulsd	-40(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%rbp)
	movl	-28(%rbp), %eax
	subl	%eax, -20(%rbp)
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L3
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	simple, .-simple
	.globl	compound
	.type	compound, @function
compound:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movsd	%xmm0, -40(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L6
.L7:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-20(%rbp), %xmm0
	mulsd	-40(%rbp), %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	subl	-28(%rbp), %eax
	movl	%eax, -20(%rbp)
	addl	$1, -8(%rbp)
.L6:
	movl	-8(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L7
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	compound, .-compound
	.globl	Max
	.type	Max, @function
Max:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L10
	movl	-4(%rbp), %eax
	jmp	.L11
.L10:
	movl	-8(%rbp), %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	Max, .-Max
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %lf %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB3:
	.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
	movl	$0, -20(%rbp)
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L13
.L16:
	leaq	-28(%rbp), %rcx
	leaq	-16(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movq	-16(%rbp), %rsi
	movl	-28(%rbp), %edx
	movl	-40(%rbp), %ecx
	movl	-44(%rbp), %eax
	movq	%rsi, %xmm0
	movl	%ecx, %esi
	movl	%eax, %edi
	call	simple
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Max
	movl	%eax, -20(%rbp)
	jmp	.L15
.L14:
	movq	-16(%rbp), %rsi
	movl	-28(%rbp), %edx
	movl	-40(%rbp), %ecx
	movl	-44(%rbp), %eax
	movq	%rsi, %xmm0
	movl	%ecx, %esi
	movl	%eax, %edi
	call	compound
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	Max
	movl	%eax, -20(%rbp)
.L15:
	addl	$1, -24(%rbp)
.L13:
	movl	-36(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L16
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	solve, .-solve
	.globl	main
	.type	main, @function
main:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L19
.L20:
	movl	$0, %eax
	call	solve
	addl	$1, -12(%rbp)
.L19:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L20
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.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:
