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>
int gcd(int a,int b);
int compare(const void* a, const void* b);

typedef struct {
    int pos;
    int vit[100];
}PA;

int main(void){
    int N;
    int X[100];
    int sum[100];
    int min = 1000000;
    int i,j,k;
    scanf("%d",&N); //人数
    for( i = 0 ; i < N ; i++){
        scanf("%d",&(X[i]));    // i番目の人はどこにいる？
    }
    for( i = 0 ; i < 100 ; i++){ // i番目で実行したときの全員の消費体力
        sum[i] = 0;
        for( k = 0 ; k < N;k++){
            sum[i] = sum[i] + (X[k] - i)*(X[k] - i);
        }
        if (min>sum[i]) min = sum[i];
    }
    printf("%d\n",min);
    return 0;
}
int compare(const void* a, const void* b){
    return strcmp(a, b);
}
// 最大公約数
int gcd(int a,int b){
    int c;
    int tmp;
    if(b > a){  //bがaより大きい場合bとaを入れ替える
        c = a;
        a = b;
        b = c;
    }
    tmp = a % b;
    while(tmp!=0){
        a = b;
        b = tmp;
        tmp = a % b;
    }
    return b;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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	$832, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1000000, -828(%rbp)
	leaq	-832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -824(%rbp)
	jmp	.L2
.L3:
	leaq	-816(%rbp), %rdx
	movl	-824(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -824(%rbp)
.L2:
	movl	-832(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L3
	movl	$0, -824(%rbp)
	jmp	.L4
.L8:
	movl	-824(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	movl	$0, -820(%rbp)
	jmp	.L5
.L6:
	movl	-824(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	-820(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	subl	-824(%rbp), %eax
	movl	%eax, %edx
	movl	-820(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	subl	-824(%rbp), %eax
	imull	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -820(%rbp)
.L5:
	movl	-832(%rbp), %eax
	cmpl	%eax, -820(%rbp)
	jl	.L6
	movl	-824(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -828(%rbp)
	jle	.L7
	movl	-824(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -828(%rbp)
.L7:
	addl	$1, -824(%rbp)
.L4:
	cmpl	$99, -824(%rbp)
	jle	.L8
	movl	-828(%rbp), %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	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	compare
	.type	compare, @function
compare:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compare, .-compare
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L14
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L14:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -8(%rbp)
	jmp	.L15
.L16:
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -8(%rbp)
.L15:
	cmpl	$0, -8(%rbp)
	jne	.L16
	movl	-24(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	gcd, .-gcd
	.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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	movq	%rbx, %r12
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L2
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L3
.L2:
	movl	%r8d, %eax
	movl	%r8d, %r10d
	leal	-1(%r8), %r11d
	xorl	%edx, %edx
	shrl	$2, %eax
	andl	$-4, %r10d
	movl	$1000000, %r9d
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	testl	%r8d, %r8d
	jle	.L10
	cmpl	$2, %r11d
	jbe	.L11
	movd	%edx, %xmm4
	movq	%rbx, %rax
	pxor	%xmm2, %xmm2
	pshufd	$0, %xmm4, %xmm3
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	(%rax), %xmm0
	addq	$16, %rax
	psubd	%xmm3, %xmm0
	movdqa	%xmm0, %xmm1
	pmuludq	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	paddd	%xmm1, %xmm2
	cmpq	%rsi, %rax
	jne	.L6
	movdqa	%xmm2, %xmm0
	movl	%r10d, %ecx
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %eax
	cmpl	%r8d, %r10d
	je	.L4
.L5:
	movslq	%ecx, %rdi
	movl	16(%rsp,%rdi,4), %edi
	subl	%edx, %edi
	imull	%edi, %edi
	addl	%edi, %eax
	leal	1(%rcx), %edi
	cmpl	%edi, %r8d
	jle	.L4
	movslq	%edi, %rdi
	addl	$2, %ecx
	movl	16(%rsp,%rdi,4), %edi
	subl	%edx, %edi
	imull	%edi, %edi
	addl	%edi, %eax
	cmpl	%ecx, %r8d
	jle	.L4
	movslq	%ecx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	subl	%edx, %ecx
	imull	%ecx, %ecx
	addl	%ecx, %eax
.L4:
	cmpl	%eax, %r9d
	cmovg	%eax, %r9d
	addl	$1, %edx
	cmpl	$100, %edx
	jne	.L8
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L4
.L11:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L5
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.text
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB52:
	.cfi_startproc
	endbr64
	jmp	strcmp@PLT
	.cfi_endproc
.LFE52:
	.size	compare, .-compare
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB53:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	cmpl	%edi, %esi
	jle	.L22
	movl	%esi, %eax
	movl	%edi, %esi
.L22:
	cltd
	idivl	%esi
	testl	%edx, %edx
	je	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%esi, %eax
	movl	%edx, %r8d
	cltd
	movl	%r8d, %esi
	idivl	%r8d
	testl	%edx, %edx
	jne	.L24
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%esi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	gcd, .-gcd
	.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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	movq	%rbx, %r12
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L2
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L3
.L2:
	movl	%r8d, %eax
	movl	%r8d, %r10d
	leal	-1(%r8), %r11d
	xorl	%edx, %edx
	shrl	$2, %eax
	andl	$-4, %r10d
	movl	$1000000, %r9d
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	testl	%r8d, %r8d
	jle	.L10
	cmpl	$2, %r11d
	jbe	.L11
	movd	%edx, %xmm4
	movq	%rbx, %rax
	pxor	%xmm2, %xmm2
	pshufd	$0, %xmm4, %xmm3
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	(%rax), %xmm0
	addq	$16, %rax
	psubd	%xmm3, %xmm0
	movdqa	%xmm0, %xmm1
	pmuludq	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	paddd	%xmm1, %xmm2
	cmpq	%rsi, %rax
	jne	.L6
	movdqa	%xmm2, %xmm0
	movl	%r10d, %ecx
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %eax
	cmpl	%r8d, %r10d
	je	.L4
.L5:
	movslq	%ecx, %rdi
	movl	16(%rsp,%rdi,4), %edi
	subl	%edx, %edi
	imull	%edi, %edi
	addl	%edi, %eax
	leal	1(%rcx), %edi
	cmpl	%edi, %r8d
	jle	.L4
	movslq	%edi, %rdi
	addl	$2, %ecx
	movl	16(%rsp,%rdi,4), %edi
	subl	%edx, %edi
	imull	%edi, %edi
	addl	%edi, %eax
	cmpl	%ecx, %r8d
	jle	.L4
	movslq	%ecx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	subl	%edx, %ecx
	imull	%ecx, %ecx
	addl	%ecx, %eax
.L4:
	cmpl	%eax, %r9d
	cmovg	%eax, %r9d
	addl	$1, %edx
	cmpl	$100, %edx
	jne	.L8
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$440, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L4
.L11:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L5
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.text
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB52:
	.cfi_startproc
	endbr64
	jmp	strcmp@PLT
	.cfi_endproc
.LFE52:
	.size	compare, .-compare
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB53:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	cmpl	%edi, %esi
	jle	.L22
	movl	%esi, %eax
	movl	%edi, %esi
.L22:
	cltd
	idivl	%esi
	testl	%edx, %edx
	je	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%esi, %eax
	movl	%edx, %r8d
	cltd
	movl	%r8d, %esi
	idivl	%r8d
	testl	%edx, %edx
	jne	.L24
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%esi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	gcd, .-gcd
	.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>
int gcd(int a,int b);
int compare(const void* a, const void* b);

typedef struct {
    int pos;
    int vit[100];
}PA;

int main(void){
    int N;
    int X[100];
    int sum[100];
    int min = 1000000;
    int i,j,k;
    scanf("%d",&N); //人数
    for( i = 0 ; i < N ; i++){
        scanf("%d",&(X[i]));    // i番目の人はどこにいる？
    }
    for( i = 0 ; i < 100 ; i++){ // i番目で実行したときの全員の消費体力
        sum[i] = 0;
        for( k = 0 ; k < N;k++){
            sum[i] = sum[i] + (X[k] - i)*(X[k] - i);
        }
        if (min>sum[i]) min = sum[i];
    }
    printf("%d\n",min);
    return 0;
}
int compare(const void* a, const void* b){
    return strcmp(a, b);
}
// 最大公約数
int gcd(int a,int b){
    int c;
    int tmp;
    if(b > a){  //bがaより大きい場合bとaを入れ替える
        c = a;
        a = b;
        b = c;
    }
    tmp = a % b;
    while(tmp!=0){
        a = b;
        b = tmp;
        tmp = a % b;
    }
    return b;
}

7
14 14 3 13 56 2 37
 2
0 4
 7
14 14 3 13 56 2 0
 2
0 1
 7
14 14 3 12 56 2 0
 7
19 14 3 12 56 2 0
 7
19 14 3 24 56 2 0
 7
11 14 3 24 56 2 0
 7
11 14 3 24 56 1 0
 7
11 14 3 33 56 1 0

2319
 8
 2225
 1
 2229
 2245
 2293
 2314
 2343
 2563

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>
int gcd(int a,int b);
int compare(const void* a, const void* b);

typedef struct {
    int pos;
    int vit[100];
}PA;

int main(void){
    int N;
    int X[100];
    int sum[100];
    int min = 1000000;
    int i,j,k;
    scanf("%d",&N); //人数
    for( i = 0 ; i < N ; i++){
        scanf("%d",&(X[i]));    // i番目の人はどこにいる？
    }
    for( i = 0 ; i < 100 ; i++){ // i番目で実行したときの全員の消費体力
        sum[i] = 0;
        for( k = 0 ; k < N;k++){
            sum[i] = sum[i] + (X[k] - i)*(X[k] - i);
        }
        if (min>sum[i]) min = sum[i];
    }
    printf("%d\n",min);
    return 0;
}
int compare(const void* a, const void* b){
    return strcmp(a, b);
}
// 最大公約数
int gcd(int a,int b){
    int c;
    int tmp;
    if(b > a){  //bがaより大きい場合bとaを入れ替える
        c = a;
        a = b;
        b = c;
    }
    tmp = a % b;
    while(tmp!=0){
        a = b;
        b = tmp;
        tmp = a % b;
    }
    return b;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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	$832, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1000000, -828(%rbp)
	leaq	-832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -824(%rbp)
	jmp	.L2
.L3:
	leaq	-816(%rbp), %rdx
	movl	-824(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -824(%rbp)
.L2:
	movl	-832(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L3
	movl	$0, -824(%rbp)
	jmp	.L4
.L8:
	movl	-824(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	movl	$0, -820(%rbp)
	jmp	.L5
.L6:
	movl	-824(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	-820(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	subl	-824(%rbp), %eax
	movl	%eax, %edx
	movl	-820(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	subl	-824(%rbp), %eax
	imull	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -820(%rbp)
.L5:
	movl	-832(%rbp), %eax
	cmpl	%eax, -820(%rbp)
	jl	.L6
	movl	-824(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -828(%rbp)
	jle	.L7
	movl	-824(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -828(%rbp)
.L7:
	addl	$1, -824(%rbp)
.L4:
	cmpl	$99, -824(%rbp)
	jle	.L8
	movl	-828(%rbp), %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	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	compare
	.type	compare, @function
compare:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compare, .-compare
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L14
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L14:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -8(%rbp)
	jmp	.L15
.L16:
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -8(%rbp)
.L15:
	cmpl	$0, -8(%rbp)
	jne	.L16
	movl	-24(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	gcd, .-gcd
	.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\n"
	.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	$832, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1000000, -828(%rbp)
	leaq	-832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -824(%rbp)
	jmp	.L2
.L3:
	leaq	-816(%rbp), %rdx
	movl	-824(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -824(%rbp)
.L2:
	movl	-832(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L3
	movl	$0, -824(%rbp)
	jmp	.L4
.L8:
	movl	-824(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	movl	$0, -820(%rbp)
	jmp	.L5
.L6:
	movl	-824(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	-820(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	subl	-824(%rbp), %eax
	movl	%eax, %edx
	movl	-820(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	subl	-824(%rbp), %eax
	imull	%edx, %eax
	leal	(%rcx,%rax), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -820(%rbp)
.L5:
	movl	-832(%rbp), %eax
	cmpl	%eax, -820(%rbp)
	jl	.L6
	movl	-824(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -828(%rbp)
	jle	.L7
	movl	-824(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -828(%rbp)
.L7:
	addl	$1, -824(%rbp)
.L4:
	cmpl	$99, -824(%rbp)
	jle	.L8
	movl	-828(%rbp), %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	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	compare
	.type	compare, @function
compare:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compare, .-compare
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L14
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L14:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -8(%rbp)
	jmp	.L15
.L16:
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-8(%rbp), %eax
	movl	%eax, -24(%rbp)
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -8(%rbp)
.L15:
	cmpl	$0, -8(%rbp)
	jne	.L16
	movl	-24(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	gcd, .-gcd
	.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:
