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

```c
#include<stdio.h>

int main(){
int i,max=0;
int n,a[100000],b[100000];

scanf("%d",&n);
for(i=0;i<n;i++){
    scanf("%d%d",&a[i],&b[i]);
    if(a[i]>=a[max])max=i;
}

printf("%d",a[max]+b[max]);
    return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1312, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -800020(%rbp)
	leaq	-800028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800024(%rbp)
	jmp	.L2
.L4:
	leaq	-400016(%rbp), %rdx
	movl	-800024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-800016(%rbp), %rcx
	movl	-800024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800024(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %edx
	movl	-800020(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L3
	movl	-800024(%rbp), %eax
	movl	%eax, -800020(%rbp)
.L3:
	addl	$1, -800024(%rbp)
.L2:
	movl	-800028(%rbp), %eax
	cmpl	%eax, -800024(%rbp)
	jl	.L4
	movl	-800020(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %edx
	movl	-800020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%edx, %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	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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"
.LC1:
	.string	"%d%d"
	.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	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800096
	leaq	.LC0(%rip), %r14
	movq	%r14, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r12
	xorl	%ebp, %ebp
	leaq	400016(%rsp), %r13
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%eax, %edx
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jle	.L5
.L4:
	leaq	0(,%rbx,4), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	0(%r13,%rsi), %rdx
	addq	%r15, %rsi
	call	__isoc99_scanf@PLT
	movl	(%r15,%rbx,4), %edx
	movl	16(%rsp,%rbp,4), %eax
	cmpl	%eax, %edx
	jl	.L11
	movslq	%ebx, %rbp
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jg	.L4
.L5:
	addl	400016(%rsp,%rbp,4), %edx
	xorl	%eax, %eax
	movq	%r14, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$800040, %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
.L2:
	.cfi_restore_state
	movl	16(%rsp), %edx
	xorl	%ebp, %ebp
	jmp	.L5
.L12:
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.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	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800096
	leaq	.LC0(%rip), %r14
	movq	%r14, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r15
	leaq	.LC1(%rip), %r12
	xorl	%ebp, %ebp
	leaq	400016(%rsp), %r13
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%eax, %edx
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jle	.L5
.L4:
	leaq	0(,%rbx,4), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	0(%r13,%rsi), %rdx
	addq	%r15, %rsi
	call	__isoc99_scanf@PLT
	movl	(%r15,%rbx,4), %edx
	movl	16(%rsp,%rbp,4), %eax
	cmpl	%eax, %edx
	jl	.L11
	movslq	%ebx, %rbp
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jg	.L4
.L5:
	addl	400016(%rsp,%rbp,4), %edx
	xorl	%eax, %eax
	movq	%r14, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L12
	addq	$800040, %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
.L2:
	.cfi_restore_state
	movl	16(%rsp), %edx
	xorl	%ebp, %ebp
	jmp	.L5
.L12:
	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:

#include<stdio.h>

int main(){
int i,max=0;
int n,a[100000],b[100000];

scanf("%d",&n);
for(i=0;i<n;i++){
    scanf("%d%d",&a[i],&b[i]);
    if(a[i]>=a[max])max=i;
}

printf("%d",a[max]+b[max]);
    return(0);
}
3
4 5
2 9
6 2
 2
1 1000100000
1000000000 1
 3
4 5
2 9
6 3
 2
1 1000100000
1000000010 1
 3
8 3
2 14
3 3
 2
0 1000110010
1000001010 1
 2
0 1000100010
1000001010 0
 2
-1 1000000011
1100001010 0
 2
-1 1000000011
1100001010 1
 2
-1 1000000011
1100001010 2

8 1000000001 9 1000000011 11 1000001011 1000001010 1100001010 1100001011 1100001012
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
int i,max=0;
int n,a[100000],b[100000];

scanf("%d",&n);
for(i=0;i<n;i++){
    scanf("%d%d",&a[i],&b[i]);
    if(a[i]>=a[max])max=i;
}

printf("%d",a[max]+b[max]);
    return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1312, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -800020(%rbp)
	leaq	-800028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800024(%rbp)
	jmp	.L2
.L4:
	leaq	-400016(%rbp), %rdx
	movl	-800024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-800016(%rbp), %rcx
	movl	-800024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800024(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %edx
	movl	-800020(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L3
	movl	-800024(%rbp), %eax
	movl	%eax, -800020(%rbp)
.L3:
	addl	$1, -800024(%rbp)
.L2:
	movl	-800028(%rbp), %eax
	cmpl	%eax, -800024(%rbp)
	jl	.L4
	movl	-800020(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %edx
	movl	-800020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%edx, %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	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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"
.LC1:
	.string	"%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1312, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -800020(%rbp)
	leaq	-800028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800024(%rbp)
	jmp	.L2
.L4:
	leaq	-400016(%rbp), %rdx
	movl	-800024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-800016(%rbp), %rcx
	movl	-800024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800024(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %edx
	movl	-800020(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L3
	movl	-800024(%rbp), %eax
	movl	%eax, -800020(%rbp)
.L3:
	addl	$1, -800024(%rbp)
.L2:
	movl	-800028(%rbp), %eax
	cmpl	%eax, -800024(%rbp)
	jl	.L4
	movl	-800020(%rbp), %eax
	cltq
	movl	-800016(%rbp,%rax,4), %edx
	movl	-800020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%edx, %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	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
