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()
{
	int n,t[101],m,p[101],x[101],a=0,i;

	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&t[i]);
	scanf("%d",&m);
	for(i=0;i<m;i++)
		scanf("%d%d",&p[i],&x[i]);

	for(i=0;i<n;i++)
		a+=t[i];
	for(i=0;i<m;i++)
		printf("%d\n",a-t[p[i]-1]+x[i]);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$1264, %rsp
	.cfi_def_cfa_offset 1312
	movq	%fs:40, %rax
	movq	%rax, 1256(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L5
.L6:
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L30
	leaq	432(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	848(%rsp), %r12
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	(%r12,%rbx,4), %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L7
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L17
.L15:
	testl	%ecx, %ecx
	movl	$1, %edi
	cmovg	%ecx, %edi
	cmpl	$3, %ecx
	jle	.L18
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	movl	%edi, %esi
	shrl	$2, %esi
	subl	$1, %esi
	salq	$4, %rsi
	leaq	32(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rsi
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %edi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebp
	je	.L8
.L9:
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %ebp
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L8
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	16(%rsp,%rsi,4), %ebp
	cmpl	%eax, %ecx
	jle	.L8
	cltq
	addl	16(%rsp,%rax,4), %ebp
.L8:
	testl	%edx, %edx
	jle	.L14
	xorl	%ebx, %ebx
	leaq	432(%rsp), %r14
	leaq	848(%rsp), %r12
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%r14,%rbx,4), %eax
	movl	%ebp, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	subl	$1, %eax
	cltq
	subl	16(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	addl	(%r12,%rbx,4), %edx
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L13
.L14:
	movq	1256(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$1264, %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
.L30:
	.cfi_restore_state
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jg	.L15
	jmp	.L14
.L17:
	xorl	%ebp, %ebp
	jmp	.L8
.L18:
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	jmp	.L9
.L31:
	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%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$1264, %rsp
	.cfi_def_cfa_offset 1312
	movq	%fs:40, %rax
	movq	%rax, 1256(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L5
.L6:
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L30
	leaq	432(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	848(%rsp), %r12
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	(%r12,%rbx,4), %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L7
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L17
.L15:
	testl	%ecx, %ecx
	movl	$1, %edi
	cmovg	%ecx, %edi
	cmpl	$3, %ecx
	jle	.L18
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	movl	%edi, %esi
	shrl	$2, %esi
	subl	$1, %esi
	salq	$4, %rsi
	leaq	32(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rsi
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %edi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebp
	je	.L8
.L9:
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %ebp
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L8
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	16(%rsp,%rsi,4), %ebp
	cmpl	%eax, %ecx
	jle	.L8
	cltq
	addl	16(%rsp,%rax,4), %ebp
.L8:
	testl	%edx, %edx
	jle	.L14
	xorl	%ebx, %ebx
	leaq	432(%rsp), %r14
	leaq	848(%rsp), %r12
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%r14,%rbx,4), %eax
	movl	%ebp, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	subl	$1, %eax
	cltq
	subl	16(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	addl	(%r12,%rbx,4), %edx
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L13
.L14:
	movq	1256(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$1264, %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
.L30:
	.cfi_restore_state
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jg	.L15
	jmp	.L14
.L17:
	xorl	%ebp, %ebp
	jmp	.L8
.L18:
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	jmp	.L9
.L31:
	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%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$1264, %rsp
	.cfi_def_cfa_offset 1312
	movq	%fs:40, %rax
	movq	%rax, 1256(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L5
.L6:
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L30
	leaq	432(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	848(%rsp), %r12
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	(%r12,%rbx,4), %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L7
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L17
.L15:
	testl	%ecx, %ecx
	movl	$1, %edi
	cmovg	%ecx, %edi
	cmpl	$3, %ecx
	jle	.L18
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	movl	%edi, %esi
	shrl	$2, %esi
	subl	$1, %esi
	salq	$4, %rsi
	leaq	32(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rsi
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %edi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebp
	je	.L8
.L9:
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %ebp
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L8
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	16(%rsp,%rsi,4), %ebp
	cmpl	%eax, %ecx
	jle	.L8
	cltq
	addl	16(%rsp,%rax,4), %ebp
.L8:
	testl	%edx, %edx
	jle	.L14
	xorl	%ebx, %ebx
	leaq	432(%rsp), %r14
	leaq	848(%rsp), %r12
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%r14,%rbx,4), %eax
	movl	%ebp, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	subl	$1, %eax
	cltq
	subl	16(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	addl	(%r12,%rbx,4), %edx
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L13
.L14:
	movq	1256(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$1264, %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
.L30:
	.cfi_restore_state
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jg	.L15
	jmp	.L14
.L17:
	xorl	%ebp, %ebp
	jmp	.L8
.L18:
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	jmp	.L9
.L31:
	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()
{
	int n,t[101],m,p[101],x[101],a=0,i;

	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&t[i]);
	scanf("%d",&m);
	for(i=0;i<m;i++)
		scanf("%d%d",&p[i],&x[i]);

	for(i=0;i<n;i++)
		a+=t[i];
	for(i=0;i<m;i++)
		printf("%d\n",a-t[p[i]-1]+x[i]);
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
int main()
{
	int n,t[101],m,p[101],x[101],a=0,i;

	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&t[i]);
	scanf("%d",&m);
	for(i=0;i<m;i++)
		scanf("%d%d",&p[i],&x[i]);

	for(i=0;i<n;i++)
		a+=t[i];
	for(i=0;i<m;i++)
		printf("%d\n",a-t[p[i]-1]+x[i]);
	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
2 1 4
2
1 1
0 3
 5
7 2 3 10 5
3
4 2
1 7
4 13
 3
2 1 4
2
1 1
0 6
 5
7 4 3 10 5
3
4 2
1 7
4 13
 3
2 1 4
2
1 0
2 3
 3
2 1 4
2
1 0
0 3
 5
7 2 3 10 5
3
4 2
1 7
4 20
 3
1 1 4
2
1 1
0 6
 5
7 4 3 10 5
3
4 2
1 7
3 13
 3
2 0 4
2
1 0
0 3

6
9
 19
27
30
 6
12
 21
29
32
 5
9
 5
9
 19
27
37
 6
11
 21
29
39
 4
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>
int main()
{
	int n,t[101],m,p[101],x[101],a=0,i;

	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d",&t[i]);
	scanf("%d",&m);
	for(i=0;i<m;i++)
		scanf("%d%d",&p[i],&x[i]);

	for(i=0;i<n;i++)
		a+=t[i];
	for(i=0;i<m;i++)
		printf("%d\n",a-t[p[i]-1]+x[i]);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$1264, %rsp
	.cfi_def_cfa_offset 1312
	movq	%fs:40, %rax
	movq	%rax, 1256(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L5
.L6:
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L30
	leaq	432(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	848(%rsp), %r12
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	(%r12,%rbx,4), %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L7
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L17
.L15:
	testl	%ecx, %ecx
	movl	$1, %edi
	cmovg	%ecx, %edi
	cmpl	$3, %ecx
	jle	.L18
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	movl	%edi, %esi
	shrl	$2, %esi
	subl	$1, %esi
	salq	$4, %rsi
	leaq	32(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rsi
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %edi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebp
	je	.L8
.L9:
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %ebp
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L8
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	16(%rsp,%rsi,4), %ebp
	cmpl	%eax, %ecx
	jle	.L8
	cltq
	addl	16(%rsp,%rax,4), %ebp
.L8:
	testl	%edx, %edx
	jle	.L14
	xorl	%ebx, %ebx
	leaq	432(%rsp), %r14
	leaq	848(%rsp), %r12
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%r14,%rbx,4), %eax
	movl	%ebp, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	subl	$1, %eax
	cltq
	subl	16(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	addl	(%r12,%rbx,4), %edx
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L13
.L14:
	movq	1256(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$1264, %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
.L30:
	.cfi_restore_state
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jg	.L15
	jmp	.L14
.L17:
	xorl	%ebp, %ebp
	jmp	.L8
.L18:
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	jmp	.L9
.L31:
	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%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	subq	$1264, %rsp
	.cfi_def_cfa_offset 1312
	movq	%fs:40, %rax
	movq	%rax, 1256(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L5
.L6:
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L30
	leaq	432(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	848(%rsp), %r12
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	(%r12,%rbx,4), %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L7
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L17
.L15:
	testl	%ecx, %ecx
	movl	$1, %edi
	cmovg	%ecx, %edi
	cmpl	$3, %ecx
	jle	.L18
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	movl	%edi, %esi
	shrl	$2, %esi
	subl	$1, %esi
	salq	$4, %rsi
	leaq	32(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L10:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rsi
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	andl	$3, %edi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %ebp
	je	.L8
.L9:
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %ebp
	leal	1(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L8
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	16(%rsp,%rsi,4), %ebp
	cmpl	%eax, %ecx
	jle	.L8
	cltq
	addl	16(%rsp,%rax,4), %ebp
.L8:
	testl	%edx, %edx
	jle	.L14
	xorl	%ebx, %ebx
	leaq	432(%rsp), %r14
	leaq	848(%rsp), %r12
	leaq	.LC2(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%r14,%rbx,4), %eax
	movl	%ebp, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	subl	$1, %eax
	cltq
	subl	16(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	addl	(%r12,%rbx,4), %edx
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L13
.L14:
	movq	1256(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$1264, %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
.L30:
	.cfi_restore_state
	movl	8(%rsp), %ecx
	testl	%ecx, %ecx
	jg	.L15
	jmp	.L14
.L17:
	xorl	%ebp, %ebp
	jmp	.L8
.L18:
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	jmp	.L9
.L31:
	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:
```