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

```c

main(N,R,M,m,y,n,t,c,i,d){double r;
	for(scanf("%d",&N);N--;printf("%d\n",R)){
		for(scanf("%d%d%d",&M,&y,&n),R=M;n--;R=m>R?m:R){
			if(m=M,d=0,scanf("%d%lf%d",&t,&r,&c),t){ //fukuri
				for(i=0;i<y;i++){
					m+=(int)(r*m)-c;
				}
			}else{ //tanri
				for(i=0;i<y;i++){
					d+=(int)(r*m);
					m=m-c;
				}
				m+=d;
			}
		}
	}
exit(0);}```

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:
.LFB0:
	.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
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	%edi, 28(%rsp)
	leaq	28(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	movl	%edx, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%r9d, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	je	.L11
	leaq	20(%rsp), %rax
	leaq	16(%rsp), %r15
	movq	%rax, (%rsp)
	leaq	24(%rsp), %rax
	leaq	.LC2(%rip), %r12
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rdx
	movq	8(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	movl	16(%rsp), %eax
	movl	24(%rsp), %r14d
	leal	-1(%rax), %edx
	movl	%r14d, %r13d
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L3
	leaq	120(%rsp), %rbp
	leaq	32(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	leaq	112(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	112(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L4
	movl	20(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L7
	movsd	32(%rsp), %xmm1
	movl	120(%rsp), %edi
	xorl	%eax, %eax
	movl	%r14d, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	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	.L9
	subl	$1, %eax
	subl	%edi, %r14d
	imull	%edi, %eax
	subl	%eax, %r14d
	addl	%ecx, %r14d
.L7:
	movl	16(%rsp), %eax
	cmpl	%r14d, %r13d
	cmovl	%r14d, %r13d
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L3
	movl	24(%rsp), %r14d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L4:
	movl	20(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L7
	movsd	32(%rsp), %xmm1
	movl	120(%rsp), %esi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	pxor	%xmm0, %xmm0
	addl	$1, %eax
	cvtsi2sdl	%r14d, %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	subl	%esi, %edx
	addl	%edx, %r14d
	cmpl	%ecx, %eax
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r13d, %esi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L2
.L11:
	xorl	%edi, %edi
	call	exit@PLT
	.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.
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:
.LFB0:
	.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
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	%edi, 28(%rsp)
	leaq	28(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	movl	%edx, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%r9d, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	je	.L11
	leaq	20(%rsp), %rax
	leaq	16(%rsp), %r15
	movq	%rax, (%rsp)
	leaq	24(%rsp), %rax
	leaq	.LC2(%rip), %r12
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rdx
	movq	8(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	movl	16(%rsp), %eax
	movl	24(%rsp), %r14d
	leal	-1(%rax), %edx
	movl	%r14d, %r13d
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L3
	leaq	120(%rsp), %rbp
	leaq	32(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	leaq	112(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	112(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L4
	movl	20(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L7
	movsd	32(%rsp), %xmm1
	movl	120(%rsp), %edi
	xorl	%eax, %eax
	movl	%r14d, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	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	.L9
	subl	$1, %eax
	subl	%edi, %r14d
	imull	%edi, %eax
	subl	%eax, %r14d
	addl	%ecx, %r14d
.L7:
	movl	16(%rsp), %eax
	cmpl	%r14d, %r13d
	cmovl	%r14d, %r13d
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L3
	movl	24(%rsp), %r14d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L4:
	movl	20(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L7
	movsd	32(%rsp), %xmm1
	movl	120(%rsp), %esi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	pxor	%xmm0, %xmm0
	addl	$1, %eax
	cvtsi2sdl	%r14d, %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	subl	%esi, %edx
	addl	%edx, %r14d
	cmpl	%ecx, %eax
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r13d, %esi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L2
.L11:
	xorl	%edi, %edi
	call	exit@PLT
	.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:
```
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:
.LFB0:
	.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
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	%edi, 28(%rsp)
	leaq	28(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	movl	%edx, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%r9d, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	je	.L11
	leaq	20(%rsp), %rax
	leaq	16(%rsp), %r15
	movq	%rax, (%rsp)
	leaq	24(%rsp), %rax
	leaq	.LC2(%rip), %r12
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rdx
	movq	8(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	movl	16(%rsp), %eax
	movl	24(%rsp), %r14d
	leal	-1(%rax), %edx
	movl	%r14d, %r13d
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L3
	leaq	120(%rsp), %rbp
	leaq	32(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	leaq	112(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	112(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L4
	movl	20(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L7
	movsd	32(%rsp), %xmm1
	movl	120(%rsp), %edi
	xorl	%eax, %eax
	movl	%r14d, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	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	.L9
	subl	$1, %eax
	subl	%edi, %r14d
	imull	%edi, %eax
	subl	%eax, %r14d
	addl	%ecx, %r14d
.L7:
	movl	16(%rsp), %eax
	cmpl	%r14d, %r13d
	cmovl	%r14d, %r13d
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L3
	movl	24(%rsp), %r14d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L4:
	movl	20(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L7
	movsd	32(%rsp), %xmm1
	movl	120(%rsp), %esi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	pxor	%xmm0, %xmm0
	addl	$1, %eax
	cvtsi2sdl	%r14d, %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	subl	%esi, %edx
	addl	%edx, %r14d
	cmpl	%ecx, %eax
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r13d, %esi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L2
.L11:
	xorl	%edi, %edi
	call	exit@PLT
	.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:
```
```c

main(N,R,M,m,y,n,t,c,i,d){double r;
	for(scanf("%d",&N);N--;printf("%d\n",R)){
		for(scanf("%d%d%d",&M,&y,&n),R=M;n--;R=m>R?m:R){
			if(m=M,d=0,scanf("%d%lf%d",&t,&r,&c),t){ //fukuri
				for(i=0;i<y;i++){
					m+=(int)(r*m)-c;
				}
			}else{ //tanri
				for(i=0;i<y;i++){
					d+=(int)(r*m);
					m=m-c;
				}
				m+=d;
			}
		}
	}
exit(0);}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c

main(N,R,M,m,y,n,t,c,i,d){double r;
	for(scanf("%d",&N);N--;printf("%d\n",R)){
		for(scanf("%d%d%d",&M,&y,&n),R=M;n--;R=m>R?m:R){
			if(m=M,d=0,scanf("%d%lf%d",&t,&r,&c),t){ //fukuri
				for(i=0;i<y;i++){
					m+=(int)(r*m)-c;
				}
			}else{ //tanri
				for(i=0;i<y;i++){
					d+=(int)(r*m);
					m=m-c;
				}
				m+=d;
			}
		}
	}
exit(0);}```

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

main(N,R,M,m,y,n,t,c,i,d){double r;
	for(scanf("%d",&N);N--;printf("%d\n",R)){
		for(scanf("%d%d%d",&M,&y,&n),R=M;n--;R=m>R?m:R){
			if(m=M,d=0,scanf("%d%lf%d",&t,&r,&c),t){ //fukuri
				for(i=0;i<y;i++){
					m+=(int)(r*m)-c;
				}
			}else{ //tanri
				for(i=0;i<y;i++){
					d+=(int)(r*m);
					m=m-c;
				}
				m+=d;
			}
		}
	}
exit(0);}```

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:
.LFB0:
	.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
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	%edi, 28(%rsp)
	leaq	28(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	movl	%edx, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%r9d, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	je	.L11
	leaq	20(%rsp), %rax
	leaq	16(%rsp), %r15
	movq	%rax, (%rsp)
	leaq	24(%rsp), %rax
	leaq	.LC2(%rip), %r12
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rdx
	movq	8(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	movl	16(%rsp), %eax
	movl	24(%rsp), %r14d
	leal	-1(%rax), %edx
	movl	%r14d, %r13d
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L3
	leaq	120(%rsp), %rbp
	leaq	32(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	leaq	112(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	112(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L4
	movl	20(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L7
	movsd	32(%rsp), %xmm1
	movl	120(%rsp), %edi
	xorl	%eax, %eax
	movl	%r14d, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	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	.L9
	subl	$1, %eax
	subl	%edi, %r14d
	imull	%edi, %eax
	subl	%eax, %r14d
	addl	%ecx, %r14d
.L7:
	movl	16(%rsp), %eax
	cmpl	%r14d, %r13d
	cmovl	%r14d, %r13d
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L3
	movl	24(%rsp), %r14d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L4:
	movl	20(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L7
	movsd	32(%rsp), %xmm1
	movl	120(%rsp), %esi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	pxor	%xmm0, %xmm0
	addl	$1, %eax
	cvtsi2sdl	%r14d, %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	subl	%esi, %edx
	addl	%edx, %r14d
	cmpl	%ecx, %eax
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r13d, %esi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L2
.L11:
	xorl	%edi, %edi
	call	exit@PLT
	.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.
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:
.LFB0:
	.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
	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	$56, %rsp
	.cfi_def_cfa_offset 112
	movl	%edi, 28(%rsp)
	leaq	28(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	movl	%edx, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%r9d, 16(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	call	scanf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	je	.L11
	leaq	20(%rsp), %rax
	leaq	16(%rsp), %r15
	movq	%rax, (%rsp)
	leaq	24(%rsp), %rax
	leaq	.LC2(%rip), %r12
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rdx
	movq	8(%rsp), %rsi
	movq	%r15, %rcx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	movl	16(%rsp), %eax
	movl	24(%rsp), %r14d
	leal	-1(%rax), %edx
	movl	%r14d, %r13d
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L3
	leaq	120(%rsp), %rbp
	leaq	32(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rcx
	movq	%rbx, %rdx
	leaq	112(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	112(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L4
	movl	20(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L7
	movsd	32(%rsp), %xmm1
	movl	120(%rsp), %edi
	xorl	%eax, %eax
	movl	%r14d, %edx
	.p2align 4,,10
	.p2align 3
.L9:
	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	.L9
	subl	$1, %eax
	subl	%edi, %r14d
	imull	%edi, %eax
	subl	%eax, %r14d
	addl	%ecx, %r14d
.L7:
	movl	16(%rsp), %eax
	cmpl	%r14d, %r13d
	cmovl	%r14d, %r13d
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L3
	movl	24(%rsp), %r14d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L4:
	movl	20(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L7
	movsd	32(%rsp), %xmm1
	movl	120(%rsp), %esi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	pxor	%xmm0, %xmm0
	addl	$1, %eax
	cvtsi2sdl	%r14d, %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %edx
	subl	%esi, %edx
	addl	%edx, %r14d
	cmpl	%ecx, %eax
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r13d, %esi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 28(%rsp)
	testl	%eax, %eax
	jne	.L2
.L11:
	xorl	%edi, %edi
	call	exit@PLT
	.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:
```