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

```c
#include <stdio.h>
#include <stdlib.h>

#define MAX(A,B) \
  ( (B) > (A) ? (B) : (A) )

int
main (
  int   argc,
  char *argv[ ]
  )
{
  int dsn;
  int i, j;

  scanf ( "%d", &dsn );
  while ( dsn-- )
  {
    int init, years, wn;
    int res = 0;

    scanf ( "%d%d%d", &init, &years, &wn );
    while ( wn-- )
    {
      int type, reqs;
      double mag;

      scanf ( "%d%lf%d", &type, &mag, &reqs );
      if ( type == 0 )
      { /* 単利の場合 */
        int cur = init, adx = 0;

        for ( i = 0; i < years; ++i )
        {
          adx += (int)( cur * mag );
          cur -= reqs;
        }
        res = MAX( res, cur + adx );
      }
      else
      { /* 複利の場合 */
        int cur = init;

        for ( i = 0; i < years; ++i )
        {
          cur = (int)( cur + cur * mag - reqs );
        }
        res = MAX( res, cur );
      }
    }

    printf ( "%d\n", res );
  }

  return ( EXIT_SUCCESS );
}```

Assembly Code:

```assembly
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	je	.L11
	leaq	32(%rsp), %rax
	leaq	36(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	28(%rsp), %rax
	leaq	.LC2(%rip), %r13
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %r14d
	leal	-1(%r14), %eax
	movl	%eax, 36(%rsp)
	testl	%r14d, %r14d
	je	.L3
	xorl	%r14d, %r14d
	leaq	44(%rsp), %r12
	leaq	48(%rsp), %rbp
	leaq	40(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r12, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L4
	movl	32(%rsp), %r8d
	movl	28(%rsp), %r9d
	testl	%r8d, %r8d
	jle	.L5
	movsd	48(%rsp), %xmm1
	movl	44(%rsp), %edi
	movl	%r9d, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm0, %xmm0
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm0
	subl	%edi, %edx
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %esi
	addl	%esi, %ecx
	cmpl	%r8d, %eax
	jne	.L6
	subl	$1, %eax
	subl	%edi, %r9d
	imull	%eax, %edi
	subl	%edi, %r9d
	addl	%ecx, %r9d
.L5:
	cmpl	%r9d, %r14d
	cmovl	%r9d, %r14d
.L7:
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	jne	.L10
.L3:
	movl	%r14d, %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	jne	.L2
.L11:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$72, %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
.L4:
	.cfi_restore_state
	movl	32(%rsp), %ecx
	movl	28(%rsp), %edx
	testl	%ecx, %ecx
	jle	.L8
	pxor	%xmm2, %xmm2
	movsd	48(%rsp), %xmm3
	xorl	%eax, %eax
	cvtsi2sdl	44(%rsp), %xmm2
	.p2align 4,,10
	.p2align 3
.L9:
	pxor	%xmm1, %xmm1
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm1
	movapd	%xmm1, %xmm0
	mulsd	%xmm3, %xmm0
	addsd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	cvttsd2sil	%xmm0, %edx
	cmpl	%ecx, %eax
	jne	.L9
.L8:
	cmpl	%edx, %r14d
	cmovl	%edx, %r14d
	jmp	.L7
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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.
Optimized Assembly Code:

user
```assembly
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	je	.L11
	leaq	32(%rsp), %rax
	leaq	36(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	28(%rsp), %rax
	leaq	.LC2(%rip), %r13
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %r14d
	leal	-1(%r14), %eax
	movl	%eax, 36(%rsp)
	testl	%r14d, %r14d
	je	.L3
	xorl	%r14d, %r14d
	leaq	44(%rsp), %r12
	leaq	48(%rsp), %rbp
	leaq	40(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r12, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L4
	movl	32(%rsp), %r8d
	movl	28(%rsp), %r9d
	testl	%r8d, %r8d
	jle	.L5
	movsd	48(%rsp), %xmm1
	movl	44(%rsp), %edi
	movl	%r9d, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm0, %xmm0
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm0
	subl	%edi, %edx
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %esi
	addl	%esi, %ecx
	cmpl	%r8d, %eax
	jne	.L6
	subl	$1, %eax
	subl	%edi, %r9d
	imull	%eax, %edi
	subl	%edi, %r9d
	addl	%ecx, %r9d
.L5:
	cmpl	%r9d, %r14d
	cmovl	%r9d, %r14d
.L7:
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	jne	.L10
.L3:
	movl	%r14d, %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	jne	.L2
.L11:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$72, %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
.L4:
	.cfi_restore_state
	movl	32(%rsp), %ecx
	movl	28(%rsp), %edx
	testl	%ecx, %ecx
	jle	.L8
	pxor	%xmm2, %xmm2
	movsd	48(%rsp), %xmm3
	xorl	%eax, %eax
	cvtsi2sdl	44(%rsp), %xmm2
	.p2align 4,,10
	.p2align 3
.L9:
	pxor	%xmm1, %xmm1
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm1
	movapd	%xmm1, %xmm0
	mulsd	%xmm3, %xmm0
	addsd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	cvttsd2sil	%xmm0, %edx
	cmpl	%ecx, %eax
	jne	.L9
.L8:
	cmpl	%edx, %r14d
	cmovl	%edx, %r14d
	jmp	.L7
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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
```assembly
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	je	.L11
	leaq	32(%rsp), %rax
	leaq	36(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	28(%rsp), %rax
	leaq	.LC2(%rip), %r13
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %r14d
	leal	-1(%r14), %eax
	movl	%eax, 36(%rsp)
	testl	%r14d, %r14d
	je	.L3
	xorl	%r14d, %r14d
	leaq	44(%rsp), %r12
	leaq	48(%rsp), %rbp
	leaq	40(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r12, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L4
	movl	32(%rsp), %r8d
	movl	28(%rsp), %r9d
	testl	%r8d, %r8d
	jle	.L5
	movsd	48(%rsp), %xmm1
	movl	44(%rsp), %edi
	movl	%r9d, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm0, %xmm0
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm0
	subl	%edi, %edx
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %esi
	addl	%esi, %ecx
	cmpl	%r8d, %eax
	jne	.L6
	subl	$1, %eax
	subl	%edi, %r9d
	imull	%eax, %edi
	subl	%edi, %r9d
	addl	%ecx, %r9d
.L5:
	cmpl	%r9d, %r14d
	cmovl	%r9d, %r14d
.L7:
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	jne	.L10
.L3:
	movl	%r14d, %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	jne	.L2
.L11:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$72, %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
.L4:
	.cfi_restore_state
	movl	32(%rsp), %ecx
	movl	28(%rsp), %edx
	testl	%ecx, %ecx
	jle	.L8
	pxor	%xmm2, %xmm2
	movsd	48(%rsp), %xmm3
	xorl	%eax, %eax
	cvtsi2sdl	44(%rsp), %xmm2
	.p2align 4,,10
	.p2align 3
.L9:
	pxor	%xmm1, %xmm1
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm1
	movapd	%xmm1, %xmm0
	mulsd	%xmm3, %xmm0
	addsd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	cvttsd2sil	%xmm0, %edx
	cmpl	%ecx, %eax
	jne	.L9
.L8:
	cmpl	%edx, %r14d
	cmovl	%edx, %r14d
	jmp	.L7
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
```
```c
#include <stdio.h>
#include <stdlib.h>

#define MAX(A,B) \
  ( (B) > (A) ? (B) : (A) )

int
main (
  int   argc,
  char *argv[ ]
  )
{
  int dsn;
  int i, j;

  scanf ( "%d", &dsn );
  while ( dsn-- )
  {
    int init, years, wn;
    int res = 0;

    scanf ( "%d%d%d", &init, &years, &wn );
    while ( wn-- )
    {
      int type, reqs;
      double mag;

      scanf ( "%d%lf%d", &type, &mag, &reqs );
      if ( type == 0 )
      { /* 単利の場合 */
        int cur = init, adx = 0;

        for ( i = 0; i < years; ++i )
        {
          adx += (int)( cur * mag );
          cur -= reqs;
        }
        res = MAX( res, cur + adx );
      }
      else
      { /* 複利の場合 */
        int cur = init;

        for ( i = 0; i < years; ++i )
        {
          cur = (int)( cur + cur * mag - reqs );
        }
        res = MAX( res, cur );
      }
    }

    printf ( "%d\n", res );
  }

  return ( EXIT_SUCCESS );
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>

#define MAX(A,B) \
  ( (B) > (A) ? (B) : (A) )

int
main (
  int   argc,
  char *argv[ ]
  )
{
  int dsn;
  int i, j;

  scanf ( "%d", &dsn );
  while ( dsn-- )
  {
    int init, years, wn;
    int res = 0;

    scanf ( "%d%d%d", &init, &years, &wn );
    while ( wn-- )
    {
      int type, reqs;
      double mag;

      scanf ( "%d%lf%d", &type, &mag, &reqs );
      if ( type == 0 )
      { /* 単利の場合 */
        int cur = init, adx = 0;

        for ( i = 0; i < years; ++i )
        {
          adx += (int)( cur * mag );
          cur -= reqs;
        }
        res = MAX( res, cur + adx );
      }
      else
      { /* 複利の場合 */
        int cur = init;

        for ( i = 0; i < years; ++i )
        {
          cur = (int)( cur + cur * mag - reqs );
        }
        res = MAX( res, cur );
      }
    }

    printf ( "%d\n", res );
  }

  return ( EXIT_SUCCESS );
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>

#define MAX(A,B) \
  ( (B) > (A) ? (B) : (A) )

int
main (
  int   argc,
  char *argv[ ]
  )
{
  int dsn;
  int i, j;

  scanf ( "%d", &dsn );
  while ( dsn-- )
  {
    int init, years, wn;
    int res = 0;

    scanf ( "%d%d%d", &init, &years, &wn );
    while ( wn-- )
    {
      int type, reqs;
      double mag;

      scanf ( "%d%lf%d", &type, &mag, &reqs );
      if ( type == 0 )
      { /* 単利の場合 */
        int cur = init, adx = 0;

        for ( i = 0; i < years; ++i )
        {
          adx += (int)( cur * mag );
          cur -= reqs;
        }
        res = MAX( res, cur + adx );
      }
      else
      { /* 複利の場合 */
        int cur = init;

        for ( i = 0; i < years; ++i )
        {
          cur = (int)( cur + cur * mag - reqs );
        }
        res = MAX( res, cur );
      }
    }

    printf ( "%d\n", res );
  }

  return ( EXIT_SUCCESS );
}```

Assembly Code:

```assembly
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	je	.L11
	leaq	32(%rsp), %rax
	leaq	36(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	28(%rsp), %rax
	leaq	.LC2(%rip), %r13
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %r14d
	leal	-1(%r14), %eax
	movl	%eax, 36(%rsp)
	testl	%r14d, %r14d
	je	.L3
	xorl	%r14d, %r14d
	leaq	44(%rsp), %r12
	leaq	48(%rsp), %rbp
	leaq	40(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r12, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L4
	movl	32(%rsp), %r8d
	movl	28(%rsp), %r9d
	testl	%r8d, %r8d
	jle	.L5
	movsd	48(%rsp), %xmm1
	movl	44(%rsp), %edi
	movl	%r9d, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm0, %xmm0
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm0
	subl	%edi, %edx
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %esi
	addl	%esi, %ecx
	cmpl	%r8d, %eax
	jne	.L6
	subl	$1, %eax
	subl	%edi, %r9d
	imull	%eax, %edi
	subl	%edi, %r9d
	addl	%ecx, %r9d
.L5:
	cmpl	%r9d, %r14d
	cmovl	%r9d, %r14d
.L7:
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	jne	.L10
.L3:
	movl	%r14d, %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	jne	.L2
.L11:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$72, %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
.L4:
	.cfi_restore_state
	movl	32(%rsp), %ecx
	movl	28(%rsp), %edx
	testl	%ecx, %ecx
	jle	.L8
	pxor	%xmm2, %xmm2
	movsd	48(%rsp), %xmm3
	xorl	%eax, %eax
	cvtsi2sdl	44(%rsp), %xmm2
	.p2align 4,,10
	.p2align 3
.L9:
	pxor	%xmm1, %xmm1
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm1
	movapd	%xmm1, %xmm0
	mulsd	%xmm3, %xmm0
	addsd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	cvttsd2sil	%xmm0, %edx
	cmpl	%ecx, %eax
	jne	.L9
.L8:
	cmpl	%edx, %r14d
	cmovl	%edx, %r14d
	jmp	.L7
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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.
Optimized Assembly Code:

train
```assembly
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%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	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	je	.L11
	leaq	32(%rsp), %rax
	leaq	36(%rsp), %r15
	movq	%rax, 8(%rsp)
	leaq	28(%rsp), %rax
	leaq	.LC2(%rip), %r13
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	8(%rsp), %rdx
	movq	(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %r14d
	leal	-1(%r14), %eax
	movl	%eax, 36(%rsp)
	testl	%r14d, %r14d
	je	.L3
	xorl	%r14d, %r14d
	leaq	44(%rsp), %r12
	leaq	48(%rsp), %rbp
	leaq	40(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r12, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L4
	movl	32(%rsp), %r8d
	movl	28(%rsp), %r9d
	testl	%r8d, %r8d
	jle	.L5
	movsd	48(%rsp), %xmm1
	movl	44(%rsp), %edi
	movl	%r9d, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	pxor	%xmm0, %xmm0
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm0
	subl	%edi, %edx
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %esi
	addl	%esi, %ecx
	cmpl	%r8d, %eax
	jne	.L6
	subl	$1, %eax
	subl	%edi, %r9d
	imull	%eax, %edi
	subl	%edi, %r9d
	addl	%ecx, %r9d
.L5:
	cmpl	%r9d, %r14d
	cmovl	%r9d, %r14d
.L7:
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	jne	.L10
.L3:
	movl	%r14d, %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	24(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 24(%rsp)
	testl	%eax, %eax
	jne	.L2
.L11:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$72, %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
.L4:
	.cfi_restore_state
	movl	32(%rsp), %ecx
	movl	28(%rsp), %edx
	testl	%ecx, %ecx
	jle	.L8
	pxor	%xmm2, %xmm2
	movsd	48(%rsp), %xmm3
	xorl	%eax, %eax
	cvtsi2sdl	44(%rsp), %xmm2
	.p2align 4,,10
	.p2align 3
.L9:
	pxor	%xmm1, %xmm1
	addl	$1, %eax
	cvtsi2sdl	%edx, %xmm1
	movapd	%xmm1, %xmm0
	mulsd	%xmm3, %xmm0
	addsd	%xmm1, %xmm0
	subsd	%xmm2, %xmm0
	cvttsd2sil	%xmm0, %edx
	cmpl	%ecx, %eax
	jne	.L9
.L8:
	cmpl	%edx, %r14d
	cmovl	%edx, %r14d
	jmp	.L7
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
```