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

```c
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int N, v[110];
long long W, w[110], w0[110], w1[110], w2[110], w3[110];

long long max(int len, ...) {
    long long i, _max, num;
    va_list ap;
    va_start(ap, len);
 
    _max = va_arg(ap, long long);
    for (i = 1; i < len; i++) {
        num = va_arg(ap, long long);
        if (num > _max)
            _max = num;
    }
    va_end(ap);
    return _max;
}

int llcmp(const void *a, const void *b) {
    if (*(long long *)a < *(long long *)b) return 1;
    else if (*(long long *)a > *(long long *)b) return -1;
    else return 0;
}

int main(void) {
    int a, b, c, d, i, j, k, l, m;
    long long res, weight;
    scanf("%d%lld", &N, &W);
    for (i=0;i<N;i++) scanf("%lld%d", &w[i], &v[i]);

    j = 0; k = 0; l = 0; m = 0;
    for (i=0;i<N;i++) {
        if (w[i] == w[0]) w0[++j] = v[i];
        else if (w[i] == w[0]+1) w1[++k] = v[i];
        else if (w[i] == w[0]+2) w2[++l] = v[i];
        else w3[++m] = v[i];
    }
    qsort(w0+1,j,sizeof(long long),llcmp);
    qsort(w1+1,k,sizeof(long long),llcmp);
    qsort(w2+1,l,sizeof(long long),llcmp);
    qsort(w3+1,m,sizeof(long long),llcmp);
    for (a=1;a<=j;a++) w0[a] += w0[a-1];
    for (b=1;b<=k;b++) w1[b] += w1[b-1];
    for (c=1;c<=l;c++) w2[c] += w2[c-1];
    for (d=1;d<=m;d++) w3[d] += w3[d-1]; 
    res = 0; weight = 0;
    for (a=0;a<=j;a++) for (b=0;b<=k;b++) for (c=0;c<=l;c++) for (d=0;d<=m;d++) {
        weight = w[0]*a + (w[0]+1)*b + (w[0]+2)*c + (w[0]+3)*d;
        if (weight <= W) res = max(2,res,w0[a]+w1[b]+w2[c]+w3[d]);
    }

    printf("%lld\n", res);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 440
v:
	.zero	440
	.globl	W
	.align 8
	.type	W, @object
	.size	W, 8
W:
	.zero	8
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 880
w:
	.zero	880
	.globl	w0
	.align 32
	.type	w0, @object
	.size	w0, 880
w0:
	.zero	880
	.globl	w1
	.align 32
	.type	w1, @object
	.size	w1, 880
w1:
	.zero	880
	.globl	w2
	.align 32
	.type	w2, @object
	.size	w2, 880
w2:
	.zero	880
	.globl	w3
	.align 32
	.type	w3, @object
	.size	w3, 880
w3:
	.zero	880
	.text
	.globl	max
	.type	max, @function
max:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$256, %rsp
	movl	%edi, -244(%rbp)
	movq	%rsi, -168(%rbp)
	movq	%rdx, -160(%rbp)
	movq	%rcx, -152(%rbp)
	movq	%r8, -144(%rbp)
	movq	%r9, -136(%rbp)
	testb	%al, %al
	je	.L2
	movaps	%xmm0, -128(%rbp)
	movaps	%xmm1, -112(%rbp)
	movaps	%xmm2, -96(%rbp)
	movaps	%xmm3, -80(%rbp)
	movaps	%xmm4, -64(%rbp)
	movaps	%xmm5, -48(%rbp)
	movaps	%xmm6, -32(%rbp)
	movaps	%xmm7, -16(%rbp)
.L2:
	movq	%fs:40, %rax
	movq	%rax, -184(%rbp)
	xorl	%eax, %eax
	movl	$8, -208(%rbp)
	movl	$48, -204(%rbp)
	leaq	16(%rbp), %rax
	movq	%rax, -200(%rbp)
	leaq	-176(%rbp), %rax
	movq	%rax, -192(%rbp)
	movl	-208(%rbp), %eax
	cmpl	$47, %eax
	ja	.L3
	movq	-192(%rbp), %rax
	movl	-208(%rbp), %edx
	movl	%edx, %edx
	addq	%rdx, %rax
	movl	-208(%rbp), %edx
	addl	$8, %edx
	movl	%edx, -208(%rbp)
	jmp	.L4
.L3:
	movq	-200(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	%rdx, -200(%rbp)
.L4:
	movq	(%rax), %rax
	movq	%rax, -224(%rbp)
	movq	$1, -232(%rbp)
	jmp	.L5
.L9:
	movl	-208(%rbp), %eax
	cmpl	$47, %eax
	ja	.L6
	movq	-192(%rbp), %rax
	movl	-208(%rbp), %edx
	movl	%edx, %edx
	addq	%rdx, %rax
	movl	-208(%rbp), %edx
	addl	$8, %edx
	movl	%edx, -208(%rbp)
	jmp	.L7
.L6:
	movq	-200(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	%rdx, -200(%rbp)
.L7:
	movq	(%rax), %rax
	movq	%rax, -216(%rbp)
	movq	-216(%rbp), %rax
	cmpq	-224(%rbp), %rax
	jle	.L8
	movq	-216(%rbp), %rax
	movq	%rax, -224(%rbp)
.L8:
	addq	$1, -232(%rbp)
.L5:
	movl	-244(%rbp), %eax
	cltq
	cmpq	%rax, -232(%rbp)
	jl	.L9
	movq	-224(%rbp), %rax
	movq	-184(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	max, .-max
	.globl	llcmp
	.type	llcmp, @function
llcmp:
.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
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L13
	movl	$1, %eax
	jmp	.L14
.L13:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L15
	movl	$-1, %eax
	jmp	.L14
.L15:
	movl	$0, %eax
.L14:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	llcmp, .-llcmp
	.section	.rodata
.LC0:
	.string	"%d%lld"
.LC1:
	.string	"%lld%d"
.LC2:
	.string	"%lld\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	$64, %rsp
	leaq	W(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L17
.L18:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	w(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L17:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L18
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L19
.L24:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	w(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L20
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -32(%rbp)
	cltq
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L21
.L20:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	w(%rip), %rdx
	addq	$1, %rdx
	cmpq	%rdx, %rax
	jne	.L22
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -28(%rbp)
	cltq
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w1(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L21
.L22:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	w(%rip), %rdx
	addq	$2, %rdx
	cmpq	%rdx, %rax
	jne	.L23
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -24(%rbp)
	cltq
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L21
.L23:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -20(%rbp)
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w3(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L21:
	addl	$1, -36(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L24
	movl	-32(%rbp), %eax
	cltq
	leaq	8+w0(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	8+w1(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-24(%rbp), %eax
	cltq
	leaq	8+w2(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	8+w3(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	$1, -52(%rbp)
	jmp	.L25
.L26:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-52(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -52(%rbp)
.L25:
	movl	-52(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L26
	movl	$1, -48(%rbp)
	jmp	.L27
.L28:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-48(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -48(%rbp)
.L27:
	movl	-48(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L28
	movl	$1, -44(%rbp)
	jmp	.L29
.L30:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L29:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L30
	movl	$1, -40(%rbp)
	jmp	.L31
.L32:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -40(%rbp)
.L31:
	movl	-40(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L32
	movq	$0, -16(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L33
.L41:
	movl	$0, -48(%rbp)
	jmp	.L34
.L40:
	movl	$0, -44(%rbp)
	jmp	.L35
.L39:
	movl	$0, -40(%rbp)
	jmp	.L36
.L38:
	movq	w(%rip), %rdx
	movl	-52(%rbp), %eax
	cltq
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movq	w(%rip), %rax
	leaq	1(%rax), %rdx
	movl	-48(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, %rcx
	movq	w(%rip), %rax
	leaq	2(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, %rcx
	movq	w(%rip), %rax
	leaq	3(%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -8(%rbp)
	movq	W(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jg	.L37
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	movl	$2, %edi
	movl	$0, %eax
	call	max
	movq	%rax, -16(%rbp)
.L37:
	addl	$1, -40(%rbp)
.L36:
	movl	-40(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L38
	addl	$1, -44(%rbp)
.L35:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L39
	addl	$1, -48(%rbp)
.L34:
	movl	-48(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L40
	addl	$1, -52(%rbp)
.L33:
	movl	-52(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L41
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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	llcmp
	.type	llcmp, @function
llcmp:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jl	.L1
	setg	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE52:
	.size	llcmp, .-llcmp
	.p2align 4
	.type	max.constprop.0, @function
max.constprop.0:
.LFB54:
	.cfi_startproc
	subq	$88, %rsp
	.cfi_def_cfa_offset 96
	movq	%rsi, 40(%rsp)
	movq	%rdx, 48(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	96(%rsp), %rax
	movl	$8, (%rsp)
	cmpq	%rdx, %rsi
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 16(%rsp)
	movq	%rsi, %rax
	cmovl	%rdx, %rax
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L13
	addq	$88, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	max.constprop.0, .-max.constprop.0
	.section	.text.unlikely,"ax",@progbits
.LCOLDB0:
	.text
.LHOTB0:
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$88, %rsp
	.cfi_def_cfa_offset 96
	movslq	%edi, %rdi
	movq	%r9, 72(%rsp)
	leaq	32(%rsp), %r9
	movq	%rsi, 40(%rsp)
	movq	%rdx, 48(%rsp)
	movq	%rcx, 56(%rsp)
	movq	%r8, 64(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	96(%rsp), %rax
	movq	%r9, 16(%rsp)
	movq	%rax, 8(%rsp)
	movq	%rsi, %rax
	movl	$16, (%rsp)
	cmpl	$1, %edi
	jle	.L14
	movl	$16, %ecx
	leaq	96(%rsp), %r8
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	$47, %ecx
	ja	.L18
	movl	%ecx, %esi
	addl	$8, %ecx
	movq	(%r9,%rsi), %rsi
	cmpq	%rsi, %rax
	cmovl	%rsi, %rax
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	jne	.L19
	.p2align 4,,10
	.p2align 3
.L14:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L31
	addq	$88, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movq	(%r8), %rcx
	leaq	8(%r8), %rsi
	cmpq	%rcx, %rax
	cmovl	%rcx, %rax
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	jne	.L21
	jmp	.L14
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	max.cold, @function
max.cold:
.LFSB51:
.L21:
	.cfi_def_cfa_offset 96
	movq	%rsi, 8(%rsp)
.L24:
	movq	%rsi, %rcx
	addq	$8, %rsi
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	cmovl	%rcx, %rax
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	jg	.L24
	jmp	.L14
	.cfi_endproc
.LFE51:
	.text
	.size	max, .-max
	.section	.text.unlikely
	.size	max.cold, .-max.cold
.LCOLDE0:
	.text
.LHOTE0:
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%lld"
.LC2:
	.string	"%lld%d"
.LC3:
	.string	"%lld\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
	leaq	W(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC1(%rip), %rdi
	leaq	w(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L33
	leaq	w(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	v(%rip), %r15
	movq	%rbx, %r14
	movq	%rbx, %r13
	leaq	.LC2(%rip), %rcx
.L34:
	leaq	(%r15,%r12,4), %rdx
	movq	%r13, %rsi
	movq	%rcx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addq	$1, %r12
	movl	N(%rip), %eax
	addq	$8, %r13
	leaq	v(%rip), %rbp
	leaq	.LC2(%rip), %rcx
	cmpl	%r12d, %eax
	jg	.L34
	testl	%eax, %eax
	jle	.L33
	movq	w(%rip), %rdx
	leal	-1(%rax), %ecx
	xorl	%r15d, %r15d
	xorl	%r10d, %r10d
	leaq	8+w(%rip), %rax
	movl	$0, 24(%rsp)
	leaq	w0(%rip), %r11
	movl	$0, 28(%rsp)
	leaq	1(%rdx), %r12
	leaq	2(%rdx), %r13
	leaq	(%rax,%rcx,8), %r8
	leaq	w1(%rip), %r9
	leaq	w3(%rip), %rdi
	leaq	w2(%rip), %rsi
	jmp	.L39
.L35:
	cmpq	%r12, %rcx
	je	.L73
	cmpq	%r13, %rcx
	je	.L74
	addl	$1, %r15d
	movslq	%r15d, %rcx
	movq	%rax, (%rdi,%rcx,8)
.L36:
	addq	$8, %rbx
	addq	$4, %rbp
	cmpq	%rbx, %r8
	je	.L75
.L39:
	movq	(%rbx), %rcx
	movslq	0(%rbp), %rax
	cmpq	%rdx, %rcx
	jne	.L35
	addl	$1, 28(%rsp)
	movslq	28(%rsp), %rcx
	addq	$8, %rbx
	addq	$4, %rbp
	movq	%rax, (%r11,%rcx,8)
	cmpq	%rbx, %r8
	jne	.L39
.L75:
	leaq	llcmp(%rip), %r12
	movslq	28(%rsp), %rsi
	movl	$8, %edx
	movl	%r10d, %r13d
	leaq	8+w0(%rip), %rbx
	movq	%r12, %rcx
	movl	%r10d, 20(%rsp)
	movq	%rbx, %rdi
	movq	%rsi, %rbp
	call	qsort@PLT
	movslq	24(%rsp), %rsi
	movq	%r12, %rcx
	movl	$8, %edx
	leaq	8+w1(%rip), %rdi
	call	qsort@PLT
	movslq	%r13d, %rsi
	movq	%r12, %rcx
	movl	$8, %edx
	leaq	8+w2(%rip), %rdi
	call	qsort@PLT
	movslq	%r15d, %rax
	movq	%r12, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	8+w3(%rip), %rdi
	call	qsort@PLT
	testl	%ebp, %ebp
	je	.L40
	leal	-1(%rbp), %edx
	leaq	8(%rbx), %rsi
	movq	w0(%rip), %rcx
	movq	%rbx, %rax
	leaq	(%rsi,%rdx,8), %rdx
.L41:
	addq	(%rax), %rcx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	cmpq	%rax, %rdx
	jne	.L41
.L40:
	movl	24(%rsp), %edx
	testl	%edx, %edx
	je	.L46
	movl	24(%rsp), %esi
	leaq	8+w1(%rip), %rax
	movq	w1(%rip), %rcx
	leal	-1(%rsi), %edx
	leaq	8(%rax), %rsi
	leaq	(%rsi,%rdx,8), %rdx
.L45:
	addq	(%rax), %rcx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	cmpq	%rax, %rdx
	jne	.L45
.L46:
	movl	20(%rsp), %eax
	testl	%eax, %eax
	je	.L44
	movl	20(%rsp), %esi
	leaq	8+w2(%rip), %rax
	movq	w2(%rip), %rcx
	leal	-1(%rsi), %edx
	leaq	8(%rax), %rsi
	leaq	(%rsi,%rdx,8), %rdx
.L49:
	addq	(%rax), %rcx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	cmpq	%rax, %rdx
	jne	.L49
.L44:
	testl	%r15d, %r15d
	je	.L48
	leaq	8+w3(%rip), %rax
	leal	-1(%r15), %edx
	movq	w3(%rip), %rcx
	leaq	8(%rax), %rsi
	leaq	(%rsi,%rdx,8), %rdx
.L51:
	addq	(%rax), %rcx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	cmpq	%rax, %rdx
	jne	.L51
.L48:
	leaq	w0(%rip), %rax
	movq	%r14, %r12
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	movq	%rax, 8(%rsp)
	movl	%r15d, %r14d
.L50:
	leaq	w1(%rip), %r10
	movq	%r12, %r9
	xorl	%r15d, %r15d
	movq	%r10, %r12
	.p2align 4,,10
	.p2align 3
.L58:
	movq	%r15, %rax
	xorl	%ebp, %ebp
	movq	%r13, %r15
	movq	%r12, %r13
	movq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L56:
	movq	%r13, %rcx
	xorl	%ebx, %ebx
	movq	%r9, %r13
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L52:
	addq	$1, %rbx
	cmpl	%ebx, %r14d
	jl	.L76
.L53:
	movq	0(%r13), %rdx
	leaq	1(%rdx), %rax
	movq	%rdx, %rdi
	imulq	%r15, %rdi
	imulq	%r12, %rax
	addq	%rdi, %rax
	leaq	2(%rdx), %rdi
	addq	$3, %rdx
	imulq	%rbp, %rdi
	imulq	%rbx, %rdx
	addq	%rdi, %rax
	addq	%rdx, %rax
	cmpq	%rax, W(%rip)
	jl	.L52
	movq	8(%rsp), %rax
	movq	(%rcx), %rdx
	movl	$2, %edi
	movq	%rcx, (%rsp)
	addq	(%rax), %rdx
	leaq	w2(%rip), %rax
	addq	(%rax,%rbp,8), %rdx
	leaq	w3(%rip), %rax
	addq	(%rax,%rbx,8), %rdx
	xorl	%eax, %eax
	addq	$1, %rbx
	call	max.constprop.0
	movq	(%rsp), %rcx
	movq	%rax, %rsi
	cmpl	%ebx, %r14d
	jge	.L53
.L76:
	movq	%r13, %r9
	addq	$1, %rbp
	movq	%rcx, %r13
	cmpl	%ebp, 20(%rsp)
	jge	.L56
	movq	%r12, %rax
	movq	%r15, %r13
	movq	%rcx, %r12
	movq	%rax, %r15
	addq	$8, %r12
	addq	$1, %r15
	cmpl	%r15d, 24(%rsp)
	jge	.L58
	addq	$8, 8(%rsp)
	movq	%r9, %r12
	addq	$1, %r13
	cmpl	%r13d, 28(%rsp)
	jge	.L50
	movq	%rsi, %rdx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	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
.L73:
	.cfi_restore_state
	addl	$1, 24(%rsp)
	movslq	24(%rsp), %rcx
	movq	%rax, (%r9,%rcx,8)
	jmp	.L36
.L74:
	addl	$1, %r10d
	movslq	%r10d, %rcx
	movq	%rax, (%rsi,%rcx,8)
	jmp	.L36
.L33:
	leaq	llcmp(%rip), %r12
	movl	$8, %edx
	xorl	%esi, %esi
	xorl	%r15d, %r15d
	movq	%r12, %rcx
	leaq	8+w0(%rip), %rdi
	call	qsort@PLT
	movq	%r12, %rcx
	movl	$8, %edx
	xorl	%esi, %esi
	leaq	8+w1(%rip), %rdi
	call	qsort@PLT
	movq	%r12, %rcx
	movl	$8, %edx
	xorl	%esi, %esi
	leaq	8+w2(%rip), %rdi
	call	qsort@PLT
	movq	%r12, %rcx
	movl	$8, %edx
	xorl	%esi, %esi
	leaq	8+w3(%rip), %rdi
	call	qsort@PLT
	movl	$0, 24(%rsp)
	movl	$0, 28(%rsp)
	movl	$0, 20(%rsp)
	jmp	.L48
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	w3
	.bss
	.align 32
	.type	w3, @object
	.size	w3, 880
w3:
	.zero	880
	.globl	w2
	.align 32
	.type	w2, @object
	.size	w2, 880
w2:
	.zero	880
	.globl	w1
	.align 32
	.type	w1, @object
	.size	w1, 880
w1:
	.zero	880
	.globl	w0
	.align 32
	.type	w0, @object
	.size	w0, 880
w0:
	.zero	880
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 880
w:
	.zero	880
	.globl	W
	.align 8
	.type	W, @object
	.size	W, 8
W:
	.zero	8
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 440
v:
	.zero	440
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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	llcmp
	.type	llcmp, @function
llcmp:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rdx
	movl	$1, %eax
	cmpq	%rdx, (%rdi)
	jl	.L1
	setg	%al
	movzbl	%al, %eax
	negl	%eax
.L1:
	ret
	.cfi_endproc
.LFE52:
	.size	llcmp, .-llcmp
	.p2align 4
	.type	max.constprop.0, @function
max.constprop.0:
.LFB54:
	.cfi_startproc
	subq	$88, %rsp
	.cfi_def_cfa_offset 96
	movq	%rsi, 40(%rsp)
	movq	%rdx, 48(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	96(%rsp), %rax
	movl	$8, (%rsp)
	cmpq	%rdx, %rsi
	movq	%rax, 8(%rsp)
	leaq	32(%rsp), %rax
	movq	%rax, 16(%rsp)
	movq	%rsi, %rax
	cmovl	%rdx, %rax
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L13
	addq	$88, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE54:
	.size	max.constprop.0, .-max.constprop.0
	.section	.text.unlikely,"ax",@progbits
.LCOLDB0:
	.text
.LHOTB0:
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB51:
	.cfi_startproc
	endbr64
	subq	$88, %rsp
	.cfi_def_cfa_offset 96
	movslq	%edi, %rdi
	movq	%r9, 72(%rsp)
	leaq	32(%rsp), %r9
	movq	%rsi, 40(%rsp)
	movq	%rdx, 48(%rsp)
	movq	%rcx, 56(%rsp)
	movq	%r8, 64(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	96(%rsp), %rax
	movq	%r9, 16(%rsp)
	movq	%rax, 8(%rsp)
	movq	%rsi, %rax
	movl	$16, (%rsp)
	cmpl	$1, %edi
	jle	.L14
	movl	$16, %ecx
	leaq	96(%rsp), %r8
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L19:
	cmpl	$47, %ecx
	ja	.L18
	movl	%ecx, %esi
	addl	$8, %ecx
	movq	(%r9,%rsi), %rsi
	cmpq	%rsi, %rax
	cmovl	%rsi, %rax
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	jne	.L19
	.p2align 4,,10
	.p2align 3
.L14:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L31
	addq	$88, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	movq	(%r8), %rcx
	leaq	8(%r8), %rsi
	cmpq	%rcx, %rax
	cmovl	%rcx, %rax
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	jne	.L21
	jmp	.L14
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	max.cold, @function
max.cold:
.LFSB51:
.L21:
	.cfi_def_cfa_offset 96
	movq	%rsi, 8(%rsp)
.L24:
	movq	%rsi, %rcx
	addq	$8, %rsi
	movq	(%rcx), %rcx
	cmpq	%rcx, %rax
	cmovl	%rcx, %rax
	addq	$1, %rdx
	cmpq	%rdx, %rdi
	jg	.L24
	jmp	.L14
	.cfi_endproc
.LFE51:
	.text
	.size	max, .-max
	.section	.text.unlikely
	.size	max.cold, .-max.cold
.LCOLDE0:
	.text
.LHOTE0:
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d%lld"
.LC2:
	.string	"%lld%d"
.LC3:
	.string	"%lld\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
	leaq	W(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC1(%rip), %rdi
	leaq	w(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L33
	leaq	w(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	v(%rip), %r15
	movq	%rbx, %r14
	movq	%rbx, %r13
	leaq	.LC2(%rip), %rcx
.L34:
	leaq	(%r15,%r12,4), %rdx
	movq	%r13, %rsi
	movq	%rcx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	addq	$1, %r12
	movl	N(%rip), %eax
	addq	$8, %r13
	leaq	v(%rip), %rbp
	leaq	.LC2(%rip), %rcx
	cmpl	%r12d, %eax
	jg	.L34
	testl	%eax, %eax
	jle	.L33
	movq	w(%rip), %rdx
	leal	-1(%rax), %ecx
	xorl	%r15d, %r15d
	xorl	%r10d, %r10d
	leaq	8+w(%rip), %rax
	movl	$0, 24(%rsp)
	leaq	w0(%rip), %r11
	movl	$0, 28(%rsp)
	leaq	1(%rdx), %r12
	leaq	2(%rdx), %r13
	leaq	(%rax,%rcx,8), %r8
	leaq	w1(%rip), %r9
	leaq	w3(%rip), %rdi
	leaq	w2(%rip), %rsi
	jmp	.L39
.L35:
	cmpq	%r12, %rcx
	je	.L73
	cmpq	%r13, %rcx
	je	.L74
	addl	$1, %r15d
	movslq	%r15d, %rcx
	movq	%rax, (%rdi,%rcx,8)
.L36:
	addq	$8, %rbx
	addq	$4, %rbp
	cmpq	%rbx, %r8
	je	.L75
.L39:
	movq	(%rbx), %rcx
	movslq	0(%rbp), %rax
	cmpq	%rdx, %rcx
	jne	.L35
	addl	$1, 28(%rsp)
	movslq	28(%rsp), %rcx
	addq	$8, %rbx
	addq	$4, %rbp
	movq	%rax, (%r11,%rcx,8)
	cmpq	%rbx, %r8
	jne	.L39
.L75:
	leaq	llcmp(%rip), %r12
	movslq	28(%rsp), %rsi
	movl	$8, %edx
	movl	%r10d, %r13d
	leaq	8+w0(%rip), %rbx
	movq	%r12, %rcx
	movl	%r10d, 20(%rsp)
	movq	%rbx, %rdi
	movq	%rsi, %rbp
	call	qsort@PLT
	movslq	24(%rsp), %rsi
	movq	%r12, %rcx
	movl	$8, %edx
	leaq	8+w1(%rip), %rdi
	call	qsort@PLT
	movslq	%r13d, %rsi
	movq	%r12, %rcx
	movl	$8, %edx
	leaq	8+w2(%rip), %rdi
	call	qsort@PLT
	movslq	%r15d, %rax
	movq	%r12, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	8+w3(%rip), %rdi
	call	qsort@PLT
	testl	%ebp, %ebp
	je	.L40
	leal	-1(%rbp), %edx
	leaq	8(%rbx), %rsi
	movq	w0(%rip), %rcx
	movq	%rbx, %rax
	leaq	(%rsi,%rdx,8), %rdx
.L41:
	addq	(%rax), %rcx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	cmpq	%rax, %rdx
	jne	.L41
.L40:
	movl	24(%rsp), %edx
	testl	%edx, %edx
	je	.L46
	movl	24(%rsp), %esi
	leaq	8+w1(%rip), %rax
	movq	w1(%rip), %rcx
	leal	-1(%rsi), %edx
	leaq	8(%rax), %rsi
	leaq	(%rsi,%rdx,8), %rdx
.L45:
	addq	(%rax), %rcx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	cmpq	%rax, %rdx
	jne	.L45
.L46:
	movl	20(%rsp), %eax
	testl	%eax, %eax
	je	.L44
	movl	20(%rsp), %esi
	leaq	8+w2(%rip), %rax
	movq	w2(%rip), %rcx
	leal	-1(%rsi), %edx
	leaq	8(%rax), %rsi
	leaq	(%rsi,%rdx,8), %rdx
.L49:
	addq	(%rax), %rcx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	cmpq	%rax, %rdx
	jne	.L49
.L44:
	testl	%r15d, %r15d
	je	.L48
	leaq	8+w3(%rip), %rax
	leal	-1(%r15), %edx
	movq	w3(%rip), %rcx
	leaq	8(%rax), %rsi
	leaq	(%rsi,%rdx,8), %rdx
.L51:
	addq	(%rax), %rcx
	addq	$8, %rax
	movq	%rcx, -8(%rax)
	cmpq	%rax, %rdx
	jne	.L51
.L48:
	leaq	w0(%rip), %rax
	movq	%r14, %r12
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	movq	%rax, 8(%rsp)
	movl	%r15d, %r14d
.L50:
	leaq	w1(%rip), %r10
	movq	%r12, %r9
	xorl	%r15d, %r15d
	movq	%r10, %r12
	.p2align 4,,10
	.p2align 3
.L58:
	movq	%r15, %rax
	xorl	%ebp, %ebp
	movq	%r13, %r15
	movq	%r12, %r13
	movq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L56:
	movq	%r13, %rcx
	xorl	%ebx, %ebx
	movq	%r9, %r13
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L52:
	addq	$1, %rbx
	cmpl	%ebx, %r14d
	jl	.L76
.L53:
	movq	0(%r13), %rdx
	leaq	1(%rdx), %rax
	movq	%rdx, %rdi
	imulq	%r15, %rdi
	imulq	%r12, %rax
	addq	%rdi, %rax
	leaq	2(%rdx), %rdi
	addq	$3, %rdx
	imulq	%rbp, %rdi
	imulq	%rbx, %rdx
	addq	%rdi, %rax
	addq	%rdx, %rax
	cmpq	%rax, W(%rip)
	jl	.L52
	movq	8(%rsp), %rax
	movq	(%rcx), %rdx
	movl	$2, %edi
	movq	%rcx, (%rsp)
	addq	(%rax), %rdx
	leaq	w2(%rip), %rax
	addq	(%rax,%rbp,8), %rdx
	leaq	w3(%rip), %rax
	addq	(%rax,%rbx,8), %rdx
	xorl	%eax, %eax
	addq	$1, %rbx
	call	max.constprop.0
	movq	(%rsp), %rcx
	movq	%rax, %rsi
	cmpl	%ebx, %r14d
	jge	.L53
.L76:
	movq	%r13, %r9
	addq	$1, %rbp
	movq	%rcx, %r13
	cmpl	%ebp, 20(%rsp)
	jge	.L56
	movq	%r12, %rax
	movq	%r15, %r13
	movq	%rcx, %r12
	movq	%rax, %r15
	addq	$8, %r12
	addq	$1, %r15
	cmpl	%r15d, 24(%rsp)
	jge	.L58
	addq	$8, 8(%rsp)
	movq	%r9, %r12
	addq	$1, %r13
	cmpl	%r13d, 28(%rsp)
	jge	.L50
	movq	%rsi, %rdx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	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
.L73:
	.cfi_restore_state
	addl	$1, 24(%rsp)
	movslq	24(%rsp), %rcx
	movq	%rax, (%r9,%rcx,8)
	jmp	.L36
.L74:
	addl	$1, %r10d
	movslq	%r10d, %rcx
	movq	%rax, (%rsi,%rcx,8)
	jmp	.L36
.L33:
	leaq	llcmp(%rip), %r12
	movl	$8, %edx
	xorl	%esi, %esi
	xorl	%r15d, %r15d
	movq	%r12, %rcx
	leaq	8+w0(%rip), %rdi
	call	qsort@PLT
	movq	%r12, %rcx
	movl	$8, %edx
	xorl	%esi, %esi
	leaq	8+w1(%rip), %rdi
	call	qsort@PLT
	movq	%r12, %rcx
	movl	$8, %edx
	xorl	%esi, %esi
	leaq	8+w2(%rip), %rdi
	call	qsort@PLT
	movq	%r12, %rcx
	movl	$8, %edx
	xorl	%esi, %esi
	leaq	8+w3(%rip), %rdi
	call	qsort@PLT
	movl	$0, 24(%rsp)
	movl	$0, 28(%rsp)
	movl	$0, 20(%rsp)
	jmp	.L48
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	w3
	.bss
	.align 32
	.type	w3, @object
	.size	w3, 880
w3:
	.zero	880
	.globl	w2
	.align 32
	.type	w2, @object
	.size	w2, 880
w2:
	.zero	880
	.globl	w1
	.align 32
	.type	w1, @object
	.size	w1, 880
w1:
	.zero	880
	.globl	w0
	.align 32
	.type	w0, @object
	.size	w0, 880
w0:
	.zero	880
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 880
w:
	.zero	880
	.globl	W
	.align 8
	.type	W, @object
	.size	W, 8
W:
	.zero	8
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 440
v:
	.zero	440
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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:

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

int N, v[110];
long long W, w[110], w0[110], w1[110], w2[110], w3[110];

long long max(int len, ...) {
    long long i, _max, num;
    va_list ap;
    va_start(ap, len);
 
    _max = va_arg(ap, long long);
    for (i = 1; i < len; i++) {
        num = va_arg(ap, long long);
        if (num > _max)
            _max = num;
    }
    va_end(ap);
    return _max;
}

int llcmp(const void *a, const void *b) {
    if (*(long long *)a < *(long long *)b) return 1;
    else if (*(long long *)a > *(long long *)b) return -1;
    else return 0;
}

int main(void) {
    int a, b, c, d, i, j, k, l, m;
    long long res, weight;
    scanf("%d%lld", &N, &W);
    for (i=0;i<N;i++) scanf("%lld%d", &w[i], &v[i]);

    j = 0; k = 0; l = 0; m = 0;
    for (i=0;i<N;i++) {
        if (w[i] == w[0]) w0[++j] = v[i];
        else if (w[i] == w[0]+1) w1[++k] = v[i];
        else if (w[i] == w[0]+2) w2[++l] = v[i];
        else w3[++m] = v[i];
    }
    qsort(w0+1,j,sizeof(long long),llcmp);
    qsort(w1+1,k,sizeof(long long),llcmp);
    qsort(w2+1,l,sizeof(long long),llcmp);
    qsort(w3+1,m,sizeof(long long),llcmp);
    for (a=1;a<=j;a++) w0[a] += w0[a-1];
    for (b=1;b<=k;b++) w1[b] += w1[b-1];
    for (c=1;c<=l;c++) w2[c] += w2[c-1];
    for (d=1;d<=m;d++) w3[d] += w3[d-1]; 
    res = 0; weight = 0;
    for (a=0;a<=j;a++) for (b=0;b<=k;b++) for (c=0;c<=l;c++) for (d=0;d<=m;d++) {
        weight = w[0]*a + (w[0]+1)*b + (w[0]+2)*c + (w[0]+3)*d;
        if (weight <= W) res = max(2,res,w0[a]+w1[b]+w2[c]+w3[d]);
    }

    printf("%lld\n", res);

    return 0;
}
4 10
1 100
2 100
1 100
1 100
 4 1
10 100
10 100
10 101
10 100
 4 6
2 1
3 6
4 10
3 4
 4 10
1 000
1 100
1 100
1 100
 4 6
2 1
3 7
4 10
3 9
 4 12
2 1
3 4
4 10
3 4
 4 6
2 1
3 6
4 8
3 4
 4 6
2 1
3 6
4 10
3 9
 4 10
1 100
4 100
1 101
1 100
 4 6
2 1
3 6
2 8
3 4

400
 0
 11
 300
 16
 19
 10
 15
 401
 14

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

```c
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int N, v[110];
long long W, w[110], w0[110], w1[110], w2[110], w3[110];

long long max(int len, ...) {
    long long i, _max, num;
    va_list ap;
    va_start(ap, len);
 
    _max = va_arg(ap, long long);
    for (i = 1; i < len; i++) {
        num = va_arg(ap, long long);
        if (num > _max)
            _max = num;
    }
    va_end(ap);
    return _max;
}

int llcmp(const void *a, const void *b) {
    if (*(long long *)a < *(long long *)b) return 1;
    else if (*(long long *)a > *(long long *)b) return -1;
    else return 0;
}

int main(void) {
    int a, b, c, d, i, j, k, l, m;
    long long res, weight;
    scanf("%d%lld", &N, &W);
    for (i=0;i<N;i++) scanf("%lld%d", &w[i], &v[i]);

    j = 0; k = 0; l = 0; m = 0;
    for (i=0;i<N;i++) {
        if (w[i] == w[0]) w0[++j] = v[i];
        else if (w[i] == w[0]+1) w1[++k] = v[i];
        else if (w[i] == w[0]+2) w2[++l] = v[i];
        else w3[++m] = v[i];
    }
    qsort(w0+1,j,sizeof(long long),llcmp);
    qsort(w1+1,k,sizeof(long long),llcmp);
    qsort(w2+1,l,sizeof(long long),llcmp);
    qsort(w3+1,m,sizeof(long long),llcmp);
    for (a=1;a<=j;a++) w0[a] += w0[a-1];
    for (b=1;b<=k;b++) w1[b] += w1[b-1];
    for (c=1;c<=l;c++) w2[c] += w2[c-1];
    for (d=1;d<=m;d++) w3[d] += w3[d-1]; 
    res = 0; weight = 0;
    for (a=0;a<=j;a++) for (b=0;b<=k;b++) for (c=0;c<=l;c++) for (d=0;d<=m;d++) {
        weight = w[0]*a + (w[0]+1)*b + (w[0]+2)*c + (w[0]+3)*d;
        if (weight <= W) res = max(2,res,w0[a]+w1[b]+w2[c]+w3[d]);
    }

    printf("%lld\n", res);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 440
v:
	.zero	440
	.globl	W
	.align 8
	.type	W, @object
	.size	W, 8
W:
	.zero	8
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 880
w:
	.zero	880
	.globl	w0
	.align 32
	.type	w0, @object
	.size	w0, 880
w0:
	.zero	880
	.globl	w1
	.align 32
	.type	w1, @object
	.size	w1, 880
w1:
	.zero	880
	.globl	w2
	.align 32
	.type	w2, @object
	.size	w2, 880
w2:
	.zero	880
	.globl	w3
	.align 32
	.type	w3, @object
	.size	w3, 880
w3:
	.zero	880
	.text
	.globl	max
	.type	max, @function
max:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$256, %rsp
	movl	%edi, -244(%rbp)
	movq	%rsi, -168(%rbp)
	movq	%rdx, -160(%rbp)
	movq	%rcx, -152(%rbp)
	movq	%r8, -144(%rbp)
	movq	%r9, -136(%rbp)
	testb	%al, %al
	je	.L2
	movaps	%xmm0, -128(%rbp)
	movaps	%xmm1, -112(%rbp)
	movaps	%xmm2, -96(%rbp)
	movaps	%xmm3, -80(%rbp)
	movaps	%xmm4, -64(%rbp)
	movaps	%xmm5, -48(%rbp)
	movaps	%xmm6, -32(%rbp)
	movaps	%xmm7, -16(%rbp)
.L2:
	movq	%fs:40, %rax
	movq	%rax, -184(%rbp)
	xorl	%eax, %eax
	movl	$8, -208(%rbp)
	movl	$48, -204(%rbp)
	leaq	16(%rbp), %rax
	movq	%rax, -200(%rbp)
	leaq	-176(%rbp), %rax
	movq	%rax, -192(%rbp)
	movl	-208(%rbp), %eax
	cmpl	$47, %eax
	ja	.L3
	movq	-192(%rbp), %rax
	movl	-208(%rbp), %edx
	movl	%edx, %edx
	addq	%rdx, %rax
	movl	-208(%rbp), %edx
	addl	$8, %edx
	movl	%edx, -208(%rbp)
	jmp	.L4
.L3:
	movq	-200(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	%rdx, -200(%rbp)
.L4:
	movq	(%rax), %rax
	movq	%rax, -224(%rbp)
	movq	$1, -232(%rbp)
	jmp	.L5
.L9:
	movl	-208(%rbp), %eax
	cmpl	$47, %eax
	ja	.L6
	movq	-192(%rbp), %rax
	movl	-208(%rbp), %edx
	movl	%edx, %edx
	addq	%rdx, %rax
	movl	-208(%rbp), %edx
	addl	$8, %edx
	movl	%edx, -208(%rbp)
	jmp	.L7
.L6:
	movq	-200(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	%rdx, -200(%rbp)
.L7:
	movq	(%rax), %rax
	movq	%rax, -216(%rbp)
	movq	-216(%rbp), %rax
	cmpq	-224(%rbp), %rax
	jle	.L8
	movq	-216(%rbp), %rax
	movq	%rax, -224(%rbp)
.L8:
	addq	$1, -232(%rbp)
.L5:
	movl	-244(%rbp), %eax
	cltq
	cmpq	%rax, -232(%rbp)
	jl	.L9
	movq	-224(%rbp), %rax
	movq	-184(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	max, .-max
	.globl	llcmp
	.type	llcmp, @function
llcmp:
.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
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L13
	movl	$1, %eax
	jmp	.L14
.L13:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L15
	movl	$-1, %eax
	jmp	.L14
.L15:
	movl	$0, %eax
.L14:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	llcmp, .-llcmp
	.section	.rodata
.LC0:
	.string	"%d%lld"
.LC1:
	.string	"%lld%d"
.LC2:
	.string	"%lld\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	$64, %rsp
	leaq	W(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L17
.L18:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	w(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L17:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L18
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L19
.L24:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	w(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L20
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -32(%rbp)
	cltq
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L21
.L20:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	w(%rip), %rdx
	addq	$1, %rdx
	cmpq	%rdx, %rax
	jne	.L22
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -28(%rbp)
	cltq
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w1(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L21
.L22:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	w(%rip), %rdx
	addq	$2, %rdx
	cmpq	%rdx, %rax
	jne	.L23
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -24(%rbp)
	cltq
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L21
.L23:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -20(%rbp)
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w3(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L21:
	addl	$1, -36(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L24
	movl	-32(%rbp), %eax
	cltq
	leaq	8+w0(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	8+w1(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-24(%rbp), %eax
	cltq
	leaq	8+w2(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	8+w3(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	$1, -52(%rbp)
	jmp	.L25
.L26:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-52(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -52(%rbp)
.L25:
	movl	-52(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L26
	movl	$1, -48(%rbp)
	jmp	.L27
.L28:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-48(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -48(%rbp)
.L27:
	movl	-48(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L28
	movl	$1, -44(%rbp)
	jmp	.L29
.L30:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L29:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L30
	movl	$1, -40(%rbp)
	jmp	.L31
.L32:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -40(%rbp)
.L31:
	movl	-40(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L32
	movq	$0, -16(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L33
.L41:
	movl	$0, -48(%rbp)
	jmp	.L34
.L40:
	movl	$0, -44(%rbp)
	jmp	.L35
.L39:
	movl	$0, -40(%rbp)
	jmp	.L36
.L38:
	movq	w(%rip), %rdx
	movl	-52(%rbp), %eax
	cltq
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movq	w(%rip), %rax
	leaq	1(%rax), %rdx
	movl	-48(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, %rcx
	movq	w(%rip), %rax
	leaq	2(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, %rcx
	movq	w(%rip), %rax
	leaq	3(%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -8(%rbp)
	movq	W(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jg	.L37
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	movl	$2, %edi
	movl	$0, %eax
	call	max
	movq	%rax, -16(%rbp)
.L37:
	addl	$1, -40(%rbp)
.L36:
	movl	-40(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L38
	addl	$1, -44(%rbp)
.L35:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L39
	addl	$1, -48(%rbp)
.L34:
	movl	-48(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L40
	addl	$1, -52(%rbp)
.L33:
	movl	-52(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L41
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	v
	.align 32
	.type	v, @object
	.size	v, 440
v:
	.zero	440
	.globl	W
	.align 8
	.type	W, @object
	.size	W, 8
W:
	.zero	8
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 880
w:
	.zero	880
	.globl	w0
	.align 32
	.type	w0, @object
	.size	w0, 880
w0:
	.zero	880
	.globl	w1
	.align 32
	.type	w1, @object
	.size	w1, 880
w1:
	.zero	880
	.globl	w2
	.align 32
	.type	w2, @object
	.size	w2, 880
w2:
	.zero	880
	.globl	w3
	.align 32
	.type	w3, @object
	.size	w3, 880
w3:
	.zero	880
	.text
	.globl	max
	.type	max, @function
max:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$256, %rsp
	movl	%edi, -244(%rbp)
	movq	%rsi, -168(%rbp)
	movq	%rdx, -160(%rbp)
	movq	%rcx, -152(%rbp)
	movq	%r8, -144(%rbp)
	movq	%r9, -136(%rbp)
	testb	%al, %al
	je	.L2
	movaps	%xmm0, -128(%rbp)
	movaps	%xmm1, -112(%rbp)
	movaps	%xmm2, -96(%rbp)
	movaps	%xmm3, -80(%rbp)
	movaps	%xmm4, -64(%rbp)
	movaps	%xmm5, -48(%rbp)
	movaps	%xmm6, -32(%rbp)
	movaps	%xmm7, -16(%rbp)
.L2:
	movq	%fs:40, %rax
	movq	%rax, -184(%rbp)
	xorl	%eax, %eax
	movl	$8, -208(%rbp)
	movl	$48, -204(%rbp)
	leaq	16(%rbp), %rax
	movq	%rax, -200(%rbp)
	leaq	-176(%rbp), %rax
	movq	%rax, -192(%rbp)
	movl	-208(%rbp), %eax
	cmpl	$47, %eax
	ja	.L3
	movq	-192(%rbp), %rax
	movl	-208(%rbp), %edx
	movl	%edx, %edx
	addq	%rdx, %rax
	movl	-208(%rbp), %edx
	addl	$8, %edx
	movl	%edx, -208(%rbp)
	jmp	.L4
.L3:
	movq	-200(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	%rdx, -200(%rbp)
.L4:
	movq	(%rax), %rax
	movq	%rax, -224(%rbp)
	movq	$1, -232(%rbp)
	jmp	.L5
.L9:
	movl	-208(%rbp), %eax
	cmpl	$47, %eax
	ja	.L6
	movq	-192(%rbp), %rax
	movl	-208(%rbp), %edx
	movl	%edx, %edx
	addq	%rdx, %rax
	movl	-208(%rbp), %edx
	addl	$8, %edx
	movl	%edx, -208(%rbp)
	jmp	.L7
.L6:
	movq	-200(%rbp), %rax
	leaq	8(%rax), %rdx
	movq	%rdx, -200(%rbp)
.L7:
	movq	(%rax), %rax
	movq	%rax, -216(%rbp)
	movq	-216(%rbp), %rax
	cmpq	-224(%rbp), %rax
	jle	.L8
	movq	-216(%rbp), %rax
	movq	%rax, -224(%rbp)
.L8:
	addq	$1, -232(%rbp)
.L5:
	movl	-244(%rbp), %eax
	cltq
	cmpq	%rax, -232(%rbp)
	jl	.L9
	movq	-224(%rbp), %rax
	movq	-184(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	max, .-max
	.globl	llcmp
	.type	llcmp, @function
llcmp:
.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
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jge	.L13
	movl	$1, %eax
	jmp	.L14
.L13:
	movq	-8(%rbp), %rax
	movq	(%rax), %rdx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	jle	.L15
	movl	$-1, %eax
	jmp	.L14
.L15:
	movl	$0, %eax
.L14:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	llcmp, .-llcmp
	.section	.rodata
.LC0:
	.string	"%d%lld"
.LC1:
	.string	"%lld%d"
.LC2:
	.string	"%lld\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	$64, %rsp
	leaq	W(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -36(%rbp)
	jmp	.L17
.L18:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	w(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L17:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L18
	movl	$0, -32(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L19
.L24:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	w(%rip), %rax
	cmpq	%rax, %rdx
	jne	.L20
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -32(%rbp)
	cltq
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L21
.L20:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	w(%rip), %rdx
	addq	$1, %rdx
	cmpq	%rdx, %rax
	jne	.L22
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -28(%rbp)
	cltq
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w1(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L21
.L22:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	w(%rip), %rdx
	addq	$2, %rdx
	cmpq	%rdx, %rax
	jne	.L23
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -24(%rbp)
	cltq
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w2(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	jmp	.L21
.L23:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	v(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	$1, -20(%rbp)
	cltq
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	w3(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L21:
	addl	$1, -36(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -36(%rbp)
	jl	.L24
	movl	-32(%rbp), %eax
	cltq
	leaq	8+w0(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	8+w1(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-24(%rbp), %eax
	cltq
	leaq	8+w2(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	8+w3(%rip), %rdi
	leaq	llcmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	$1, -52(%rbp)
	jmp	.L25
.L26:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-52(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -52(%rbp)
.L25:
	movl	-52(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L26
	movl	$1, -48(%rbp)
	jmp	.L27
.L28:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-48(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -48(%rbp)
.L27:
	movl	-48(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L28
	movl	$1, -44(%rbp)
	jmp	.L29
.L30:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -44(%rbp)
.L29:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L30
	movl	$1, -40(%rbp)
	jmp	.L31
.L32:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -40(%rbp)
.L31:
	movl	-40(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L32
	movq	$0, -16(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L33
.L41:
	movl	$0, -48(%rbp)
	jmp	.L34
.L40:
	movl	$0, -44(%rbp)
	jmp	.L35
.L39:
	movl	$0, -40(%rbp)
	jmp	.L36
.L38:
	movq	w(%rip), %rdx
	movl	-52(%rbp), %eax
	cltq
	movq	%rdx, %rcx
	imulq	%rax, %rcx
	movq	w(%rip), %rax
	leaq	1(%rax), %rdx
	movl	-48(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, %rcx
	movq	w(%rip), %rax
	leaq	2(%rax), %rdx
	movl	-44(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rax, %rcx
	movq	w(%rip), %rax
	leaq	3(%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	imulq	%rdx, %rax
	addq	%rcx, %rax
	movq	%rax, -8(%rbp)
	movq	W(%rip), %rax
	cmpq	%rax, -8(%rbp)
	jg	.L37
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w0(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w1(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w2(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	w3(%rip), %rax
	movq	(%rdx,%rax), %rax
	leaq	(%rcx,%rax), %rdx
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	movl	$2, %edi
	movl	$0, %eax
	call	max
	movq	%rax, -16(%rbp)
.L37:
	addl	$1, -40(%rbp)
.L36:
	movl	-40(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jle	.L38
	addl	$1, -44(%rbp)
.L35:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L39
	addl	$1, -48(%rbp)
.L34:
	movl	-48(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jle	.L40
	addl	$1, -52(%rbp)
.L33:
	movl	-52(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L41
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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:
