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()
{
	long long tc,sum = 1;
	int flagO = 1,flag = 1;
	scanf("%lld",&tc);
	long long input[tc+1];
	for(int i = 0;i<tc;i++)
	{
		scanf("%lld",&input[i]);
		if(input[i] == 0) flagO =0;
	}
	for(int i = 0;i<tc;i++)
	{
		if(input[i] > 1000000000 && sum > 1000000000)
		{
			flag = 0;
			break;
		}
		if(sum > 1000000000000000000 || sum < 0 || sum * input[i] > 1000000000000000000) 
		{
			flag = 0;
		}
		sum*= input[i];
	}
	if(flagO == 0) printf("0\n");
	else if(flag == 0) printf("-1\n");
	else printf("%lld\n",sum);
	
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"0"
.LC2:
	.string	"-1"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rcx
	movq	%rsp, %rsi
	leaq	23(,%rcx,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L38:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L38
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L39
.L4:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	andq	$-8, %r12
	shrq	$3, %rax
	movq	%rax, -72(%rbp)
	testq	%rcx, %rcx
	jle	.L5
	movq	%r12, %rbx
	xorl	%r14d, %r14d
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movq	-64(%rbp), %rsi
	cmpq	$0, (%rbx)
	cmove	%eax, %r15d
	addq	$1, %r14
	addq	$8, %rbx
	cmpq	%r14, %rsi
	jg	.L7
	testq	%rsi, %rsi
	jle	.L40
	movq	-72(%rbp), %rax
	movl	$1, %r9d
	xorl	%r11d, %r11d
	movl	$1, %edx
	movabsq	$1000000000000000000, %r10
	movq	0(,%rax,8), %rcx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdx, %rdi
	imulq	%rcx, %rdx
	cmpq	%r10, %rdi
	ja	.L20
	cmpq	%r10, %rdx
	cmovg	%r11d, %r9d
	cmpq	%rsi, %rax
	je	.L41
.L14:
	movq	(%r12,%rax,8), %rcx
	addq	$1, %rax
	cmpq	$1000000000, %rcx
	jle	.L10
	cmpq	$1000000000, %rdx
	jle	.L10
	testl	%r15d, %r15d
	je	.L9
.L18:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L16:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L42
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	xorl	%r9d, %r9d
	cmpq	%rsi, %rax
	jne	.L14
.L41:
	testl	%r15d, %r15d
	je	.L9
	testl	%r9d, %r9d
	je	.L18
.L17:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L16
.L40:
	testl	%r15d, %r15d
	jne	.L5
.L9:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L16
.L39:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	movl	$1, %edx
	jmp	.L17
.L42:
	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	"%lld"
.LC1:
	.string	"0"
.LC2:
	.string	"-1"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rcx
	movq	%rsp, %rsi
	leaq	23(,%rcx,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L38:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L38
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L39
.L4:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	andq	$-8, %r12
	shrq	$3, %rax
	movq	%rax, -72(%rbp)
	testq	%rcx, %rcx
	jle	.L5
	movq	%r12, %rbx
	xorl	%r14d, %r14d
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movq	-64(%rbp), %rsi
	cmpq	$0, (%rbx)
	cmove	%eax, %r15d
	addq	$1, %r14
	addq	$8, %rbx
	cmpq	%r14, %rsi
	jg	.L7
	testq	%rsi, %rsi
	jle	.L40
	movq	-72(%rbp), %rax
	movl	$1, %r9d
	xorl	%r11d, %r11d
	movl	$1, %edx
	movabsq	$1000000000000000000, %r10
	movq	0(,%rax,8), %rcx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdx, %rdi
	imulq	%rcx, %rdx
	cmpq	%r10, %rdi
	ja	.L20
	cmpq	%r10, %rdx
	cmovg	%r11d, %r9d
	cmpq	%rsi, %rax
	je	.L41
.L14:
	movq	(%r12,%rax,8), %rcx
	addq	$1, %rax
	cmpq	$1000000000, %rcx
	jle	.L10
	cmpq	$1000000000, %rdx
	jle	.L10
	testl	%r15d, %r15d
	je	.L9
.L18:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L16:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L42
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	xorl	%r9d, %r9d
	cmpq	%rsi, %rax
	jne	.L14
.L41:
	testl	%r15d, %r15d
	je	.L9
	testl	%r9d, %r9d
	je	.L18
.L17:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L16
.L40:
	testl	%r15d, %r15d
	jne	.L5
.L9:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L16
.L39:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	movl	$1, %edx
	jmp	.L17
.L42:
	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	"%lld"
.LC1:
	.string	"0"
.LC2:
	.string	"-1"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rcx
	movq	%rsp, %rsi
	leaq	23(,%rcx,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L38:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L38
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L39
.L4:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	andq	$-8, %r12
	shrq	$3, %rax
	movq	%rax, -72(%rbp)
	testq	%rcx, %rcx
	jle	.L5
	movq	%r12, %rbx
	xorl	%r14d, %r14d
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movq	-64(%rbp), %rsi
	cmpq	$0, (%rbx)
	cmove	%eax, %r15d
	addq	$1, %r14
	addq	$8, %rbx
	cmpq	%r14, %rsi
	jg	.L7
	testq	%rsi, %rsi
	jle	.L40
	movq	-72(%rbp), %rax
	movl	$1, %r9d
	xorl	%r11d, %r11d
	movl	$1, %edx
	movabsq	$1000000000000000000, %r10
	movq	0(,%rax,8), %rcx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdx, %rdi
	imulq	%rcx, %rdx
	cmpq	%r10, %rdi
	ja	.L20
	cmpq	%r10, %rdx
	cmovg	%r11d, %r9d
	cmpq	%rsi, %rax
	je	.L41
.L14:
	movq	(%r12,%rax,8), %rcx
	addq	$1, %rax
	cmpq	$1000000000, %rcx
	jle	.L10
	cmpq	$1000000000, %rdx
	jle	.L10
	testl	%r15d, %r15d
	je	.L9
.L18:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L16:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L42
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	xorl	%r9d, %r9d
	cmpq	%rsi, %rax
	jne	.L14
.L41:
	testl	%r15d, %r15d
	je	.L9
	testl	%r9d, %r9d
	je	.L18
.L17:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L16
.L40:
	testl	%r15d, %r15d
	jne	.L5
.L9:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L16
.L39:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	movl	$1, %edx
	jmp	.L17
.L42:
	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()
{
	long long tc,sum = 1;
	int flagO = 1,flag = 1;
	scanf("%lld",&tc);
	long long input[tc+1];
	for(int i = 0;i<tc;i++)
	{
		scanf("%lld",&input[i]);
		if(input[i] == 0) flagO =0;
	}
	for(int i = 0;i<tc;i++)
	{
		if(input[i] > 1000000000 && sum > 1000000000)
		{
			flag = 0;
			break;
		}
		if(sum > 1000000000000000000 || sum < 0 || sum * input[i] > 1000000000000000000) 
		{
			flag = 0;
		}
		sum*= input[i];
	}
	if(flagO == 0) printf("0\n");
	else if(flag == 0) printf("-1\n");
	else printf("%lld\n",sum);
	
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main()
{
	long long tc,sum = 1;
	int flagO = 1,flag = 1;
	scanf("%lld",&tc);
	long long input[tc+1];
	for(int i = 0;i<tc;i++)
	{
		scanf("%lld",&input[i]);
		if(input[i] == 0) flagO =0;
	}
	for(int i = 0;i<tc;i++)
	{
		if(input[i] > 1000000000 && sum > 1000000000)
		{
			flag = 0;
			break;
		}
		if(sum > 1000000000000000000 || sum < 0 || sum * input[i] > 1000000000000000000) 
		{
			flag = 0;
		}
		sum*= input[i];
	}
	if(flagO == 0) printf("0\n");
	else if(flag == 0) printf("-1\n");
	else printf("%lld\n",sum);
	
}```

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
101 9901 1693005451348
 31
4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 0 2 7 9 5 0
 3
101 8497 834116832270
 3
101 5000 834116832270
 3
101 5000 29935402316
 3
111 5000 29935402316
 3
111 5000 36731156058
 3
011 5000 36731156058
 2
0000100010 1001010010
 3
101 5000 36731156058

-1
 0
 715836563103617190
 421229000296350000
 15117378169580000
 16614148285380000
 20385791612190000
 2020213583190000
 100111011100100
 18549233809290000

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()
{
	long long tc,sum = 1;
	int flagO = 1,flag = 1;
	scanf("%lld",&tc);
	long long input[tc+1];
	for(int i = 0;i<tc;i++)
	{
		scanf("%lld",&input[i]);
		if(input[i] == 0) flagO =0;
	}
	for(int i = 0;i<tc;i++)
	{
		if(input[i] > 1000000000 && sum > 1000000000)
		{
			flag = 0;
			break;
		}
		if(sum > 1000000000000000000 || sum < 0 || sum * input[i] > 1000000000000000000) 
		{
			flag = 0;
		}
		sum*= input[i];
	}
	if(flagO == 0) printf("0\n");
	else if(flag == 0) printf("-1\n");
	else printf("%lld\n",sum);
	
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"0"
.LC2:
	.string	"-1"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rcx
	movq	%rsp, %rsi
	leaq	23(,%rcx,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L38:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L38
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L39
.L4:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	andq	$-8, %r12
	shrq	$3, %rax
	movq	%rax, -72(%rbp)
	testq	%rcx, %rcx
	jle	.L5
	movq	%r12, %rbx
	xorl	%r14d, %r14d
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movq	-64(%rbp), %rsi
	cmpq	$0, (%rbx)
	cmove	%eax, %r15d
	addq	$1, %r14
	addq	$8, %rbx
	cmpq	%r14, %rsi
	jg	.L7
	testq	%rsi, %rsi
	jle	.L40
	movq	-72(%rbp), %rax
	movl	$1, %r9d
	xorl	%r11d, %r11d
	movl	$1, %edx
	movabsq	$1000000000000000000, %r10
	movq	0(,%rax,8), %rcx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdx, %rdi
	imulq	%rcx, %rdx
	cmpq	%r10, %rdi
	ja	.L20
	cmpq	%r10, %rdx
	cmovg	%r11d, %r9d
	cmpq	%rsi, %rax
	je	.L41
.L14:
	movq	(%r12,%rax,8), %rcx
	addq	$1, %rax
	cmpq	$1000000000, %rcx
	jle	.L10
	cmpq	$1000000000, %rdx
	jle	.L10
	testl	%r15d, %r15d
	je	.L9
.L18:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L16:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L42
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	xorl	%r9d, %r9d
	cmpq	%rsi, %rax
	jne	.L14
.L41:
	testl	%r15d, %r15d
	je	.L9
	testl	%r9d, %r9d
	je	.L18
.L17:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L16
.L40:
	testl	%r15d, %r15d
	jne	.L5
.L9:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L16
.L39:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	movl	$1, %edx
	jmp	.L17
.L42:
	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	"%lld"
.LC1:
	.string	"0"
.LC2:
	.string	"-1"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rcx
	movq	%rsp, %rsi
	leaq	23(,%rcx,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L38:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L38
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L39
.L4:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	andq	$-8, %r12
	shrq	$3, %rax
	movq	%rax, -72(%rbp)
	testq	%rcx, %rcx
	jle	.L5
	movq	%r12, %rbx
	xorl	%r14d, %r14d
	movl	$1, %r15d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	movq	-64(%rbp), %rsi
	cmpq	$0, (%rbx)
	cmove	%eax, %r15d
	addq	$1, %r14
	addq	$8, %rbx
	cmpq	%r14, %rsi
	jg	.L7
	testq	%rsi, %rsi
	jle	.L40
	movq	-72(%rbp), %rax
	movl	$1, %r9d
	xorl	%r11d, %r11d
	movl	$1, %edx
	movabsq	$1000000000000000000, %r10
	movq	0(,%rax,8), %rcx
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdx, %rdi
	imulq	%rcx, %rdx
	cmpq	%r10, %rdi
	ja	.L20
	cmpq	%r10, %rdx
	cmovg	%r11d, %r9d
	cmpq	%rsi, %rax
	je	.L41
.L14:
	movq	(%r12,%rax,8), %rcx
	addq	$1, %rax
	cmpq	$1000000000, %rcx
	jle	.L10
	cmpq	$1000000000, %rdx
	jle	.L10
	testl	%r15d, %r15d
	je	.L9
.L18:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
.L16:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L42
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	xorl	%r9d, %r9d
	cmpq	%rsi, %rax
	jne	.L14
.L41:
	testl	%r15d, %r15d
	je	.L9
	testl	%r9d, %r9d
	je	.L18
.L17:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L16
.L40:
	testl	%r15d, %r15d
	jne	.L5
.L9:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L16
.L39:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L5:
	movl	$1, %edx
	jmp	.L17
.L42:
	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:
```