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 main(void)
{
  int m, plan, set, money, year, part, total, top, answer[500]={0}; 
  double r;
  scanf("%d", &m);
  int i, j, k;

  for(i=0; i<m; i++)
    {
      scanf(" %d %d %d", &money ,&year, &part);
      for(j=0; j<part; j++)
	{
/*	  scanf(" %d %f %d", &plan, &r, &set);*/
	  scanf(" %d %lf %d", &plan, &r, &set);
	  total=money;
	  if(plan==0)  //??????
	    {
	      top=0;
	      for(k=0; k<year; k++)
		{
		  top+=total*r;
		  total-=set;
		}
	      total+=top; 
	      if(answer[i]<=total)
		{
		  answer[i]=total; //?????§???   
		}   
	    }
	  else if(plan==1)//??????
	    {
	      for(k=0; k<year; k++)
		{
		  total+=total*r-set;	  
		}
	      if(answer[i]<=total)
		{
		  answer[i]=total; //?????§???   
		}
	    }
	  else
	    {
	      break;
	    }
	}
    }
  for(i=0; i<m; i++) printf("%d\n", answer[i]);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %d %d %d"
.LC2:
	.string	" %d %lf %d"
.LC3:
	.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	$2080, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2016(%rbp), %rdx
	movl	$0, %eax
	movl	$250, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-2068(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2036(%rbp)
	jmp	.L2
.L13:
	leaq	-2048(%rbp), %rcx
	leaq	-2052(%rbp), %rdx
	leaq	-2056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2032(%rbp)
	jmp	.L3
.L12:
	leaq	-2060(%rbp), %rcx
	leaq	-2024(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2056(%rbp), %eax
	movl	%eax, -2044(%rbp)
	movl	-2064(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, -2040(%rbp)
	movl	$0, -2028(%rbp)
	jmp	.L5
.L6:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-2040(%rbp), %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-2044(%rbp), %xmm2
	movsd	-2024(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -2040(%rbp)
	movl	-2060(%rbp), %eax
	subl	%eax, -2044(%rbp)
	addl	$1, -2028(%rbp)
.L5:
	movl	-2052(%rbp), %eax
	cmpl	%eax, -2028(%rbp)
	jl	.L6
	movl	-2040(%rbp), %eax
	addl	%eax, -2044(%rbp)
	movl	-2036(%rbp), %eax
	cltq
	movl	-2016(%rbp,%rax,4), %eax
	cmpl	%eax, -2044(%rbp)
	jl	.L7
	movl	-2036(%rbp), %eax
	cltq
	movl	-2044(%rbp), %edx
	movl	%edx, -2016(%rbp,%rax,4)
	jmp	.L7
.L4:
	movl	-2064(%rbp), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	$0, -2028(%rbp)
	jmp	.L9
.L10:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-2044(%rbp), %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-2044(%rbp), %xmm2
	movsd	-2024(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	movl	-2060(%rbp), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	subsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -2044(%rbp)
	addl	$1, -2028(%rbp)
.L9:
	movl	-2052(%rbp), %eax
	cmpl	%eax, -2028(%rbp)
	jl	.L10
	movl	-2036(%rbp), %eax
	cltq
	movl	-2016(%rbp,%rax,4), %eax
	cmpl	%eax, -2044(%rbp)
	jl	.L7
	movl	-2036(%rbp), %eax
	cltq
	movl	-2044(%rbp), %edx
	movl	%edx, -2016(%rbp,%rax,4)
.L7:
	addl	$1, -2032(%rbp)
.L3:
	movl	-2048(%rbp), %eax
	cmpl	%eax, -2032(%rbp)
	jl	.L12
	jmp	.L11
.L18:
	nop
.L11:
	addl	$1, -2036(%rbp)
.L2:
	movl	-2068(%rbp), %eax
	cmpl	%eax, -2036(%rbp)
	jl	.L13
	movl	$0, -2036(%rbp)
	jmp	.L14
.L15:
	movl	-2036(%rbp), %eax
	cltq
	movl	-2016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2036(%rbp)
.L14:
	movl	-2068(%rbp), %eax
	cmpl	%eax, -2036(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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 %d %d"
.LC2:
	.string	" %d %lf %d"
.LC3:
	.string	"%d\n"
	.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
	movl	$250, %ecx
	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	$2104, %rsp
	.cfi_def_cfa_offset 2160
	movq	%fs:40, %rax
	movq	%rax, 2088(%rsp)
	xorl	%eax, %eax
	leaq	80(%rsp), %rdi
	leaq	48(%rsp), %rsi
	movq	%rdi, 40(%rsp)
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %edx
	testl	%edx, %edx
	jle	.L13
	leaq	68(%rsp), %rax
	movl	$0, 12(%rsp)
	movq	40(%rsp), %rbx
	leaq	.LC2(%rip), %r14
	movq	%rax, 16(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 32(%rsp)
	leaq	60(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	16(%rsp), %rcx
	movq	32(%rsp), %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	68(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	xorl	%r15d, %r15d
	leaq	56(%rsp), %r13
	leaq	72(%rsp), %r12
	leaq	52(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rcx
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %esi
	movl	60(%rsp), %edx
	testl	%esi, %esi
	jne	.L6
	movl	64(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L11
	movsd	72(%rsp), %xmm2
	movl	56(%rsp), %edi
	xorl	%eax, %eax
	movl	%edx, %ecx
	.p2align 4,,10
	.p2align 3
.L8:
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %eax
	cvtsi2sdl	%ecx, %xmm0
	subl	%edi, %ecx
	cvtsi2sdl	%esi, %xmm1
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %esi
	cmpl	%r8d, %eax
	jne	.L8
	subl	$1, %eax
	subl	%edi, %edx
	imull	%eax, %edi
	subl	%edi, %edx
	addl	%esi, %edx
.L11:
	cmpl	%edx, (%rbx)
	jg	.L9
	movl	%edx, (%rbx)
.L9:
	addl	$1, %r15d
	cmpl	%r15d, 68(%rsp)
	jg	.L3
.L10:
	addl	$1, 12(%rsp)
	movl	48(%rsp), %eax
	addq	$4, %rbx
	movl	12(%rsp), %edi
	cmpl	%edi, %eax
	jg	.L4
	testl	%eax, %eax
	jle	.L13
	movq	40(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%r12,%rbx,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 48(%rsp)
	jg	.L14
.L13:
	movq	2088(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$2104, %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
.L6:
	.cfi_restore_state
	cmpl	$1, %esi
	jne	.L10
	movl	64(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L11
	pxor	%xmm2, %xmm2
	movsd	72(%rsp), %xmm3
	xorl	%eax, %eax
	cvtsi2sdl	56(%rsp), %xmm2
	.p2align 4,,10
	.p2align 3
.L12:
	pxor	%xmm1, %xmm1
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm1
	movapd	%xmm1, %xmm0
	mulsd	%xmm3, %xmm0
	subsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	cmpl	%ecx, %eax
	jne	.L12
	jmp	.L11
.L29:
	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 %d %d"
.LC2:
	.string	" %d %lf %d"
.LC3:
	.string	"%d\n"
	.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
	movl	$250, %ecx
	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	$2104, %rsp
	.cfi_def_cfa_offset 2160
	movq	%fs:40, %rax
	movq	%rax, 2088(%rsp)
	xorl	%eax, %eax
	leaq	80(%rsp), %rdi
	leaq	48(%rsp), %rsi
	movq	%rdi, 40(%rsp)
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %edx
	testl	%edx, %edx
	jle	.L13
	leaq	68(%rsp), %rax
	movl	$0, 12(%rsp)
	movq	40(%rsp), %rbx
	leaq	.LC2(%rip), %r14
	movq	%rax, 16(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 32(%rsp)
	leaq	60(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	16(%rsp), %rcx
	movq	32(%rsp), %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	68(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	xorl	%r15d, %r15d
	leaq	56(%rsp), %r13
	leaq	72(%rsp), %r12
	leaq	52(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rcx
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	52(%rsp), %esi
	movl	60(%rsp), %edx
	testl	%esi, %esi
	jne	.L6
	movl	64(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L11
	movsd	72(%rsp), %xmm2
	movl	56(%rsp), %edi
	xorl	%eax, %eax
	movl	%edx, %ecx
	.p2align 4,,10
	.p2align 3
.L8:
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	addl	$1, %eax
	cvtsi2sdl	%ecx, %xmm0
	subl	%edi, %ecx
	cvtsi2sdl	%esi, %xmm1
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %esi
	cmpl	%r8d, %eax
	jne	.L8
	subl	$1, %eax
	subl	%edi, %edx
	imull	%eax, %edi
	subl	%edi, %edx
	addl	%esi, %edx
.L11:
	cmpl	%edx, (%rbx)
	jg	.L9
	movl	%edx, (%rbx)
.L9:
	addl	$1, %r15d
	cmpl	%r15d, 68(%rsp)
	jg	.L3
.L10:
	addl	$1, 12(%rsp)
	movl	48(%rsp), %eax
	addq	$4, %rbx
	movl	12(%rsp), %edi
	cmpl	%edi, %eax
	jg	.L4
	testl	%eax, %eax
	jle	.L13
	movq	40(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%r12,%rbx,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 48(%rsp)
	jg	.L14
.L13:
	movq	2088(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$2104, %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
.L6:
	.cfi_restore_state
	cmpl	$1, %esi
	jne	.L10
	movl	64(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L11
	pxor	%xmm2, %xmm2
	movsd	72(%rsp), %xmm3
	xorl	%eax, %eax
	cvtsi2sdl	56(%rsp), %xmm2
	.p2align 4,,10
	.p2align 3
.L12:
	pxor	%xmm1, %xmm1
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm1
	movapd	%xmm1, %xmm0
	mulsd	%xmm3, %xmm0
	subsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	cmpl	%ecx, %eax
	jne	.L12
	jmp	.L11
.L29:
	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:

#include<stdio.h>
int main(void)
{
  int m, plan, set, money, year, part, total, top, answer[500]={0}; 
  double r;
  scanf("%d", &m);
  int i, j, k;

  for(i=0; i<m; i++)
    {
      scanf(" %d %d %d", &money ,&year, &part);
      for(j=0; j<part; j++)
	{
/*	  scanf(" %d %f %d", &plan, &r, &set);*/
	  scanf(" %d %lf %d", &plan, &r, &set);
	  total=money;
	  if(plan==0)  //??????
	    {
	      top=0;
	      for(k=0; k<year; k++)
		{
		  top+=total*r;
		  total-=set;
		}
	      total+=top; 
	      if(answer[i]<=total)
		{
		  answer[i]=total; //?????§???   
		}   
	    }
	  else if(plan==1)//??????
	    {
	      for(k=0; k<year; k++)
		{
		  total+=total*r-set;	  
		}
	      if(answer[i]<=total)
		{
		  answer[i]=total; //?????§???   
		}
	    }
	  else
	    {
	      break;
	    }
	}
    }
  for(i=0; i<m; i++) printf("%d\n", answer[i]);

  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 main(void)
{
  int m, plan, set, money, year, part, total, top, answer[500]={0}; 
  double r;
  scanf("%d", &m);
  int i, j, k;

  for(i=0; i<m; i++)
    {
      scanf(" %d %d %d", &money ,&year, &part);
      for(j=0; j<part; j++)
	{
/*	  scanf(" %d %f %d", &plan, &r, &set);*/
	  scanf(" %d %lf %d", &plan, &r, &set);
	  total=money;
	  if(plan==0)  //??????
	    {
	      top=0;
	      for(k=0; k<year; k++)
		{
		  top+=total*r;
		  total-=set;
		}
	      total+=top; 
	      if(answer[i]<=total)
		{
		  answer[i]=total; //?????§???   
		}   
	    }
	  else if(plan==1)//??????
	    {
	      for(k=0; k<year; k++)
		{
		  total+=total*r-set;	  
		}
	      if(answer[i]<=total)
		{
		  answer[i]=total; //?????§???   
		}
	    }
	  else
	    {
	      break;
	    }
	}
    }
  for(i=0; i<m; i++) printf("%d\n", answer[i]);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %d %d %d"
.LC2:
	.string	" %d %lf %d"
.LC3:
	.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	$2080, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2016(%rbp), %rdx
	movl	$0, %eax
	movl	$250, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-2068(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2036(%rbp)
	jmp	.L2
.L13:
	leaq	-2048(%rbp), %rcx
	leaq	-2052(%rbp), %rdx
	leaq	-2056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2032(%rbp)
	jmp	.L3
.L12:
	leaq	-2060(%rbp), %rcx
	leaq	-2024(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2056(%rbp), %eax
	movl	%eax, -2044(%rbp)
	movl	-2064(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, -2040(%rbp)
	movl	$0, -2028(%rbp)
	jmp	.L5
.L6:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-2040(%rbp), %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-2044(%rbp), %xmm2
	movsd	-2024(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -2040(%rbp)
	movl	-2060(%rbp), %eax
	subl	%eax, -2044(%rbp)
	addl	$1, -2028(%rbp)
.L5:
	movl	-2052(%rbp), %eax
	cmpl	%eax, -2028(%rbp)
	jl	.L6
	movl	-2040(%rbp), %eax
	addl	%eax, -2044(%rbp)
	movl	-2036(%rbp), %eax
	cltq
	movl	-2016(%rbp,%rax,4), %eax
	cmpl	%eax, -2044(%rbp)
	jl	.L7
	movl	-2036(%rbp), %eax
	cltq
	movl	-2044(%rbp), %edx
	movl	%edx, -2016(%rbp,%rax,4)
	jmp	.L7
.L4:
	movl	-2064(%rbp), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	$0, -2028(%rbp)
	jmp	.L9
.L10:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-2044(%rbp), %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-2044(%rbp), %xmm2
	movsd	-2024(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	movl	-2060(%rbp), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	subsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -2044(%rbp)
	addl	$1, -2028(%rbp)
.L9:
	movl	-2052(%rbp), %eax
	cmpl	%eax, -2028(%rbp)
	jl	.L10
	movl	-2036(%rbp), %eax
	cltq
	movl	-2016(%rbp,%rax,4), %eax
	cmpl	%eax, -2044(%rbp)
	jl	.L7
	movl	-2036(%rbp), %eax
	cltq
	movl	-2044(%rbp), %edx
	movl	%edx, -2016(%rbp,%rax,4)
.L7:
	addl	$1, -2032(%rbp)
.L3:
	movl	-2048(%rbp), %eax
	cmpl	%eax, -2032(%rbp)
	jl	.L12
	jmp	.L11
.L18:
	nop
.L11:
	addl	$1, -2036(%rbp)
.L2:
	movl	-2068(%rbp), %eax
	cmpl	%eax, -2036(%rbp)
	jl	.L13
	movl	$0, -2036(%rbp)
	jmp	.L14
.L15:
	movl	-2036(%rbp), %eax
	cltq
	movl	-2016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2036(%rbp)
.L14:
	movl	-2068(%rbp), %eax
	cmpl	%eax, -2036(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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 %d %d"
.LC2:
	.string	" %d %lf %d"
.LC3:
	.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	$2080, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-2016(%rbp), %rdx
	movl	$0, %eax
	movl	$250, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-2068(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2036(%rbp)
	jmp	.L2
.L13:
	leaq	-2048(%rbp), %rcx
	leaq	-2052(%rbp), %rdx
	leaq	-2056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -2032(%rbp)
	jmp	.L3
.L12:
	leaq	-2060(%rbp), %rcx
	leaq	-2024(%rbp), %rdx
	leaq	-2064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-2056(%rbp), %eax
	movl	%eax, -2044(%rbp)
	movl	-2064(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	movl	$0, -2040(%rbp)
	movl	$0, -2028(%rbp)
	jmp	.L5
.L6:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-2040(%rbp), %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-2044(%rbp), %xmm2
	movsd	-2024(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -2040(%rbp)
	movl	-2060(%rbp), %eax
	subl	%eax, -2044(%rbp)
	addl	$1, -2028(%rbp)
.L5:
	movl	-2052(%rbp), %eax
	cmpl	%eax, -2028(%rbp)
	jl	.L6
	movl	-2040(%rbp), %eax
	addl	%eax, -2044(%rbp)
	movl	-2036(%rbp), %eax
	cltq
	movl	-2016(%rbp,%rax,4), %eax
	cmpl	%eax, -2044(%rbp)
	jl	.L7
	movl	-2036(%rbp), %eax
	cltq
	movl	-2044(%rbp), %edx
	movl	%edx, -2016(%rbp,%rax,4)
	jmp	.L7
.L4:
	movl	-2064(%rbp), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	$0, -2028(%rbp)
	jmp	.L9
.L10:
	pxor	%xmm1, %xmm1
	cvtsi2sdl	-2044(%rbp), %xmm1
	pxor	%xmm2, %xmm2
	cvtsi2sdl	-2044(%rbp), %xmm2
	movsd	-2024(%rbp), %xmm0
	mulsd	%xmm2, %xmm0
	movl	-2060(%rbp), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	subsd	%xmm2, %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -2044(%rbp)
	addl	$1, -2028(%rbp)
.L9:
	movl	-2052(%rbp), %eax
	cmpl	%eax, -2028(%rbp)
	jl	.L10
	movl	-2036(%rbp), %eax
	cltq
	movl	-2016(%rbp,%rax,4), %eax
	cmpl	%eax, -2044(%rbp)
	jl	.L7
	movl	-2036(%rbp), %eax
	cltq
	movl	-2044(%rbp), %edx
	movl	%edx, -2016(%rbp,%rax,4)
.L7:
	addl	$1, -2032(%rbp)
.L3:
	movl	-2048(%rbp), %eax
	cmpl	%eax, -2032(%rbp)
	jl	.L12
	jmp	.L11
.L18:
	nop
.L11:
	addl	$1, -2036(%rbp)
.L2:
	movl	-2068(%rbp), %eax
	cmpl	%eax, -2036(%rbp)
	jl	.L13
	movl	$0, -2036(%rbp)
	jmp	.L14
.L15:
	movl	-2036(%rbp), %eax
	cltq
	movl	-2016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -2036(%rbp)
.L14:
	movl	-2068(%rbp), %eax
	cmpl	%eax, -2036(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
