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

```c
#define f(I)p[I]+h[I]*(h[I]-2*h[i])
long C,h[2<<17],p[2<<17],X;
P[2<<17];
s,t=-1,i;
c(x,y,z){
	return (h[y]-h[x])*(p[y]+h[y]*h[y]-p[z]-h[z]*h[z])>=
	(h[z]-h[y])*(p[x]+h[x]*h[x]-p[y]-h[y]*h[y]);
}
main(){
	for(scanf("%*d%ld",&C);~scanf("%ld",h+i);){
		for(;X=f(P[s]),s<t&&X>=f(P[s+1]);s++);
		X=p[i]=i?h[i]*h[i]+C+X:0;
		for(;s<t&&c(P[t-1],P[t],i);t--);
		P[++t]=i++;
	}
	printf("%ld",X);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	C
	.bss
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.zero	8
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 2097152
h:
	.zero	2097152
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 2097152
p:
	.zero	2097152
	.globl	X
	.align 8
	.type	X, @object
	.size	X, 8
X:
	.zero	8
	.globl	P
	.align 32
	.type	P, @object
	.size	P, 1048576
P:
	.zero	1048576
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	t
	.data
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.long	-1
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.text
	.globl	c
	.type	c, @function
c:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	h(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rsi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rcx, %rdi
	subq	%rax, %rdi
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rax, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	movl	-8(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	h(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdi
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	p(%rip), %rax
	movq	(%rcx,%rax), %r8
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	h(%rip), %rax
	movq	(%rsi,%rax), %rax
	imulq	%rcx, %rax
	leaq	(%r8,%rax), %rsi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	p(%rip), %rax
	movq	(%rcx,%rax), %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	h(%rip), %rax
	movq	(%rsi,%rax), %rax
	imulq	%rax, %rcx
	movq	%r8, %rax
	subq	%rcx, %rax
	imulq	%rdi, %rax
	cmpq	%rax, %rdx
	setge	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	c, .-c
	.section	.rodata
.LC0:
	.string	"%*d%ld"
.LC1:
	.string	"%ld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	C(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L4
.L8:
	movl	s(%rip), %eax
	addl	$1, %eax
	movl	%eax, s(%rip)
.L5:
	movl	s(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	s(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	s(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	P(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	h(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	i(%rip), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	h(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	addq	%rcx, %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	addq	%rdi, %rax
	movq	%rax, X(%rip)
	movl	s(%rip), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	s(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	s(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	s(%rip), %edx
	addl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	P(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	h(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	i(%rip), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	h(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	addq	%rcx, %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rdx
	movq	X(%rip), %rax
	cmpq	%rax, %rdx
	jg	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	$0, %eax
.L7:
	testl	%eax, %eax
	jne	.L8
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L9
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rax, %rdx
	movq	C(%rip), %rax
	addq	%rax, %rdx
	movq	X(%rip), %rax
	addq	%rax, %rdx
	jmp	.L10
.L9:
	movl	$0, %edx
.L10:
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	p(%rip), %rcx
	movq	%rdx, (%rsi,%rcx)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, X(%rip)
	jmp	.L11
.L13:
	movl	t(%rip), %eax
	subl	$1, %eax
	movl	%eax, t(%rip)
.L11:
	movl	s(%rip), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	jge	.L12
	movl	i(%rip), %edx
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	P(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	t(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	P(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	c
	testl	%eax, %eax
	jne	.L13
.L12:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, i(%rip)
	movl	t(%rip), %edx
	addl	$1, %edx
	movl	%edx, t(%rip)
	movl	t(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	P(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L4:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L5
	movq	X(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	c
	.type	c, @function
c:
.LFB0:
	.cfi_startproc
	endbr64
	leaq	h(%rip), %rcx
	movslq	%esi, %rsi
	movslq	%edi, %r8
	movq	(%rcx,%rsi,8), %rdi
	leaq	p(%rip), %r11
	movq	(%rcx,%r8,8), %rax
	movq	(%r11,%rsi,8), %r10
	movslq	%edx, %rsi
	movq	%rdi, %r9
	movq	(%rcx,%rsi,8), %rcx
	imulq	%rdi, %r9
	leaq	(%r10,%r9), %rdx
	subq	(%r11,%rsi,8), %rdx
	movq	%rcx, %rsi
	imulq	%rcx, %rsi
	subq	%rdi, %rcx
	subq	%rsi, %rdx
	movq	%rdi, %rsi
	subq	%rax, %rsi
	imulq	%rax, %rax
	addq	(%r11,%r8,8), %rax
	subq	%r10, %rax
	imulq	%rsi, %rdx
	subq	%r9, %rax
	imulq	%rcx, %rax
	cmpq	%rax, %rdx
	setge	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE0:
	.size	c, .-c
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%*d%ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	C(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	p(%rip), %r15
	leaq	h(%rip), %r14
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	call	scanf@PLT
	movl	i(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	leaq	.LC1(%rip), %rdi
	leaq	(%r14,%rax,8), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L32
	movslq	s(%rip), %rdi
	leaq	P(%rip), %r10
	movslq	i(%rip), %rbx
	movl	t(%rip), %r8d
	movslq	(%r10,%rdi,4), %rcx
	movq	(%r14,%rbx,8), %r13
	movl	%ebx, 8(%rsp)
	movq	%rdi, %rax
	movq	(%r14,%rcx,8), %rsi
	leaq	(%r13,%r13), %r11
	movq	%rsi, %rdx
	subq	%r11, %rdx
	imulq	%rsi, %rdx
	addq	(%r15,%rcx,8), %rdx
	cmpl	%r8d, %edi
	jge	.L18
	movl	12(%rsp), %esi
	leaq	(%r10,%rdi,4), %rdi
	xorl	%ebp, %ebp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L34:
	addq	$4, %rdi
	movl	$1, %ebp
	cmpl	%r8d, %eax
	je	.L33
	movl	%eax, %esi
.L7:
	movslq	4(%rdi), %rcx
	movq	%rdx, %r9
	movl	%eax, %r10d
	leal	1(%rax), %eax
	movq	(%r14,%rcx,8), %r12
	movq	%r12, %rdx
	subq	%r11, %rdx
	imulq	%r12, %rdx
	addq	(%r15,%rcx,8), %rdx
	cmpq	%r9, %rdx
	jle	.L34
	movl	%esi, 12(%rsp)
	testb	%bpl, %bpl
	je	.L9
	movl	%esi, s(%rip)
.L9:
	movl	8(%rsp), %ecx
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jne	.L35
.L10:
	movq	%rdx, (%r15,%rbx,8)
	movq	%rdx, X(%rip)
	cmpl	%r10d, %r8d
	jle	.L31
	movq	%r13, %rax
	leaq	P(%rip), %rbx
	imulq	%r13, %rax
	movq	%rax, (%rsp)
	movslq	%r8d, %rax
	movslq	(%rbx,%rax,4), %rcx
	leaq	(%rbx,%rax,4), %rbx
	movq	(%r14,%rcx,8), %rsi
	movq	(%r15,%rcx,8), %r9
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L14:
	subq	$4, %rbx
	cmpl	%r10d, %r8d
	je	.L12
.L13:
	movq	%rsi, %rdi
	movslq	-4(%rbx), %rax
	movl	%r8d, %ebp
	leal	-1(%r8), %r8d
	movq	%rdi, %r11
	movq	%rdi, %r12
	imulq	%rdi, %r11
	movq	(%r14,%rax,8), %rsi
	subq	%rsi, %r12
	leaq	(%r11,%r9), %rcx
	subq	%rdx, %rcx
	subq	(%rsp), %rcx
	imulq	%r12, %rcx
	movq	%r9, %r12
	movq	(%r15,%rax,8), %r9
	movq	%rsi, %rax
	imulq	%rsi, %rax
	addq	%r9, %rax
	subq	%r12, %rax
	subq	%r11, %rax
	movq	%r13, %r11
	subq	%rdi, %r11
	imulq	%r11, %rax
	cmpq	%rax, %rcx
	jge	.L14
	addl	$1, %ebp
.L12:
	movl	8(%rsp), %ebx
	movl	%ebp, t(%rip)
	leaq	P(%rip), %rsi
	movslq	%ebp, %rbp
	leal	1(%rbx), %eax
	movl	%ebx, (%rsi,%rbp,4)
	movl	%eax, i(%rip)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L33:
	movl	%esi, 12(%rsp)
	movl	%r8d, %r10d
	movl	%r8d, s(%rip)
.L5:
	movl	8(%rsp), %eax
	testl	%eax, %eax
	je	.L36
.L16:
	movq	%r13, %rax
	imulq	%r13, %rax
	addq	C(%rip), %rax
	addq	%rax, %rdx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L32:
	movq	X(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$24, %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
.L18:
	.cfi_restore_state
	movl	%edi, %r10d
	jmp	.L5
.L36:
	movq	$0, p(%rip)
	movq	$0, X(%rip)
.L31:
	leal	1(%r8), %ebp
	jmp	.L12
.L35:
	movq	%r9, %rdx
	jmp	.L16
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	t
	.data
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.long	-1
	.globl	s
	.bss
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	P
	.align 32
	.type	P, @object
	.size	P, 1048576
P:
	.zero	1048576
	.globl	X
	.align 8
	.type	X, @object
	.size	X, 8
X:
	.zero	8
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 2097152
p:
	.zero	2097152
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 2097152
h:
	.zero	2097152
	.globl	C
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.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	c
	.type	c, @function
c:
.LFB0:
	.cfi_startproc
	endbr64
	leaq	h(%rip), %rcx
	movslq	%esi, %rsi
	movslq	%edi, %r8
	movq	(%rcx,%rsi,8), %rdi
	leaq	p(%rip), %r11
	movq	(%rcx,%r8,8), %rax
	movq	(%r11,%rsi,8), %r10
	movslq	%edx, %rsi
	movq	%rdi, %r9
	movq	(%rcx,%rsi,8), %rcx
	imulq	%rdi, %r9
	leaq	(%r10,%r9), %rdx
	subq	(%r11,%rsi,8), %rdx
	movq	%rcx, %rsi
	imulq	%rcx, %rsi
	subq	%rdi, %rcx
	subq	%rsi, %rdx
	movq	%rdi, %rsi
	subq	%rax, %rsi
	imulq	%rax, %rax
	addq	(%r11,%r8,8), %rax
	subq	%r10, %rax
	imulq	%rsi, %rdx
	subq	%r9, %rax
	imulq	%rcx, %rax
	cmpq	%rax, %rdx
	setge	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE0:
	.size	c, .-c
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%*d%ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	C(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	p(%rip), %r15
	leaq	h(%rip), %r14
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	call	scanf@PLT
	movl	i(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L4:
	cltq
	leaq	.LC1(%rip), %rdi
	leaq	(%r14,%rax,8), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L32
	movslq	s(%rip), %rdi
	leaq	P(%rip), %r10
	movslq	i(%rip), %rbx
	movl	t(%rip), %r8d
	movslq	(%r10,%rdi,4), %rcx
	movq	(%r14,%rbx,8), %r13
	movl	%ebx, 8(%rsp)
	movq	%rdi, %rax
	movq	(%r14,%rcx,8), %rsi
	leaq	(%r13,%r13), %r11
	movq	%rsi, %rdx
	subq	%r11, %rdx
	imulq	%rsi, %rdx
	addq	(%r15,%rcx,8), %rdx
	cmpl	%r8d, %edi
	jge	.L18
	movl	12(%rsp), %esi
	leaq	(%r10,%rdi,4), %rdi
	xorl	%ebp, %ebp
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L34:
	addq	$4, %rdi
	movl	$1, %ebp
	cmpl	%r8d, %eax
	je	.L33
	movl	%eax, %esi
.L7:
	movslq	4(%rdi), %rcx
	movq	%rdx, %r9
	movl	%eax, %r10d
	leal	1(%rax), %eax
	movq	(%r14,%rcx,8), %r12
	movq	%r12, %rdx
	subq	%r11, %rdx
	imulq	%r12, %rdx
	addq	(%r15,%rcx,8), %rdx
	cmpq	%r9, %rdx
	jle	.L34
	movl	%esi, 12(%rsp)
	testb	%bpl, %bpl
	je	.L9
	movl	%esi, s(%rip)
.L9:
	movl	8(%rsp), %ecx
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jne	.L35
.L10:
	movq	%rdx, (%r15,%rbx,8)
	movq	%rdx, X(%rip)
	cmpl	%r10d, %r8d
	jle	.L31
	movq	%r13, %rax
	leaq	P(%rip), %rbx
	imulq	%r13, %rax
	movq	%rax, (%rsp)
	movslq	%r8d, %rax
	movslq	(%rbx,%rax,4), %rcx
	leaq	(%rbx,%rax,4), %rbx
	movq	(%r14,%rcx,8), %rsi
	movq	(%r15,%rcx,8), %r9
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L14:
	subq	$4, %rbx
	cmpl	%r10d, %r8d
	je	.L12
.L13:
	movq	%rsi, %rdi
	movslq	-4(%rbx), %rax
	movl	%r8d, %ebp
	leal	-1(%r8), %r8d
	movq	%rdi, %r11
	movq	%rdi, %r12
	imulq	%rdi, %r11
	movq	(%r14,%rax,8), %rsi
	subq	%rsi, %r12
	leaq	(%r11,%r9), %rcx
	subq	%rdx, %rcx
	subq	(%rsp), %rcx
	imulq	%r12, %rcx
	movq	%r9, %r12
	movq	(%r15,%rax,8), %r9
	movq	%rsi, %rax
	imulq	%rsi, %rax
	addq	%r9, %rax
	subq	%r12, %rax
	subq	%r11, %rax
	movq	%r13, %r11
	subq	%rdi, %r11
	imulq	%r11, %rax
	cmpq	%rax, %rcx
	jge	.L14
	addl	$1, %ebp
.L12:
	movl	8(%rsp), %ebx
	movl	%ebp, t(%rip)
	leaq	P(%rip), %rsi
	movslq	%ebp, %rbp
	leal	1(%rbx), %eax
	movl	%ebx, (%rsi,%rbp,4)
	movl	%eax, i(%rip)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L33:
	movl	%esi, 12(%rsp)
	movl	%r8d, %r10d
	movl	%r8d, s(%rip)
.L5:
	movl	8(%rsp), %eax
	testl	%eax, %eax
	je	.L36
.L16:
	movq	%r13, %rax
	imulq	%r13, %rax
	addq	C(%rip), %rax
	addq	%rax, %rdx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L32:
	movq	X(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$24, %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
.L18:
	.cfi_restore_state
	movl	%edi, %r10d
	jmp	.L5
.L36:
	movq	$0, p(%rip)
	movq	$0, X(%rip)
.L31:
	leal	1(%r8), %ebp
	jmp	.L12
.L35:
	movq	%r9, %rdx
	jmp	.L16
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	t
	.data
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.long	-1
	.globl	s
	.bss
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	P
	.align 32
	.type	P, @object
	.size	P, 1048576
P:
	.zero	1048576
	.globl	X
	.align 8
	.type	X, @object
	.size	X, 8
X:
	.zero	8
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 2097152
p:
	.zero	2097152
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 2097152
h:
	.zero	2097152
	.globl	C
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.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 f(I)p[I]+h[I]*(h[I]-2*h[i])
long C,h[2<<17],p[2<<17],X;
P[2<<17];
s,t=-1,i;
c(x,y,z){
	return (h[y]-h[x])*(p[y]+h[y]*h[y]-p[z]-h[z]*h[z])>=
	(h[z]-h[y])*(p[x]+h[x]*h[x]-p[y]-h[y]*h[y]);
}
main(){
	for(scanf("%*d%ld",&C);~scanf("%ld",h+i);){
		for(;X=f(P[s]),s<t&&X>=f(P[s+1]);s++);
		X=p[i]=i?h[i]*h[i]+C+X:0;
		for(;s<t&&c(P[t-1],P[t],i);t--);
		P[++t]=i++;
	}
	printf("%ld",X);
}
1 1000000000000
500000 1000000
 8 5
1 3 4 6 10 11 12 13
 2 1000000000000
948591 1000000
 8 5
1 3 4 6 10 11 12 14
 2 1000000000000
710905 1000000
 2 1000000100000
710905 1000000
 2 1000000100000
710905 1001000
 2 1000000110000
710905 1001000
 2 1100100000000
596787 1000001
 2 1000000010000
710905 1001000

1250000000000 58 1002642885281 62 1083575919025 1083576019025 1084155209025 1084155219025 1262681529796 1084155119025
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#define f(I)p[I]+h[I]*(h[I]-2*h[i])
long C,h[2<<17],p[2<<17],X;
P[2<<17];
s,t=-1,i;
c(x,y,z){
	return (h[y]-h[x])*(p[y]+h[y]*h[y]-p[z]-h[z]*h[z])>=
	(h[z]-h[y])*(p[x]+h[x]*h[x]-p[y]-h[y]*h[y]);
}
main(){
	for(scanf("%*d%ld",&C);~scanf("%ld",h+i);){
		for(;X=f(P[s]),s<t&&X>=f(P[s+1]);s++);
		X=p[i]=i?h[i]*h[i]+C+X:0;
		for(;s<t&&c(P[t-1],P[t],i);t--);
		P[++t]=i++;
	}
	printf("%ld",X);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	C
	.bss
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.zero	8
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 2097152
h:
	.zero	2097152
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 2097152
p:
	.zero	2097152
	.globl	X
	.align 8
	.type	X, @object
	.size	X, 8
X:
	.zero	8
	.globl	P
	.align 32
	.type	P, @object
	.size	P, 1048576
P:
	.zero	1048576
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	t
	.data
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.long	-1
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.text
	.globl	c
	.type	c, @function
c:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	h(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rsi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rcx, %rdi
	subq	%rax, %rdi
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rax, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	movl	-8(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	h(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdi
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	p(%rip), %rax
	movq	(%rcx,%rax), %r8
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	h(%rip), %rax
	movq	(%rsi,%rax), %rax
	imulq	%rcx, %rax
	leaq	(%r8,%rax), %rsi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	p(%rip), %rax
	movq	(%rcx,%rax), %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	h(%rip), %rax
	movq	(%rsi,%rax), %rax
	imulq	%rax, %rcx
	movq	%r8, %rax
	subq	%rcx, %rax
	imulq	%rdi, %rax
	cmpq	%rax, %rdx
	setge	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	c, .-c
	.section	.rodata
.LC0:
	.string	"%*d%ld"
.LC1:
	.string	"%ld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	C(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L4
.L8:
	movl	s(%rip), %eax
	addl	$1, %eax
	movl	%eax, s(%rip)
.L5:
	movl	s(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	s(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	s(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	P(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	h(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	i(%rip), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	h(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	addq	%rcx, %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	addq	%rdi, %rax
	movq	%rax, X(%rip)
	movl	s(%rip), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	s(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	s(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	s(%rip), %edx
	addl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	P(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	h(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	i(%rip), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	h(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	addq	%rcx, %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rdx
	movq	X(%rip), %rax
	cmpq	%rax, %rdx
	jg	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	$0, %eax
.L7:
	testl	%eax, %eax
	jne	.L8
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L9
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rax, %rdx
	movq	C(%rip), %rax
	addq	%rax, %rdx
	movq	X(%rip), %rax
	addq	%rax, %rdx
	jmp	.L10
.L9:
	movl	$0, %edx
.L10:
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	p(%rip), %rcx
	movq	%rdx, (%rsi,%rcx)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, X(%rip)
	jmp	.L11
.L13:
	movl	t(%rip), %eax
	subl	$1, %eax
	movl	%eax, t(%rip)
.L11:
	movl	s(%rip), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	jge	.L12
	movl	i(%rip), %edx
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	P(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	t(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	P(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	c
	testl	%eax, %eax
	jne	.L13
.L12:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, i(%rip)
	movl	t(%rip), %edx
	addl	$1, %edx
	movl	%edx, t(%rip)
	movl	t(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	P(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L4:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L5
	movq	X(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	C
	.bss
	.align 8
	.type	C, @object
	.size	C, 8
C:
	.zero	8
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 2097152
h:
	.zero	2097152
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 2097152
p:
	.zero	2097152
	.globl	X
	.align 8
	.type	X, @object
	.size	X, 8
X:
	.zero	8
	.globl	P
	.align 32
	.type	P, @object
	.size	P, 1048576
P:
	.zero	1048576
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	t
	.data
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.long	-1
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.text
	.globl	c
	.type	c, @function
c:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	h(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rsi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rcx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rcx, %rdi
	subq	%rax, %rdi
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rax, %rdx
	movq	%rdi, %rax
	subq	%rdx, %rax
	imulq	%rax, %rsi
	movq	%rsi, %rdx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	movl	-8(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	h(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdi
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	p(%rip), %rax
	movq	(%rcx,%rax), %r8
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	h(%rip), %rax
	movq	(%rsi,%rax), %rax
	imulq	%rcx, %rax
	leaq	(%r8,%rax), %rsi
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	p(%rip), %rax
	movq	(%rcx,%rax), %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rcx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rsi
	leaq	h(%rip), %rax
	movq	(%rsi,%rax), %rax
	imulq	%rax, %rcx
	movq	%r8, %rax
	subq	%rcx, %rax
	imulq	%rdi, %rax
	cmpq	%rax, %rdx
	setge	%al
	movzbl	%al, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	c, .-c
	.section	.rodata
.LC0:
	.string	"%*d%ld"
.LC1:
	.string	"%ld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	C(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L4
.L8:
	movl	s(%rip), %eax
	addl	$1, %eax
	movl	%eax, s(%rip)
.L5:
	movl	s(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	s(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	s(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	P(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	h(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	i(%rip), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	h(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	addq	%rcx, %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	addq	%rdi, %rax
	movq	%rax, X(%rip)
	movl	s(%rip), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	jge	.L6
	movl	s(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rdi
	movl	s(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	P(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	s(%rip), %edx
	addl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	P(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	h(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	movl	i(%rip), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	h(%rip), %rcx
	movq	(%rsi,%rcx), %rcx
	addq	%rcx, %rcx
	subq	%rcx, %rdx
	imulq	%rdx, %rax
	leaq	(%rdi,%rax), %rdx
	movq	X(%rip), %rax
	cmpq	%rax, %rdx
	jg	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	$0, %eax
.L7:
	testl	%eax, %eax
	jne	.L8
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L9
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	h(%rip), %rax
	movq	(%rcx,%rax), %rax
	imulq	%rax, %rdx
	movq	C(%rip), %rax
	addq	%rax, %rdx
	movq	X(%rip), %rax
	addq	%rax, %rdx
	jmp	.L10
.L9:
	movl	$0, %edx
.L10:
	movl	i(%rip), %eax
	movslq	%eax, %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	p(%rip), %rcx
	movq	%rdx, (%rsi,%rcx)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	p(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, X(%rip)
	jmp	.L11
.L13:
	movl	t(%rip), %eax
	subl	$1, %eax
	movl	%eax, t(%rip)
.L11:
	movl	s(%rip), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	jge	.L12
	movl	i(%rip), %edx
	movl	t(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	P(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	t(%rip), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	P(%rip), %rax
	movl	(%rsi,%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	movl	$0, %eax
	call	c
	testl	%eax, %eax
	jne	.L13
.L12:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, i(%rip)
	movl	t(%rip), %edx
	addl	$1, %edx
	movl	%edx, t(%rip)
	movl	t(%rip), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	P(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L4:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	h(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L5
	movq	X(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
