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

```c
#define MAX(x,y) x>y?x:y
typedef long long int ll;

ll N,C,x[100002],v[100002];

ll Solve(){
	ll lg=0,tem=0;
        ll max[100001];
        max[0]=0;
	for(ll i=0;i<N;i++)
	{
		lg+=v[i+1]+x[i]-x[i+1];
		max[i+1]=MAX(max[i],lg);
	}
	ll ans=max[N];
	for(ll i=N;i>1;i--)
	{
		tem+=v[i]+x[i]-x[i+1];
		ans=MAX(tem+x[i]-C+max[i-1],ans);
	}
	return ans;
}

void swap(ll* v1,ll* v2){
        ll sw = *v1;
        *v1=*v2;
        *v2=sw;
}
       
int main(){
	scanf("%lld %lld",&N,&C);
	for(ll i=0;i<N;i++) scanf("%lld %lld",&x[i+1],&v[i+1]);
	x[N+1]=C;
        x[0]=0;
	ll Ans1=Solve();
        for(ll i=1;i<=N/2;i++) {
            x[i]=C-x[i];
            x[N+1-i]=C-x[N+1-i];
            swap(&x[i],&x[N+1-i]);
            swap(&v[i],&v[N+1-i]);
        }
	ll Ans2=Solve();
	printf("%lld",MAX(Ans1,Ans2));
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 8
	.type	N, @object
	.size	N, 8
N:
	.zero	8
	.globl	C
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.zero	8
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 800016
x:
	.zero	800016
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 800016
v:
	.zero	800016
	.text
	.globl	Solve
	.type	Solve, @function
Solve:
.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	$1344, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -800056(%rbp)
	movq	$0, -800048(%rbp)
	movq	$0, -800016(%rbp)
	movq	$0, -800040(%rbp)
	jmp	.L2
.L3:
	movq	-800040(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-800040(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movq	-800040(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -800056(%rbp)
	movq	-800040(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rdx
	movq	-800040(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-800056(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -800016(%rbp,%rcx,8)
	addq	$1, -800040(%rbp)
.L2:
	movq	N(%rip), %rax
	cmpq	%rax, -800040(%rbp)
	jl	.L3
	movq	N(%rip), %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	%rax, -800032(%rbp)
	movq	N(%rip), %rax
	movq	%rax, -800024(%rbp)
	jmp	.L4
.L5:
	movq	-800024(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-800024(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movq	-800024(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -800048(%rbp)
	movq	-800024(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-800048(%rbp), %rax
	addq	%rdx, %rax
	movq	C(%rip), %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-800024(%rbp), %rax
	subq	$1, %rax
	movq	-800016(%rbp,%rax,8), %rax
	leaq	(%rcx,%rax), %rdx
	movq	-800032(%rbp), %rax
	cmpq	%rdx, %rax
	cmovl	%rdx, %rax
	movq	%rax, -800032(%rbp)
	subq	$1, -800024(%rbp)
.L4:
	cmpq	$1, -800024(%rbp)
	jg	.L5
	movq	-800032(%rbp), %rax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Solve, .-Solve
	.globl	swap
	.type	swap, @function
swap:
.LFB1:
	.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), %rax
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	leaq	C(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	$0, -32(%rbp)
	jmp	.L10
.L11:
	movq	-32(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rcx
	leaq	x(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addq	$1, -32(%rbp)
.L10:
	movq	N(%rip), %rax
	cmpq	%rax, -32(%rbp)
	jl	.L11
	movq	N(%rip), %rax
	leaq	1(%rax), %rdx
	movq	C(%rip), %rax
	leaq	0(,%rdx,8), %rcx
	leaq	x(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	$0, x(%rip)
	movl	$0, %eax
	call	Solve
	movq	%rax, -16(%rbp)
	movq	$1, -24(%rbp)
	jmp	.L12
.L13:
	movq	C(%rip), %rax
	movq	-24(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	x(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	C(%rip), %rdx
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	x(%rip), %rax
	movq	(%rcx,%rax), %rsi
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	movq	%rdx, %rcx
	subq	%rsi, %rcx
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	x(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	v(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	addq	$1, -24(%rbp)
.L12:
	movq	N(%rip), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -24(%rbp)
	jle	.L13
	movl	$0, %eax
	call	Solve
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	Solve
	.type	Solve, @function
Solve:
.LFB0:
	.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	$1304, %rsp
	.cfi_def_cfa_offset 800080
	movq	N(%rip), %r11
	movq	%fs:40, %rax
	movq	%rax, 800008(%rsp)
	xorl	%eax, %eax
	movq	$0, (%rsp)
	testq	%r11, %r11
	jle	.L2
	movq	x(%rip), %r10
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movq	%rsp, %r8
	leaq	v(%rip), %r9
	leaq	x(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	movq	(%r9,%rax,8), %rsi
	addq	%r10, %rsi
	movq	(%rdi,%rax,8), %r10
	subq	%r10, %rsi
	addq	%rsi, %rdx
	cmpq	%rdx, %rcx
	cmovl	%rdx, %rcx
	movq	%rcx, (%r8,%rax,8)
	cmpq	%r11, %rax
	jne	.L3
	movq	(%rsp,%r11,8), %r10
	cmpq	$1, %r11
	jle	.L1
	movq	C(%rip), %rbx
	leaq	8(%rdi,%r11,8), %rdx
	cmpq	$3, %r11
	jle	.L9
	movq	(%rdx), %rbp
	leaq	-2(%r11), %rcx
	leaq	-4(%r11), %rdx
	xorl	%esi, %esi
	andq	$-2, %rdx
	movq	%rcx, %rax
	leaq	-8+x(%rip), %r13
	subq	%rdx, %rax
	leaq	-8+v(%rip), %r12
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	subq	$2, %rcx
.L6:
	movq	(%rdi,%r11,8), %rdx
	movq	(%r9,%r11,8), %r15
	movq	%r11, %r14
	addq	%rdx, %r15
	subq	%rbp, %r15
	movq	0(%r13,%r11,8), %rbp
	addq	%rsi, %r15
	movq	(%r12,%r11,8), %rsi
	movq	%rcx, %r11
	addq	%rbp, %rsi
	subq	%rdx, %rsi
	addq	%r15, %rdx
	addq	%r15, %rsi
	subq	%rbx, %rdx
	addq	-8(%r8,%r14,8), %rdx
	leaq	(%rsi,%rbp), %r14
	subq	%rbx, %r14
	addq	(%r8,%rcx,8), %r14
	cmpq	%r14, %rdx
	cmovl	%r14, %rdx
	cmpq	%rdx, %r10
	cmovl	%rdx, %r10
	cmpq	%rax, %rcx
	jne	.L15
.L5:
	leaq	8+x(%rip), %r11
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdi,%rax,8), %rdx
	movq	(%r9,%rax,8), %rcx
	addq	%rdx, %rcx
	subq	(%r11,%rax,8), %rcx
	subq	$1, %rax
	addq	%rcx, %rsi
	addq	%rsi, %rdx
	subq	%rbx, %rdx
	addq	(%r8,%rax,8), %rdx
	cmpq	%rdx, %r10
	cmovl	%rdx, %r10
	cmpq	$1, %rax
	jne	.L7
.L1:
	movq	800008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$800024, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r10, %rax
	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
.L2:
	.cfi_restore_state
	movq	(%rsp,%r11,8), %r10
	jmp	.L1
.L9:
	xorl	%esi, %esi
	jmp	.L5
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	Solve, .-Solve
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB1:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	movq	(%rsi), %rdx
	movq	%rdx, (%rdi)
	movq	%rax, (%rsi)
	ret
	.cfi_endproc
.LFE1:
	.size	swap, .-swap
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	leaq	C(%rip), %rdx
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	N(%rip), %rsi
	movq	%r15, %rdi
	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	scanf@PLT
	movq	N(%rip), %rax
	testq	%rax, %rax
	jle	.L19
	leaq	8+x(%rip), %r14
	xorl	%ebp, %ebp
	leaq	v(%rip), %r12
	movq	%r14, %r13
	.p2align 4,,10
	.p2align 3
.L20:
	addq	$1, %rbp
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	leaq	(%r12,%rbp,8), %rdx
	addq	$8, %r13
	call	scanf@PLT
	movq	N(%rip), %rbx
	cmpq	%rbx, %rbp
	jl	.L20
	movq	C(%rip), %r13
	leaq	x(%rip), %rbp
	xorl	%eax, %eax
	movq	%r13, 8(%rbp,%rbx,8)
	movq	$0, x(%rip)
	call	Solve
	movq	%rbx, %rdi
	shrq	$63, %rdi
	movq	%rax, %r15
	addq	%rbx, %rdi
	sarq	%rdi
	cmpq	$1, %rbx
	jle	.L25
	movq	%rdi, %rax
	leaq	0(,%rbx,8), %rsi
	leaq	8(,%rdi,8), %rcx
	negq	%rax
	leaq	0(%rbp,%rcx), %r9
	leaq	8(%rsi,%rax,8), %rdx
	leaq	8(%rsi), %rax
	leaq	0(%rbp,%rdx), %r8
	cmpq	%r8, %r9
	leaq	0(%rbp,%rax), %r9
	setbe	%r8b
	cmpq	%r14, %r9
	setbe	%r9b
	addq	%r12, %rcx
	addq	%r12, %rdx
	orl	%r9d, %r8d
	cmpq	%rdx, %rcx
	leaq	8+v(%rip), %rcx
	setbe	%dl
	addq	%r12, %rax
	cmpq	%rcx, %rax
	setbe	%al
	orl	%edx, %eax
	testb	%al, %r8b
	je	.L22
	cmpq	$3, %rbx
	jle	.L22
	subq	$8, %rsi
	movq	%r13, %xmm2
	leaq	8(%rbp), %rdx
	movq	%rdi, %r9
	leaq	0(%rbp,%rsi), %rax
	shrq	%r9
	punpcklqdq	%xmm2, %xmm2
	addq	%r12, %rsi
	salq	$4, %r9
	movq	%rax, %r8
	subq	%r9, %r8
	.p2align 4,,10
	.p2align 3
.L23:
	movdqu	(%rdx), %xmm3
	movdqa	%xmm2, %xmm0
	movdqa	%xmm2, %xmm1
	subq	$16, %rax
	addq	$16, %rdx
	addq	$16, %rcx
	subq	$16, %rsi
	psubq	%xmm3, %xmm0
	movups	%xmm0, -16(%rdx)
	movdqu	16(%rax), %xmm0
	shufpd	$1, %xmm0, %xmm0
	psubq	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	shufpd	$1, %xmm1, %xmm0
	movups	%xmm0, 16(%rax)
	movdqu	-16(%rdx), %xmm0
	movups	%xmm1, -16(%rdx)
	shufpd	$1, %xmm0, %xmm0
	movups	%xmm0, 16(%rax)
	movdqu	-16(%rcx), %xmm0
	movdqu	16(%rsi), %xmm1
	shufpd	$1, %xmm0, %xmm0
	shufpd	$1, %xmm1, %xmm1
	movups	%xmm1, -16(%rcx)
	movups	%xmm0, 16(%rsi)
	cmpq	%rax, %r8
	jne	.L23
	movq	%rdi, %rcx
	movq	%rdi, %rdx
	andq	$-2, %rcx
	orq	$1, %rdx
	andl	$1, %edi
	je	.L25
	movq	%r13, %rax
	subq	0(%rbp,%rdx,8), %rax
	movq	%rax, 0(%rbp,%rdx,8)
	movq	%rbx, %rax
	subq	%rcx, %rax
	subq	0(%rbp,%rax,8), %r13
	movq	%r13, 0(%rbp,%rax,8)
	movq	0(%rbp,%rdx,8), %rcx
	movq	%r13, 0(%rbp,%rdx,8)
	movq	%rcx, 0(%rbp,%rax,8)
	movq	(%r12,%rdx,8), %rcx
	movq	(%r12,%rax,8), %rsi
	movq	%rsi, (%r12,%rdx,8)
	movq	%rcx, (%r12,%rax,8)
.L25:
	xorl	%eax, %eax
	call	Solve
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	cmpq	%r15, %rax
	cmovge	%rax, %rsi
	xorl	%eax, %eax
	call	printf@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
.L22:
	.cfi_restore_state
	addq	%rsi, %rbp
	leaq	8+x(%rip), %rax
	addq	%r12, %rsi
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L27:
	movq	%r13, %rcx
	subq	(%rax), %rcx
	subq	$8, %rbp
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	movq	%r13, %rcx
	subq	8(%rbp), %rcx
	subq	$8, %rsi
	movq	%rcx, 8(%rbp)
	movq	-8(%rax), %r8
	movq	%rcx, -8(%rax)
	movq	(%r12,%rdx,8), %rcx
	movq	%r8, 8(%rbp)
	movq	8(%rsi), %r8
	movq	%r8, (%r12,%rdx,8)
	addq	$1, %rdx
	movq	%rcx, 8(%rsi)
	cmpq	%rdx, %rdi
	jge	.L27
	jmp	.L25
.L19:
	movq	C(%rip), %rcx
	leaq	x(%rip), %rdx
	movq	%rcx, 8(%rdx,%rax,8)
	xorl	%eax, %eax
	movq	$0, x(%rip)
	call	Solve
	movq	%rax, %r15
	jmp	.L25
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.globl	v
	.bss
	.align 32
	.type	v, @object
	.size	v, 800016
v:
	.zero	800016
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 800016
x:
	.zero	800016
	.globl	C
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.zero	8
	.globl	N
	.align 8
	.type	N, @object
	.size	N, 8
N:
	.zero	8
	.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	Solve
	.type	Solve, @function
Solve:
.LFB0:
	.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	$1304, %rsp
	.cfi_def_cfa_offset 800080
	movq	N(%rip), %r11
	movq	%fs:40, %rax
	movq	%rax, 800008(%rsp)
	xorl	%eax, %eax
	movq	$0, (%rsp)
	testq	%r11, %r11
	jle	.L2
	movq	x(%rip), %r10
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movq	%rsp, %r8
	leaq	v(%rip), %r9
	leaq	x(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	movq	(%r9,%rax,8), %rsi
	addq	%r10, %rsi
	movq	(%rdi,%rax,8), %r10
	subq	%r10, %rsi
	addq	%rsi, %rdx
	cmpq	%rdx, %rcx
	cmovl	%rdx, %rcx
	movq	%rcx, (%r8,%rax,8)
	cmpq	%r11, %rax
	jne	.L3
	movq	(%rsp,%r11,8), %r10
	cmpq	$1, %r11
	jle	.L1
	movq	C(%rip), %rbx
	leaq	8(%rdi,%r11,8), %rdx
	cmpq	$3, %r11
	jle	.L9
	movq	(%rdx), %rbp
	leaq	-2(%r11), %rcx
	leaq	-4(%r11), %rdx
	xorl	%esi, %esi
	andq	$-2, %rdx
	movq	%rcx, %rax
	leaq	-8+x(%rip), %r13
	subq	%rdx, %rax
	leaq	-8+v(%rip), %r12
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	subq	$2, %rcx
.L6:
	movq	(%rdi,%r11,8), %rdx
	movq	(%r9,%r11,8), %r15
	movq	%r11, %r14
	addq	%rdx, %r15
	subq	%rbp, %r15
	movq	0(%r13,%r11,8), %rbp
	addq	%rsi, %r15
	movq	(%r12,%r11,8), %rsi
	movq	%rcx, %r11
	addq	%rbp, %rsi
	subq	%rdx, %rsi
	addq	%r15, %rdx
	addq	%r15, %rsi
	subq	%rbx, %rdx
	addq	-8(%r8,%r14,8), %rdx
	leaq	(%rsi,%rbp), %r14
	subq	%rbx, %r14
	addq	(%r8,%rcx,8), %r14
	cmpq	%r14, %rdx
	cmovl	%r14, %rdx
	cmpq	%rdx, %r10
	cmovl	%rdx, %r10
	cmpq	%rax, %rcx
	jne	.L15
.L5:
	leaq	8+x(%rip), %r11
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdi,%rax,8), %rdx
	movq	(%r9,%rax,8), %rcx
	addq	%rdx, %rcx
	subq	(%r11,%rax,8), %rcx
	subq	$1, %rax
	addq	%rcx, %rsi
	addq	%rsi, %rdx
	subq	%rbx, %rdx
	addq	(%r8,%rax,8), %rdx
	cmpq	%rdx, %r10
	cmovl	%rdx, %r10
	cmpq	$1, %rax
	jne	.L7
.L1:
	movq	800008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$800024, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r10, %rax
	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
.L2:
	.cfi_restore_state
	movq	(%rsp,%r11,8), %r10
	jmp	.L1
.L9:
	xorl	%esi, %esi
	jmp	.L5
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	Solve, .-Solve
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB1:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	movq	(%rsi), %rdx
	movq	%rdx, (%rdi)
	movq	%rax, (%rsi)
	ret
	.cfi_endproc
.LFE1:
	.size	swap, .-swap
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	leaq	C(%rip), %rdx
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	N(%rip), %rsi
	movq	%r15, %rdi
	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	scanf@PLT
	movq	N(%rip), %rax
	testq	%rax, %rax
	jle	.L19
	leaq	8+x(%rip), %r14
	xorl	%ebp, %ebp
	leaq	v(%rip), %r12
	movq	%r14, %r13
	.p2align 4,,10
	.p2align 3
.L20:
	addq	$1, %rbp
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	leaq	(%r12,%rbp,8), %rdx
	addq	$8, %r13
	call	scanf@PLT
	movq	N(%rip), %rbx
	cmpq	%rbx, %rbp
	jl	.L20
	movq	C(%rip), %r13
	leaq	x(%rip), %rbp
	xorl	%eax, %eax
	movq	%r13, 8(%rbp,%rbx,8)
	movq	$0, x(%rip)
	call	Solve
	movq	%rbx, %rdi
	shrq	$63, %rdi
	movq	%rax, %r15
	addq	%rbx, %rdi
	sarq	%rdi
	cmpq	$1, %rbx
	jle	.L25
	movq	%rdi, %rax
	leaq	0(,%rbx,8), %rsi
	leaq	8(,%rdi,8), %rcx
	negq	%rax
	leaq	0(%rbp,%rcx), %r9
	leaq	8(%rsi,%rax,8), %rdx
	leaq	8(%rsi), %rax
	leaq	0(%rbp,%rdx), %r8
	cmpq	%r8, %r9
	leaq	0(%rbp,%rax), %r9
	setbe	%r8b
	cmpq	%r14, %r9
	setbe	%r9b
	addq	%r12, %rcx
	addq	%r12, %rdx
	orl	%r9d, %r8d
	cmpq	%rdx, %rcx
	leaq	8+v(%rip), %rcx
	setbe	%dl
	addq	%r12, %rax
	cmpq	%rcx, %rax
	setbe	%al
	orl	%edx, %eax
	testb	%al, %r8b
	je	.L22
	cmpq	$3, %rbx
	jle	.L22
	subq	$8, %rsi
	movq	%r13, %xmm2
	leaq	8(%rbp), %rdx
	movq	%rdi, %r9
	leaq	0(%rbp,%rsi), %rax
	shrq	%r9
	punpcklqdq	%xmm2, %xmm2
	addq	%r12, %rsi
	salq	$4, %r9
	movq	%rax, %r8
	subq	%r9, %r8
	.p2align 4,,10
	.p2align 3
.L23:
	movdqu	(%rdx), %xmm3
	movdqa	%xmm2, %xmm0
	movdqa	%xmm2, %xmm1
	subq	$16, %rax
	addq	$16, %rdx
	addq	$16, %rcx
	subq	$16, %rsi
	psubq	%xmm3, %xmm0
	movups	%xmm0, -16(%rdx)
	movdqu	16(%rax), %xmm0
	shufpd	$1, %xmm0, %xmm0
	psubq	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	shufpd	$1, %xmm1, %xmm0
	movups	%xmm0, 16(%rax)
	movdqu	-16(%rdx), %xmm0
	movups	%xmm1, -16(%rdx)
	shufpd	$1, %xmm0, %xmm0
	movups	%xmm0, 16(%rax)
	movdqu	-16(%rcx), %xmm0
	movdqu	16(%rsi), %xmm1
	shufpd	$1, %xmm0, %xmm0
	shufpd	$1, %xmm1, %xmm1
	movups	%xmm1, -16(%rcx)
	movups	%xmm0, 16(%rsi)
	cmpq	%rax, %r8
	jne	.L23
	movq	%rdi, %rcx
	movq	%rdi, %rdx
	andq	$-2, %rcx
	orq	$1, %rdx
	andl	$1, %edi
	je	.L25
	movq	%r13, %rax
	subq	0(%rbp,%rdx,8), %rax
	movq	%rax, 0(%rbp,%rdx,8)
	movq	%rbx, %rax
	subq	%rcx, %rax
	subq	0(%rbp,%rax,8), %r13
	movq	%r13, 0(%rbp,%rax,8)
	movq	0(%rbp,%rdx,8), %rcx
	movq	%r13, 0(%rbp,%rdx,8)
	movq	%rcx, 0(%rbp,%rax,8)
	movq	(%r12,%rdx,8), %rcx
	movq	(%r12,%rax,8), %rsi
	movq	%rsi, (%r12,%rdx,8)
	movq	%rcx, (%r12,%rax,8)
.L25:
	xorl	%eax, %eax
	call	Solve
	movq	%r15, %rsi
	leaq	.LC1(%rip), %rdi
	cmpq	%r15, %rax
	cmovge	%rax, %rsi
	xorl	%eax, %eax
	call	printf@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
.L22:
	.cfi_restore_state
	addq	%rsi, %rbp
	leaq	8+x(%rip), %rax
	addq	%r12, %rsi
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L27:
	movq	%r13, %rcx
	subq	(%rax), %rcx
	subq	$8, %rbp
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	movq	%r13, %rcx
	subq	8(%rbp), %rcx
	subq	$8, %rsi
	movq	%rcx, 8(%rbp)
	movq	-8(%rax), %r8
	movq	%rcx, -8(%rax)
	movq	(%r12,%rdx,8), %rcx
	movq	%r8, 8(%rbp)
	movq	8(%rsi), %r8
	movq	%r8, (%r12,%rdx,8)
	addq	$1, %rdx
	movq	%rcx, 8(%rsi)
	cmpq	%rdx, %rdi
	jge	.L27
	jmp	.L25
.L19:
	movq	C(%rip), %rcx
	leaq	x(%rip), %rdx
	movq	%rcx, 8(%rdx,%rax,8)
	xorl	%eax, %eax
	movq	$0, x(%rip)
	call	Solve
	movq	%rax, %r15
	jmp	.L25
	.cfi_endproc
.LFE2:
	.size	main, .-main
	.globl	v
	.bss
	.align 32
	.type	v, @object
	.size	v, 800016
v:
	.zero	800016
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 800016
x:
	.zero	800016
	.globl	C
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.zero	8
	.globl	N
	.align 8
	.type	N, @object
	.size	N, 8
N:
	.zero	8
	.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:

#define MAX(x,y) x>y?x:y
typedef long long int ll;

ll N,C,x[100002],v[100002];

ll Solve(){
	ll lg=0,tem=0;
        ll max[100001];
        max[0]=0;
	for(ll i=0;i<N;i++)
	{
		lg+=v[i+1]+x[i]-x[i+1];
		max[i+1]=MAX(max[i],lg);
	}
	ll ans=max[N];
	for(ll i=N;i>1;i--)
	{
		tem+=v[i]+x[i]-x[i+1];
		ans=MAX(tem+x[i]-C+max[i-1],ans);
	}
	return ans;
}

void swap(ll* v1,ll* v2){
        ll sw = *v1;
        *v1=*v2;
        *v2=sw;
}
       
int main(){
	scanf("%lld %lld",&N,&C);
	for(ll i=0;i<N;i++) scanf("%lld %lld",&x[i+1],&v[i+1]);
	x[N+1]=C;
        x[0]=0;
	ll Ans1=Solve();
        for(ll i=1;i<=N/2;i++) {
            x[i]=C-x[i];
            x[N+1-i]=C-x[N+1-i];
            swap(&x[i],&x[N+1-i]);
            swap(&v[i],&v[N+1-i]);
        }
	ll Ans2=Solve();
	printf("%lld",MAX(Ans1,Ans2));
	return 0;
}

3 20
2 80
9 120
16 1

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

```c
#define MAX(x,y) x>y?x:y
typedef long long int ll;

ll N,C,x[100002],v[100002];

ll Solve(){
	ll lg=0,tem=0;
        ll max[100001];
        max[0]=0;
	for(ll i=0;i<N;i++)
	{
		lg+=v[i+1]+x[i]-x[i+1];
		max[i+1]=MAX(max[i],lg);
	}
	ll ans=max[N];
	for(ll i=N;i>1;i--)
	{
		tem+=v[i]+x[i]-x[i+1];
		ans=MAX(tem+x[i]-C+max[i-1],ans);
	}
	return ans;
}

void swap(ll* v1,ll* v2){
        ll sw = *v1;
        *v1=*v2;
        *v2=sw;
}
       
int main(){
	scanf("%lld %lld",&N,&C);
	for(ll i=0;i<N;i++) scanf("%lld %lld",&x[i+1],&v[i+1]);
	x[N+1]=C;
        x[0]=0;
	ll Ans1=Solve();
        for(ll i=1;i<=N/2;i++) {
            x[i]=C-x[i];
            x[N+1-i]=C-x[N+1-i];
            swap(&x[i],&x[N+1-i]);
            swap(&v[i],&v[N+1-i]);
        }
	ll Ans2=Solve();
	printf("%lld",MAX(Ans1,Ans2));
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 8
	.type	N, @object
	.size	N, 8
N:
	.zero	8
	.globl	C
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.zero	8
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 800016
x:
	.zero	800016
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 800016
v:
	.zero	800016
	.text
	.globl	Solve
	.type	Solve, @function
Solve:
.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	$1344, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -800056(%rbp)
	movq	$0, -800048(%rbp)
	movq	$0, -800016(%rbp)
	movq	$0, -800040(%rbp)
	jmp	.L2
.L3:
	movq	-800040(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-800040(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movq	-800040(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -800056(%rbp)
	movq	-800040(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rdx
	movq	-800040(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-800056(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -800016(%rbp,%rcx,8)
	addq	$1, -800040(%rbp)
.L2:
	movq	N(%rip), %rax
	cmpq	%rax, -800040(%rbp)
	jl	.L3
	movq	N(%rip), %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	%rax, -800032(%rbp)
	movq	N(%rip), %rax
	movq	%rax, -800024(%rbp)
	jmp	.L4
.L5:
	movq	-800024(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-800024(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movq	-800024(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -800048(%rbp)
	movq	-800024(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-800048(%rbp), %rax
	addq	%rdx, %rax
	movq	C(%rip), %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-800024(%rbp), %rax
	subq	$1, %rax
	movq	-800016(%rbp,%rax,8), %rax
	leaq	(%rcx,%rax), %rdx
	movq	-800032(%rbp), %rax
	cmpq	%rdx, %rax
	cmovl	%rdx, %rax
	movq	%rax, -800032(%rbp)
	subq	$1, -800024(%rbp)
.L4:
	cmpq	$1, -800024(%rbp)
	jg	.L5
	movq	-800032(%rbp), %rax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Solve, .-Solve
	.globl	swap
	.type	swap, @function
swap:
.LFB1:
	.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), %rax
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	leaq	C(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	$0, -32(%rbp)
	jmp	.L10
.L11:
	movq	-32(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rcx
	leaq	x(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addq	$1, -32(%rbp)
.L10:
	movq	N(%rip), %rax
	cmpq	%rax, -32(%rbp)
	jl	.L11
	movq	N(%rip), %rax
	leaq	1(%rax), %rdx
	movq	C(%rip), %rax
	leaq	0(,%rdx,8), %rcx
	leaq	x(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	$0, x(%rip)
	movl	$0, %eax
	call	Solve
	movq	%rax, -16(%rbp)
	movq	$1, -24(%rbp)
	jmp	.L12
.L13:
	movq	C(%rip), %rax
	movq	-24(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	x(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	C(%rip), %rdx
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	x(%rip), %rax
	movq	(%rcx,%rax), %rsi
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	movq	%rdx, %rcx
	subq	%rsi, %rcx
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	x(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	v(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	addq	$1, -24(%rbp)
.L12:
	movq	N(%rip), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -24(%rbp)
	jle	.L13
	movl	$0, %eax
	call	Solve
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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.
val
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 8
	.type	N, @object
	.size	N, 8
N:
	.zero	8
	.globl	C
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.zero	8
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 800016
x:
	.zero	800016
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 800016
v:
	.zero	800016
	.text
	.globl	Solve
	.type	Solve, @function
Solve:
.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	$1344, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -800056(%rbp)
	movq	$0, -800048(%rbp)
	movq	$0, -800016(%rbp)
	movq	$0, -800040(%rbp)
	jmp	.L2
.L3:
	movq	-800040(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-800040(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movq	-800040(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -800056(%rbp)
	movq	-800040(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rdx
	movq	-800040(%rbp), %rax
	leaq	1(%rax), %rcx
	movq	-800056(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -800016(%rbp,%rcx,8)
	addq	$1, -800040(%rbp)
.L2:
	movq	N(%rip), %rax
	cmpq	%rax, -800040(%rbp)
	jl	.L3
	movq	N(%rip), %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	%rax, -800032(%rbp)
	movq	N(%rip), %rax
	movq	%rax, -800024(%rbp)
	jmp	.L4
.L5:
	movq	-800024(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movq	-800024(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movq	-800024(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	addq	%rax, -800048(%rbp)
	movq	-800024(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-800048(%rbp), %rax
	addq	%rdx, %rax
	movq	C(%rip), %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-800024(%rbp), %rax
	subq	$1, %rax
	movq	-800016(%rbp,%rax,8), %rax
	leaq	(%rcx,%rax), %rdx
	movq	-800032(%rbp), %rax
	cmpq	%rdx, %rax
	cmovl	%rdx, %rax
	movq	%rax, -800032(%rbp)
	subq	$1, -800024(%rbp)
.L4:
	cmpq	$1, -800024(%rbp)
	jg	.L5
	movq	-800032(%rbp), %rax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	Solve, .-Solve
	.globl	swap
	.type	swap, @function
swap:
.LFB1:
	.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), %rax
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, (%rax)
	movq	-32(%rbp), %rax
	movq	-8(%rbp), %rdx
	movq	%rdx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	leaq	C(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movq	$0, -32(%rbp)
	jmp	.L10
.L11:
	movq	-32(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	addq	$1, %rax
	leaq	0(,%rax,8), %rcx
	leaq	x(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addq	$1, -32(%rbp)
.L10:
	movq	N(%rip), %rax
	cmpq	%rax, -32(%rbp)
	jl	.L11
	movq	N(%rip), %rax
	leaq	1(%rax), %rdx
	movq	C(%rip), %rax
	leaq	0(,%rdx,8), %rcx
	leaq	x(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	$0, x(%rip)
	movl	$0, %eax
	call	Solve
	movq	%rax, -16(%rbp)
	movq	$1, -24(%rbp)
	jmp	.L12
.L13:
	movq	C(%rip), %rax
	movq	-24(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	x(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	C(%rip), %rdx
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	x(%rip), %rax
	movq	(%rcx,%rax), %rsi
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	movq	%rdx, %rcx
	subq	%rsi, %rcx
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	x(%rip), %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	x(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	movq	N(%rip), %rax
	addq	$1, %rax
	subq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	v(%rip), %rax
	addq	%rax, %rdx
	movq	-24(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	v(%rip), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	addq	$1, -24(%rbp)
.L12:
	movq	N(%rip), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -24(%rbp)
	jle	.L13
	movl	$0, %eax
	call	Solve
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
