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>

#define NUMBER 10000

int main(void)
{
  while(1){
  int matrix[2][NUMBER]={0};
  int i;
  int number;
  int a=0,b=0;

  scanf("%d",&number);
  if( number==0 )break;
  for( i=0; i<number; i++ ){
    scanf("%d",&matrix[0][i]); scanf("%d",&matrix[1][i]);
  }

  for( i=0; i<number; i++ ){
    if( matrix[0][i]>matrix[1][i] )
      a+=matrix[0][i]+matrix[1][i];
    else if( matrix[0][i]<matrix[1][i] )
      b+=matrix[0][i]+matrix[1][i];
    else {
      a+=matrix[0][i];
      b+=matrix[1][i];
    }
  }
  printf("%d %d\n",a,b);
  }
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2216, %rsp
	.cfi_def_cfa_offset 80096
	leaq	.LC0(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 80024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	leaq	12(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$80000, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	%r12, %rbx
	movq	%r12, %r15
	movl	$0, %r14d
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	leaq	40000(%r15), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r15
	cmpl	%r14d, %eax
	jg	.L5
	testl	%eax, %eax
	jle	.L6
	subl	$1, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	leaq	4(%r12,%rax,4), %rsi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	addl	%edx, %eax
	addl	%eax, %r8d
.L8:
	addq	$4, %rbx
	cmpq	%rsi, %rbx
	je	.L4
.L10:
	movl	(%rbx), %eax
	movl	40000(%rbx), %edx
	cmpl	%edx, %eax
	jg	.L18
	jge	.L9
	addl	%edx, %eax
	addq	$4, %rbx
	addl	%eax, %ecx
	cmpq	%rsi, %rbx
	jne	.L10
.L4:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	addl	%eax, %r8d
	addl	%edx, %ecx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L2:
	movq	80024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$80040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L4
.L19:
	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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2216, %rsp
	.cfi_def_cfa_offset 80096
	leaq	.LC0(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 80024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	leaq	12(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$80000, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	%r12, %rbx
	movq	%r12, %r15
	movl	$0, %r14d
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	leaq	40000(%r15), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r15
	cmpl	%r14d, %eax
	jg	.L5
	testl	%eax, %eax
	jle	.L6
	subl	$1, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	leaq	4(%r12,%rax,4), %rsi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	addl	%edx, %eax
	addl	%eax, %r8d
.L8:
	addq	$4, %rbx
	cmpq	%rsi, %rbx
	je	.L4
.L10:
	movl	(%rbx), %eax
	movl	40000(%rbx), %edx
	cmpl	%edx, %eax
	jg	.L18
	jge	.L9
	addl	%edx, %eax
	addq	$4, %rbx
	addl	%eax, %ecx
	cmpq	%rsi, %rbx
	jne	.L10
.L4:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	addl	%eax, %r8d
	addl	%edx, %ecx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L2:
	movq	80024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$80040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L4
.L19:
	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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2216, %rsp
	.cfi_def_cfa_offset 80096
	leaq	.LC0(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 80024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	leaq	12(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$80000, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	%r12, %rbx
	movq	%r12, %r15
	movl	$0, %r14d
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	leaq	40000(%r15), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r15
	cmpl	%r14d, %eax
	jg	.L5
	testl	%eax, %eax
	jle	.L6
	subl	$1, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	leaq	4(%r12,%rax,4), %rsi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	addl	%edx, %eax
	addl	%eax, %r8d
.L8:
	addq	$4, %rbx
	cmpq	%rsi, %rbx
	je	.L4
.L10:
	movl	(%rbx), %eax
	movl	40000(%rbx), %edx
	cmpl	%edx, %eax
	jg	.L18
	jge	.L9
	addl	%edx, %eax
	addq	$4, %rbx
	addl	%eax, %ecx
	cmpq	%rsi, %rbx
	jne	.L10
.L4:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	addl	%eax, %r8d
	addl	%edx, %ecx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L2:
	movq	80024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$80040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L4
.L19:
	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>

#define NUMBER 10000

int main(void)
{
  while(1){
  int matrix[2][NUMBER]={0};
  int i;
  int number;
  int a=0,b=0;

  scanf("%d",&number);
  if( number==0 )break;
  for( i=0; i<number; i++ ){
    scanf("%d",&matrix[0][i]); scanf("%d",&matrix[1][i]);
  }

  for( i=0; i<number; i++ ){
    if( matrix[0][i]>matrix[1][i] )
      a+=matrix[0][i]+matrix[1][i];
    else if( matrix[0][i]<matrix[1][i] )
      b+=matrix[0][i]+matrix[1][i];
    else {
      a+=matrix[0][i];
      b+=matrix[1][i];
    }
  }
  printf("%d %d\n",a,b);
  }
  return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

#define NUMBER 10000

int main(void)
{
  while(1){
  int matrix[2][NUMBER]={0};
  int i;
  int number;
  int a=0,b=0;

  scanf("%d",&number);
  if( number==0 )break;
  for( i=0; i<number; i++ ){
    scanf("%d",&matrix[0][i]); scanf("%d",&matrix[1][i]);
  }

  for( i=0; i<number; i++ ){
    if( matrix[0][i]>matrix[1][i] )
      a+=matrix[0][i]+matrix[1][i];
    else if( matrix[0][i]<matrix[1][i] )
      b+=matrix[0][i]+matrix[1][i];
    else {
      a+=matrix[0][i];
      b+=matrix[1][i];
    }
  }
  printf("%d %d\n",a,b);
  }
  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
9 1
5 4
0 4
3
9 1
5 4
1 0
3
9 1
5 5
1 8
0
 3
9 1
5 4
0 8
3
9 1
5 4
1 0
3
9 1
5 0
1 8
0
 3
9 1
5 4
1 4
3
9 1
5 4
1 0
3
9 1
5 5
1 8
0
 3
9 1
5 4
0 8
3
9 1
5 4
1 0
3
9 1
5 0
1 1
0
 3
9 1
5 4
1 4
3
9 1
6 4
1 0
3
9 1
5 5
1 8
0
 3
9 1
5 4
0 8
3
9 1
9 4
1 0
3
9 1
5 0
1 1
0
 3
9 1
5 4
1 4
3
10 1
6 4
1 0
3
9 1
5 5
1 8
0
 3
9 1
5 4
0 8
3
9 1
18 4
1 0
3
9 1
5 0
1 1
0
 3
9 1
5 4
1 4
3
10 1
6 7
1 0
3
9 1
5 5
1 8
0
 3
9 1
5 4
0 14
3
9 1
18 4
1 0
3
9 1
5 0
1 1
0

19 4
20 0
15 14
 19 8
20 0
15 9
 19 5
20 0
15 14
 19 8
20 0
16 1
 19 5
21 0
15 14
 19 8
24 0
16 1
 19 5
22 0
15 14
 19 8
33 0
16 1
 19 5
12 13
15 14
 19 14
33 0
16 1

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>

#define NUMBER 10000

int main(void)
{
  while(1){
  int matrix[2][NUMBER]={0};
  int i;
  int number;
  int a=0,b=0;

  scanf("%d",&number);
  if( number==0 )break;
  for( i=0; i<number; i++ ){
    scanf("%d",&matrix[0][i]); scanf("%d",&matrix[1][i]);
  }

  for( i=0; i<number; i++ ){
    if( matrix[0][i]>matrix[1][i] )
      a+=matrix[0][i]+matrix[1][i];
    else if( matrix[0][i]<matrix[1][i] )
      b+=matrix[0][i]+matrix[1][i];
    else {
      a+=matrix[0][i];
      b+=matrix[1][i];
    }
  }
  printf("%d %d\n",a,b);
  }
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2216, %rsp
	.cfi_def_cfa_offset 80096
	leaq	.LC0(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 80024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	leaq	12(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$80000, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	%r12, %rbx
	movq	%r12, %r15
	movl	$0, %r14d
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	leaq	40000(%r15), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r15
	cmpl	%r14d, %eax
	jg	.L5
	testl	%eax, %eax
	jle	.L6
	subl	$1, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	leaq	4(%r12,%rax,4), %rsi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	addl	%edx, %eax
	addl	%eax, %r8d
.L8:
	addq	$4, %rbx
	cmpq	%rsi, %rbx
	je	.L4
.L10:
	movl	(%rbx), %eax
	movl	40000(%rbx), %edx
	cmpl	%edx, %eax
	jg	.L18
	jge	.L9
	addl	%edx, %eax
	addq	$4, %rbx
	addl	%eax, %ecx
	cmpq	%rsi, %rbx
	jne	.L10
.L4:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	addl	%eax, %r8d
	addl	%edx, %ecx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L2:
	movq	80024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$80040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L4
.L19:
	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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-77824(%rsp), %r11
	.cfi_def_cfa 11, 77880
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2216, %rsp
	.cfi_def_cfa_offset 80096
	leaq	.LC0(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 80024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r12
	leaq	12(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$80000, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	memset@PLT
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	%r12, %rbx
	movq	%r12, %r15
	movl	$0, %r14d
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	leaq	40000(%r15), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %r15
	cmpl	%r14d, %eax
	jg	.L5
	testl	%eax, %eax
	jle	.L6
	subl	$1, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	leaq	4(%r12,%rax,4), %rsi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	addl	%edx, %eax
	addl	%eax, %r8d
.L8:
	addq	$4, %rbx
	cmpq	%rsi, %rbx
	je	.L4
.L10:
	movl	(%rbx), %eax
	movl	40000(%rbx), %edx
	cmpl	%edx, %eax
	jg	.L18
	jge	.L9
	addl	%edx, %eax
	addq	$4, %rbx
	addl	%eax, %ecx
	cmpq	%rsi, %rbx
	jne	.L10
.L4:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	addl	%eax, %r8d
	addl	%edx, %ecx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L2:
	movq	80024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$80040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L4
.L19:
	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:
```