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

```c
// AOJ 2549 7 Age
// 2018.2.5 bal4u

#include <stdio.h>

#define QMAX 250000
typedef struct { int s, t; } Q;
Q que[QMAX+2]; int top, end;

int lo[501], up[501];
int w[501][501];
int p[501];

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

#define MAX(a,b)	((a)>=(b)?(a):(b))

int main()
{
	int n, s, i, j, k, t, dt, ans;

	n = in(), s = in()-1;
	for (i = 0; i < n; i++) lo[i] = in(), up[i] = in();
	for (i = 0; i < n; i++) for (j = 0; j < n; j++) w[i][j] = in();

	for (k = 0; k < n; k++) for (i = 0; i < n; i++) for (j = 0; j < n; j++)
		if ((t = w[i][k] + w[k][j]) < w[i][j]) w[i][j] = t;

	top = end = 0;
	for (i = 0; i < n; i++) if (up[i] > w[s][i]) {
		p[i] = up[i]-MAX(w[s][i], lo[i]);
		que[end].s = i, que[end++].t = up[i];
	}

	while (top != end) {
		k = que[top].s, t = que[top++].t;
		for (i = 0; i < n; i++) if (up[i] > t+w[k][i]) {
			dt = up[i] - MAX(t+w[k][i], lo[i]);
			if (p[i] < p[k] + dt) {
				p[i] = p[k] + dt;
				que[end].s = i, que[end++].t = up[i];
			}
		}
	}
	ans = 0;
	for (i = 0; i < n; i++) if (p[i] > ans) ans = p[i];
	printf("%d\n", ans);
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 2000016
que:
	.zero	2000016
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	end
	.align 4
	.type	end, @object
	.size	end, 4
end:
	.zero	4
	.globl	lo
	.align 32
	.type	lo, @object
	.size	lo, 2004
lo:
	.zero	2004
	.globl	up
	.align 32
	.type	up, @object
	.size	up, 2004
up:
	.zero	2004
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 1004004
w:
	.zero	1004004
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 2004
p:
	.zero	2004
	.text
	.globl	in
	.type	in, @function
in:
.LFB0:
	.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
.LFE0:
	.size	in, .-in
	.section	.rodata
.LC0:
	.string	"%d\n"
	.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
	subq	$32, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L5
.L6:
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	lo(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	up(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L5:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L6
	movl	$0, -32(%rbp)
	jmp	.L7
.L10:
	movl	$0, -28(%rbp)
	jmp	.L8
.L9:
	movl	$0, %eax
	call	in
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$501, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	w(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L9
	addl	$1, -32(%rbp)
.L7:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L10
	movl	$0, -24(%rbp)
	jmp	.L11
.L17:
	movl	$0, -32(%rbp)
	jmp	.L12
.L16:
	movl	$0, -28(%rbp)
	jmp	.L13
.L15:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-24(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -8(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L14
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	w(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	addl	$1, -28(%rbp)
.L13:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L15
	addl	$1, -32(%rbp)
.L12:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L16
	addl	$1, -24(%rbp)
.L11:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L17
	movl	$0, end(%rip)
	movl	end(%rip), %eax
	movl	%eax, top(%rip)
	movl	$0, -32(%rbp)
	jmp	.L18
.L20:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	w(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L19
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	lo(%rip), %rax
	movl	(%rsi,%rax), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	subl	%eax, %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	end(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	end(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, end(%rip)
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	up(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L19:
	addl	$1, -32(%rbp)
.L18:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L20
	jmp	.L21
.L25:
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	top(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, top(%rip)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L22
.L24:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rcx
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$501, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	w(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	cmpl	%edx, %eax
	jle	.L23
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-24(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	lo(%rip), %rax
	movl	(%rsi,%rax), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-4(%rbp), %edx
	addl	%ecx, %edx
	cmpl	%edx, %eax
	jge	.L23
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	end(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	end(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, end(%rip)
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	up(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L23:
	addl	$1, -32(%rbp)
.L22:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L24
.L21:
	movl	top(%rip), %edx
	movl	end(%rip), %eax
	cmpl	%eax, %edx
	jne	.L25
	movl	$0, -20(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L26
.L28:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L27
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
.L27:
	addl	$1, -32(%rbp)
.L26:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L28
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	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
.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	in
	.type	in, @function
in:
.LFB23:
	.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	.L11
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L5:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L7:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L4
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	in, .-in
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	call	in
	movl	%eax, %r13d
	xorl	%eax, %eax
	call	in
	subl	$1, %eax
	movl	%eax, 12(%rsp)
	testl	%r13d, %r13d
	jle	.L13
	leal	-1(%r13), %esi
	movq	stdin(%rip), %rdi
	leaq	up(%rip), %rbx
	movl	%r13d, 28(%rsp)
	movl	%esi, 24(%rsp)
	leaq	4(%rbx), %rdx
	movq	%rbx, %rbp
	leaq	lo(%rip), %r12
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	movq	%rsi, (%rsp)
	salq	$2, %rsi
	movq	%rsi, 16(%rsp)
	addq	%rsi, %rdx
	movq	%r12, %r15
	movq	%rdx, %r14
	movq	%rax, %r8
	.p2align 4,,10
	.p2align 3
.L26:
	cmpq	%rcx, %r8
	jnb	.L74
	leaq	1(%r8), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%r8), %eax
.L15:
	xorl	%r13d, %r13d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L16:
	leaq	1(%rdx), %r8
	movq	%r8, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L18
.L17:
	movq	%r8, %rdx
.L19:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rcx, %rdx
	jb	.L16
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %r8
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L17
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%r13d, (%r15)
	cmpq	%r8, %rcx
	jbe	.L75
	leaq	1(%r8), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%r8), %eax
.L21:
	xorl	%r13d, %r13d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L22:
	leaq	1(%rdx), %r8
	movq	%r8, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L24
.L23:
	movq	%r8, %rdx
.L25:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rcx, %rdx
	jb	.L22
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %r8
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%r13d, 0(%rbp)
	addq	$4, %rbp
	addq	$4, %r15
	cmpq	%r14, %rbp
	jne	.L26
	movq	16(%rsp), %rsi
	imulq	$2008, (%rsp), %r14
	leaq	4+w(%rip), %rdx
	movq	%r8, %rax
	addq	%rsi, %rdx
	movq	%rdx, 16(%rsp)
	movq	%rdx, %rbp
	leaq	2008+w(%rip), %rdx
	addq	%r14, %rdx
	movq	%rdx, (%rsp)
	movq	$-4, %rdx
	subq	%rsi, %rdx
	movq	%rdx, %r15
	.p2align 4,,10
	.p2align 3
.L27:
	leaq	(%r15,%rbp), %r13
	cmpq	%rcx, %rax
	jnb	.L76
	.p2align 4,,10
	.p2align 3
.L28:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L29:
	xorl	%r14d, %r14d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L30:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L32
.L31:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L33:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rcx, %rdx
	jb	.L30
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L32
	movq	stdin(%rip), %rdi
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L32:
	movl	%r14d, 0(%r13)
	addq	$4, %r13
	cmpq	%rbp, %r13
	je	.L77
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jb	.L28
.L76:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L77:
	leaq	2004(%r13), %rbp
	cmpq	(%rsp), %rbp
	je	.L78
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	jmp	.L27
.L78:
	movl	28(%rsp), %r10d
	movq	16(%rsp), %r14
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r10, %r11
	movq	%r10, %r13
	imulq	$-2004, %r10, %r10
	negq	%r11
	salq	$2, %r11
	.p2align 4,,10
	.p2align 3
.L36:
	leaq	w(%rip), %rdi
	movq	%r14, %rbp
	xorl	%esi, %esi
	subq	%r9, %rdi
	.p2align 4,,10
	.p2align 3
.L42:
	leaq	(%rdi,%r9), %rax
	.p2align 4,,10
	.p2align 3
.L39:
	leaq	(%rax,%rsi), %rcx
	movl	(%rdi), %edx
	addl	(%rcx,%r8), %edx
	cmpl	%edx, (%rax)
	jle	.L38
	movl	%edx, (%rax)
.L38:
	addq	$4, %rax
	cmpq	%rbp, %rax
	jne	.L39
	subq	$2004, %rsi
	leaq	2004(%rax), %rbp
	addq	$2004, %rdi
	cmpq	%r10, %rsi
	jne	.L42
	subq	$4, %r9
	addq	$2004, %r8
	cmpq	%r11, %r9
	jne	.L36
	movslq	12(%rsp), %rdi
	leaq	w(%rip), %rax
	xorl	%esi, %esi
	movl	$0, end(%rip)
	movl	$0, top(%rip)
	xorl	%r10d, %r10d
	leaq	p(%rip), %r8
	leaq	que(%rip), %r9
	imulq	$2004, %rdi, %rdi
	addq	%rax, %rdi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L44:
	movl	(%rbx,%rax,4), %edx
	movl	(%rdi,%rax,4), %ecx
	movd	%eax, %xmm0
	movd	%edx, %xmm4
	punpckldq	%xmm4, %xmm0
	cmpl	%ecx, %edx
	jle	.L43
	movl	(%r12,%rax,4), %r10d
	cmpl	%r10d, %ecx
	cmovl	%r10d, %ecx
	movl	$1, %r10d
	subl	%ecx, %edx
	movl	%edx, (%r8,%rax,4)
	movslq	%esi, %rdx
	addl	$1, %esi
	movq	%xmm0, (%r9,%rdx,8)
.L43:
	addq	$1, %rax
	cmpl	%eax, %r13d
	jg	.L44
	testb	%r10b, %r10b
	je	.L45
	movl	%esi, end(%rip)
.L45:
	movl	end(%rip), %r10d
	testl	%r10d, %r10d
	je	.L47
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	leaq	que(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L46:
	movslq	(%r15,%rbp,8), %r11
	leal	1(%rbp), %eax
	movl	%eax, (%rsp)
	leaq	4+que(%rip), %rax
	imulq	$2004, %r11, %rdi
	movl	(%rax,%rbp,8), %r9d
	leaq	w(%rip), %rax
	addq	%rax, %rdi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L49:
	movl	(%rbx,%rax,4), %edx
	movl	(%rdi,%rax,4), %ecx
	movd	%eax, %xmm0
	movd	%edx, %xmm3
	addl	%r9d, %ecx
	punpckldq	%xmm3, %xmm0
	cmpl	%ecx, %edx
	jle	.L48
	movl	(%r12,%rax,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	subl	%ecx, %edx
	addl	(%r8,%r11,4), %edx
	cmpl	%edx, (%r8,%rax,4)
	jge	.L48
	movl	%edx, (%r8,%rax,4)
	movslq	%r10d, %rdx
	movl	$1, %r14d
	addl	$1, %r10d
	movq	%xmm0, (%r15,%rdx,8)
.L48:
	addq	$1, %rax
	cmpl	%eax, %r13d
	jg	.L49
	addq	$1, %rbp
	cmpl	%ebp, %r10d
	jne	.L46
	movl	(%rsp), %eax
	movl	%eax, top(%rip)
	testb	%r14b, %r14b
	je	.L47
	movl	%r10d, end(%rip)
.L47:
	cmpl	$2, 24(%rsp)
	jbe	.L79
	movl	%r13d, %edx
	leaq	p(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rcx
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
.L51:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	pcmpgtd	-16(%rax), %xmm1
	pand	%xmm1, %xmm0
	pandn	-16(%rax), %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L51
	movdqa	%xmm0, %xmm2
	movl	%r13d, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movd	%xmm0, %edx
	testb	$3, %r13b
	je	.L53
.L54:
	movslq	%eax, %rcx
	movl	(%r8,%rcx,4), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	leal	1(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L53
	movslq	%ecx, %rcx
	movl	(%r8,%rcx,4), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addl	$2, %eax
	cmpl	%eax, %r13d
	jle	.L53
	cltq
	movl	(%r8,%rax,4), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
.L53:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$40, %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
.L75:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L21
.L74:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L15
.L13:
	movl	$0, end(%rip)
	xorl	%edx, %edx
	movl	$0, top(%rip)
	jmp	.L53
.L79:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L54
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 2004
p:
	.zero	2004
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 1004004
w:
	.zero	1004004
	.globl	up
	.align 32
	.type	up, @object
	.size	up, 2004
up:
	.zero	2004
	.globl	lo
	.align 32
	.type	lo, @object
	.size	lo, 2004
lo:
	.zero	2004
	.globl	end
	.align 4
	.type	end, @object
	.size	end, 4
end:
	.zero	4
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 2000016
que:
	.zero	2000016
	.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	in
	.type	in, @function
in:
.LFB23:
	.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	.L11
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L5:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L7:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L4
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	in, .-in
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$40, %rsp
	.cfi_def_cfa_offset 96
	call	in
	movl	%eax, %r13d
	xorl	%eax, %eax
	call	in
	subl	$1, %eax
	movl	%eax, 12(%rsp)
	testl	%r13d, %r13d
	jle	.L13
	leal	-1(%r13), %esi
	movq	stdin(%rip), %rdi
	leaq	up(%rip), %rbx
	movl	%r13d, 28(%rsp)
	movl	%esi, 24(%rsp)
	leaq	4(%rbx), %rdx
	movq	%rbx, %rbp
	leaq	lo(%rip), %r12
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	movq	%rsi, (%rsp)
	salq	$2, %rsi
	movq	%rsi, 16(%rsp)
	addq	%rsi, %rdx
	movq	%r12, %r15
	movq	%rdx, %r14
	movq	%rax, %r8
	.p2align 4,,10
	.p2align 3
.L26:
	cmpq	%rcx, %r8
	jnb	.L74
	leaq	1(%r8), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%r8), %eax
.L15:
	xorl	%r13d, %r13d
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L16:
	leaq	1(%rdx), %r8
	movq	%r8, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L18
.L17:
	movq	%r8, %rdx
.L19:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rcx, %rdx
	jb	.L16
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %r8
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L17
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%r13d, (%r15)
	cmpq	%r8, %rcx
	jbe	.L75
	leaq	1(%r8), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%r8), %eax
.L21:
	xorl	%r13d, %r13d
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L22:
	leaq	1(%rdx), %r8
	movq	%r8, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L24
.L23:
	movq	%r8, %rdx
.L25:
	leal	0(%r13,%r13,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r13d
	cmpq	%rcx, %rdx
	jb	.L22
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %r8
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L23
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%r13d, 0(%rbp)
	addq	$4, %rbp
	addq	$4, %r15
	cmpq	%r14, %rbp
	jne	.L26
	movq	16(%rsp), %rsi
	imulq	$2008, (%rsp), %r14
	leaq	4+w(%rip), %rdx
	movq	%r8, %rax
	addq	%rsi, %rdx
	movq	%rdx, 16(%rsp)
	movq	%rdx, %rbp
	leaq	2008+w(%rip), %rdx
	addq	%r14, %rdx
	movq	%rdx, (%rsp)
	movq	$-4, %rdx
	subq	%rsi, %rdx
	movq	%rdx, %r15
	.p2align 4,,10
	.p2align 3
.L27:
	leaq	(%r15,%rbp), %r13
	cmpq	%rcx, %rax
	jnb	.L76
	.p2align 4,,10
	.p2align 3
.L28:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L29:
	xorl	%r14d, %r14d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L30:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L32
.L31:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L33:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rcx, %rdx
	jb	.L30
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L32
	movq	stdin(%rip), %rdi
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L32:
	movl	%r14d, 0(%r13)
	addq	$4, %r13
	cmpq	%rbp, %r13
	je	.L77
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jb	.L28
.L76:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L77:
	leaq	2004(%r13), %rbp
	cmpq	(%rsp), %rbp
	je	.L78
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	jmp	.L27
.L78:
	movl	28(%rsp), %r10d
	movq	16(%rsp), %r14
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movq	%r10, %r11
	movq	%r10, %r13
	imulq	$-2004, %r10, %r10
	negq	%r11
	salq	$2, %r11
	.p2align 4,,10
	.p2align 3
.L36:
	leaq	w(%rip), %rdi
	movq	%r14, %rbp
	xorl	%esi, %esi
	subq	%r9, %rdi
	.p2align 4,,10
	.p2align 3
.L42:
	leaq	(%rdi,%r9), %rax
	.p2align 4,,10
	.p2align 3
.L39:
	leaq	(%rax,%rsi), %rcx
	movl	(%rdi), %edx
	addl	(%rcx,%r8), %edx
	cmpl	%edx, (%rax)
	jle	.L38
	movl	%edx, (%rax)
.L38:
	addq	$4, %rax
	cmpq	%rbp, %rax
	jne	.L39
	subq	$2004, %rsi
	leaq	2004(%rax), %rbp
	addq	$2004, %rdi
	cmpq	%r10, %rsi
	jne	.L42
	subq	$4, %r9
	addq	$2004, %r8
	cmpq	%r11, %r9
	jne	.L36
	movslq	12(%rsp), %rdi
	leaq	w(%rip), %rax
	xorl	%esi, %esi
	movl	$0, end(%rip)
	movl	$0, top(%rip)
	xorl	%r10d, %r10d
	leaq	p(%rip), %r8
	leaq	que(%rip), %r9
	imulq	$2004, %rdi, %rdi
	addq	%rax, %rdi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L44:
	movl	(%rbx,%rax,4), %edx
	movl	(%rdi,%rax,4), %ecx
	movd	%eax, %xmm0
	movd	%edx, %xmm4
	punpckldq	%xmm4, %xmm0
	cmpl	%ecx, %edx
	jle	.L43
	movl	(%r12,%rax,4), %r10d
	cmpl	%r10d, %ecx
	cmovl	%r10d, %ecx
	movl	$1, %r10d
	subl	%ecx, %edx
	movl	%edx, (%r8,%rax,4)
	movslq	%esi, %rdx
	addl	$1, %esi
	movq	%xmm0, (%r9,%rdx,8)
.L43:
	addq	$1, %rax
	cmpl	%eax, %r13d
	jg	.L44
	testb	%r10b, %r10b
	je	.L45
	movl	%esi, end(%rip)
.L45:
	movl	end(%rip), %r10d
	testl	%r10d, %r10d
	je	.L47
	xorl	%ebp, %ebp
	xorl	%r14d, %r14d
	leaq	que(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L46:
	movslq	(%r15,%rbp,8), %r11
	leal	1(%rbp), %eax
	movl	%eax, (%rsp)
	leaq	4+que(%rip), %rax
	imulq	$2004, %r11, %rdi
	movl	(%rax,%rbp,8), %r9d
	leaq	w(%rip), %rax
	addq	%rax, %rdi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L49:
	movl	(%rbx,%rax,4), %edx
	movl	(%rdi,%rax,4), %ecx
	movd	%eax, %xmm0
	movd	%edx, %xmm3
	addl	%r9d, %ecx
	punpckldq	%xmm3, %xmm0
	cmpl	%ecx, %edx
	jle	.L48
	movl	(%r12,%rax,4), %esi
	cmpl	%esi, %ecx
	cmovl	%esi, %ecx
	subl	%ecx, %edx
	addl	(%r8,%r11,4), %edx
	cmpl	%edx, (%r8,%rax,4)
	jge	.L48
	movl	%edx, (%r8,%rax,4)
	movslq	%r10d, %rdx
	movl	$1, %r14d
	addl	$1, %r10d
	movq	%xmm0, (%r15,%rdx,8)
.L48:
	addq	$1, %rax
	cmpl	%eax, %r13d
	jg	.L49
	addq	$1, %rbp
	cmpl	%ebp, %r10d
	jne	.L46
	movl	(%rsp), %eax
	movl	%eax, top(%rip)
	testb	%r14b, %r14b
	je	.L47
	movl	%r10d, end(%rip)
.L47:
	cmpl	$2, 24(%rsp)
	jbe	.L79
	movl	%r13d, %edx
	leaq	p(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rcx
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
.L51:
	movdqa	%xmm0, %xmm1
	addq	$16, %rax
	pcmpgtd	-16(%rax), %xmm1
	pand	%xmm1, %xmm0
	pandn	-16(%rax), %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L51
	movdqa	%xmm0, %xmm2
	movl	%r13d, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movd	%xmm0, %edx
	testb	$3, %r13b
	je	.L53
.L54:
	movslq	%eax, %rcx
	movl	(%r8,%rcx,4), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	leal	1(%rax), %ecx
	cmpl	%ecx, %r13d
	jle	.L53
	movslq	%ecx, %rcx
	movl	(%r8,%rcx,4), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addl	$2, %eax
	cmpl	%eax, %r13d
	jle	.L53
	cltq
	movl	(%r8,%rax,4), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
.L53:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$40, %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
.L75:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L21
.L74:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L15
.L13:
	movl	$0, end(%rip)
	xorl	%edx, %edx
	movl	$0, top(%rip)
	jmp	.L53
.L79:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L54
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 2004
p:
	.zero	2004
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 1004004
w:
	.zero	1004004
	.globl	up
	.align 32
	.type	up, @object
	.size	up, 2004
up:
	.zero	2004
	.globl	lo
	.align 32
	.type	lo, @object
	.size	lo, 2004
lo:
	.zero	2004
	.globl	end
	.align 4
	.type	end, @object
	.size	end, 4
end:
	.zero	4
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 2000016
que:
	.zero	2000016
	.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 2549 7 Age
// 2018.2.5 bal4u

#include <stdio.h>

#define QMAX 250000
typedef struct { int s, t; } Q;
Q que[QMAX+2]; int top, end;

int lo[501], up[501];
int w[501][501];
int p[501];

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

#define MAX(a,b)	((a)>=(b)?(a):(b))

int main()
{
	int n, s, i, j, k, t, dt, ans;

	n = in(), s = in()-1;
	for (i = 0; i < n; i++) lo[i] = in(), up[i] = in();
	for (i = 0; i < n; i++) for (j = 0; j < n; j++) w[i][j] = in();

	for (k = 0; k < n; k++) for (i = 0; i < n; i++) for (j = 0; j < n; j++)
		if ((t = w[i][k] + w[k][j]) < w[i][j]) w[i][j] = t;

	top = end = 0;
	for (i = 0; i < n; i++) if (up[i] > w[s][i]) {
		p[i] = up[i]-MAX(w[s][i], lo[i]);
		que[end].s = i, que[end++].t = up[i];
	}

	while (top != end) {
		k = que[top].s, t = que[top++].t;
		for (i = 0; i < n; i++) if (up[i] > t+w[k][i]) {
			dt = up[i] - MAX(t+w[k][i], lo[i]);
			if (p[i] < p[k] + dt) {
				p[i] = p[k] + dt;
				que[end].s = i, que[end++].t = up[i];
			}
		}
	}
	ans = 0;
	for (i = 0; i < n; i++) if (p[i] > ans) ans = p[i];
	printf("%d\n", ans);
	return 0;
}


2 1
0 100
150 250
0 100
100 0

150

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

```c
// AOJ 2549 7 Age
// 2018.2.5 bal4u

#include <stdio.h>

#define QMAX 250000
typedef struct { int s, t; } Q;
Q que[QMAX+2]; int top, end;

int lo[501], up[501];
int w[501][501];
int p[501];

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

#define MAX(a,b)	((a)>=(b)?(a):(b))

int main()
{
	int n, s, i, j, k, t, dt, ans;

	n = in(), s = in()-1;
	for (i = 0; i < n; i++) lo[i] = in(), up[i] = in();
	for (i = 0; i < n; i++) for (j = 0; j < n; j++) w[i][j] = in();

	for (k = 0; k < n; k++) for (i = 0; i < n; i++) for (j = 0; j < n; j++)
		if ((t = w[i][k] + w[k][j]) < w[i][j]) w[i][j] = t;

	top = end = 0;
	for (i = 0; i < n; i++) if (up[i] > w[s][i]) {
		p[i] = up[i]-MAX(w[s][i], lo[i]);
		que[end].s = i, que[end++].t = up[i];
	}

	while (top != end) {
		k = que[top].s, t = que[top++].t;
		for (i = 0; i < n; i++) if (up[i] > t+w[k][i]) {
			dt = up[i] - MAX(t+w[k][i], lo[i]);
			if (p[i] < p[k] + dt) {
				p[i] = p[k] + dt;
				que[end].s = i, que[end++].t = up[i];
			}
		}
	}
	ans = 0;
	for (i = 0; i < n; i++) if (p[i] > ans) ans = p[i];
	printf("%d\n", ans);
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 2000016
que:
	.zero	2000016
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	end
	.align 4
	.type	end, @object
	.size	end, 4
end:
	.zero	4
	.globl	lo
	.align 32
	.type	lo, @object
	.size	lo, 2004
lo:
	.zero	2004
	.globl	up
	.align 32
	.type	up, @object
	.size	up, 2004
up:
	.zero	2004
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 1004004
w:
	.zero	1004004
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 2004
p:
	.zero	2004
	.text
	.globl	in
	.type	in, @function
in:
.LFB0:
	.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
.LFE0:
	.size	in, .-in
	.section	.rodata
.LC0:
	.string	"%d\n"
	.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
	subq	$32, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L5
.L6:
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	lo(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	up(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L5:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L6
	movl	$0, -32(%rbp)
	jmp	.L7
.L10:
	movl	$0, -28(%rbp)
	jmp	.L8
.L9:
	movl	$0, %eax
	call	in
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$501, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	w(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L9
	addl	$1, -32(%rbp)
.L7:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L10
	movl	$0, -24(%rbp)
	jmp	.L11
.L17:
	movl	$0, -32(%rbp)
	jmp	.L12
.L16:
	movl	$0, -28(%rbp)
	jmp	.L13
.L15:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-24(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -8(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L14
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	w(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	addl	$1, -28(%rbp)
.L13:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L15
	addl	$1, -32(%rbp)
.L12:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L16
	addl	$1, -24(%rbp)
.L11:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L17
	movl	$0, end(%rip)
	movl	end(%rip), %eax
	movl	%eax, top(%rip)
	movl	$0, -32(%rbp)
	jmp	.L18
.L20:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	w(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L19
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	lo(%rip), %rax
	movl	(%rsi,%rax), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	subl	%eax, %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	end(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	end(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, end(%rip)
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	up(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L19:
	addl	$1, -32(%rbp)
.L18:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L20
	jmp	.L21
.L25:
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	top(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, top(%rip)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L22
.L24:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rcx
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$501, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	w(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	cmpl	%edx, %eax
	jle	.L23
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-24(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	lo(%rip), %rax
	movl	(%rsi,%rax), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-4(%rbp), %edx
	addl	%ecx, %edx
	cmpl	%edx, %eax
	jge	.L23
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	end(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	end(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, end(%rip)
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	up(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L23:
	addl	$1, -32(%rbp)
.L22:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L24
.L21:
	movl	top(%rip), %edx
	movl	end(%rip), %eax
	cmpl	%eax, %edx
	jne	.L25
	movl	$0, -20(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L26
.L28:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L27
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
.L27:
	addl	$1, -32(%rbp)
.L26:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L28
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	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
.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	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 2000016
que:
	.zero	2000016
	.globl	top
	.align 4
	.type	top, @object
	.size	top, 4
top:
	.zero	4
	.globl	end
	.align 4
	.type	end, @object
	.size	end, 4
end:
	.zero	4
	.globl	lo
	.align 32
	.type	lo, @object
	.size	lo, 2004
lo:
	.zero	2004
	.globl	up
	.align 32
	.type	up, @object
	.size	up, 2004
up:
	.zero	2004
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 1004004
w:
	.zero	1004004
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 2004
p:
	.zero	2004
	.text
	.globl	in
	.type	in, @function
in:
.LFB0:
	.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
.LFE0:
	.size	in, .-in
	.section	.rodata
.LC0:
	.string	"%d\n"
	.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
	subq	$32, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L5
.L6:
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	lo(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	up(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L5:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L6
	movl	$0, -32(%rbp)
	jmp	.L7
.L10:
	movl	$0, -28(%rbp)
	jmp	.L8
.L9:
	movl	$0, %eax
	call	in
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$501, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	w(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L8:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L9
	addl	$1, -32(%rbp)
.L7:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L10
	movl	$0, -24(%rbp)
	jmp	.L11
.L17:
	movl	$0, -32(%rbp)
	jmp	.L12
.L16:
	movl	$0, -28(%rbp)
	jmp	.L13
.L15:
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-24(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -8(%rbp)
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -8(%rbp)
	jge	.L14
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	w(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L14:
	addl	$1, -28(%rbp)
.L13:
	movl	-28(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L15
	addl	$1, -32(%rbp)
.L12:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L16
	addl	$1, -24(%rbp)
.L11:
	movl	-24(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L17
	movl	$0, end(%rip)
	movl	end(%rip), %eax
	movl	%eax, top(%rip)
	movl	$0, -32(%rbp)
	jmp	.L18
.L20:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	w(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L19
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-12(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	lo(%rip), %rax
	movl	(%rsi,%rax), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	subl	%eax, %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	end(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	end(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, end(%rip)
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	up(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L19:
	addl	$1, -32(%rbp)
.L18:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L20
	jmp	.L21
.L25:
	movl	top(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	top(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, top(%rip)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+que(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L22
.L24:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rcx
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$501, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	w(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	cmpl	%edx, %eax
	jle	.L23
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	up(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	movslq	%eax, %rdx
	movl	-24(%rbp), %eax
	cltq
	imulq	$501, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	leaq	lo(%rip), %rax
	movl	(%rsi,%rax), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-4(%rbp), %edx
	addl	%ecx, %edx
	cmpl	%edx, %eax
	jge	.L23
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	end(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	end(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, end(%rip)
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	up(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+que(%rip), %rax
	movl	%edx, (%rcx,%rax)
.L23:
	addl	$1, -32(%rbp)
.L22:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L24
.L21:
	movl	top(%rip), %edx
	movl	end(%rip), %eax
	cmpl	%eax, %edx
	jne	.L25
	movl	$0, -20(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L26
.L28:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L27
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -20(%rbp)
.L27:
	addl	$1, -32(%rbp)
.L26:
	movl	-32(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L28
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	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
.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:
