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>

double tanri(int y, double r){
        return 1+y*r/100.0;
}

double fukuri(int y, double r){
        double ret=1;
        int i;
        for(i=0; i<y; i++) ret *= 1+r/100.0;
        return ret;
}

int main(){
        while(1){
                int n, y;
                scanf("%d", &n);
                if(n==0) break;
                scanf("%d", &y);

                double mxget=0;
                int i, mxidx;
                for(i=0; i<n; i++){
                        int b, r, t;
                        double get;
                        scanf("%d %d %d", &b, &r, &t);
                        if(t==1) get = tanri(y, r);
                        else get = fukuri(y, r);

                        if(mxget<=get){
                                mxget = get;
                                mxidx = b;
                        }
                }
                printf("%d\n", mxidx);
        }
        return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tanri
	.type	tanri, @function
tanri:
.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, -4(%rbp)
	movsd	%xmm0, -16(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-4(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movsd	.LC0(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	tanri, .-tanri
	.globl	fukuri
	.type	fukuri, @function
fukuri:
.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)
	movsd	%xmm0, -32(%rbp)
	movsd	.LC1(%rip), %xmm0
	movsd	%xmm0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	movsd	-32(%rbp), %xmm0
	movsd	.LC0(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	-8(%rbp), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -8(%rbp)
	addl	$1, -12(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L5
	movsd	-8(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	fukuri, .-fukuri
	.section	.rodata
.LC2:
	.string	"%d"
.LC4:
	.string	"%d %d %d"
.LC5:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L16:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	jmp	.L19
.L8:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L10
.L15:
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	-40(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movq	%xmm1, %rdx
	movl	-48(%rbp), %eax
	movq	%rdx, %xmm0
	movl	%eax, %edi
	call	tanri
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	jmp	.L12
.L11:
	movl	-40(%rbp), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movq	%xmm2, %rdx
	movl	-48(%rbp), %eax
	movq	%rdx, %xmm0
	movl	%eax, %edi
	call	fukuri
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
.L12:
	movsd	-16(%rbp), %xmm0
	comisd	-24(%rbp), %xmm0
	jb	.L13
	movsd	-16(%rbp), %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -28(%rbp)
.L13:
	addl	$1, -32(%rbp)
.L10:
	movl	-52(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L15
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L16
.L19:
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1079574528
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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	tanri
	.type	tanri, @function
tanri:
.LFB23:
	.cfi_startproc
	endbr64
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm0
	mulsd	%xmm1, %xmm0
	divsd	.LC0(%rip), %xmm0
	addsd	.LC1(%rip), %xmm0
	ret
	.cfi_endproc
.LFE23:
	.size	tanri, .-tanri
	.p2align 4
	.globl	fukuri
	.type	fukuri, @function
fukuri:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L6
	movapd	%xmm0, %xmm1
	movsd	.LC1(%rip), %xmm0
	divsd	.LC0(%rip), %xmm1
	xorl	%eax, %eax
	addsd	%xmm0, %xmm1
	.p2align 4,,10
	.p2align 3
.L5:
	mulsd	%xmm1, %xmm0
	addl	$1, %eax
	cmpl	%eax, %edi
	jne	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	movsd	.LC1(%rip), %xmm0
	ret
	.cfi_endproc
.LFE24:
	.size	fukuri, .-fukuri
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%d"
.LC4:
	.string	"%d %d %d"
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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
	leaq	.LC4(%rip), %r13
	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
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movq	8(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	je	.L9
	leaq	24(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	movq	$0x000000000, (%rsp)
	xorl	%r15d, %r15d
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbp
	leaq	28(%rsp), %rbx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L24:
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	32(%rsp), %xmm0
	cvtsi2sdl	24(%rsp), %xmm1
	mulsd	%xmm1, %xmm0
	divsd	.LC0(%rip), %xmm0
	addsd	.LC1(%rip), %xmm0
.L12:
	comisd	(%rsp), %xmm0
	jb	.L14
	movl	28(%rsp), %r14d
	movsd	%xmm0, (%rsp)
.L14:
	addl	$1, %r15d
	cmpl	%r15d, 20(%rsp)
	jle	.L10
.L16:
	xorl	%eax, %eax
	movq	%r12, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, 36(%rsp)
	je	.L24
	movl	24(%rsp), %edx
	pxor	%xmm1, %xmm1
	cvtsi2sdl	32(%rsp), %xmm1
	testl	%edx, %edx
	jle	.L19
	movq	.LC1(%rip), %rcx
	divsd	.LC0(%rip), %xmm1
	xorl	%eax, %eax
	addsd	.LC1(%rip), %xmm1
	movq	%rcx, %xmm0
	.p2align 4,,10
	.p2align 3
.L13:
	mulsd	%xmm1, %xmm0
	addl	$1, %eax
	cmpl	%eax, %edx
	jne	.L13
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r14d, %edx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L19:
	movq	.LC1(%rip), %rax
	movq	%rax, %xmm0
	jmp	.L12
.L9:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$56, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1079574528
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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	tanri
	.type	tanri, @function
tanri:
.LFB23:
	.cfi_startproc
	endbr64
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%edi, %xmm0
	mulsd	%xmm1, %xmm0
	divsd	.LC0(%rip), %xmm0
	addsd	.LC1(%rip), %xmm0
	ret
	.cfi_endproc
.LFE23:
	.size	tanri, .-tanri
	.p2align 4
	.globl	fukuri
	.type	fukuri, @function
fukuri:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L6
	movapd	%xmm0, %xmm1
	movsd	.LC1(%rip), %xmm0
	divsd	.LC0(%rip), %xmm1
	xorl	%eax, %eax
	addsd	%xmm0, %xmm1
	.p2align 4,,10
	.p2align 3
.L5:
	mulsd	%xmm1, %xmm0
	addl	$1, %eax
	cmpl	%eax, %edi
	jne	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	movsd	.LC1(%rip), %xmm0
	ret
	.cfi_endproc
.LFE24:
	.size	fukuri, .-fukuri
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%d"
.LC4:
	.string	"%d %d %d"
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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
	leaq	.LC4(%rip), %r13
	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
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movq	8(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	je	.L9
	leaq	24(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L10
	movq	$0x000000000, (%rsp)
	xorl	%r15d, %r15d
	leaq	36(%rsp), %r12
	leaq	32(%rsp), %rbp
	leaq	28(%rsp), %rbx
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L24:
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	32(%rsp), %xmm0
	cvtsi2sdl	24(%rsp), %xmm1
	mulsd	%xmm1, %xmm0
	divsd	.LC0(%rip), %xmm0
	addsd	.LC1(%rip), %xmm0
.L12:
	comisd	(%rsp), %xmm0
	jb	.L14
	movl	28(%rsp), %r14d
	movsd	%xmm0, (%rsp)
.L14:
	addl	$1, %r15d
	cmpl	%r15d, 20(%rsp)
	jle	.L10
.L16:
	xorl	%eax, %eax
	movq	%r12, %rcx
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, 36(%rsp)
	je	.L24
	movl	24(%rsp), %edx
	pxor	%xmm1, %xmm1
	cvtsi2sdl	32(%rsp), %xmm1
	testl	%edx, %edx
	jle	.L19
	movq	.LC1(%rip), %rcx
	divsd	.LC0(%rip), %xmm1
	xorl	%eax, %eax
	addsd	.LC1(%rip), %xmm1
	movq	%rcx, %xmm0
	.p2align 4,,10
	.p2align 3
.L13:
	mulsd	%xmm1, %xmm0
	addl	$1, %eax
	cmpl	%eax, %edx
	jne	.L13
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r14d, %edx
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L19:
	movq	.LC1(%rip), %rax
	movq	%rax, %xmm0
	jmp	.L12
.L9:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$56, %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
.L25:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	0
	.long	1079574528
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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>

double tanri(int y, double r){
        return 1+y*r/100.0;
}

double fukuri(int y, double r){
        double ret=1;
        int i;
        for(i=0; i<y; i++) ret *= 1+r/100.0;
        return ret;
}

int main(){
        while(1){
                int n, y;
                scanf("%d", &n);
                if(n==0) break;
                scanf("%d", &y);

                double mxget=0;
                int i, mxidx;
                for(i=0; i<n; i++){
                        int b, r, t;
                        double get;
                        scanf("%d %d %d", &b, &r, &t);
                        if(t==1) get = tanri(y, r);
                        else get = fukuri(y, r);

                        if(mxget<=get){
                                mxget = get;
                                mxidx = b;
                        }
                }
                printf("%d\n", mxidx);
        }
        return 0;
}

2
8
1 5 2
2 6 1
2
9
1 3 2
2 6 1
0
 2
8
1 5 2
3 6 1
2
7
1 5 2
2 6 1
0
 2
8
1 5 2
2 6 1
0
9
0 3 2
2 6 1
0
 2
14
1 5 2
3 6 1
2
7
1 5 2
2 6 1
0
 2
8
1 5 2
2 6 1
2
7
1 8 2
2 6 1
0
 2
14
1 5 2
3 6 1
2
7
1 5 2
1 6 1
0
 2
8
1 5 2
0 6 1
2
9
1 5 2
2 10 1
0
 2
14
1 5 2
2 6 1
2
9
0 5 2
2 6 1
0
 2
14
1 5 2
3 6 2
2
7
1 5 2
1 6 1
0
 2
8
1 5 2
2 6 1
2
7
0 8 2
2 6 1
0

2
2
 3
2
 2
 1
2
 2
1
 1
1
 0
2
 1
0
 3
1
 2
0

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>

double tanri(int y, double r){
        return 1+y*r/100.0;
}

double fukuri(int y, double r){
        double ret=1;
        int i;
        for(i=0; i<y; i++) ret *= 1+r/100.0;
        return ret;
}

int main(){
        while(1){
                int n, y;
                scanf("%d", &n);
                if(n==0) break;
                scanf("%d", &y);

                double mxget=0;
                int i, mxidx;
                for(i=0; i<n; i++){
                        int b, r, t;
                        double get;
                        scanf("%d %d %d", &b, &r, &t);
                        if(t==1) get = tanri(y, r);
                        else get = fukuri(y, r);

                        if(mxget<=get){
                                mxget = get;
                                mxidx = b;
                        }
                }
                printf("%d\n", mxidx);
        }
        return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	tanri
	.type	tanri, @function
tanri:
.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, -4(%rbp)
	movsd	%xmm0, -16(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-4(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movsd	.LC0(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	tanri, .-tanri
	.globl	fukuri
	.type	fukuri, @function
fukuri:
.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)
	movsd	%xmm0, -32(%rbp)
	movsd	.LC1(%rip), %xmm0
	movsd	%xmm0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	movsd	-32(%rbp), %xmm0
	movsd	.LC0(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	-8(%rbp), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -8(%rbp)
	addl	$1, -12(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L5
	movsd	-8(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	fukuri, .-fukuri
	.section	.rodata
.LC2:
	.string	"%d"
.LC4:
	.string	"%d %d %d"
.LC5:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L16:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	jmp	.L19
.L8:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L10
.L15:
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	-40(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movq	%xmm1, %rdx
	movl	-48(%rbp), %eax
	movq	%rdx, %xmm0
	movl	%eax, %edi
	call	tanri
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	jmp	.L12
.L11:
	movl	-40(%rbp), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movq	%xmm2, %rdx
	movl	-48(%rbp), %eax
	movq	%rdx, %xmm0
	movl	%eax, %edi
	call	fukuri
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
.L12:
	movsd	-16(%rbp), %xmm0
	comisd	-24(%rbp), %xmm0
	jb	.L13
	movsd	-16(%rbp), %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -28(%rbp)
.L13:
	addl	$1, -32(%rbp)
.L10:
	movl	-52(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L15
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L16
.L19:
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1079574528
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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	tanri
	.type	tanri, @function
tanri:
.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, -4(%rbp)
	movsd	%xmm0, -16(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-4(%rbp), %xmm0
	mulsd	-16(%rbp), %xmm0
	movsd	.LC0(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	tanri, .-tanri
	.globl	fukuri
	.type	fukuri, @function
fukuri:
.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)
	movsd	%xmm0, -32(%rbp)
	movsd	.LC1(%rip), %xmm0
	movsd	%xmm0, -8(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L4
.L5:
	movsd	-32(%rbp), %xmm0
	movsd	.LC0(%rip), %xmm2
	movapd	%xmm0, %xmm1
	divsd	%xmm2, %xmm1
	movsd	.LC1(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	-8(%rbp), %xmm1
	mulsd	%xmm1, %xmm0
	movsd	%xmm0, -8(%rbp)
	addl	$1, -12(%rbp)
.L4:
	movl	-12(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L5
	movsd	-8(%rbp), %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	fukuri, .-fukuri
	.section	.rodata
.LC2:
	.string	"%d"
.LC4:
	.string	"%d %d %d"
.LC5:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L16:
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	jmp	.L19
.L8:
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L10
.L15:
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	-40(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	movq	%xmm1, %rdx
	movl	-48(%rbp), %eax
	movq	%rdx, %xmm0
	movl	%eax, %edi
	call	tanri
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
	jmp	.L12
.L11:
	movl	-40(%rbp), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movq	%xmm2, %rdx
	movl	-48(%rbp), %eax
	movq	%rdx, %xmm0
	movl	%eax, %edi
	call	fukuri
	movq	%xmm0, %rax
	movq	%rax, -16(%rbp)
.L12:
	movsd	-16(%rbp), %xmm0
	comisd	-24(%rbp), %xmm0
	jb	.L13
	movsd	-16(%rbp), %xmm0
	movsd	%xmm0, -24(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -28(%rbp)
.L13:
	addl	$1, -32(%rbp)
.L10:
	movl	-52(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jl	.L15
	movl	-28(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L16
.L19:
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC0:
	.long	0
	.long	1079574528
	.align 8
.LC1:
	.long	0
	.long	1072693248
	.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:
