Given the following C code and 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;

}

```

Assembly Code:

```assembly
	.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:
```

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\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
```assembly
	.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:
```
```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;

}

```
Given the following C 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;

}

```

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
5
10
15

25

Given the following C code and 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;

}

```

Assembly Code:

```assembly
	.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:
```

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\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:
```