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){
    int n, array[101], g=0, h, ans=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&array[i]);
        g+=array[i];
    }
    h = round((float)g/n);
    for(int i=0;i<n;i++){
        ans += pow((h-array[i]),2);
    }
    printf("%d\n",ans);
    
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.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
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r14
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	(%r14,%rbp,4), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%r14, %rbx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r12d
	addl	(%r14,%rbp,4), %r13d
	addq	$1, %rbp
	cmpl	%ebp, %r12d
	jg	.L2
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2ssl	%r12d, %xmm1
	cvtsi2ssl	%r13d, %xmm0
	divss	%xmm1, %xmm0
	call	roundf@PLT
	cvttss2sil	%xmm0, %esi
	testl	%r12d, %r12d
	jle	.L4
	leal	-1(%r12), %eax
	xorl	%edx, %edx
	leaq	20(%rsp,%rax,4), %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	subl	(%rbx), %eax
	addq	$4, %rbx
	cvtsi2sdl	%eax, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%edx, %xmm1
	mulsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %edx
	cmpq	%rbx, %rcx
	jne	.L5
.L3:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$440, %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
.L4:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L3
.L14:
	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"
.LC1:
	.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
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r14
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	(%r14,%rbp,4), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%r14, %rbx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r12d
	addl	(%r14,%rbp,4), %r13d
	addq	$1, %rbp
	cmpl	%ebp, %r12d
	jg	.L2
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2ssl	%r12d, %xmm1
	cvtsi2ssl	%r13d, %xmm0
	divss	%xmm1, %xmm0
	call	roundf@PLT
	cvttss2sil	%xmm0, %esi
	testl	%r12d, %r12d
	jle	.L4
	leal	-1(%r12), %eax
	xorl	%edx, %edx
	leaq	20(%rsp,%rax,4), %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	subl	(%rbx), %eax
	addq	$4, %rbx
	cvtsi2sdl	%eax, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%edx, %xmm1
	mulsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %edx
	cmpq	%rbx, %rcx
	jne	.L5
.L3:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$440, %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
.L4:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L3
.L14:
	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"
.LC1:
	.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
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r14
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	(%r14,%rbp,4), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%r14, %rbx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r12d
	addl	(%r14,%rbp,4), %r13d
	addq	$1, %rbp
	cmpl	%ebp, %r12d
	jg	.L2
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2ssl	%r12d, %xmm1
	cvtsi2ssl	%r13d, %xmm0
	divss	%xmm1, %xmm0
	call	roundf@PLT
	cvttss2sil	%xmm0, %esi
	testl	%r12d, %r12d
	jle	.L4
	leal	-1(%r12), %eax
	xorl	%edx, %edx
	leaq	20(%rsp,%rax,4), %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	subl	(%rbx), %eax
	addq	$4, %rbx
	cvtsi2sdl	%eax, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%edx, %xmm1
	mulsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %edx
	cmpq	%rbx, %rcx
	jne	.L5
.L3:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$440, %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
.L4:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L3
.L14:
	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>
#include <math.h>
int main(void){
    int n, array[101], g=0, h, ans=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&array[i]);
        g+=array[i];
    }
    h = round((float)g/n);
    for(int i=0;i<n;i++){
        ans += pow((h-array[i]),2);
    }
    printf("%d\n",ans);
    
}
```
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){
    int n, array[101], g=0, h, ans=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&array[i]);
        g+=array[i];
    }
    h = round((float)g/n);
    for(int i=0;i<n;i++){
        ans += pow((h-array[i]),2);
    }
    printf("%d\n",ans);
    
}
```

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:

2
5 8
 3
1 1 6
 3
4 3 5
 4
-100 -45 -100 -100
 2
5 11
 3
1 1 8
 3
3 3 5
 3
0 1 8
 3
3 0 5
 2
10 6

5
 17
 2
 2269
 18
 33
 3
 38
 13
 8

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){
    int n, array[101], g=0, h, ans=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&array[i]);
        g+=array[i];
    }
    h = round((float)g/n);
    for(int i=0;i<n;i++){
        ans += pow((h-array[i]),2);
    }
    printf("%d\n",ans);
    
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.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
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r14
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	(%r14,%rbp,4), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%r14, %rbx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r12d
	addl	(%r14,%rbp,4), %r13d
	addq	$1, %rbp
	cmpl	%ebp, %r12d
	jg	.L2
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2ssl	%r12d, %xmm1
	cvtsi2ssl	%r13d, %xmm0
	divss	%xmm1, %xmm0
	call	roundf@PLT
	cvttss2sil	%xmm0, %esi
	testl	%r12d, %r12d
	jle	.L4
	leal	-1(%r12), %eax
	xorl	%edx, %edx
	leaq	20(%rsp,%rax,4), %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	subl	(%rbx), %eax
	addq	$4, %rbx
	cvtsi2sdl	%eax, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%edx, %xmm1
	mulsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %edx
	cmpq	%rbx, %rcx
	jne	.L5
.L3:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$440, %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
.L4:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L3
.L14:
	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"
.LC1:
	.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
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r15, %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	xorl	%r13d, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r14
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	(%r14,%rbp,4), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	movq	%r14, %rbx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r12d
	addl	(%r14,%rbp,4), %r13d
	addq	$1, %rbp
	cmpl	%ebp, %r12d
	jg	.L2
	pxor	%xmm0, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2ssl	%r12d, %xmm1
	cvtsi2ssl	%r13d, %xmm0
	divss	%xmm1, %xmm0
	call	roundf@PLT
	cvttss2sil	%xmm0, %esi
	testl	%r12d, %r12d
	jle	.L4
	leal	-1(%r12), %eax
	xorl	%edx, %edx
	leaq	20(%rsp,%rax,4), %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	subl	(%rbx), %eax
	addq	$4, %rbx
	cvtsi2sdl	%eax, %xmm0
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%edx, %xmm1
	mulsd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	cvttsd2sil	%xmm1, %edx
	cmpq	%rbx, %rcx
	jne	.L5
.L3:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$440, %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
.L4:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L3
.L14:
	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:
```