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 <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");
}```

Assembly Code:

```assembly
	.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:
```

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	"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
```assembly
	.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:
```
```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");
}```
Given the following C 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");
}```

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:

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 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");
}```

Assembly Code:

```assembly
	.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:
```

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	"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:
```