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 <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#define _USE_MATH_DEFINES

int main()
{
    int n=0,best_n=0;
    float T=0.0,A=0.0,height_i[1001]={0.0},temp_average=0.0,temp_diff_from_a=0.0,new_temp_diff_from_a=0.0;
    scanf("%d",&n);
    scanf("%f %f",&T,&A);
    for(int i=0;i<n;i++)
	scanf("%f",&height_i[i]);

    temp_average=T-height_i[0]*0.006;
    temp_diff_from_a=fabsf(A-temp_average);


    for(int i=1;i<n;i++){
	temp_average=T-height_i[i]*0.006;
	new_temp_diff_from_a=fabsf(A-temp_average);

	if(new_temp_diff_from_a<temp_diff_from_a){
	    temp_diff_from_a=new_temp_diff_from_a;
	    best_n=i;
	}

    }
    printf("%d",best_n+1);
    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC1:
	.string	"%d"
.LC2:
	.string	"%f %f"
.LC3:
	.string	"%f"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4064, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4052(%rbp)
	movl	$0, -4040(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4048(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4044(%rbp)
	leaq	-4016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4024(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4036(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4020(%rbp)
	leaq	-4052(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-4044(%rbp), %rdx
	leaq	-4048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4032(%rbp)
	jmp	.L2
.L3:
	leaq	-4016(%rbp), %rdx
	movl	-4032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4032(%rbp)
.L2:
	movl	-4052(%rbp), %eax
	cmpl	%eax, -4032(%rbp)
	jl	.L3
	movss	-4048(%rbp), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movss	-4016(%rbp), %xmm1
	pxor	%xmm2, %xmm2
	cvtss2sd	%xmm1, %xmm2
	movsd	.LC4(%rip), %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, -4024(%rbp)
	movss	-4044(%rbp), %xmm0
	subss	-4024(%rbp), %xmm0
	movss	.LC5(%rip), %xmm1
	andps	%xmm1, %xmm0
	movss	%xmm0, -4036(%rbp)
	movl	$1, -4028(%rbp)
	jmp	.L4
.L7:
	movss	-4048(%rbp), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	-4028(%rbp), %eax
	cltq
	movss	-4016(%rbp,%rax,4), %xmm1
	pxor	%xmm2, %xmm2
	cvtss2sd	%xmm1, %xmm2
	movsd	.LC4(%rip), %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, -4024(%rbp)
	movss	-4044(%rbp), %xmm0
	subss	-4024(%rbp), %xmm0
	movss	.LC5(%rip), %xmm1
	andps	%xmm1, %xmm0
	movss	%xmm0, -4020(%rbp)
	movss	-4036(%rbp), %xmm0
	comiss	-4020(%rbp), %xmm0
	jbe	.L5
	movss	-4020(%rbp), %xmm0
	movss	%xmm0, -4036(%rbp)
	movl	-4028(%rbp), %eax
	movl	%eax, -4040(%rbp)
.L5:
	addl	$1, -4028(%rbp)
.L4:
	movl	-4052(%rbp), %eax
	cmpl	%eax, -4028(%rbp)
	jl	.L7
	movl	-4040(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.long	-1133871366
	.long	1064866676
	.align 16
.LC5:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.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
.LC1:
	.string	"%d"
.LC2:
	.string	"%f %f"
.LC3:
	.string	"%f"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$500, %ecx
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4080
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	4(%rsp), %rsi
	movl	$0, 4(%rsp)
	movq	%rbx, %rdi
	movl	$0x00000000, 8(%rsp)
	movl	$0x00000000, 12(%rsp)
	rep stosq
	movl	$0, (%rdi)
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L8
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	leaq	.LC3(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jg	.L3
	movsd	.LC4(%rip), %xmm5
	pxor	%xmm1, %xmm1
	pxor	%xmm3, %xmm3
	movss	12(%rsp), %xmm4
	cvtss2sd	16(%rsp), %xmm1
	cvtss2sd	8(%rsp), %xmm3
	movapd	%xmm3, %xmm0
	movss	.LC5(%rip), %xmm6
	mulsd	%xmm5, %xmm1
	movaps	%xmm4, %xmm2
	subsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	subss	%xmm0, %xmm2
	andps	%xmm6, %xmm2
	cmpl	$1, %eax
	jle	.L8
	movslq	%eax, %rcx
	xorl	%edx, %edx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	pxor	%xmm0, %xmm0
	movapd	%xmm3, %xmm1
	cvtss2sd	(%rbx,%rax,4), %xmm0
	mulsd	%xmm5, %xmm0
	subsd	%xmm0, %xmm1
	movaps	%xmm4, %xmm0
	cvtsd2ss	%xmm1, %xmm1
	subss	%xmm1, %xmm0
	andps	%xmm6, %xmm0
	comiss	%xmm0, %xmm2
	minss	%xmm2, %xmm0
	cmova	%eax, %edx
	addq	$1, %rax
	movaps	%xmm0, %xmm2
	cmpq	%rax, %rcx
	jne	.L5
.L2:
	addl	$1, %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L2
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.long	-1133871366
	.long	1064866676
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC5:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.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
.LC1:
	.string	"%d"
.LC2:
	.string	"%f %f"
.LC3:
	.string	"%f"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$500, %ecx
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4080
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	leaq	4(%rsp), %rsi
	movl	$0, 4(%rsp)
	movq	%rbx, %rdi
	movl	$0x00000000, 8(%rsp)
	movl	$0x00000000, 12(%rsp)
	rep stosq
	movl	$0, (%rdi)
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L8
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	leaq	.LC3(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jg	.L3
	movsd	.LC4(%rip), %xmm5
	pxor	%xmm1, %xmm1
	pxor	%xmm3, %xmm3
	movss	12(%rsp), %xmm4
	cvtss2sd	16(%rsp), %xmm1
	cvtss2sd	8(%rsp), %xmm3
	movapd	%xmm3, %xmm0
	movss	.LC5(%rip), %xmm6
	mulsd	%xmm5, %xmm1
	movaps	%xmm4, %xmm2
	subsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	subss	%xmm0, %xmm2
	andps	%xmm6, %xmm2
	cmpl	$1, %eax
	jle	.L8
	movslq	%eax, %rcx
	xorl	%edx, %edx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	pxor	%xmm0, %xmm0
	movapd	%xmm3, %xmm1
	cvtss2sd	(%rbx,%rax,4), %xmm0
	mulsd	%xmm5, %xmm0
	subsd	%xmm0, %xmm1
	movaps	%xmm4, %xmm0
	cvtsd2ss	%xmm1, %xmm1
	subss	%xmm1, %xmm0
	andps	%xmm6, %xmm0
	comiss	%xmm0, %xmm2
	minss	%xmm2, %xmm0
	cmova	%eax, %edx
	addq	$1, %rax
	movaps	%xmm0, %xmm2
	cmpq	%rax, %rcx
	jne	.L5
.L2:
	addl	$1, %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L2
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC4:
	.long	-1133871366
	.long	1064866676
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC5:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.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 <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#define _USE_MATH_DEFINES

int main()
{
    int n=0,best_n=0;
    float T=0.0,A=0.0,height_i[1001]={0.0},temp_average=0.0,temp_diff_from_a=0.0,new_temp_diff_from_a=0.0;
    scanf("%d",&n);
    scanf("%f %f",&T,&A);
    for(int i=0;i<n;i++)
	scanf("%f",&height_i[i]);

    temp_average=T-height_i[0]*0.006;
    temp_diff_from_a=fabsf(A-temp_average);


    for(int i=1;i<n;i++){
	temp_average=T-height_i[i]*0.006;
	new_temp_diff_from_a=fabsf(A-temp_average);

	if(new_temp_diff_from_a<temp_diff_from_a){
	    temp_diff_from_a=new_temp_diff_from_a;
	    best_n=i;
	}

    }
    printf("%d",best_n+1);
    return 0;
}


2
12 5
1000 2000

1
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 <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#define _USE_MATH_DEFINES

int main()
{
    int n=0,best_n=0;
    float T=0.0,A=0.0,height_i[1001]={0.0},temp_average=0.0,temp_diff_from_a=0.0,new_temp_diff_from_a=0.0;
    scanf("%d",&n);
    scanf("%f %f",&T,&A);
    for(int i=0;i<n;i++)
	scanf("%f",&height_i[i]);

    temp_average=T-height_i[0]*0.006;
    temp_diff_from_a=fabsf(A-temp_average);


    for(int i=1;i<n;i++){
	temp_average=T-height_i[i]*0.006;
	new_temp_diff_from_a=fabsf(A-temp_average);

	if(new_temp_diff_from_a<temp_diff_from_a){
	    temp_diff_from_a=new_temp_diff_from_a;
	    best_n=i;
	}

    }
    printf("%d",best_n+1);
    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC1:
	.string	"%d"
.LC2:
	.string	"%f %f"
.LC3:
	.string	"%f"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4064, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4052(%rbp)
	movl	$0, -4040(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4048(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4044(%rbp)
	leaq	-4016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4024(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4036(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4020(%rbp)
	leaq	-4052(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-4044(%rbp), %rdx
	leaq	-4048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4032(%rbp)
	jmp	.L2
.L3:
	leaq	-4016(%rbp), %rdx
	movl	-4032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4032(%rbp)
.L2:
	movl	-4052(%rbp), %eax
	cmpl	%eax, -4032(%rbp)
	jl	.L3
	movss	-4048(%rbp), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movss	-4016(%rbp), %xmm1
	pxor	%xmm2, %xmm2
	cvtss2sd	%xmm1, %xmm2
	movsd	.LC4(%rip), %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, -4024(%rbp)
	movss	-4044(%rbp), %xmm0
	subss	-4024(%rbp), %xmm0
	movss	.LC5(%rip), %xmm1
	andps	%xmm1, %xmm0
	movss	%xmm0, -4036(%rbp)
	movl	$1, -4028(%rbp)
	jmp	.L4
.L7:
	movss	-4048(%rbp), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	-4028(%rbp), %eax
	cltq
	movss	-4016(%rbp,%rax,4), %xmm1
	pxor	%xmm2, %xmm2
	cvtss2sd	%xmm1, %xmm2
	movsd	.LC4(%rip), %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, -4024(%rbp)
	movss	-4044(%rbp), %xmm0
	subss	-4024(%rbp), %xmm0
	movss	.LC5(%rip), %xmm1
	andps	%xmm1, %xmm0
	movss	%xmm0, -4020(%rbp)
	movss	-4036(%rbp), %xmm0
	comiss	-4020(%rbp), %xmm0
	jbe	.L5
	movss	-4020(%rbp), %xmm0
	movss	%xmm0, -4036(%rbp)
	movl	-4028(%rbp), %eax
	movl	%eax, -4040(%rbp)
.L5:
	addl	$1, -4028(%rbp)
.L4:
	movl	-4052(%rbp), %eax
	cmpl	%eax, -4028(%rbp)
	jl	.L7
	movl	-4040(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.long	-1133871366
	.long	1064866676
	.align 16
.LC5:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.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
.LC1:
	.string	"%d"
.LC2:
	.string	"%f %f"
.LC3:
	.string	"%f"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4064, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -4052(%rbp)
	movl	$0, -4040(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4048(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4044(%rbp)
	leaq	-4016(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4024(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4036(%rbp)
	pxor	%xmm0, %xmm0
	movss	%xmm0, -4020(%rbp)
	leaq	-4052(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-4044(%rbp), %rdx
	leaq	-4048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4032(%rbp)
	jmp	.L2
.L3:
	leaq	-4016(%rbp), %rdx
	movl	-4032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4032(%rbp)
.L2:
	movl	-4052(%rbp), %eax
	cmpl	%eax, -4032(%rbp)
	jl	.L3
	movss	-4048(%rbp), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movss	-4016(%rbp), %xmm1
	pxor	%xmm2, %xmm2
	cvtss2sd	%xmm1, %xmm2
	movsd	.LC4(%rip), %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, -4024(%rbp)
	movss	-4044(%rbp), %xmm0
	subss	-4024(%rbp), %xmm0
	movss	.LC5(%rip), %xmm1
	andps	%xmm1, %xmm0
	movss	%xmm0, -4036(%rbp)
	movl	$1, -4028(%rbp)
	jmp	.L4
.L7:
	movss	-4048(%rbp), %xmm0
	cvtss2sd	%xmm0, %xmm0
	movl	-4028(%rbp), %eax
	cltq
	movss	-4016(%rbp,%rax,4), %xmm1
	pxor	%xmm2, %xmm2
	cvtss2sd	%xmm1, %xmm2
	movsd	.LC4(%rip), %xmm1
	mulsd	%xmm2, %xmm1
	subsd	%xmm1, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movss	%xmm0, -4024(%rbp)
	movss	-4044(%rbp), %xmm0
	subss	-4024(%rbp), %xmm0
	movss	.LC5(%rip), %xmm1
	andps	%xmm1, %xmm0
	movss	%xmm0, -4020(%rbp)
	movss	-4036(%rbp), %xmm0
	comiss	-4020(%rbp), %xmm0
	jbe	.L5
	movss	-4020(%rbp), %xmm0
	movss	%xmm0, -4036(%rbp)
	movl	-4028(%rbp), %eax
	movl	%eax, -4040(%rbp)
.L5:
	addl	$1, -4028(%rbp)
.L4:
	movl	-4052(%rbp), %eax
	cmpl	%eax, -4028(%rbp)
	jl	.L7
	movl	-4040(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC4:
	.long	-1133871366
	.long	1064866676
	.align 16
.LC5:
	.long	2147483647
	.long	0
	.long	0
	.long	0
	.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:
