Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#pragma warning(disable:4996)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAX_STRING 4
#define QNUM_LIMIT 100

int main() {

	char  sInput[MAX_STRING]="";
	char* psInput=NULL;
	char* psTemp=NULL;

	int nQNum=0;
	int anScore[QNUM_LIMIT];
	int nSum=0;
	int nMinNum = 10000;
	int nAnswer=0;

	int i=0;
	int j=0;


	// read line 1
	psTemp = fgets(sInput,MAX_STRING,stdin);
	if (strchr(sInput, '\n') != NULL) {
	    sInput[strlen(sInput) - 1] = '\0';
	} else {
		while(getchar() != '\n');
	}
	nQNum=atoi(sInput);

	for (i=0;i<nQNum;i++){
		psTemp = fgets(sInput,MAX_STRING,stdin);
		if (strchr(sInput, '\n') != NULL) {
			sInput[strlen(sInput) - 1] = '\0';
		} else {
			while(getchar() != '\n');
		}
		anScore[i]=atoi(sInput);
		nSum = nSum + anScore[i];

		if (anScore[i]%10 != 0 && anScore[i]<nMinNum){
			nMinNum=anScore[i];
		}
	}

	if (nSum%10 != 0 ){
		nAnswer = nSum;
	} else {
		nAnswer = nSum - nMinNum;
		if ( nAnswer <= 0 || nAnswer%10 == 0){
			nAnswer=0;
		}
	}


	printf("%d\n",nAnswer);
	
	return 0;

}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	movq	$0, -432(%rbp)
	movq	$0, -424(%rbp)
	movl	$0, -440(%rbp)
	movl	$0, -456(%rbp)
	movl	$10000, -452(%rbp)
	movl	$0, -448(%rbp)
	movl	$0, -444(%rbp)
	movl	$0, -436(%rbp)
	movq	stdin(%rip), %rdx
	leaq	-12(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movq	%rax, -424(%rbp)
	leaq	-12(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L16
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subq	$1, %rax
	movb	$0, -12(%rbp,%rax)
	jmp	.L3
.L16:
	nop
.L4:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L4
.L3:
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, -440(%rbp)
	movl	$0, -444(%rbp)
	jmp	.L5
.L10:
	movq	stdin(%rip), %rdx
	leaq	-12(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movq	%rax, -424(%rbp)
	leaq	-12(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L17
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subq	$1, %rax
	movb	$0, -12(%rbp,%rax)
	jmp	.L7
.L17:
	nop
.L8:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L8
.L7:
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	-444(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -416(%rbp,%rdx,4)
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -456(%rbp)
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L9
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -452(%rbp)
	jle	.L9
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -452(%rbp)
.L9:
	addl	$1, -444(%rbp)
.L5:
	movl	-444(%rbp), %eax
	cmpl	-440(%rbp), %eax
	jl	.L10
	movl	-456(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L11
	movl	-456(%rbp), %eax
	movl	%eax, -448(%rbp)
	jmp	.L12
.L11:
	movl	-456(%rbp), %eax
	subl	-452(%rbp), %eax
	movl	%eax, -448(%rbp)
	cmpl	$0, -448(%rbp)
	jle	.L13
	movl	-448(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L12
.L13:
	movl	$0, -448(%rbp)
.L12:
	movl	-448(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.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	$4, %esi
	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
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbx
	movl	$0, 4(%rsp)
	movq	%rbx, %rdi
	call	fgets@PLT
	movl	$10, %esi
	movq	%rbx, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L2
	movq	%rbx, %rdi
	call	strlen@PLT
	movb	$0, 3(%rsp,%rax)
.L3:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	strtol@PLT
	movl	%eax, %r14d
	testl	%eax, %eax
	jle	.L11
	xorl	%r12d, %r12d
	movl	$10000, %ebp
	xorl	%r13d, %r13d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%rbx, %rdi
	call	strlen@PLT
	movb	$0, 3(%rsp,%rax)
.L6:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	strtol@PLT
	imull	$-858993459, %eax, %edx
	addl	%eax, %r13d
	addl	$429496728, %edx
	rorl	%edx
	cmpl	%eax, %ebp
	cmovle	%ebp, %eax
	cmpl	$429496728, %edx
	cmova	%eax, %ebp
	addl	$1, %r12d
	cmpl	%r14d, %r12d
	je	.L23
.L8:
	movq	stdin(%rip), %rdx
	movl	$4, %esi
	movq	%rbx, %rdi
	call	fgets@PLT
	movl	$10, %esi
	movq	%rbx, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	jne	.L24
	.p2align 4,,10
	.p2align 3
.L5:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$10, %eax
	jne	.L5
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$10, %eax
	jne	.L2
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	%r13d, %rax
	movl	%r13d, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	cmpl	%eax, %r13d
	je	.L25
.L4:
	xorl	%eax, %eax
	movl	%r13d, %edx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$16, %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
.L25:
	.cfi_restore_state
	subl	%ebp, %r13d
	testl	%r13d, %r13d
	jle	.L11
	movl	%r13d, %eax
	movl	$10, %ecx
	cltd
	idivl	%ecx
	testl	%edx, %edx
	cmove	%edx, %r13d
	jmp	.L4
.L11:
	xorl	%r13d, %r13d
	jmp	.L4
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.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	$4, %esi
	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
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	stdin(%rip), %rdx
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbx
	movl	$0, 4(%rsp)
	movq	%rbx, %rdi
	call	fgets@PLT
	movl	$10, %esi
	movq	%rbx, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L2
	movq	%rbx, %rdi
	call	strlen@PLT
	movb	$0, 3(%rsp,%rax)
.L3:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	strtol@PLT
	movl	%eax, %r14d
	testl	%eax, %eax
	jle	.L11
	xorl	%r12d, %r12d
	movl	$10000, %ebp
	xorl	%r13d, %r13d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%rbx, %rdi
	call	strlen@PLT
	movb	$0, 3(%rsp,%rax)
.L6:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	strtol@PLT
	imull	$-858993459, %eax, %edx
	addl	%eax, %r13d
	addl	$429496728, %edx
	rorl	%edx
	cmpl	%eax, %ebp
	cmovle	%ebp, %eax
	cmpl	$429496728, %edx
	cmova	%eax, %ebp
	addl	$1, %r12d
	cmpl	%r14d, %r12d
	je	.L23
.L8:
	movq	stdin(%rip), %rdx
	movl	$4, %esi
	movq	%rbx, %rdi
	call	fgets@PLT
	movl	$10, %esi
	movq	%rbx, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	jne	.L24
	.p2align 4,,10
	.p2align 3
.L5:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$10, %eax
	jne	.L5
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpl	$10, %eax
	jne	.L2
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	%r13d, %rax
	movl	%r13d, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	cmpl	%eax, %r13d
	je	.L25
.L4:
	xorl	%eax, %eax
	movl	%r13d, %edx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$16, %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
.L25:
	.cfi_restore_state
	subl	%ebp, %r13d
	testl	%r13d, %r13d
	jle	.L11
	movl	%r13d, %eax
	movl	$10, %ecx
	cltd
	idivl	%ecx
	testl	%edx, %edx
	cmove	%edx, %r13d
	jmp	.L4
.L11:
	xorl	%r13d, %r13d
	jmp	.L4
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:

#pragma warning(disable:4996)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAX_STRING 4
#define QNUM_LIMIT 100

int main() {

	char  sInput[MAX_STRING]="";
	char* psInput=NULL;
	char* psTemp=NULL;

	int nQNum=0;
	int anScore[QNUM_LIMIT];
	int nSum=0;
	int nMinNum = 10000;
	int nAnswer=0;

	int i=0;
	int j=0;


	// read line 1
	psTemp = fgets(sInput,MAX_STRING,stdin);
	if (strchr(sInput, '\n') != NULL) {
	    sInput[strlen(sInput) - 1] = '\0';
	} else {
		while(getchar() != '\n');
	}
	nQNum=atoi(sInput);

	for (i=0;i<nQNum;i++){
		psTemp = fgets(sInput,MAX_STRING,stdin);
		if (strchr(sInput, '\n') != NULL) {
			sInput[strlen(sInput) - 1] = '\0';
		} else {
			while(getchar() != '\n');
		}
		anScore[i]=atoi(sInput);
		nSum = nSum + anScore[i];

		if (anScore[i]%10 != 0 && anScore[i]<nMinNum){
			nMinNum=anScore[i];
		}
	}

	if (nSum%10 != 0 ){
		nAnswer = nSum;
	} else {
		nAnswer = nSum - nMinNum;
		if ( nAnswer <= 0 || nAnswer%10 == 0){
			nAnswer=0;
		}
	}


	printf("%d\n",nAnswer);
	
	return 0;

}


3
5
10
15

25

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#pragma warning(disable:4996)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAX_STRING 4
#define QNUM_LIMIT 100

int main() {

	char  sInput[MAX_STRING]="";
	char* psInput=NULL;
	char* psTemp=NULL;

	int nQNum=0;
	int anScore[QNUM_LIMIT];
	int nSum=0;
	int nMinNum = 10000;
	int nAnswer=0;

	int i=0;
	int j=0;


	// read line 1
	psTemp = fgets(sInput,MAX_STRING,stdin);
	if (strchr(sInput, '\n') != NULL) {
	    sInput[strlen(sInput) - 1] = '\0';
	} else {
		while(getchar() != '\n');
	}
	nQNum=atoi(sInput);

	for (i=0;i<nQNum;i++){
		psTemp = fgets(sInput,MAX_STRING,stdin);
		if (strchr(sInput, '\n') != NULL) {
			sInput[strlen(sInput) - 1] = '\0';
		} else {
			while(getchar() != '\n');
		}
		anScore[i]=atoi(sInput);
		nSum = nSum + anScore[i];

		if (anScore[i]%10 != 0 && anScore[i]<nMinNum){
			nMinNum=anScore[i];
		}
	}

	if (nSum%10 != 0 ){
		nAnswer = nSum;
	} else {
		nAnswer = nSum - nMinNum;
		if ( nAnswer <= 0 || nAnswer%10 == 0){
			nAnswer=0;
		}
	}


	printf("%d\n",nAnswer);
	
	return 0;

}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	movq	$0, -432(%rbp)
	movq	$0, -424(%rbp)
	movl	$0, -440(%rbp)
	movl	$0, -456(%rbp)
	movl	$10000, -452(%rbp)
	movl	$0, -448(%rbp)
	movl	$0, -444(%rbp)
	movl	$0, -436(%rbp)
	movq	stdin(%rip), %rdx
	leaq	-12(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movq	%rax, -424(%rbp)
	leaq	-12(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L16
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subq	$1, %rax
	movb	$0, -12(%rbp,%rax)
	jmp	.L3
.L16:
	nop
.L4:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L4
.L3:
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, -440(%rbp)
	movl	$0, -444(%rbp)
	jmp	.L5
.L10:
	movq	stdin(%rip), %rdx
	leaq	-12(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movq	%rax, -424(%rbp)
	leaq	-12(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L17
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subq	$1, %rax
	movb	$0, -12(%rbp,%rax)
	jmp	.L7
.L17:
	nop
.L8:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L8
.L7:
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	-444(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -416(%rbp,%rdx,4)
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -456(%rbp)
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L9
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -452(%rbp)
	jle	.L9
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -452(%rbp)
.L9:
	addl	$1, -444(%rbp)
.L5:
	movl	-444(%rbp), %eax
	cmpl	-440(%rbp), %eax
	jl	.L10
	movl	-456(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L11
	movl	-456(%rbp), %eax
	movl	%eax, -448(%rbp)
	jmp	.L12
.L11:
	movl	-456(%rbp), %eax
	subl	-452(%rbp), %eax
	movl	%eax, -448(%rbp)
	cmpl	$0, -448(%rbp)
	jle	.L13
	movl	-448(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L12
.L13:
	movl	$0, -448(%rbp)
.L12:
	movl	-448(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -12(%rbp)
	movq	$0, -432(%rbp)
	movq	$0, -424(%rbp)
	movl	$0, -440(%rbp)
	movl	$0, -456(%rbp)
	movl	$10000, -452(%rbp)
	movl	$0, -448(%rbp)
	movl	$0, -444(%rbp)
	movl	$0, -436(%rbp)
	movq	stdin(%rip), %rdx
	leaq	-12(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movq	%rax, -424(%rbp)
	leaq	-12(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L16
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subq	$1, %rax
	movb	$0, -12(%rbp,%rax)
	jmp	.L3
.L16:
	nop
.L4:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L4
.L3:
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, -440(%rbp)
	movl	$0, -444(%rbp)
	jmp	.L5
.L10:
	movq	stdin(%rip), %rdx
	leaq	-12(%rbp), %rax
	movl	$4, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movq	%rax, -424(%rbp)
	leaq	-12(%rbp), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	strchr@PLT
	testq	%rax, %rax
	je	.L17
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subq	$1, %rax
	movb	$0, -12(%rbp,%rax)
	jmp	.L7
.L17:
	nop
.L8:
	call	getchar@PLT
	cmpl	$10, %eax
	jne	.L8
.L7:
	leaq	-12(%rbp), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	-444(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -416(%rbp,%rdx,4)
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -456(%rbp)
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L9
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -452(%rbp)
	jle	.L9
	movl	-444(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -452(%rbp)
.L9:
	addl	$1, -444(%rbp)
.L5:
	movl	-444(%rbp), %eax
	cmpl	-440(%rbp), %eax
	jl	.L10
	movl	-456(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	je	.L11
	movl	-456(%rbp), %eax
	movl	%eax, -448(%rbp)
	jmp	.L12
.L11:
	movl	-456(%rbp), %eax
	subl	-452(%rbp), %eax
	movl	%eax, -448(%rbp)
	cmpl	$0, -448(%rbp)
	jle	.L13
	movl	-448(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	testl	%edx, %edx
	jne	.L12
.L13:
	movl	$0, -448(%rbp)
.L12:
	movl	-448(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
