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

```c
// AOJ 2578 Disciple Life is Hard
// 2018.3.16 bal4u

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

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

// library //

int e[102], c[102], h[102], a[102];
int p[102];
int dp1[102][102*102], dp2[102][102][102], dp3[102][102];
int ee[102];
int cmp(int *a, int *b) { return *a - *b; }

int main()
{
	int S, T, U, N, O, D, i, j, s, x;

	S = in(), T = in(), U = in(), N = in(), O = in(), D = in();
	for (i = 0; i < T; i++) ee[i] = e[i] = in(), c[i] = in();
	for (i = 0; i < N; i++) h[i] = in(), a[i] = in();

	qsort(ee, T, sizeof(int), cmp);
	s = 0; for (i = 0; i < U; i++) s += ee[i];
	if (s > S || S-(D-1)*(s-O) < s) { puts("-1"); return 0; }

	memset(dp1, -1, sizeof(dp1)), dp1[0][0] = 0;
	for (i = 1; i <= N; i++) for (j = 0; j <= 10000; j++) for (s = 0; s*a[i-1] <= j; s++) {
		if (dp1[i-1][j-s*a[i-1]] >= 0) {
			x = dp1[i-1][j-s*a[i-1]]+h[i-1]*s;
			if (dp1[i][j] < x) dp1[i][j] = x;
		}
	}

	memset(dp2, -1, sizeof(dp2)); dp2[0][0][0] = 0;
	for (i = 1; i <= T; i++) {
		dp2[i][0][0] = 0;
		for (j = 1; j <= i; j++) for (s = 0; s <= S; s++) {
			dp2[i][j][s] = dp2[i-1][j][s];
			if (s-e[i-1] >= 0 && dp2[i-1][j-1][s-e[i-1]] >= 0) {
				x = dp2[i-1][j-1][s-e[i-1]]+c[i-1];
				if (dp2[i][j][s] < x) dp2[i][j][s] = x;
			}
		}
	}

	memset(p, -1, sizeof(p));
    for (s = 0; s <= S; s++) for (i = 0; i <= dp2[T][U][s]; i++) if (p[s] < dp1[N][i]) p[s] = dp1[N][i];

	memset(dp3, -1, sizeof(dp3)), memset(dp3[0], 0, sizeof(dp3[0]));
	for (i = 1; i <= D; i++) for (s = 0; s <= S; s++) for (j = 0; j <= s; j++) {
		x = s-j+O; if (x > S) x = S;
		if (dp3[i-1][x] >= 0 && p[j] >= 0) {
			int t = dp3[i-1][x] + p[j];
			if (dp3[i][s] < t) dp3[i][s] = t;
		}
	}
	printf("%d\n", dp3[D][S]);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	e
	.bss
	.align 32
	.type	e, @object
	.size	e, 408
e:
	.zero	408
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 408
c:
	.zero	408
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 408
h:
	.zero	408
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 408
a:
	.zero	408
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 408
p:
	.zero	408
	.globl	dp1
	.align 32
	.type	dp1, @object
	.size	dp1, 4244832
dp1:
	.zero	4244832
	.globl	dp2
	.align 32
	.type	dp2, @object
	.size	dp2, 4244832
dp2:
	.zero	4244832
	.globl	dp3
	.align 32
	.type	dp3, @object
	.size	dp3, 41616
dp3:
	.zero	41616
	.globl	ee
	.align 32
	.type	ee, @object
	.size	ee, 408
ee:
	.zero	408
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"-1"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -20(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L7
.L8:
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ee(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -44(%rbp)
.L7:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L8
	movl	$0, -44(%rbp)
	jmp	.L9
.L10:
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -44(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	ee(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -36(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L11
.L12:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ee(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -36(%rbp)
	addl	$1, -44(%rbp)
.L11:
	movl	-44(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L12
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L13
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	subl	-12(%rbp), %eax
	imull	%eax, %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	%eax, -36(%rbp)
	jle	.L14
.L13:
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L15
.L14:
	movl	$4244832, %edx
	movl	$-1, %esi
	leaq	dp1(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp1(%rip)
	movl	$1, -44(%rbp)
	jmp	.L16
.L22:
	movl	$0, -40(%rbp)
	jmp	.L17
.L21:
	movl	$0, -36(%rbp)
	jmp	.L18
.L20:
	movl	-44(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L19
	movl	-44(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L19
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp1(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L19:
	addl	$1, -36(%rbp)
.L18:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L20
	addl	$1, -40(%rbp)
.L17:
	cmpl	$10000, -40(%rbp)
	jle	.L21
	addl	$1, -44(%rbp)
.L16:
	movl	-44(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L22
	movl	$4244832, %edx
	movl	$-1, %esi
	leaq	dp2(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp2(%rip)
	movl	$1, -44(%rbp)
	jmp	.L23
.L29:
	movl	-44(%rbp), %eax
	cltq
	imulq	$41616, %rax, %rax
	leaq	dp2(%rip), %rdx
	movl	$0, (%rax,%rdx)
	movl	$1, -40(%rbp)
	jmp	.L24
.L28:
	movl	$0, -36(%rbp)
	jmp	.L25
.L27:
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rsi
	movl	-44(%rbp), %edx
	movslq	%edx, %rcx
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10404, %rcx, %rcx
	imulq	$102, %rdx, %rdx
	addq	%rcx, %rdx
	addq	%rsi, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L26
	movl	-44(%rbp), %eax
	leal	-1(%rax), %esi
	movl	-40(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdi
	movslq	%esi, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L26
	movl	-44(%rbp), %eax
	leal	-1(%rax), %esi
	movl	-40(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdi
	movslq	%esi, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L26
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp2(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L26:
	addl	$1, -36(%rbp)
.L25:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L27
	addl	$1, -40(%rbp)
.L24:
	movl	-40(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L28
	addl	$1, -44(%rbp)
.L23:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L29
	movl	$408, %edx
	movl	$-1, %esi
	leaq	p(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -36(%rbp)
	jmp	.L30
.L34:
	movl	$0, -44(%rbp)
	jmp	.L31
.L33:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-44(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp1(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L32
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L32:
	addl	$1, -44(%rbp)
.L31:
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L33
	addl	$1, -36(%rbp)
.L30:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L34
	movl	$41616, %edx
	movl	$-1, %esi
	leaq	dp3(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$408, %edx
	movl	$0, %esi
	leaq	dp3(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -44(%rbp)
	jmp	.L35
.L42:
	movl	$0, -36(%rbp)
	jmp	.L36
.L41:
	movl	$0, -40(%rbp)
	jmp	.L37
.L40:
	movl	-36(%rbp), %eax
	subl	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L38
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
.L38:
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$102, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L39
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L39
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$102, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L39
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp3(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L39:
	addl	$1, -40(%rbp)
.L37:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L40
	addl	$1, -36(%rbp)
.L36:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L41
	addl	$1, -44(%rbp)
.L35:
	movl	-44(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L42
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB51:
	.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	.L12
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L5:
	xorl	%r12d, %r12d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L3
.L7:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L9:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L6
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L3
	movq	stdin(%rip), %rdi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L5
	.cfi_endproc
.LFE51:
	.size	in, .-in
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"-1"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.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
	leaq	ee(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	call	in
	movl	%eax, %ebx
	xorl	%eax, %eax
	call	in
	movl	%eax, %r15d
	xorl	%eax, %eax
	call	in
	movl	%eax, 4(%rsp)
	xorl	%eax, %eax
	call	in
	movl	%eax, 8(%rsp)
	xorl	%eax, %eax
	call	in
	movl	%eax, %ebp
	xorl	%eax, %eax
	call	in
	movl	%eax, 12(%rsp)
	movslq	%r15d, %rax
	movq	%rax, 16(%rsp)
	testl	%r15d, %r15d
	jle	.L30
.L29:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L101
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L18:
	xorl	%r14d, %r14d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L19:
	leaq	1(%rdx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L21
.L20:
	movq	%rsi, %rdx
.L22:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rdx, %rcx
	ja	.L19
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L20
.L21:
	leaq	e(%rip), %rax
	movl	%r14d, 0(%r13,%r12,4)
	movl	%r14d, (%rax,%r12,4)
	cmpq	%rsi, %rcx
	jbe	.L102
	leaq	1(%rsi), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rsi), %eax
.L24:
	xorl	%r14d, %r14d
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L25:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L27
.L26:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L28:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rdx, %rcx
	ja	.L25
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L27
	movq	stdin(%rip), %rdi
	jmp	.L26
.L27:
	leaq	c(%rip), %rax
	movl	%r14d, (%rax,%r12,4)
	addq	$1, %r12
	cmpq	16(%rsp), %r12
	jne	.L29
.L30:
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jle	.L16
	movl	8(%rsp), %eax
	leaq	a(%rip), %r12
	movl	%ebx, 32(%rsp)
	leaq	h(%rip), %r14
	leaq	4(%r12), %rdx
	subl	$1, %eax
	leaq	(%rdx,%rax,4), %rax
	movq	%rax, 24(%rsp)
.L45:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L103
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L34:
	xorl	%ebx, %ebx
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L35:
	leaq	1(%rdx), %r8
	movq	%r8, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L37
.L36:
	movq	%r8, %rdx
.L38:
	leal	(%rbx,%rbx,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebx
	cmpq	%rcx, %rdx
	jb	.L35
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %r8
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L36
.L37:
	movl	%ebx, (%r14)
	cmpq	%rcx, %r8
	jnb	.L104
	leaq	1(%r8), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%r8), %eax
.L40:
	xorl	%ebx, %ebx
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L41:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L43
.L42:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L44:
	leal	(%rbx,%rbx,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebx
	cmpq	%rcx, %rdx
	jb	.L41
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L43
	movq	stdin(%rip), %rdi
	jmp	.L42
.L43:
	movl	%ebx, (%r12)
	addq	$4, %r14
	addq	$4, %r12
	cmpq	24(%rsp), %r12
	jne	.L45
	movl	32(%rsp), %ebx
.L16:
	movq	16(%rsp), %rsi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%r13, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L105
	movl	4(%rsp), %edi
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L79
	movl	%edi, %eax
	leaq	ee(%rip), %rdx
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leaq	16(%rdx), %rcx
	subl	$1, %eax
	salq	$4, %rax
	addq	%rcx, %rax
.L47:
	paddd	(%rdx), %xmm0
	addq	$16, %rdx
	cmpq	%rax, %rdx
	jne	.L47
	movdqa	%xmm0, %xmm1
	movl	4(%rsp), %edi
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movl	%edi, %edx
	movdqa	%xmm0, %xmm1
	andl	$-4, %edx
	andl	$3, %edi
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	je	.L32
.L46:
	movslq	%edx, %rcx
	movl	4(%rsp), %edi
	addl	0(%r13,%rcx,4), %eax
	leal	1(%rdx), %ecx
	cmpl	%ecx, %edi
	jle	.L32
	movslq	%ecx, %rcx
	addl	$2, %edx
	addl	0(%r13,%rcx,4), %eax
	cmpl	%edx, %edi
	jle	.L32
	movslq	%edx, %rdx
	addl	0(%r13,%rdx,4), %eax
.L32:
	cmpl	%eax, %ebx
	jl	.L50
	movl	12(%rsp), %edi
	movl	%eax, %ecx
	subl	%ebp, %ecx
	leal	-1(%rdi), %edx
	imull	%ecx, %edx
	movl	%ebx, %ecx
	subl	%edx, %ecx
	cmpl	%eax, %ecx
	jge	.L51
.L50:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
.L92:
	addq	$72, %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
.L104:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L40
.L103:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L34
.L102:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L24
.L101:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L18
.L51:
	movl	$4244832, %edx
	orl	$-1, %esi
	leaq	dp1(%rip), %rdi
	call	memset@PLT
	movl	8(%rsp), %eax
	movl	$0, dp1(%rip)
	testl	%eax, %eax
	jle	.L53
	leaq	h(%rip), %r12
	subl	$1, %eax
	leaq	a(%rip), %r13
	leaq	4(%r12), %rdx
	leaq	dp1(%rip), %r14
	leaq	(%rdx,%rax,4), %rax
	movq	%rax, 24(%rsp)
.L54:
	movl	0(%r13), %r10d
	movq	%r14, %r8
	xorl	%edi, %edi
	movl	%r10d, %r9d
	negl	%r9d
	movslq	%r9d, %r9
	salq	$2, %r9
	.p2align 4,,10
	.p2align 3
.L58:
	movq	%r8, %rdx
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L56:
	movl	(%rdx), %r11d
	testl	%r11d, %r11d
	js	.L55
	movl	(%r12), %esi
	imull	%ecx, %esi
	addl	%r11d, %esi
	cmpl	%esi, 41616(%r8)
	jge	.L55
	movl	%esi, 41616(%r8)
.L55:
	addl	%r10d, %eax
	addl	$1, %ecx
	addq	%r9, %rdx
	cmpl	%eax, %edi
	jge	.L56
	addl	$1, %edi
	addq	$4, %r8
	cmpl	$10001, %edi
	jne	.L58
	addq	$4, %r13
	addq	$4, %r12
	addq	$41616, %r14
	cmpq	24(%rsp), %r12
	jne	.L54
.L53:
	leaq	dp2(%rip), %r10
	movl	$4244832, %edx
	orl	$-1, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	$0, dp2(%rip)
	movq	%rax, %r10
	testl	%r15d, %r15d
	jle	.L67
	leaq	e(%rip), %rax
	leal	-1(%r15), %edx
	movl	%ebp, 60(%rsp)
	xorl	%r9d, %r9d
	leaq	c(%rip), %r13
	movq	%rax, 32(%rsp)
	movq	$-41616, %r8
	movl	$102, %r14d
	movq	$41616, 40(%rsp)
	leaq	4(%r13), %rax
	movq	$0, 24(%rsp)
	leaq	(%rax,%rdx,4), %rax
	movq	%rax, 48(%rsp)
	leal	1(%rbx), %eax
	movl	%eax, 56(%rsp)
.L66:
	movq	40(%rsp), %rax
	movl	$0, (%r10,%rax)
	testl	%ebx, %ebx
	js	.L62
	movq	32(%rsp), %rax
	movl	56(%rsp), %r11d
	movq	24(%rsp), %rbp
	movl	(%rax), %eax
	movl	%eax, %r12d
	subl	%eax, %r11d
	negl	%r12d
	movslq	%r12d, %r15
.L63:
	leaq	(%r15,%rbp), %rdx
	leaq	42024+dp2(%rip), %rax
	leaq	(%r10,%rdx,4), %rcx
	leaq	(%rax,%rbp,4), %rax
	movl	%r12d, %edx
	.p2align 4,,10
	.p2align 3
.L65:
	leaq	(%rax,%r8), %rsi
	movl	(%rsi,%r9), %edi
	movl	%edi, (%rax)
	testl	%edx, %edx
	js	.L64
	movl	(%rcx), %esi
	testl	%esi, %esi
	js	.L64
	addl	0(%r13), %esi
	cmpl	%esi, %edi
	jge	.L64
	movl	%esi, (%rax)
	.p2align 4,,10
	.p2align 3
.L64:
	addl	$1, %edx
	addq	$4, %rax
	addq	$4, %rcx
	cmpl	%r11d, %edx
	jne	.L65
	addq	$102, %rbp
	cmpq	%r14, %rbp
	jne	.L63
.L62:
	addq	$10404, 24(%rsp)
	addq	$10506, %r14
	addq	$4, %r13
	subq	$41616, %r8
	addq	$4, 32(%rsp)
	addq	$41616, %r9
	addq	$41616, 40(%rsp)
	cmpq	48(%rsp), %r13
	jne	.L66
	movl	60(%rsp), %ebp
.L67:
	movl	$51, %r12d
	leaq	p(%rip), %rsi
	orq	$-1, %rax
	movq	%r12, %rcx
	movq	%rsi, %rdi
	rep stosq
	movq	%rcx, %r12
	testl	%ebx, %ebx
	js	.L60
	movslq	4(%rsp), %rax
	movslq	8(%rsp), %r9
	movslq	%ebx, %r12
	imulq	$41616, 16(%rsp), %r8
	imulq	$408, %rax, %rax
	imulq	$41616, %r9, %r11
	imulq	$10404, %r9, %r9
	addq	%rax, %r8
	leaq	4(%rsi), %rax
	addq	%r10, %r8
	leaq	(%rax,%r12,4), %r10
	leaq	dp1(%rip), %rax
	addq	%rax, %r11
	leaq	4(%rax), %r13
.L61:
	movslq	(%r8), %rax
	testl	%eax, %eax
	js	.L72
	addq	%r9, %rax
	movl	(%rsi), %ecx
	leaq	0(%r13,%rax,4), %rdi
	movq	%r11, %rax
.L69:
	movl	(%rax), %edx
	cmpl	%ecx, %edx
	jle	.L68
	movl	%edx, (%rsi)
	movl	%edx, %ecx
.L68:
	addq	$4, %rax
	cmpq	%rdi, %rax
	jne	.L69
.L72:
	addq	$4, %rsi
	addq	$4, %r8
	cmpq	%r10, %rsi
	jne	.L61
	leaq	dp3(%rip), %r8
	orl	$-1, %esi
	movl	$41616, %edx
	movq	%r8, %rdi
	call	memset@PLT
	movl	$51, %ecx
	movq	%rax, %r8
	xorl	%eax, %eax
	cmpl	$0, 12(%rsp)
	movq	%r8, %rdi
	rep stosq
	jle	.L77
	movq	%rdi, %r11
	xorl	%r13d, %r13d
	leal	1(%rbx), %r10d
.L73:
	movslq	%r13d, %rsi
	movq	%r11, %rdi
	xorl	%r9d, %r9d
	imulq	$102, %rsi, %rsi
.L76:
	leal	(%r9,%rbp), %edx
	leaq	p(%rip), %rcx
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L80:
	movl	%eax, %edx
.L75:
	cmpl	%ebx, %edx
	movl	%ebx, %eax
	cmovle	%edx, %eax
	cltq
	addq	%rsi, %rax
	movl	(%r8,%rax,4), %eax
	testl	%eax, %eax
	js	.L74
	movl	(%rcx), %r14d
	testl	%r14d, %r14d
	js	.L74
	addl	%r14d, %eax
	cmpl	%eax, (%rdi)
	jge	.L74
	movl	%eax, (%rdi)
	.p2align 4,,10
	.p2align 3
.L74:
	leal	-1(%rdx), %eax
	addq	$4, %rcx
	cmpl	%edx, %ebp
	jne	.L80
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r10d
	jne	.L76
	addl	$1, %r13d
	addq	$408, %r11
	cmpl	%r13d, 12(%rsp)
	jne	.L73
.L77:
	movslq	12(%rsp), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	imulq	$102, %rax, %rax
	addq	%r12, %rax
	movl	(%r8,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L92
.L105:
	xorl	%eax, %eax
	jmp	.L32
.L79:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L46
.L60:
	leaq	dp3(%rip), %r8
	movl	$41616, %edx
	orl	$-1, %esi
	movq	%r8, %rdi
	call	memset@PLT
	movl	$51, %ecx
	movq	%rax, %rdi
	movq	%rax, %r8
	movq	%r12, %rax
	movslq	%ebx, %r12
	rep stosq
	jmp	.L77
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	ee
	.bss
	.align 32
	.type	ee, @object
	.size	ee, 408
ee:
	.zero	408
	.globl	dp3
	.align 32
	.type	dp3, @object
	.size	dp3, 41616
dp3:
	.zero	41616
	.globl	dp2
	.align 32
	.type	dp2, @object
	.size	dp2, 4244832
dp2:
	.zero	4244832
	.globl	dp1
	.align 32
	.type	dp1, @object
	.size	dp1, 4244832
dp1:
	.zero	4244832
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 408
p:
	.zero	408
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 408
a:
	.zero	408
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 408
h:
	.zero	408
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 408
c:
	.zero	408
	.globl	e
	.align 32
	.type	e, @object
	.size	e, 408
e:
	.zero	408
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	cmp, .-cmp
	.p2align 4
	.globl	in
	.type	in, @function
in:
.LFB51:
	.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	.L12
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L5:
	xorl	%r12d, %r12d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L3
.L7:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L9:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L6
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L3
	movq	stdin(%rip), %rdi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L5
	.cfi_endproc
.LFE51:
	.size	in, .-in
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"-1"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.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
	leaq	ee(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	call	in
	movl	%eax, %ebx
	xorl	%eax, %eax
	call	in
	movl	%eax, %r15d
	xorl	%eax, %eax
	call	in
	movl	%eax, 4(%rsp)
	xorl	%eax, %eax
	call	in
	movl	%eax, 8(%rsp)
	xorl	%eax, %eax
	call	in
	movl	%eax, %ebp
	xorl	%eax, %eax
	call	in
	movl	%eax, 12(%rsp)
	movslq	%r15d, %rax
	movq	%rax, 16(%rsp)
	testl	%r15d, %r15d
	jle	.L30
.L29:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L101
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L18:
	xorl	%r14d, %r14d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L19:
	leaq	1(%rdx), %rsi
	movq	%rsi, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L21
.L20:
	movq	%rsi, %rdx
.L22:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rdx, %rcx
	ja	.L19
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L20
.L21:
	leaq	e(%rip), %rax
	movl	%r14d, 0(%r13,%r12,4)
	movl	%r14d, (%rax,%r12,4)
	cmpq	%rsi, %rcx
	jbe	.L102
	leaq	1(%rsi), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rsi), %eax
.L24:
	xorl	%r14d, %r14d
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L25:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L27
.L26:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L28:
	leal	(%r14,%r14,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r14d
	cmpq	%rdx, %rcx
	ja	.L25
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L27
	movq	stdin(%rip), %rdi
	jmp	.L26
.L27:
	leaq	c(%rip), %rax
	movl	%r14d, (%rax,%r12,4)
	addq	$1, %r12
	cmpq	16(%rsp), %r12
	jne	.L29
.L30:
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jle	.L16
	movl	8(%rsp), %eax
	leaq	a(%rip), %r12
	movl	%ebx, 32(%rsp)
	leaq	h(%rip), %r14
	leaq	4(%r12), %rdx
	subl	$1, %eax
	leaq	(%rdx,%rax,4), %rax
	movq	%rax, 24(%rsp)
.L45:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L103
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L34:
	xorl	%ebx, %ebx
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L35:
	leaq	1(%rdx), %r8
	movq	%r8, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L37
.L36:
	movq	%r8, %rdx
.L38:
	leal	(%rbx,%rbx,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebx
	cmpq	%rcx, %rdx
	jb	.L35
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %r8
	movq	16(%rdi), %rcx
	cmpl	$47, %eax
	jg	.L36
.L37:
	movl	%ebx, (%r14)
	cmpq	%rcx, %r8
	jnb	.L104
	leaq	1(%r8), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%r8), %eax
.L40:
	xorl	%ebx, %ebx
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L41:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L43
.L42:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L44:
	leal	(%rbx,%rbx,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %ebx
	cmpq	%rcx, %rdx
	jb	.L41
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L43
	movq	stdin(%rip), %rdi
	jmp	.L42
.L43:
	movl	%ebx, (%r12)
	addq	$4, %r14
	addq	$4, %r12
	cmpq	24(%rsp), %r12
	jne	.L45
	movl	32(%rsp), %ebx
.L16:
	movq	16(%rsp), %rsi
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%r13, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L105
	movl	4(%rsp), %edi
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L79
	movl	%edi, %eax
	leaq	ee(%rip), %rdx
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leaq	16(%rdx), %rcx
	subl	$1, %eax
	salq	$4, %rax
	addq	%rcx, %rax
.L47:
	paddd	(%rdx), %xmm0
	addq	$16, %rdx
	cmpq	%rax, %rdx
	jne	.L47
	movdqa	%xmm0, %xmm1
	movl	4(%rsp), %edi
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movl	%edi, %edx
	movdqa	%xmm0, %xmm1
	andl	$-4, %edx
	andl	$3, %edi
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	je	.L32
.L46:
	movslq	%edx, %rcx
	movl	4(%rsp), %edi
	addl	0(%r13,%rcx,4), %eax
	leal	1(%rdx), %ecx
	cmpl	%ecx, %edi
	jle	.L32
	movslq	%ecx, %rcx
	addl	$2, %edx
	addl	0(%r13,%rcx,4), %eax
	cmpl	%edx, %edi
	jle	.L32
	movslq	%edx, %rdx
	addl	0(%r13,%rdx,4), %eax
.L32:
	cmpl	%eax, %ebx
	jl	.L50
	movl	12(%rsp), %edi
	movl	%eax, %ecx
	subl	%ebp, %ecx
	leal	-1(%rdi), %edx
	imull	%ecx, %edx
	movl	%ebx, %ecx
	subl	%edx, %ecx
	cmpl	%eax, %ecx
	jge	.L51
.L50:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
.L92:
	addq	$72, %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
.L104:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L40
.L103:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L34
.L102:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L24
.L101:
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L18
.L51:
	movl	$4244832, %edx
	orl	$-1, %esi
	leaq	dp1(%rip), %rdi
	call	memset@PLT
	movl	8(%rsp), %eax
	movl	$0, dp1(%rip)
	testl	%eax, %eax
	jle	.L53
	leaq	h(%rip), %r12
	subl	$1, %eax
	leaq	a(%rip), %r13
	leaq	4(%r12), %rdx
	leaq	dp1(%rip), %r14
	leaq	(%rdx,%rax,4), %rax
	movq	%rax, 24(%rsp)
.L54:
	movl	0(%r13), %r10d
	movq	%r14, %r8
	xorl	%edi, %edi
	movl	%r10d, %r9d
	negl	%r9d
	movslq	%r9d, %r9
	salq	$2, %r9
	.p2align 4,,10
	.p2align 3
.L58:
	movq	%r8, %rdx
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L56:
	movl	(%rdx), %r11d
	testl	%r11d, %r11d
	js	.L55
	movl	(%r12), %esi
	imull	%ecx, %esi
	addl	%r11d, %esi
	cmpl	%esi, 41616(%r8)
	jge	.L55
	movl	%esi, 41616(%r8)
.L55:
	addl	%r10d, %eax
	addl	$1, %ecx
	addq	%r9, %rdx
	cmpl	%eax, %edi
	jge	.L56
	addl	$1, %edi
	addq	$4, %r8
	cmpl	$10001, %edi
	jne	.L58
	addq	$4, %r13
	addq	$4, %r12
	addq	$41616, %r14
	cmpq	24(%rsp), %r12
	jne	.L54
.L53:
	leaq	dp2(%rip), %r10
	movl	$4244832, %edx
	orl	$-1, %esi
	movq	%r10, %rdi
	call	memset@PLT
	movl	$0, dp2(%rip)
	movq	%rax, %r10
	testl	%r15d, %r15d
	jle	.L67
	leaq	e(%rip), %rax
	leal	-1(%r15), %edx
	movl	%ebp, 60(%rsp)
	xorl	%r9d, %r9d
	leaq	c(%rip), %r13
	movq	%rax, 32(%rsp)
	movq	$-41616, %r8
	movl	$102, %r14d
	movq	$41616, 40(%rsp)
	leaq	4(%r13), %rax
	movq	$0, 24(%rsp)
	leaq	(%rax,%rdx,4), %rax
	movq	%rax, 48(%rsp)
	leal	1(%rbx), %eax
	movl	%eax, 56(%rsp)
.L66:
	movq	40(%rsp), %rax
	movl	$0, (%r10,%rax)
	testl	%ebx, %ebx
	js	.L62
	movq	32(%rsp), %rax
	movl	56(%rsp), %r11d
	movq	24(%rsp), %rbp
	movl	(%rax), %eax
	movl	%eax, %r12d
	subl	%eax, %r11d
	negl	%r12d
	movslq	%r12d, %r15
.L63:
	leaq	(%r15,%rbp), %rdx
	leaq	42024+dp2(%rip), %rax
	leaq	(%r10,%rdx,4), %rcx
	leaq	(%rax,%rbp,4), %rax
	movl	%r12d, %edx
	.p2align 4,,10
	.p2align 3
.L65:
	leaq	(%rax,%r8), %rsi
	movl	(%rsi,%r9), %edi
	movl	%edi, (%rax)
	testl	%edx, %edx
	js	.L64
	movl	(%rcx), %esi
	testl	%esi, %esi
	js	.L64
	addl	0(%r13), %esi
	cmpl	%esi, %edi
	jge	.L64
	movl	%esi, (%rax)
	.p2align 4,,10
	.p2align 3
.L64:
	addl	$1, %edx
	addq	$4, %rax
	addq	$4, %rcx
	cmpl	%r11d, %edx
	jne	.L65
	addq	$102, %rbp
	cmpq	%r14, %rbp
	jne	.L63
.L62:
	addq	$10404, 24(%rsp)
	addq	$10506, %r14
	addq	$4, %r13
	subq	$41616, %r8
	addq	$4, 32(%rsp)
	addq	$41616, %r9
	addq	$41616, 40(%rsp)
	cmpq	48(%rsp), %r13
	jne	.L66
	movl	60(%rsp), %ebp
.L67:
	movl	$51, %r12d
	leaq	p(%rip), %rsi
	orq	$-1, %rax
	movq	%r12, %rcx
	movq	%rsi, %rdi
	rep stosq
	movq	%rcx, %r12
	testl	%ebx, %ebx
	js	.L60
	movslq	4(%rsp), %rax
	movslq	8(%rsp), %r9
	movslq	%ebx, %r12
	imulq	$41616, 16(%rsp), %r8
	imulq	$408, %rax, %rax
	imulq	$41616, %r9, %r11
	imulq	$10404, %r9, %r9
	addq	%rax, %r8
	leaq	4(%rsi), %rax
	addq	%r10, %r8
	leaq	(%rax,%r12,4), %r10
	leaq	dp1(%rip), %rax
	addq	%rax, %r11
	leaq	4(%rax), %r13
.L61:
	movslq	(%r8), %rax
	testl	%eax, %eax
	js	.L72
	addq	%r9, %rax
	movl	(%rsi), %ecx
	leaq	0(%r13,%rax,4), %rdi
	movq	%r11, %rax
.L69:
	movl	(%rax), %edx
	cmpl	%ecx, %edx
	jle	.L68
	movl	%edx, (%rsi)
	movl	%edx, %ecx
.L68:
	addq	$4, %rax
	cmpq	%rdi, %rax
	jne	.L69
.L72:
	addq	$4, %rsi
	addq	$4, %r8
	cmpq	%r10, %rsi
	jne	.L61
	leaq	dp3(%rip), %r8
	orl	$-1, %esi
	movl	$41616, %edx
	movq	%r8, %rdi
	call	memset@PLT
	movl	$51, %ecx
	movq	%rax, %r8
	xorl	%eax, %eax
	cmpl	$0, 12(%rsp)
	movq	%r8, %rdi
	rep stosq
	jle	.L77
	movq	%rdi, %r11
	xorl	%r13d, %r13d
	leal	1(%rbx), %r10d
.L73:
	movslq	%r13d, %rsi
	movq	%r11, %rdi
	xorl	%r9d, %r9d
	imulq	$102, %rsi, %rsi
.L76:
	leal	(%r9,%rbp), %edx
	leaq	p(%rip), %rcx
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L80:
	movl	%eax, %edx
.L75:
	cmpl	%ebx, %edx
	movl	%ebx, %eax
	cmovle	%edx, %eax
	cltq
	addq	%rsi, %rax
	movl	(%r8,%rax,4), %eax
	testl	%eax, %eax
	js	.L74
	movl	(%rcx), %r14d
	testl	%r14d, %r14d
	js	.L74
	addl	%r14d, %eax
	cmpl	%eax, (%rdi)
	jge	.L74
	movl	%eax, (%rdi)
	.p2align 4,,10
	.p2align 3
.L74:
	leal	-1(%rdx), %eax
	addq	$4, %rcx
	cmpl	%edx, %ebp
	jne	.L80
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r10d
	jne	.L76
	addl	$1, %r13d
	addq	$408, %r11
	cmpl	%r13d, 12(%rsp)
	jne	.L73
.L77:
	movslq	12(%rsp), %rax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	imulq	$102, %rax, %rax
	addq	%r12, %rax
	movl	(%r8,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L92
.L105:
	xorl	%eax, %eax
	jmp	.L32
.L79:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L46
.L60:
	leaq	dp3(%rip), %r8
	movl	$41616, %edx
	orl	$-1, %esi
	movq	%r8, %rdi
	call	memset@PLT
	movl	$51, %ecx
	movq	%rax, %rdi
	movq	%rax, %r8
	movq	%r12, %rax
	movslq	%ebx, %r12
	rep stosq
	jmp	.L77
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	ee
	.bss
	.align 32
	.type	ee, @object
	.size	ee, 408
ee:
	.zero	408
	.globl	dp3
	.align 32
	.type	dp3, @object
	.size	dp3, 41616
dp3:
	.zero	41616
	.globl	dp2
	.align 32
	.type	dp2, @object
	.size	dp2, 4244832
dp2:
	.zero	4244832
	.globl	dp1
	.align 32
	.type	dp1, @object
	.size	dp1, 4244832
dp1:
	.zero	4244832
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 408
p:
	.zero	408
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 408
a:
	.zero	408
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 408
h:
	.zero	408
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 408
c:
	.zero	408
	.globl	e
	.align 32
	.type	e, @object
	.size	e, 408
e:
	.zero	408
	.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 2578 Disciple Life is Hard
// 2018.3.16 bal4u

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

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

// library //

int e[102], c[102], h[102], a[102];
int p[102];
int dp1[102][102*102], dp2[102][102][102], dp3[102][102];
int ee[102];
int cmp(int *a, int *b) { return *a - *b; }

int main()
{
	int S, T, U, N, O, D, i, j, s, x;

	S = in(), T = in(), U = in(), N = in(), O = in(), D = in();
	for (i = 0; i < T; i++) ee[i] = e[i] = in(), c[i] = in();
	for (i = 0; i < N; i++) h[i] = in(), a[i] = in();

	qsort(ee, T, sizeof(int), cmp);
	s = 0; for (i = 0; i < U; i++) s += ee[i];
	if (s > S || S-(D-1)*(s-O) < s) { puts("-1"); return 0; }

	memset(dp1, -1, sizeof(dp1)), dp1[0][0] = 0;
	for (i = 1; i <= N; i++) for (j = 0; j <= 10000; j++) for (s = 0; s*a[i-1] <= j; s++) {
		if (dp1[i-1][j-s*a[i-1]] >= 0) {
			x = dp1[i-1][j-s*a[i-1]]+h[i-1]*s;
			if (dp1[i][j] < x) dp1[i][j] = x;
		}
	}

	memset(dp2, -1, sizeof(dp2)); dp2[0][0][0] = 0;
	for (i = 1; i <= T; i++) {
		dp2[i][0][0] = 0;
		for (j = 1; j <= i; j++) for (s = 0; s <= S; s++) {
			dp2[i][j][s] = dp2[i-1][j][s];
			if (s-e[i-1] >= 0 && dp2[i-1][j-1][s-e[i-1]] >= 0) {
				x = dp2[i-1][j-1][s-e[i-1]]+c[i-1];
				if (dp2[i][j][s] < x) dp2[i][j][s] = x;
			}
		}
	}

	memset(p, -1, sizeof(p));
    for (s = 0; s <= S; s++) for (i = 0; i <= dp2[T][U][s]; i++) if (p[s] < dp1[N][i]) p[s] = dp1[N][i];

	memset(dp3, -1, sizeof(dp3)), memset(dp3[0], 0, sizeof(dp3[0]));
	for (i = 1; i <= D; i++) for (s = 0; s <= S; s++) for (j = 0; j <= s; j++) {
		x = s-j+O; if (x > S) x = S;
		if (dp3[i-1][x] >= 0 && p[j] >= 0) {
			int t = dp3[i-1][x] + p[j];
			if (dp3[i][s] < t) dp3[i][s] = t;
		}
	}
	printf("%d\n", dp3[D][S]);
}

17 1 1 1 4 3
6 10
5 8
 8 1 1 1 4 3
6 14
5 8
 17 1 1 1 4 3
6 10
4 8
 17 1 1 1 4 3
6 14
5 4
 17 1 1 1 4 3
6 10
4 4
 17 1 1 1 4 3
6 14
10 4
 22 1 1 1 4 6
6 14
5 8
 30 1 1 1 4 5
6 14
5 8
 17 1 1 1 4 6
6 10
7 8
 17 1 1 1 4 1
6 10
5 8

15
 -1
 12
 45
 24
 90
 30
 25
 42
 5

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

```c
// AOJ 2578 Disciple Life is Hard
// 2018.3.16 bal4u

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

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

// library //

int e[102], c[102], h[102], a[102];
int p[102];
int dp1[102][102*102], dp2[102][102][102], dp3[102][102];
int ee[102];
int cmp(int *a, int *b) { return *a - *b; }

int main()
{
	int S, T, U, N, O, D, i, j, s, x;

	S = in(), T = in(), U = in(), N = in(), O = in(), D = in();
	for (i = 0; i < T; i++) ee[i] = e[i] = in(), c[i] = in();
	for (i = 0; i < N; i++) h[i] = in(), a[i] = in();

	qsort(ee, T, sizeof(int), cmp);
	s = 0; for (i = 0; i < U; i++) s += ee[i];
	if (s > S || S-(D-1)*(s-O) < s) { puts("-1"); return 0; }

	memset(dp1, -1, sizeof(dp1)), dp1[0][0] = 0;
	for (i = 1; i <= N; i++) for (j = 0; j <= 10000; j++) for (s = 0; s*a[i-1] <= j; s++) {
		if (dp1[i-1][j-s*a[i-1]] >= 0) {
			x = dp1[i-1][j-s*a[i-1]]+h[i-1]*s;
			if (dp1[i][j] < x) dp1[i][j] = x;
		}
	}

	memset(dp2, -1, sizeof(dp2)); dp2[0][0][0] = 0;
	for (i = 1; i <= T; i++) {
		dp2[i][0][0] = 0;
		for (j = 1; j <= i; j++) for (s = 0; s <= S; s++) {
			dp2[i][j][s] = dp2[i-1][j][s];
			if (s-e[i-1] >= 0 && dp2[i-1][j-1][s-e[i-1]] >= 0) {
				x = dp2[i-1][j-1][s-e[i-1]]+c[i-1];
				if (dp2[i][j][s] < x) dp2[i][j][s] = x;
			}
		}
	}

	memset(p, -1, sizeof(p));
    for (s = 0; s <= S; s++) for (i = 0; i <= dp2[T][U][s]; i++) if (p[s] < dp1[N][i]) p[s] = dp1[N][i];

	memset(dp3, -1, sizeof(dp3)), memset(dp3[0], 0, sizeof(dp3[0]));
	for (i = 1; i <= D; i++) for (s = 0; s <= S; s++) for (j = 0; j <= s; j++) {
		x = s-j+O; if (x > S) x = S;
		if (dp3[i-1][x] >= 0 && p[j] >= 0) {
			int t = dp3[i-1][x] + p[j];
			if (dp3[i][s] < t) dp3[i][s] = t;
		}
	}
	printf("%d\n", dp3[D][S]);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	e
	.bss
	.align 32
	.type	e, @object
	.size	e, 408
e:
	.zero	408
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 408
c:
	.zero	408
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 408
h:
	.zero	408
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 408
a:
	.zero	408
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 408
p:
	.zero	408
	.globl	dp1
	.align 32
	.type	dp1, @object
	.size	dp1, 4244832
dp1:
	.zero	4244832
	.globl	dp2
	.align 32
	.type	dp2, @object
	.size	dp2, 4244832
dp2:
	.zero	4244832
	.globl	dp3
	.align 32
	.type	dp3, @object
	.size	dp3, 41616
dp3:
	.zero	41616
	.globl	ee
	.align 32
	.type	ee, @object
	.size	ee, 408
ee:
	.zero	408
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"-1"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -20(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L7
.L8:
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ee(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -44(%rbp)
.L7:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L8
	movl	$0, -44(%rbp)
	jmp	.L9
.L10:
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -44(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	ee(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -36(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L11
.L12:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ee(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -36(%rbp)
	addl	$1, -44(%rbp)
.L11:
	movl	-44(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L12
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L13
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	subl	-12(%rbp), %eax
	imull	%eax, %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	%eax, -36(%rbp)
	jle	.L14
.L13:
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L15
.L14:
	movl	$4244832, %edx
	movl	$-1, %esi
	leaq	dp1(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp1(%rip)
	movl	$1, -44(%rbp)
	jmp	.L16
.L22:
	movl	$0, -40(%rbp)
	jmp	.L17
.L21:
	movl	$0, -36(%rbp)
	jmp	.L18
.L20:
	movl	-44(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L19
	movl	-44(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L19
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp1(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L19:
	addl	$1, -36(%rbp)
.L18:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L20
	addl	$1, -40(%rbp)
.L17:
	cmpl	$10000, -40(%rbp)
	jle	.L21
	addl	$1, -44(%rbp)
.L16:
	movl	-44(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L22
	movl	$4244832, %edx
	movl	$-1, %esi
	leaq	dp2(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp2(%rip)
	movl	$1, -44(%rbp)
	jmp	.L23
.L29:
	movl	-44(%rbp), %eax
	cltq
	imulq	$41616, %rax, %rax
	leaq	dp2(%rip), %rdx
	movl	$0, (%rax,%rdx)
	movl	$1, -40(%rbp)
	jmp	.L24
.L28:
	movl	$0, -36(%rbp)
	jmp	.L25
.L27:
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rsi
	movl	-44(%rbp), %edx
	movslq	%edx, %rcx
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10404, %rcx, %rcx
	imulq	$102, %rdx, %rdx
	addq	%rcx, %rdx
	addq	%rsi, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L26
	movl	-44(%rbp), %eax
	leal	-1(%rax), %esi
	movl	-40(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdi
	movslq	%esi, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L26
	movl	-44(%rbp), %eax
	leal	-1(%rax), %esi
	movl	-40(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdi
	movslq	%esi, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L26
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp2(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L26:
	addl	$1, -36(%rbp)
.L25:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L27
	addl	$1, -40(%rbp)
.L24:
	movl	-40(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L28
	addl	$1, -44(%rbp)
.L23:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L29
	movl	$408, %edx
	movl	$-1, %esi
	leaq	p(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -36(%rbp)
	jmp	.L30
.L34:
	movl	$0, -44(%rbp)
	jmp	.L31
.L33:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-44(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp1(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L32
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L32:
	addl	$1, -44(%rbp)
.L31:
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L33
	addl	$1, -36(%rbp)
.L30:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L34
	movl	$41616, %edx
	movl	$-1, %esi
	leaq	dp3(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$408, %edx
	movl	$0, %esi
	leaq	dp3(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -44(%rbp)
	jmp	.L35
.L42:
	movl	$0, -36(%rbp)
	jmp	.L36
.L41:
	movl	$0, -40(%rbp)
	jmp	.L37
.L40:
	movl	-36(%rbp), %eax
	subl	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L38
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
.L38:
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$102, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L39
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L39
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$102, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L39
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp3(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L39:
	addl	$1, -40(%rbp)
.L37:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L40
	addl	$1, -36(%rbp)
.L36:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L41
	addl	$1, -44(%rbp)
.L35:
	movl	-44(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L42
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	addl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	in, .-in
	.globl	e
	.bss
	.align 32
	.type	e, @object
	.size	e, 408
e:
	.zero	408
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 408
c:
	.zero	408
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 408
h:
	.zero	408
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 408
a:
	.zero	408
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 408
p:
	.zero	408
	.globl	dp1
	.align 32
	.type	dp1, @object
	.size	dp1, 4244832
dp1:
	.zero	4244832
	.globl	dp2
	.align 32
	.type	dp2, @object
	.size	dp2, 4244832
dp2:
	.zero	4244832
	.globl	dp3
	.align 32
	.type	dp3, @object
	.size	dp3, 41616
dp3:
	.zero	41616
	.globl	ee
	.align 32
	.type	ee, @object
	.size	ee, 408
ee:
	.zero	408
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"-1"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	$0, %eax
	call	in
	movl	%eax, -28(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -24(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -20(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -16(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -12(%rbp)
	movl	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L7
.L8:
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	e(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	ee(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	c(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -44(%rbp)
.L7:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L8
	movl	$0, -44(%rbp)
	jmp	.L9
.L10:
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
	call	in
	movl	-44(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -44(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jl	.L10
	movl	-24(%rbp), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	ee(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -36(%rbp)
	movl	$0, -44(%rbp)
	jmp	.L11
.L12:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ee(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -36(%rbp)
	addl	$1, -44(%rbp)
.L11:
	movl	-44(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L12
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	.L13
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	subl	-12(%rbp), %eax
	imull	%eax, %edx
	movl	-28(%rbp), %eax
	subl	%edx, %eax
	cmpl	%eax, -36(%rbp)
	jle	.L14
.L13:
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L15
.L14:
	movl	$4244832, %edx
	movl	$-1, %esi
	leaq	dp1(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp1(%rip)
	movl	$1, -44(%rbp)
	jmp	.L16
.L22:
	movl	$0, -40(%rbp)
	jmp	.L17
.L21:
	movl	$0, -36(%rbp)
	jmp	.L18
.L20:
	movl	-44(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L19
	movl	-44(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L19
	movl	-40(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp1(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L19:
	addl	$1, -36(%rbp)
.L18:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	imull	-36(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L20
	addl	$1, -40(%rbp)
.L17:
	cmpl	$10000, -40(%rbp)
	jle	.L21
	addl	$1, -44(%rbp)
.L16:
	movl	-44(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jle	.L22
	movl	$4244832, %edx
	movl	$-1, %esi
	leaq	dp2(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, dp2(%rip)
	movl	$1, -44(%rbp)
	jmp	.L23
.L29:
	movl	-44(%rbp), %eax
	cltq
	imulq	$41616, %rax, %rax
	leaq	dp2(%rip), %rdx
	movl	$0, (%rax,%rdx)
	movl	$1, -40(%rbp)
	jmp	.L24
.L28:
	movl	$0, -36(%rbp)
	jmp	.L25
.L27:
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rsi
	movl	-44(%rbp), %edx
	movslq	%edx, %rcx
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$10404, %rcx, %rcx
	imulq	$102, %rdx, %rdx
	addq	%rcx, %rdx
	addq	%rsi, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	dp2(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L26
	movl	-44(%rbp), %eax
	leal	-1(%rax), %esi
	movl	-40(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdi
	movslq	%esi, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L26
	movl	-44(%rbp), %eax
	leal	-1(%rax), %esi
	movl	-40(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	e(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	movslq	%eax, %rdi
	movslq	%esi, %rdx
	movslq	%ecx, %rax
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rdi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -32(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L26
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp2(%rip), %rdx
	movl	-32(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L26:
	addl	$1, -36(%rbp)
.L25:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L27
	addl	$1, -40(%rbp)
.L24:
	movl	-40(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L28
	addl	$1, -44(%rbp)
.L23:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L29
	movl	$408, %edx
	movl	$-1, %esi
	leaq	p(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -36(%rbp)
	jmp	.L30
.L34:
	movl	$0, -44(%rbp)
	jmp	.L31
.L33:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-44(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp1(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L32
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16(%rbp), %eax
	cltq
	imulq	$10404, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp1(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L32:
	addl	$1, -44(%rbp)
.L31:
	movl	-36(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$10404, %rdx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp2(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -44(%rbp)
	jle	.L33
	addl	$1, -36(%rbp)
.L30:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L34
	movl	$41616, %edx
	movl	$-1, %esi
	leaq	dp3(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$408, %edx
	movl	$0, %esi
	leaq	dp3(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$1, -44(%rbp)
	jmp	.L35
.L42:
	movl	$0, -36(%rbp)
	jmp	.L36
.L41:
	movl	$0, -40(%rbp)
	jmp	.L37
.L40:
	movl	-36(%rbp), %eax
	subl	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L38
	movl	-28(%rbp), %eax
	movl	%eax, -32(%rbp)
.L38:
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$102, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L39
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	js	.L39
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$102, %rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L39
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	dp3(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L39:
	addl	$1, -40(%rbp)
.L37:
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L40
	addl	$1, -36(%rbp)
.L36:
	movl	-36(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L41
	addl	$1, -44(%rbp)
.L35:
	movl	-44(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L42
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-8(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	dp3(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
