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

```c
// AOJ 0648 Art Exhibition
// 2018.3.30 bal4u

#include <stdio.h>
#include <stdlib.h>

//#define getchar_unlocked()  getchar()
int in()	/* 整数値の入力 */
{
	int n = 0, c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
	return n;
}

long long big()		/* long long 整数値の入力 */
{
	long long n = 0, c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
	return n;
}

#define INF 0x1010101010101010LL
typedef struct { long long a; int b; } T;
T tbl[500002];

int cmp(T *a, T *b) {
	long long t = a->a - b->a;
	if (!t) return a->b - b->b;
	if (t > 0) return 1;
	return -1;
}

int main()
{
	int N, i;
	long long s, t, min, max;

	N = in();
	for (i = 0; i < N; i++) tbl[i].a = big(), tbl[i].b = in();
	qsort(tbl, N, sizeof(T), cmp);

	min = INF, max = -INF, s = 0;
	for (i = 0; i < N; i++) {
		t  = s - tbl[i].a;   if (t < min) min = t;
		t += tbl[i].b - min; if (t > max) max = t;
		s += tbl[i].b;
	}
	printf("%lld\n", max);
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	big
	.type	big, @function
big:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	$0, -16(%rbp)
	call	getchar_unlocked@PLT
	cltq
	movq	%rax, -8(%rbp)
.L5:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	andl	$15, %eax
	addq	%rdx, %rax
	movq	%rax, -16(%rbp)
	call	getchar_unlocked@PLT
	cltq
	movq	%rax, -8(%rbp)
	cmpq	$47, -8(%rbp)
	jg	.L5
	movq	-16(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	big, .-big
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 8000032
tbl:
	.zero	8000032
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jne	.L8
	movq	-24(%rbp), %rax
	movl	8(%rax), %edx
	movq	-32(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L9
.L8:
	cmpq	$0, -8(%rbp)
	jle	.L10
	movl	$1, %eax
	jmp	.L9
.L10:
	movl	$-1, %eax
.L9:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, -36(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L12
.L13:
	movl	$0, %eax
	call	big
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	tbl(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -40(%rbp)
.L12:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L13
	movl	-36(%rbp), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movabsq	$1157442765409226768, %rax
	movq	%rax, -24(%rbp)
	movabsq	$-1157442765409226768, %rax
	movq	%rax, -16(%rbp)
	movq	$0, -32(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L14
.L17:
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	tbl(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jge	.L15
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
.L15:
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	subq	-24(%rbp), %rax
	addq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jle	.L16
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L16:
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -32(%rbp)
	addl	$1, -40(%rbp)
.L14:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L17
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB41:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	(%rsi), %rax
	testq	%rax, %rax
	je	.L6
	setg	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	movl	8(%rdi), %eax
	subl	8(%rsi), %eax
	ret
	.cfi_endproc
.LFE41:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB39:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L16
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L9:
	xorl	%r12d, %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L10:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L7
.L11:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L13:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L10
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L7
	movq	stdin(%rip), %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L9
	.cfi_endproc
.LFE39:
	.size	in, .-in
	.p2align 4
	.globl	big
	.type	big, @function
big:
.LFB40:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L26
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L19:
	cltq
	xorl	%r12d, %r12d
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L20:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpq	$47, %rax
	jle	.L17
.L21:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L23:
	leaq	(%r12,%r12,4), %rsi
	andl	$15, %eax
	leaq	(%rax,%rsi,2), %r12
	cmpq	%rcx, %rdx
	jb	.L20
	call	__uflow@PLT
	movl	%eax, %r8d
	cltq
	cmpl	$47, %r8d
	jle	.L17
	movq	stdin(%rip), %rdi
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r12, %rax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L19
	.cfi_endproc
.LFE40:
	.size	big, .-big
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	in
	movl	%eax, %ebp
	testl	%eax, %eax
	jle	.L28
	leaq	tbl(%rip), %r13
	leal	-1(%rax), %ebx
	salq	$4, %rbx
	leaq	16(%r13), %rax
	movq	%r13, %r12
	movq	%r13, %r14
	addq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L41:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L51
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L30:
	cltq
	xorl	%r15d, %r15d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L31:
	leaq	1(%rdx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpq	$47, %rax
	jle	.L33
.L32:
	movq	%rsi, %rdx
.L34:
	leaq	(%r15,%r15,4), %rsi
	andl	$15, %eax
	leaq	(%rax,%rsi,2), %r15
	cmpq	%rcx, %rdx
	jb	.L31
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movl	%eax, %r8d
	cltq
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
	cmpl	$47, %r8d
	jg	.L32
	.p2align 4,,10
	.p2align 3
.L33:
	movq	%r15, (%r14)
	cmpq	%rsi, %rcx
	jbe	.L52
	leaq	1(%rsi), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rsi), %eax
.L36:
	xorl	%r15d, %r15d
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L39
.L38:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L40:
	leal	(%r15,%r15,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r15d
	cmpq	%rcx, %rdx
	jb	.L37
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L39
	movq	stdin(%rip), %rdi
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L39:
	movl	%r15d, 8(%r14)
	addq	$16, %r14
	cmpq	%r14, %rbx
	jne	.L41
	movslq	%ebp, %rsi
	movl	$16, %edx
	leaq	cmp(%rip), %rcx
	movq	%r12, %rdi
	call	qsort@PLT
	xorl	%esi, %esi
	movabsq	$-1157442765409226768, %r8
	movabsq	$1157442765409226768, %rdx
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rsi, %rcx
	subq	0(%r13), %rcx
	movslq	8(%r13), %rdi
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	cmpq	%rax, %r8
	cmovl	%rax, %r8
	addq	$16, %r13
	addq	%rdi, %rsi
	cmpq	%r13, %rbx
	jne	.L43
.L44:
	movq	%r8, %rdx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %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
.L52:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L51:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L30
.L28:
	movslq	%eax, %rsi
	leaq	cmp(%rip), %rcx
	movl	$16, %edx
	leaq	tbl(%rip), %rdi
	call	qsort@PLT
	movabsq	$-1157442765409226768, %r8
	jmp	.L44
	.cfi_endproc
.LFE42:
	.size	main, .-main
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 8000032
tbl:
	.zero	8000032
	.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
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB41:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subq	(%rsi), %rax
	testq	%rax, %rax
	je	.L6
	setg	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	movl	8(%rdi), %eax
	subl	8(%rsi), %eax
	ret
	.cfi_endproc
.LFE41:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB39:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L16
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L9:
	xorl	%r12d, %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L10:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L7
.L11:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L13:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L10
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L7
	movq	stdin(%rip), %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L9
	.cfi_endproc
.LFE39:
	.size	in, .-in
	.p2align 4
	.globl	big
	.type	big, @function
big:
.LFB40:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L26
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L19:
	cltq
	xorl	%r12d, %r12d
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L20:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpq	$47, %rax
	jle	.L17
.L21:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L23:
	leaq	(%r12,%r12,4), %rsi
	andl	$15, %eax
	leaq	(%rax,%rsi,2), %r12
	cmpq	%rcx, %rdx
	jb	.L20
	call	__uflow@PLT
	movl	%eax, %r8d
	cltq
	cmpl	$47, %r8d
	jle	.L17
	movq	stdin(%rip), %rdi
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r12, %rax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L26:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L19
	.cfi_endproc
.LFE40:
	.size	big, .-big
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	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
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	in
	movl	%eax, %ebp
	testl	%eax, %eax
	jle	.L28
	leaq	tbl(%rip), %r13
	leal	-1(%rax), %ebx
	salq	$4, %rbx
	leaq	16(%r13), %rax
	movq	%r13, %r12
	movq	%r13, %r14
	addq	%rax, %rbx
	.p2align 4,,10
	.p2align 3
.L41:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L51
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L30:
	cltq
	xorl	%r15d, %r15d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L31:
	leaq	1(%rdx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpq	$47, %rax
	jle	.L33
.L32:
	movq	%rsi, %rdx
.L34:
	leaq	(%r15,%r15,4), %rsi
	andl	$15, %eax
	leaq	(%rax,%rsi,2), %r15
	cmpq	%rcx, %rdx
	jb	.L31
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movl	%eax, %r8d
	cltq
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
	cmpl	$47, %r8d
	jg	.L32
	.p2align 4,,10
	.p2align 3
.L33:
	movq	%r15, (%r14)
	cmpq	%rsi, %rcx
	jbe	.L52
	leaq	1(%rsi), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rsi), %eax
.L36:
	xorl	%r15d, %r15d
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L39
.L38:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L40:
	leal	(%r15,%r15,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r15d
	cmpq	%rcx, %rdx
	jb	.L37
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L39
	movq	stdin(%rip), %rdi
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L39:
	movl	%r15d, 8(%r14)
	addq	$16, %r14
	cmpq	%r14, %rbx
	jne	.L41
	movslq	%ebp, %rsi
	movl	$16, %edx
	leaq	cmp(%rip), %rcx
	movq	%r12, %rdi
	call	qsort@PLT
	xorl	%esi, %esi
	movabsq	$-1157442765409226768, %r8
	movabsq	$1157442765409226768, %rdx
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rsi, %rcx
	subq	0(%r13), %rcx
	movslq	8(%r13), %rdi
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	cmpq	%rax, %r8
	cmovl	%rax, %r8
	addq	$16, %r13
	addq	%rdi, %rsi
	cmpq	%r13, %rbx
	jne	.L43
.L44:
	movq	%r8, %rdx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %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
.L52:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L51:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L30
.L28:
	movslq	%eax, %rsi
	leaq	cmp(%rip), %rcx
	movl	$16, %edx
	leaq	tbl(%rip), %rdi
	call	qsort@PLT
	movabsq	$-1157442765409226768, %r8
	jmp	.L44
	.cfi_endproc
.LFE42:
	.size	main, .-main
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 8000032
tbl:
	.zero	8000032
	.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:

// AOJ 0648 Art Exhibition
// 2018.3.30 bal4u

#include <stdio.h>
#include <stdlib.h>

//#define getchar_unlocked()  getchar()
int in()	/* 整数値の入力 */
{
	int n = 0, c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
	return n;
}

long long big()		/* long long 整数値の入力 */
{
	long long n = 0, c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
	return n;
}

#define INF 0x1010101010101010LL
typedef struct { long long a; int b; } T;
T tbl[500002];

int cmp(T *a, T *b) {
	long long t = a->a - b->a;
	if (!t) return a->b - b->b;
	if (t > 0) return 1;
	return -1;
}

int main()
{
	int N, i;
	long long s, t, min, max;

	N = in();
	for (i = 0; i < N; i++) tbl[i].a = big(), tbl[i].b = in();
	qsort(tbl, N, sizeof(T), cmp);

	min = INF, max = -INF, s = 0;
	for (i = 0; i < N; i++) {
		t  = s - tbl[i].a;   if (t < min) min = t;
		t += tbl[i].b - min; if (t > max) max = t;
		s += tbl[i].b;
	}
	printf("%lld\n", max);
	return 0;
}


3
2 3
11 2
4 2
 3
2 5
11 2
4 2
 3
2 5
11 2
4 3
 3
2 9
11 0
4 3
 3
2 9
11 0
7 3
 3
2 3
2 2
4 5
 3
2 2
11 2
4 2
 3
2 5
11 2
4 4
 3
2 3
11 0
4 3
 3
0 16
54 3
5 1

3
 5
 6
 10
 9
 8
 2
 7
 4
 16

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

```c
// AOJ 0648 Art Exhibition
// 2018.3.30 bal4u

#include <stdio.h>
#include <stdlib.h>

//#define getchar_unlocked()  getchar()
int in()	/* 整数値の入力 */
{
	int n = 0, c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
	return n;
}

long long big()		/* long long 整数値の入力 */
{
	long long n = 0, c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
	return n;
}

#define INF 0x1010101010101010LL
typedef struct { long long a; int b; } T;
T tbl[500002];

int cmp(T *a, T *b) {
	long long t = a->a - b->a;
	if (!t) return a->b - b->b;
	if (t > 0) return 1;
	return -1;
}

int main()
{
	int N, i;
	long long s, t, min, max;

	N = in();
	for (i = 0; i < N; i++) tbl[i].a = big(), tbl[i].b = in();
	qsort(tbl, N, sizeof(T), cmp);

	min = INF, max = -INF, s = 0;
	for (i = 0; i < N; i++) {
		t  = s - tbl[i].a;   if (t < min) min = t;
		t += tbl[i].b - min; if (t > max) max = t;
		s += tbl[i].b;
	}
	printf("%lld\n", max);
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	big
	.type	big, @function
big:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	$0, -16(%rbp)
	call	getchar_unlocked@PLT
	cltq
	movq	%rax, -8(%rbp)
.L5:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	andl	$15, %eax
	addq	%rdx, %rax
	movq	%rax, -16(%rbp)
	call	getchar_unlocked@PLT
	cltq
	movq	%rax, -8(%rbp)
	cmpq	$47, -8(%rbp)
	jg	.L5
	movq	-16(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	big, .-big
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 8000032
tbl:
	.zero	8000032
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jne	.L8
	movq	-24(%rbp), %rax
	movl	8(%rax), %edx
	movq	-32(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L9
.L8:
	cmpq	$0, -8(%rbp)
	jle	.L10
	movl	$1, %eax
	jmp	.L9
.L10:
	movl	$-1, %eax
.L9:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, -36(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L12
.L13:
	movl	$0, %eax
	call	big
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	tbl(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -40(%rbp)
.L12:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L13
	movl	-36(%rbp), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movabsq	$1157442765409226768, %rax
	movq	%rax, -24(%rbp)
	movabsq	$-1157442765409226768, %rax
	movq	%rax, -16(%rbp)
	movq	$0, -32(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L14
.L17:
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	tbl(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jge	.L15
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
.L15:
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	subq	-24(%rbp), %rax
	addq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jle	.L16
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L16:
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -32(%rbp)
	addl	$1, -40(%rbp)
.L14:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L17
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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
	.globl	in
	.type	in, @function
in:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	big
	.type	big, @function
big:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	$0, -16(%rbp)
	call	getchar_unlocked@PLT
	cltq
	movq	%rax, -8(%rbp)
.L5:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	andl	$15, %eax
	addq	%rdx, %rax
	movq	%rax, -16(%rbp)
	call	getchar_unlocked@PLT
	cltq
	movq	%rax, -8(%rbp)
	cmpq	$47, -8(%rbp)
	jg	.L5
	movq	-16(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	big, .-big
	.globl	tbl
	.bss
	.align 32
	.type	tbl, @object
	.size	tbl, 8000032
tbl:
	.zero	8000032
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -8(%rbp)
	jne	.L8
	movq	-24(%rbp), %rax
	movl	8(%rax), %edx
	movq	-32(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L9
.L8:
	cmpq	$0, -8(%rbp)
	jle	.L10
	movl	$1, %eax
	jmp	.L9
.L10:
	movl	$-1, %eax
.L9:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, -36(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L12
.L13:
	movl	$0, %eax
	call	big
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	tbl(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+tbl(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -40(%rbp)
.L12:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L13
	movl	-36(%rbp), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	tbl(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movabsq	$1157442765409226768, %rax
	movq	%rax, -24(%rbp)
	movabsq	$-1157442765409226768, %rax
	movq	%rax, -16(%rbp)
	movq	$0, -32(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L14
.L17:
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	tbl(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-32(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-24(%rbp), %rax
	jge	.L15
	movq	-8(%rbp), %rax
	movq	%rax, -24(%rbp)
.L15:
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	subq	-24(%rbp), %rax
	addq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jle	.L16
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
.L16:
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+tbl(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -32(%rbp)
	addl	$1, -40(%rbp)
.L14:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L17
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
