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>

int main(){
	int N;
	int array[100];
	int sum=0;
	float ave=0;
	float a=0;
	float b=0;
	int answer=0;
	scanf("%d",&N);
	if(N < 1 || 100 < N) return 1;
	for(int i = 0; i < N; i++){
		scanf("%d",&array[i]);
	}
	for(int i = 0; i < N; i++){
		sum += array[i];
	}
	ave = (float)sum / (float)N;
	a = ((array[0] - ave) >= 0) ? (array[0] - ave) : (ave - array[0]);
	for(int i = 1; i < N; i++){
		b = ((array[i] - ave) >= 0) ? (array[i] - ave) : (ave - array[i]);
		if(a > b){
			a = b;
			answer = i;
		}
	}
	printf("%d",answer);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$1, %r8d
	subl	$1, %eax
	cmpl	$99, %eax
	ja	.L1
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L17
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L18
	movl	%eax, %edx
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leal	-1(%rdx), %ecx
	leaq	16(%r12), %rdx
	salq	$4, %rcx
	addq	%rdx, %rcx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$16, %rdx
.L6:
	paddd	0(%r13), %xmm0
	movq	%rdx, %r13
	cmpq	%rcx, %rdx
	jne	.L28
	movdqa	%xmm0, %xmm1
	movl	%eax, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %al
	je	.L4
.L5:
	movslq	%ecx, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %eax
	jle	.L4
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %eax
	jle	.L4
	movslq	%ecx, %rcx
	addl	16(%rsp,%rcx,4), %edx
.L4:
	pxor	%xmm3, %xmm3
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	cvtsi2ssl	%eax, %xmm0
	cvtsi2ssl	%edx, %xmm3
	divss	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	cvtsi2ssl	16(%rsp), %xmm0
	movaps	%xmm0, %xmm1
	subss	%xmm3, %xmm1
	comiss	%xmm4, %xmm1
	jb	.L29
.L9:
	cmpl	$1, %eax
	jle	.L19
	movslq	%eax, %rdx
	xorl	%r8d, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L14:
	pxor	%xmm2, %xmm2
	movl	%eax, %ecx
	cvtsi2ssl	(%r12,%rax,4), %xmm2
	movaps	%xmm2, %xmm0
	subss	%xmm3, %xmm0
	comiss	%xmm4, %xmm0
	jnb	.L11
	movaps	%xmm3, %xmm0
	subss	%xmm2, %xmm0
.L11:
	comiss	%xmm0, %xmm1
	minss	%xmm1, %xmm0
	cmova	%ecx, %r8d
	addq	$1, %rax
	movaps	%xmm0, %xmm1
	cmpq	%rdx, %rax
	jne	.L14
.L10:
	movl	%r8d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%r8d, %r8d
.L1:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$432, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movl	%r8d, %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
.L29:
	.cfi_restore_state
	movaps	%xmm3, %xmm1
	subss	%xmm0, %xmm1
	jmp	.L9
.L19:
	xorl	%r8d, %r8d
	jmp	.L10
.L17:
	xorl	%edx, %edx
	jmp	.L4
.L18:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L5
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$1, %r8d
	subl	$1, %eax
	cmpl	$99, %eax
	ja	.L1
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L17
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L18
	movl	%eax, %edx
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leal	-1(%rdx), %ecx
	leaq	16(%r12), %rdx
	salq	$4, %rcx
	addq	%rdx, %rcx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$16, %rdx
.L6:
	paddd	0(%r13), %xmm0
	movq	%rdx, %r13
	cmpq	%rcx, %rdx
	jne	.L28
	movdqa	%xmm0, %xmm1
	movl	%eax, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %al
	je	.L4
.L5:
	movslq	%ecx, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %eax
	jle	.L4
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %eax
	jle	.L4
	movslq	%ecx, %rcx
	addl	16(%rsp,%rcx,4), %edx
.L4:
	pxor	%xmm3, %xmm3
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	cvtsi2ssl	%eax, %xmm0
	cvtsi2ssl	%edx, %xmm3
	divss	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	cvtsi2ssl	16(%rsp), %xmm0
	movaps	%xmm0, %xmm1
	subss	%xmm3, %xmm1
	comiss	%xmm4, %xmm1
	jb	.L29
.L9:
	cmpl	$1, %eax
	jle	.L19
	movslq	%eax, %rdx
	xorl	%r8d, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L14:
	pxor	%xmm2, %xmm2
	movl	%eax, %ecx
	cvtsi2ssl	(%r12,%rax,4), %xmm2
	movaps	%xmm2, %xmm0
	subss	%xmm3, %xmm0
	comiss	%xmm4, %xmm0
	jnb	.L11
	movaps	%xmm3, %xmm0
	subss	%xmm2, %xmm0
.L11:
	comiss	%xmm0, %xmm1
	minss	%xmm1, %xmm0
	cmova	%ecx, %r8d
	addq	$1, %rax
	movaps	%xmm0, %xmm1
	cmpq	%rdx, %rax
	jne	.L14
.L10:
	movl	%r8d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%r8d, %r8d
.L1:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$432, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movl	%r8d, %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
.L29:
	.cfi_restore_state
	movaps	%xmm3, %xmm1
	subss	%xmm0, %xmm1
	jmp	.L9
.L19:
	xorl	%r8d, %r8d
	jmp	.L10
.L17:
	xorl	%edx, %edx
	jmp	.L4
.L18:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L5
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$1, %r8d
	subl	$1, %eax
	cmpl	$99, %eax
	ja	.L1
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L17
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L18
	movl	%eax, %edx
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leal	-1(%rdx), %ecx
	leaq	16(%r12), %rdx
	salq	$4, %rcx
	addq	%rdx, %rcx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$16, %rdx
.L6:
	paddd	0(%r13), %xmm0
	movq	%rdx, %r13
	cmpq	%rcx, %rdx
	jne	.L28
	movdqa	%xmm0, %xmm1
	movl	%eax, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %al
	je	.L4
.L5:
	movslq	%ecx, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %eax
	jle	.L4
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %eax
	jle	.L4
	movslq	%ecx, %rcx
	addl	16(%rsp,%rcx,4), %edx
.L4:
	pxor	%xmm3, %xmm3
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	cvtsi2ssl	%eax, %xmm0
	cvtsi2ssl	%edx, %xmm3
	divss	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	cvtsi2ssl	16(%rsp), %xmm0
	movaps	%xmm0, %xmm1
	subss	%xmm3, %xmm1
	comiss	%xmm4, %xmm1
	jb	.L29
.L9:
	cmpl	$1, %eax
	jle	.L19
	movslq	%eax, %rdx
	xorl	%r8d, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L14:
	pxor	%xmm2, %xmm2
	movl	%eax, %ecx
	cvtsi2ssl	(%r12,%rax,4), %xmm2
	movaps	%xmm2, %xmm0
	subss	%xmm3, %xmm0
	comiss	%xmm4, %xmm0
	jnb	.L11
	movaps	%xmm3, %xmm0
	subss	%xmm2, %xmm0
.L11:
	comiss	%xmm0, %xmm1
	minss	%xmm1, %xmm0
	cmova	%ecx, %r8d
	addq	$1, %rax
	movaps	%xmm0, %xmm1
	cmpq	%rdx, %rax
	jne	.L14
.L10:
	movl	%r8d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%r8d, %r8d
.L1:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$432, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movl	%r8d, %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
.L29:
	.cfi_restore_state
	movaps	%xmm3, %xmm1
	subss	%xmm0, %xmm1
	jmp	.L9
.L19:
	xorl	%r8d, %r8d
	jmp	.L10
.L17:
	xorl	%edx, %edx
	jmp	.L4
.L18:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L5
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
#include <stdio.h>

int main(){
	int N;
	int array[100];
	int sum=0;
	float ave=0;
	float a=0;
	float b=0;
	int answer=0;
	scanf("%d",&N);
	if(N < 1 || 100 < N) return 1;
	for(int i = 0; i < N; i++){
		scanf("%d",&array[i]);
	}
	for(int i = 0; i < N; i++){
		sum += array[i];
	}
	ave = (float)sum / (float)N;
	a = ((array[0] - ave) >= 0) ? (array[0] - ave) : (ave - array[0]);
	for(int i = 1; i < N; i++){
		b = ((array[i] - ave) >= 0) ? (array[i] - ave) : (ave - array[i]);
		if(a > b){
			a = b;
			answer = i;
		}
	}
	printf("%d",answer);
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(){
	int N;
	int array[100];
	int sum=0;
	float ave=0;
	float a=0;
	float b=0;
	int answer=0;
	scanf("%d",&N);
	if(N < 1 || 100 < N) return 1;
	for(int i = 0; i < N; i++){
		scanf("%d",&array[i]);
	}
	for(int i = 0; i < N; i++){
		sum += array[i];
	}
	ave = (float)sum / (float)N;
	a = ((array[0] - ave) >= 0) ? (array[0] - ave) : (ave - array[0]);
	for(int i = 1; i < N; i++){
		b = ((array[i] - ave) >= 0) ? (array[i] - ave) : (ave - array[i]);
		if(a > b){
			a = b;
			answer = i;
		}
	}
	printf("%d",answer);
	return 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:

3
0 2 3
 4
2 5 3 5
 3
0 0 3
 4
3 9 3 5
 4
3 5 3 5
 3
0 0 1
 4
5 9 3 5
 4
5 14 3 5
 4
5 14 6 5
 4
0 14 6 5

1 2 0 3 0 0 0 0 2 2
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>

int main(){
	int N;
	int array[100];
	int sum=0;
	float ave=0;
	float a=0;
	float b=0;
	int answer=0;
	scanf("%d",&N);
	if(N < 1 || 100 < N) return 1;
	for(int i = 0; i < N; i++){
		scanf("%d",&array[i]);
	}
	for(int i = 0; i < N; i++){
		sum += array[i];
	}
	ave = (float)sum / (float)N;
	a = ((array[0] - ave) >= 0) ? (array[0] - ave) : (ave - array[0]);
	for(int i = 1; i < N; i++){
		b = ((array[i] - ave) >= 0) ? (array[i] - ave) : (ave - array[i]);
		if(a > b){
			a = b;
			answer = i;
		}
	}
	printf("%d",answer);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$1, %r8d
	subl	$1, %eax
	cmpl	$99, %eax
	ja	.L1
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L17
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L18
	movl	%eax, %edx
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leal	-1(%rdx), %ecx
	leaq	16(%r12), %rdx
	salq	$4, %rcx
	addq	%rdx, %rcx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$16, %rdx
.L6:
	paddd	0(%r13), %xmm0
	movq	%rdx, %r13
	cmpq	%rcx, %rdx
	jne	.L28
	movdqa	%xmm0, %xmm1
	movl	%eax, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %al
	je	.L4
.L5:
	movslq	%ecx, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %eax
	jle	.L4
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %eax
	jle	.L4
	movslq	%ecx, %rcx
	addl	16(%rsp,%rcx,4), %edx
.L4:
	pxor	%xmm3, %xmm3
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	cvtsi2ssl	%eax, %xmm0
	cvtsi2ssl	%edx, %xmm3
	divss	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	cvtsi2ssl	16(%rsp), %xmm0
	movaps	%xmm0, %xmm1
	subss	%xmm3, %xmm1
	comiss	%xmm4, %xmm1
	jb	.L29
.L9:
	cmpl	$1, %eax
	jle	.L19
	movslq	%eax, %rdx
	xorl	%r8d, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L14:
	pxor	%xmm2, %xmm2
	movl	%eax, %ecx
	cvtsi2ssl	(%r12,%rax,4), %xmm2
	movaps	%xmm2, %xmm0
	subss	%xmm3, %xmm0
	comiss	%xmm4, %xmm0
	jnb	.L11
	movaps	%xmm3, %xmm0
	subss	%xmm2, %xmm0
.L11:
	comiss	%xmm0, %xmm1
	minss	%xmm1, %xmm0
	cmova	%ecx, %r8d
	addq	$1, %rax
	movaps	%xmm0, %xmm1
	cmpq	%rdx, %rax
	jne	.L14
.L10:
	movl	%r8d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%r8d, %r8d
.L1:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$432, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movl	%r8d, %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
.L29:
	.cfi_restore_state
	movaps	%xmm3, %xmm1
	subss	%xmm0, %xmm1
	jmp	.L9
.L19:
	xorl	%r8d, %r8d
	jmp	.L10
.L17:
	xorl	%edx, %edx
	jmp	.L4
.L18:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L5
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$1, %r8d
	subl	$1, %eax
	cmpl	$99, %eax
	ja	.L1
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L17
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L18
	movl	%eax, %edx
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leal	-1(%rdx), %ecx
	leaq	16(%r12), %rdx
	salq	$4, %rcx
	addq	%rdx, %rcx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$16, %rdx
.L6:
	paddd	0(%r13), %xmm0
	movq	%rdx, %r13
	cmpq	%rcx, %rdx
	jne	.L28
	movdqa	%xmm0, %xmm1
	movl	%eax, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %al
	je	.L4
.L5:
	movslq	%ecx, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %eax
	jle	.L4
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %eax
	jle	.L4
	movslq	%ecx, %rcx
	addl	16(%rsp,%rcx,4), %edx
.L4:
	pxor	%xmm3, %xmm3
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	cvtsi2ssl	%eax, %xmm0
	cvtsi2ssl	%edx, %xmm3
	divss	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	cvtsi2ssl	16(%rsp), %xmm0
	movaps	%xmm0, %xmm1
	subss	%xmm3, %xmm1
	comiss	%xmm4, %xmm1
	jb	.L29
.L9:
	cmpl	$1, %eax
	jle	.L19
	movslq	%eax, %rdx
	xorl	%r8d, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L14:
	pxor	%xmm2, %xmm2
	movl	%eax, %ecx
	cvtsi2ssl	(%r12,%rax,4), %xmm2
	movaps	%xmm2, %xmm0
	subss	%xmm3, %xmm0
	comiss	%xmm4, %xmm0
	jnb	.L11
	movaps	%xmm3, %xmm0
	subss	%xmm2, %xmm0
.L11:
	comiss	%xmm0, %xmm1
	minss	%xmm1, %xmm0
	cmova	%ecx, %r8d
	addq	$1, %rax
	movaps	%xmm0, %xmm1
	cmpq	%rdx, %rax
	jne	.L14
.L10:
	movl	%r8d, %edx
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%r8d, %r8d
.L1:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$432, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movl	%r8d, %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
.L29:
	.cfi_restore_state
	movaps	%xmm3, %xmm1
	subss	%xmm0, %xmm1
	jmp	.L9
.L19:
	xorl	%r8d, %r8d
	jmp	.L10
.L17:
	xorl	%edx, %edx
	jmp	.L4
.L18:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L5
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```