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>
#include <math.h>
int main(void){
    // Your code here!
    int n;
    scanf("%d",&n);
    
    int c[501];
    int f[500];
    int s[500];
    for(int i=0;i<n-1;i++){
        scanf("%d%d%d",&c[i],&s[i],&f[i]);
    }
    
    for(int i=0;i<n-1;i++){
        int tim=0;
        for(int j=i;j<n-1;j++){
            if(tim<=s[j]){
                tim=s[j]+c[j];
            }else{
                //printf("%d %d %d :%f\n",i,j,tim,( (double)tim-(double)s[j] )/(double)f[j] );
                tim=s[j]+(int)ceil( ((double)tim-(double)s[j])/(double)f[j] )*f[j]+c[j];
                
            }
            //printf("%d %d %d\n",i,j,tim);
        }
        printf("%d\n",tim);
    }
    printf("0\n");
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"0"
	.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
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$1960, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-6052(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -6048(%rbp)
	jmp	.L2
.L3:
	leaq	-6032(%rbp), %rdx
	movl	-6048(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-4032(%rbp), %rdx
	movl	-6048(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-2032(%rbp), %rsi
	movl	-6048(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -6048(%rbp)
.L2:
	movl	-6052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -6048(%rbp)
	jl	.L3
	movl	$0, -6044(%rbp)
	jmp	.L4
.L9:
	movl	$0, -6040(%rbp)
	movl	-6044(%rbp), %eax
	movl	%eax, -6036(%rbp)
	jmp	.L5
.L8:
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	cmpl	%eax, -6040(%rbp)
	jg	.L6
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %edx
	movl	-6036(%rbp), %eax
	cltq
	movl	-2032(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -6040(%rbp)
	jmp	.L7
.L6:
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %ebx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-6040(%rbp), %xmm0
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	subsd	%xmm1, %xmm0
	movl	-6036(%rbp), %eax
	cltq
	movl	-6032(%rbp,%rax,4), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	ceil@PLT
	cvttsd2sil	%xmm0, %edx
	movl	-6036(%rbp), %eax
	cltq
	movl	-6032(%rbp,%rax,4), %eax
	imull	%edx, %eax
	leal	(%rbx,%rax), %edx
	movl	-6036(%rbp), %eax
	cltq
	movl	-2032(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -6040(%rbp)
.L7:
	addl	$1, -6036(%rbp)
.L5:
	movl	-6052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -6036(%rbp)
	jl	.L8
	movl	-6040(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -6044(%rbp)
.L4:
	movl	-6052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -6044(%rbp)
	jl	.L9
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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	"0"
.LC2:
	.string	"%d%d%d"
.LC6:
	.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
	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	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$1944, %rsp
	.cfi_def_cfa_offset 6096
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 6024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, 12(%rsp)
	jle	.L3
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	leaq	16(%rsp), %r13
	leaq	2016(%rsp), %rbp
	leaq	4016(%rsp), %r12
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	0(%r13,%rbx), %rcx
	leaq	0(%rbp,%rbx), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	leaq	(%r12,%rbx), %rsi
	addl	$1, %r15d
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %ecx
	cmpl	%r15d, %ecx
	jg	.L2
	testl	%ecx, %ecx
	jle	.L3
	movsd	.LC3(%rip), %xmm4
	movsd	.LC4(%rip), %xmm3
	xorl	%r14d, %r14d
	leaq	.LC6(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	movsd	.LC5(%rip), %xmm5
	movq	%r14, %rax
	xorl	%edx, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	addq	$1, %rax
	leal	(%rdi,%rsi), %edx
	cmpl	%eax, %ecx
	jle	.L17
.L7:
	movl	0(%rbp,%rax,4), %edi
	movl	(%r12,%rax,4), %esi
	cmpl	%edx, %edi
	jge	.L18
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	movl	0(%r13,%rax,4), %r8d
	cvtsi2sdl	%edi, %xmm1
	cvtsi2sdl	%edx, %xmm0
	subsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r8d, %xmm1
	divsd	%xmm1, %xmm0
	movapd	%xmm0, %xmm1
	andpd	%xmm3, %xmm1
	ucomisd	%xmm1, %xmm4
	jbe	.L6
	cvttsd2siq	%xmm0, %rdx
	pxor	%xmm1, %xmm1
	movapd	%xmm0, %xmm2
	cvtsi2sdq	%rdx, %xmm1
	cmpnlesd	%xmm1, %xmm2
	andpd	%xmm5, %xmm2
	addsd	%xmm2, %xmm1
	movapd	%xmm3, %xmm2
	andnpd	%xmm0, %xmm2
	movapd	%xmm1, %xmm0
	orpd	%xmm2, %xmm0
.L6:
	cvttsd2sil	%xmm0, %edx
	addq	$1, %rax
	imull	%r8d, %edx
	addl	%edi, %edx
	addl	%esi, %edx
	cmpl	%eax, %ecx
	jg	.L7
.L17:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	addq	$1, %r14
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %ecx
	movq	.LC3(%rip), %rax
	cmpl	%r14d, %ecx
	movq	%rax, %xmm4
	movq	.LC7(%rip), %rax
	movq	%rax, %xmm3
	jg	.L8
.L3:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movq	6024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$6040, %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
.L19:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1127219200
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC5:
	.long	0
	.long	1072693248
	.set	.LC7,.LC4
	.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	"0"
.LC2:
	.string	"%d%d%d"
.LC6:
	.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
	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	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$1944, %rsp
	.cfi_def_cfa_offset 6096
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 6024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, 12(%rsp)
	jle	.L3
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	leaq	16(%rsp), %r13
	leaq	2016(%rsp), %rbp
	leaq	4016(%rsp), %r12
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	0(%r13,%rbx), %rcx
	leaq	0(%rbp,%rbx), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	leaq	(%r12,%rbx), %rsi
	addl	$1, %r15d
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %ecx
	cmpl	%r15d, %ecx
	jg	.L2
	testl	%ecx, %ecx
	jle	.L3
	movsd	.LC3(%rip), %xmm4
	movsd	.LC4(%rip), %xmm3
	xorl	%r14d, %r14d
	leaq	.LC6(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	movsd	.LC5(%rip), %xmm5
	movq	%r14, %rax
	xorl	%edx, %edx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	addq	$1, %rax
	leal	(%rdi,%rsi), %edx
	cmpl	%eax, %ecx
	jle	.L17
.L7:
	movl	0(%rbp,%rax,4), %edi
	movl	(%r12,%rax,4), %esi
	cmpl	%edx, %edi
	jge	.L18
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	movl	0(%r13,%rax,4), %r8d
	cvtsi2sdl	%edi, %xmm1
	cvtsi2sdl	%edx, %xmm0
	subsd	%xmm1, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%r8d, %xmm1
	divsd	%xmm1, %xmm0
	movapd	%xmm0, %xmm1
	andpd	%xmm3, %xmm1
	ucomisd	%xmm1, %xmm4
	jbe	.L6
	cvttsd2siq	%xmm0, %rdx
	pxor	%xmm1, %xmm1
	movapd	%xmm0, %xmm2
	cvtsi2sdq	%rdx, %xmm1
	cmpnlesd	%xmm1, %xmm2
	andpd	%xmm5, %xmm2
	addsd	%xmm2, %xmm1
	movapd	%xmm3, %xmm2
	andnpd	%xmm0, %xmm2
	movapd	%xmm1, %xmm0
	orpd	%xmm2, %xmm0
.L6:
	cvttsd2sil	%xmm0, %edx
	addq	$1, %rax
	imull	%r8d, %edx
	addl	%edi, %edx
	addl	%esi, %edx
	cmpl	%eax, %ecx
	jg	.L7
.L17:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movl	$1, %edi
	addq	$1, %r14
	call	__printf_chk@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %ecx
	movq	.LC3(%rip), %rax
	cmpl	%r14d, %ecx
	movq	%rax, %xmm4
	movq	.LC7(%rip), %rax
	movq	%rax, %xmm3
	jg	.L8
.L3:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movq	6024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$6040, %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
.L19:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC3:
	.long	0
	.long	1127219200
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC4:
	.long	-1
	.long	2147483647
	.long	0
	.long	0
	.section	.rodata.cst8
	.align 8
.LC5:
	.long	0
	.long	1072693248
	.set	.LC7,.LC4
	.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>
#include <math.h>
int main(void){
    // Your code here!
    int n;
    scanf("%d",&n);
    
    int c[501];
    int f[500];
    int s[500];
    for(int i=0;i<n-1;i++){
        scanf("%d%d%d",&c[i],&s[i],&f[i]);
    }
    
    for(int i=0;i<n-1;i++){
        int tim=0;
        for(int j=i;j<n-1;j++){
            if(tim<=s[j]){
                tim=s[j]+c[j];
            }else{
                //printf("%d %d %d :%f\n",i,j,tim,( (double)tim-(double)s[j] )/(double)f[j] );
                tim=s[j]+(int)ceil( ((double)tim-(double)s[j])/(double)f[j] )*f[j]+c[j];
                
            }
            //printf("%d %d %d\n",i,j,tim);
        }
        printf("%d\n",tim);
    }
    printf("0\n");
}
3
6 6 1
1 10 1
 4
1 13 1
44 17 17
66 4096 64
 4
11 24 6
52 16 4
99 2 2
 3
6 1 1
1 10 2
 3
6 10 1
1 10 1
 4
15 24 6
52 16 4
99 2 2
 3
6 6 1
2 10 1
 4
11 23 6
31 16 4
99 2 2
 3
4 1 2
2 10 2
 4
1 13 1
44 17 22
101 4096 64

13
11
0
 4162
4162
4162
0
 187
167
101
0
 11
11
0
 17
11
0
 191
167
101
0
 14
12
0
 167
147
101
0
 12
12
0
 4197
4197
4197
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>
#include <math.h>
int main(void){
    // Your code here!
    int n;
    scanf("%d",&n);
    
    int c[501];
    int f[500];
    int s[500];
    for(int i=0;i<n-1;i++){
        scanf("%d%d%d",&c[i],&s[i],&f[i]);
    }
    
    for(int i=0;i<n-1;i++){
        int tim=0;
        for(int j=i;j<n-1;j++){
            if(tim<=s[j]){
                tim=s[j]+c[j];
            }else{
                //printf("%d %d %d :%f\n",i,j,tim,( (double)tim-(double)s[j] )/(double)f[j] );
                tim=s[j]+(int)ceil( ((double)tim-(double)s[j])/(double)f[j] )*f[j]+c[j];
                
            }
            //printf("%d %d %d\n",i,j,tim);
        }
        printf("%d\n",tim);
    }
    printf("0\n");
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"0"
	.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
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$1960, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-6052(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -6048(%rbp)
	jmp	.L2
.L3:
	leaq	-6032(%rbp), %rdx
	movl	-6048(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-4032(%rbp), %rdx
	movl	-6048(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-2032(%rbp), %rsi
	movl	-6048(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -6048(%rbp)
.L2:
	movl	-6052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -6048(%rbp)
	jl	.L3
	movl	$0, -6044(%rbp)
	jmp	.L4
.L9:
	movl	$0, -6040(%rbp)
	movl	-6044(%rbp), %eax
	movl	%eax, -6036(%rbp)
	jmp	.L5
.L8:
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	cmpl	%eax, -6040(%rbp)
	jg	.L6
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %edx
	movl	-6036(%rbp), %eax
	cltq
	movl	-2032(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -6040(%rbp)
	jmp	.L7
.L6:
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %ebx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-6040(%rbp), %xmm0
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	subsd	%xmm1, %xmm0
	movl	-6036(%rbp), %eax
	cltq
	movl	-6032(%rbp,%rax,4), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	ceil@PLT
	cvttsd2sil	%xmm0, %edx
	movl	-6036(%rbp), %eax
	cltq
	movl	-6032(%rbp,%rax,4), %eax
	imull	%edx, %eax
	leal	(%rbx,%rax), %edx
	movl	-6036(%rbp), %eax
	cltq
	movl	-2032(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -6040(%rbp)
.L7:
	addl	$1, -6036(%rbp)
.L5:
	movl	-6052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -6036(%rbp)
	jl	.L8
	movl	-6040(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -6044(%rbp)
.L4:
	movl	-6052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -6044(%rbp)
	jl	.L9
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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\n"
.LC3:
	.string	"0"
	.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
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$1960, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-6052(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -6048(%rbp)
	jmp	.L2
.L3:
	leaq	-6032(%rbp), %rdx
	movl	-6048(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-4032(%rbp), %rdx
	movl	-6048(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-2032(%rbp), %rsi
	movl	-6048(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -6048(%rbp)
.L2:
	movl	-6052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -6048(%rbp)
	jl	.L3
	movl	$0, -6044(%rbp)
	jmp	.L4
.L9:
	movl	$0, -6040(%rbp)
	movl	-6044(%rbp), %eax
	movl	%eax, -6036(%rbp)
	jmp	.L5
.L8:
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	cmpl	%eax, -6040(%rbp)
	jg	.L6
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %edx
	movl	-6036(%rbp), %eax
	cltq
	movl	-2032(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -6040(%rbp)
	jmp	.L7
.L6:
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %ebx
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-6040(%rbp), %xmm0
	movl	-6036(%rbp), %eax
	cltq
	movl	-4032(%rbp,%rax,4), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	subsd	%xmm1, %xmm0
	movl	-6036(%rbp), %eax
	cltq
	movl	-6032(%rbp,%rax,4), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	call	ceil@PLT
	cvttsd2sil	%xmm0, %edx
	movl	-6036(%rbp), %eax
	cltq
	movl	-6032(%rbp,%rax,4), %eax
	imull	%edx, %eax
	leal	(%rbx,%rax), %edx
	movl	-6036(%rbp), %eax
	cltq
	movl	-2032(%rbp,%rax,4), %eax
	addl	%edx, %eax
	movl	%eax, -6040(%rbp)
.L7:
	addl	$1, -6036(%rbp)
.L5:
	movl	-6052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -6036(%rbp)
	jl	.L8
	movl	-6040(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -6044(%rbp)
.L4:
	movl	-6052(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -6044(%rbp)
	jl	.L9
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	movq	-8(%rbp), %rbx
	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:
