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

```c
#include <stdio.h>

// 定数定義
#define MAX_PIECE   (2000)

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

// 汎用型宣言
typedef unsigned long long U8;
typedef unsigned long  U4;
typedef unsigned short U2;
typedef unsigned char  U1;

// 関数宣言
U8 dfs(U2 u2Lower, U2 u2Upper);

// グローバル変数（入力とメモ）
static U2 u2Num;
static U4 au4Size[MAX_PIECE * 2];

static U8 au8Memo[MAX_PIECE][MAX_PIECE] = {{0}}; // 初期化処理は省略

int main(){
    U2 u2Cnt;
    U8 u8Score;
    U8 u8Max;

    // 入力
    // ケーキのサイズは2週分のデータを格納して処理を簡略化する
    scanf("%hd",&u2Num);
    for(u2Cnt = 0; u2Cnt < u2Num; u2Cnt++){
        scanf("%ld",&au4Size[u2Cnt]);
        au4Size[u2Num + u2Cnt] = au4Size[u2Cnt];
    }

    // 初手は全探索 以降はメモ化再帰
    u8Max = 0;
    for(u2Cnt = 0; u2Cnt < u2Num; u2Cnt++){
        u8Score = au4Size[u2Cnt] + dfs(u2Cnt+1,u2Cnt+u2Num-1);
        u8Max = MAX(u8Max, u8Score);
    }

    // 出力
    printf("%lld\n", u8Max);

    return 0;
}


// 深さ優先探索（再帰）
// 残りのケーキの左右のインデックスを受け取り、そこから得られる最大点数を返す
U8 dfs(U2 u2Lower, U2 u2Upper){
    U8 u8Sum1;
    U8 u8Sum2;
    U2 u2NextLo;
    U2 u2NextUp;
    U8 u8Ans;

    // すでに計算済み
    if(au8Memo[u2Lower % u2Num][u2Upper % u2Num] > 0){
        return au8Memo[u2Lower % u2Num][u2Upper % u2Num];
    }

    // 残りケーキが0～1個だともう取れない
    if(u2Lower >= u2Upper){
        return 0;
    }

    // 相手が大きいほうを取る
    u2NextLo = u2Lower;
    u2NextUp = u2Upper;
    if(au4Size[u2NextLo] > au4Size[u2NextUp]){
        u2NextLo++;
    }else{
        u2NextUp--;
    }

    // 自分がどちらを取ればよいかは再帰して確認し結果が大きいほうを選ぶ
    u8Sum1 = au4Size[u2NextLo] + dfs(u2NextLo+1, u2NextUp);
    u8Sum2 = au4Size[u2NextUp] + dfs(u2NextLo, u2NextUp-1);
    u8Ans = MAX(u8Sum1, u8Sum2);

    // 計算結果を記憶
    au8Memo[u2Lower % u2Num][u2Upper % u2Num] = u8Ans;

    return u8Ans;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	u2Num
	.comm	u2Num,2,2
	.local	au4Size
	.comm	au4Size,32000,32
	.local	au8Memo
	.comm	au8Memo,32000000,32
	.section	.rodata
.LC0:
	.string	"%hd"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	leaq	u2Num(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movw	$0, -34(%rbp)
	jmp	.L2
.L3:
	movzwl	-34(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzwl	-34(%rbp), %eax
	movzwl	u2Num(%rip), %edx
	movzwl	%dx, %ecx
	movzwl	-34(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	au4Size(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movzwl	-34(%rbp), %eax
	addl	$1, %eax
	movw	%ax, -34(%rbp)
.L2:
	movzwl	u2Num(%rip), %eax
	cmpw	%ax, -34(%rbp)
	jb	.L3
	movq	$0, -32(%rbp)
	movw	$0, -34(%rbp)
	jmp	.L4
.L5:
	movzwl	-34(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rbx
	movzwl	u2Num(%rip), %edx
	movzwl	-34(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movzwl	%ax, %edx
	movzwl	-34(%rbp), %eax
	addl	$1, %eax
	movzwl	%ax, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addq	%rbx, %rax
	movq	%rax, -24(%rbp)
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movq	%rax, -32(%rbp)
	movzwl	-34(%rbp), %eax
	addl	$1, %eax
	movw	%ax, -34(%rbp)
.L4:
	movzwl	u2Num(%rip), %eax
	cmpw	%ax, -34(%rbp)
	jb	.L5
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movl	%edi, %edx
	movl	%esi, %eax
	movw	%dx, -52(%rbp)
	movw	%ax, -56(%rbp)
	movzwl	u2Num(%rip), %ecx
	movzwl	-52(%rbp), %eax
	movl	$0, %edx
	divw	%cx
	movl	%edx, %eax
	movzwl	%ax, %ecx
	movzwl	u2Num(%rip), %esi
	movzwl	-56(%rbp), %eax
	movl	$0, %edx
	divw	%si
	movl	%edx, %eax
	movzwl	%ax, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2000, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	au8Memo(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	je	.L8
	movzwl	u2Num(%rip), %ecx
	movzwl	-52(%rbp), %eax
	movl	$0, %edx
	divw	%cx
	movl	%edx, %eax
	movzwl	%ax, %ecx
	movzwl	u2Num(%rip), %esi
	movzwl	-56(%rbp), %eax
	movl	$0, %edx
	divw	%si
	movl	%edx, %eax
	movzwl	%ax, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2000, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	au8Memo(%rip), %rax
	movq	(%rdx,%rax), %rax
	jmp	.L9
.L8:
	movzwl	-52(%rbp), %eax
	cmpw	-56(%rbp), %ax
	jb	.L10
	movl	$0, %eax
	jmp	.L9
.L10:
	movzwl	-52(%rbp), %eax
	movw	%ax, -44(%rbp)
	movzwl	-56(%rbp), %eax
	movw	%ax, -42(%rbp)
	movzwl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movzwl	-42(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	au4Size(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jbe	.L11
	movzwl	-44(%rbp), %eax
	addl	$1, %eax
	movw	%ax, -44(%rbp)
	jmp	.L12
.L11:
	movzwl	-42(%rbp), %eax
	subl	$1, %eax
	movw	%ax, -42(%rbp)
.L12:
	movzwl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rbx
	movzwl	-42(%rbp), %edx
	movzwl	-44(%rbp), %eax
	addl	$1, %eax
	movzwl	%ax, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addq	%rbx, %rax
	movq	%rax, -40(%rbp)
	movzwl	-42(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rbx
	movzwl	-42(%rbp), %eax
	subl	$1, %eax
	movzwl	%ax, %edx
	movzwl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addq	%rbx, %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movq	%rax, -24(%rbp)
	movzwl	u2Num(%rip), %ecx
	movzwl	-52(%rbp), %eax
	movl	$0, %edx
	divw	%cx
	movl	%edx, %eax
	movzwl	%ax, %ecx
	movzwl	u2Num(%rip), %esi
	movzwl	-56(%rbp), %eax
	movl	$0, %edx
	divw	%si
	movl	%edx, %eax
	movzwl	%ax, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2000, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	au8Memo(%rip), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movq	-24(%rbp), %rax
.L9:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	dfs, .-dfs
	.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
	.type	dfs.part.0, @function
dfs.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	au4Size(%rip), %r8
	movzwl	%di, %eax
	movzwl	%si, %r10d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r15d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%esi, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	(%r8,%rax,8), %r13
	movw	%di, 14(%rsp)
	cmpq	(%r8,%r10,8), %r13
	ja	.L2
	subl	$1, %ebx
	movzwl	%di, %r9d
	movzwl	%bx, %r11d
	movzwl	%bx, %r10d
.L3:
	movzwl	u2Num(%rip), %ebp
	movl	%ebx, %eax
	xorl	%edx, %edx
	leal	1(%r12), %edi
	leaq	au8Memo(%rip), %r14
	divw	%bp
	movl	%edi, %eax
	movzwl	%dx, %esi
	xorl	%edx, %edx
	divw	%bp
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%rsi, %rdx
	movq	(%r14,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L11
	cmpw	%di, %bx
	jbe	.L5
	movzwl	%di, %edi
	movl	%r11d, %esi
	movq	%r10, 24(%rsp)
	movl	%r9d, 16(%rsp)
	call	dfs.part.0
	movq	24(%rsp), %r10
	movl	16(%rsp), %r9d
	leaq	au4Size(%rip), %r8
	addq	%rax, %r13
.L5:
	subl	$1, %ebx
	xorl	%edx, %edx
	movq	(%r8,%r10,8), %r8
	movl	%ebx, %eax
	divw	%bp
	movl	%r12d, %eax
	movzwl	%dx, %esi
	xorl	%edx, %edx
	divw	%bp
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%rsi, %rdx
	movq	(%r14,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L9
	cmpw	%bx, %r12w
	jnb	.L7
	movzwl	%bx, %esi
	movl	%r9d, %edi
	movq	%r8, 16(%rsp)
	call	dfs.part.0
	movq	16(%rsp), %r8
.L9:
	addq	%rax, %r8
.L7:
	cmpq	%r8, %r13
	movl	%r15d, %eax
	cmovb	%r8, %r13
	xorl	%edx, %edx
	divw	%bp
	movzwl	14(%rsp), %eax
	movzwl	%dx, %esi
	xorl	%edx, %edx
	divw	%bp
	movq	%r13, %rax
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%rsi, %rdx
	movq	%r13, (%r14,%rdx,8)
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	addl	$1, %r12d
	movzwl	%si, %r11d
	movzwl	%r12w, %eax
	movzwl	%r12w, %r9d
	movq	(%r8,%rax,8), %r13
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L11:
	addq	%rax, %r13
	jmp	.L5
	.cfi_endproc
.LFE25:
	.size	dfs.part.0, .-dfs.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%hd"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	u2Num(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	au4Size(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	call	__isoc99_scanf@PLT
	cmpw	$0, u2Num(%rip)
	je	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	movzwl	%bp, %eax
	movq	%rbx, %rdi
	movzwl	%bp, %r12d
	addl	$1, %ebp
	leaq	0(%r13,%rax,8), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzwl	u2Num(%rip), %r15d
	movslq	%r12d, %rax
	movq	0(%r13,%rax,8), %rdx
	movzwl	%r15w, %eax
	addl	%r12d, %eax
	cltq
	movq	%rdx, 0(%r13,%rax,8)
	cmpw	%bp, %r15w
	ja	.L13
	testw	%r15w, %r15w
	je	.L15
	leal	-1(%r15,%r15), %eax
	leal	-1(%r15), %r14d
	movl	%r15d, %r11d
	movl	$1, %ebx
	leaq	au4Size(%rip), %r10
	movw	%ax, 62(%rsp)
	leaq	au8Memo(%rip), %r8
	movq	$0, 8(%rsp)
	movq	%r10, %r15
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L16:
	cmpw	%r14w, %bx
	jnb	.L17
	movzwl	%r14w, %ebp
	movq	8(%r15), %rax
	movl	%ebx, 104(%rsp)
	movzwl	%r14w, %edi
	movq	0(%r13,%rbp,8), %rdx
	movq	%rax, 24(%rsp)
	movq	%rdx, 32(%rsp)
	cmpq	%rdx, %rax
	jbe	.L18
	leal	1(%rbx), %eax
	addl	$1, %ecx
	movl	%r14d, %r9d
	movl	%eax, 104(%rsp)
	movq	16(%r15), %rax
	movq	%rax, 24(%rsp)
.L19:
	leal	1(%rcx), %eax
	movslq	%esi, %r10
	movzwl	%ax, %edx
	movw	%ax, 64(%rsp)
	movl	%edx, 76(%rsp)
	xorl	%edx, %edx
	divw	%r11w
	movq	%r10, 96(%rsp)
	movzwl	%dx, %eax
	movl	%eax, 108(%rsp)
	movzwl	%dx, %eax
	movq	%rax, 80(%rsp)
	imulq	$2000, %rax, %rax
	addq	%r10, %rax
	movq	(%r8,%rax,8), %r10
	leal	-1(%r9), %eax
	movw	%ax, 16(%rsp)
	movzwl	%ax, %eax
	movl	%eax, 72(%rsp)
	testq	%r10, %r10
	jne	.L44
	movq	24(%rsp), %r10
	cmpw	64(%rsp), %r9w
	jbe	.L21
	movslq	76(%rsp), %rax
	movq	0(%r13,%rax,8), %rax
	movq	%rax, 120(%rsp)
	cmpq	32(%rsp), %rax
	jbe	.L22
	movw	%r9w, 128(%rsp)
	leal	2(%rcx), %eax
	movzwl	%ax, %edx
	movw	%ax, 88(%rsp)
	movzwl	%ax, %eax
	movq	0(%r13,%rax,8), %rax
	movl	%edx, 132(%rsp)
	movq	%rax, 120(%rsp)
	movl	72(%rsp), %eax
	movl	%eax, 136(%rsp)
	movzwl	16(%rsp), %eax
	movw	%ax, 112(%rsp)
.L23:
	movzwl	88(%rsp), %eax
	xorl	%edx, %edx
	leal	1(%rax), %r10d
	movl	%r10d, %eax
	divw	%r11w
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%rsi, %rdx
	movq	(%r8,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L24
	cmpw	%r10w, 128(%rsp)
	jbe	.L24
	movzwl	%r10w, %r10d
	movl	%edi, %esi
	movl	%r11d, 140(%rsp)
	movl	%r10d, %edi
	movl	%r9d, 128(%rsp)
	call	dfs.part.0
	movl	140(%rsp), %r11d
	movl	128(%rsp), %r9d
	leaq	au8Memo(%rip), %r8
.L24:
	movq	120(%rsp), %r10
	xorl	%edx, %edx
	movq	0(%r13,%rbp,8), %rbp
	addq	%rax, %r10
	movzwl	112(%rsp), %eax
	divw	%r11w
	movzwl	88(%rsp), %eax
	movzwl	%dx, %esi
	xorl	%edx, %edx
	divw	%r11w
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%rsi, %rdx
	movq	(%r8,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L25
	movzwl	112(%rsp), %esi
	cmpw	%si, 88(%rsp)
	jnb	.L25
	movl	136(%rsp), %esi
	movl	132(%rsp), %edi
	movl	%r11d, 120(%rsp)
	movq	%r10, 112(%rsp)
	movl	%r9d, 88(%rsp)
	call	dfs.part.0
	movl	120(%rsp), %r11d
	movq	112(%rsp), %r10
	leaq	au8Memo(%rip), %r8
	movl	88(%rsp), %r9d
.L25:
	addq	%rax, %rbp
	cmpq	%r10, %rbp
	cmovnb	%rbp, %r10
	imulq	$2000, 80(%rsp), %rax
	addq	96(%rsp), %rax
	movq	%r10, (%r8,%rax,8)
.L44:
	addq	24(%rsp), %r10
.L21:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divw	%r11w
	movzwl	16(%rsp), %eax
	movl	%edx, %edi
	xorl	%edx, %edx
	divw	%r11w
	movzwl	%di, %eax
	movq	%rax, 88(%rsp)
	imulq	$2000, %rax, %rax
	movzwl	%dx, %esi
	movzwl	%dx, %edx
	addq	%rdx, %rax
	movq	%rdx, 96(%rsp)
	movq	(%r8,%rax,8), %rax
	testq	%rax, %rax
	jne	.L45
	cmpw	16(%rsp), %cx
	jnb	.L27
	movslq	72(%rsp), %rbp
	movq	24(%rsp), %rax
	cmpq	%rax, 0(%r13,%rbp,8)
	jnb	.L28
	movslq	76(%rsp), %rax
	leal	2(%rcx), %edi
	xorl	%edx, %edx
	movzwl	64(%rsp), %ecx
	movq	%rax, %r9
	movq	0(%r13,%rax,8), %rax
	movl	%r9d, 104(%rsp)
	movq	%rax, 24(%rsp)
	movzwl	%di, %eax
	movl	%eax, 76(%rsp)
	movl	%edi, %eax
	divw	%r11w
	movzwl	%dx, %eax
.L29:
	imulq	$2000, %rax, %rax
	addq	%rsi, %rax
	movq	(%r8,%rax,8), %r9
	testq	%r9, %r9
	jne	.L30
	cmpw	%di, 16(%rsp)
	jbe	.L30
	movl	72(%rsp), %esi
	movl	76(%rsp), %edi
	movl	%r11d, 108(%rsp)
	movq	%r10, 64(%rsp)
	call	dfs.part.0
	movl	108(%rsp), %r11d
	movq	64(%rsp), %r10
	leaq	au8Memo(%rip), %r8
	movq	%rax, %r9
.L30:
	movzwl	16(%rsp), %esi
	xorl	%edx, %edx
	movq	0(%r13,%rbp,8), %rbp
	addq	24(%rsp), %r9
	subl	$1, %esi
	movl	%esi, %eax
	divw	%r11w
	imulq	$2000, 80(%rsp), %rax
	movzwl	%dx, %edx
	addq	%rdx, %rax
	movq	(%r8,%rax,8), %rax
	testq	%rax, %rax
	jne	.L31
	cmpw	%si, %cx
	jnb	.L31
	movl	104(%rsp), %edi
	movzwl	%si, %esi
	movl	%r11d, 64(%rsp)
	movq	%r10, 24(%rsp)
	movq	%r9, 16(%rsp)
	call	dfs.part.0
	movl	64(%rsp), %r11d
	movq	24(%rsp), %r10
	leaq	au8Memo(%rip), %r8
	movq	16(%rsp), %r9
.L31:
	addq	%rax, %rbp
	cmpq	%r9, %rbp
	cmovb	%r9, %rbp
	addq	%rbp, 32(%rsp)
	imulq	$2000, 88(%rsp), %rax
	addq	96(%rsp), %rax
	movq	%rbp, (%r8,%rax,8)
.L27:
	movq	32(%rsp), %rax
	cmpq	%rax, %r10
	cmovb	%rax, %r10
	imulq	$2000, 40(%rsp), %rax
	addq	48(%rsp), %rax
	movq	%r10, (%r8,%rax,8)
	addq	%r10, %r12
.L17:
	movq	8(%rsp), %rax
	cmpq	%r12, %rax
	cmovnb	%rax, %r12
	addq	$1, %rbx
	addq	$8, %r15
	addl	$1, %r14d
	movq	%r12, 8(%rsp)
	cmpw	%r14w, 62(%rsp)
	je	.L14
.L32:
	movl	%ebx, %eax
	xorl	%edx, %edx
	movq	(%r15), %r12
	movl	%ebx, %ecx
	divw	%r11w
	movl	%r14d, %eax
	movl	%edx, %edi
	xorl	%edx, %edx
	divw	%r11w
	movzwl	%di, %eax
	movq	%rax, 40(%rsp)
	imulq	$2000, %rax, %rax
	movzwl	%dx, %esi
	movzwl	%dx, %edx
	addq	%rdx, %rax
	movq	%rdx, 48(%rsp)
	movq	(%r8,%rax,8), %rax
	testq	%rax, %rax
	je	.L16
	addq	%rax, %r12
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L18:
	leal	-1(%r14), %r9d
	xorl	%edx, %edx
	movl	%r9d, %eax
	movzwl	%r9w, %ebp
	movzwl	%r9w, %edi
	divw	%r11w
	movq	0(%r13,%rbp,8), %rax
	movq	%rax, 32(%rsp)
	movzwl	%dx, %esi
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L45:
	addq	%rax, 32(%rsp)
	jmp	.L27
.L15:
	movq	$0, 8(%rsp)
.L14:
	movq	8(%rsp), %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$152, %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
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	leal	-2(%r9), %eax
	xorl	%edx, %edx
	movzwl	%ax, %edi
	movzwl	%ax, %ebp
	divw	%r11w
	movl	%edi, 72(%rsp)
	movslq	108(%rsp), %rax
	movw	%bp, 16(%rsp)
	movzwl	64(%rsp), %edi
	movzwl	%dx, %esi
	movq	88(%rsp), %rdx
	movq	%rdx, 80(%rsp)
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L22:
	movzwl	16(%rsp), %eax
	xorl	%edx, %edx
	leal	-2(%r9), %edi
	movslq	72(%rsp), %rbp
	movw	%di, 112(%rsp)
	movzwl	%di, %edi
	divw	%r11w
	movzwl	16(%rsp), %eax
	movl	%edi, 136(%rsp)
	movw	%ax, 128(%rsp)
	movzwl	64(%rsp), %eax
	movw	%ax, 88(%rsp)
	movq	%rbp, %rdi
	movzwl	%dx, %esi
	movl	76(%rsp), %edx
	movl	%edx, 132(%rsp)
	jmp	.L23
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB24:
	.cfi_startproc
	endbr64
	movzwl	u2Num(%rip), %ecx
	movl	%esi, %eax
	xorl	%edx, %edx
	divw	%cx
	movl	%edi, %eax
	movzwl	%dx, %r8d
	xorl	%edx, %edx
	divw	%cx
	leaq	au8Memo(%rip), %rax
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%r8, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L46
	cmpw	%si, %di
	jnb	.L46
	movzwl	%si, %esi
	movzwl	%di, %edi
	jmp	dfs.part.0
	.p2align 4,,10
	.p2align 3
.L46:
	ret
	.cfi_endproc
.LFE24:
	.size	dfs, .-dfs
	.local	au8Memo
	.comm	au8Memo,32000000,32
	.local	au4Size
	.comm	au4Size,32000,32
	.local	u2Num
	.comm	u2Num,2,2
	.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
	.type	dfs.part.0, @function
dfs.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	au4Size(%rip), %r8
	movzwl	%di, %eax
	movzwl	%si, %r10d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%esi, %r15d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%esi, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	(%r8,%rax,8), %r13
	movw	%di, 14(%rsp)
	cmpq	(%r8,%r10,8), %r13
	ja	.L2
	subl	$1, %ebx
	movzwl	%di, %r9d
	movzwl	%bx, %r11d
	movzwl	%bx, %r10d
.L3:
	movzwl	u2Num(%rip), %ebp
	movl	%ebx, %eax
	xorl	%edx, %edx
	leal	1(%r12), %edi
	leaq	au8Memo(%rip), %r14
	divw	%bp
	movl	%edi, %eax
	movzwl	%dx, %esi
	xorl	%edx, %edx
	divw	%bp
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%rsi, %rdx
	movq	(%r14,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L11
	cmpw	%di, %bx
	jbe	.L5
	movzwl	%di, %edi
	movl	%r11d, %esi
	movq	%r10, 24(%rsp)
	movl	%r9d, 16(%rsp)
	call	dfs.part.0
	movq	24(%rsp), %r10
	movl	16(%rsp), %r9d
	leaq	au4Size(%rip), %r8
	addq	%rax, %r13
.L5:
	subl	$1, %ebx
	xorl	%edx, %edx
	movq	(%r8,%r10,8), %r8
	movl	%ebx, %eax
	divw	%bp
	movl	%r12d, %eax
	movzwl	%dx, %esi
	xorl	%edx, %edx
	divw	%bp
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%rsi, %rdx
	movq	(%r14,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L9
	cmpw	%bx, %r12w
	jnb	.L7
	movzwl	%bx, %esi
	movl	%r9d, %edi
	movq	%r8, 16(%rsp)
	call	dfs.part.0
	movq	16(%rsp), %r8
.L9:
	addq	%rax, %r8
.L7:
	cmpq	%r8, %r13
	movl	%r15d, %eax
	cmovb	%r8, %r13
	xorl	%edx, %edx
	divw	%bp
	movzwl	14(%rsp), %eax
	movzwl	%dx, %esi
	xorl	%edx, %edx
	divw	%bp
	movq	%r13, %rax
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%rsi, %rdx
	movq	%r13, (%r14,%rdx,8)
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	addl	$1, %r12d
	movzwl	%si, %r11d
	movzwl	%r12w, %eax
	movzwl	%r12w, %r9d
	movq	(%r8,%rax,8), %r13
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L11:
	addq	%rax, %r13
	jmp	.L5
	.cfi_endproc
.LFE25:
	.size	dfs.part.0, .-dfs.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%hd"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	leaq	u2Num(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	au4Size(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$152, %rsp
	.cfi_def_cfa_offset 208
	call	__isoc99_scanf@PLT
	cmpw	$0, u2Num(%rip)
	je	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	movzwl	%bp, %eax
	movq	%rbx, %rdi
	movzwl	%bp, %r12d
	addl	$1, %ebp
	leaq	0(%r13,%rax,8), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movzwl	u2Num(%rip), %r15d
	movslq	%r12d, %rax
	movq	0(%r13,%rax,8), %rdx
	movzwl	%r15w, %eax
	addl	%r12d, %eax
	cltq
	movq	%rdx, 0(%r13,%rax,8)
	cmpw	%bp, %r15w
	ja	.L13
	testw	%r15w, %r15w
	je	.L15
	leal	-1(%r15,%r15), %eax
	leal	-1(%r15), %r14d
	movl	%r15d, %r11d
	movl	$1, %ebx
	leaq	au4Size(%rip), %r10
	movw	%ax, 62(%rsp)
	leaq	au8Memo(%rip), %r8
	movq	$0, 8(%rsp)
	movq	%r10, %r15
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L16:
	cmpw	%r14w, %bx
	jnb	.L17
	movzwl	%r14w, %ebp
	movq	8(%r15), %rax
	movl	%ebx, 104(%rsp)
	movzwl	%r14w, %edi
	movq	0(%r13,%rbp,8), %rdx
	movq	%rax, 24(%rsp)
	movq	%rdx, 32(%rsp)
	cmpq	%rdx, %rax
	jbe	.L18
	leal	1(%rbx), %eax
	addl	$1, %ecx
	movl	%r14d, %r9d
	movl	%eax, 104(%rsp)
	movq	16(%r15), %rax
	movq	%rax, 24(%rsp)
.L19:
	leal	1(%rcx), %eax
	movslq	%esi, %r10
	movzwl	%ax, %edx
	movw	%ax, 64(%rsp)
	movl	%edx, 76(%rsp)
	xorl	%edx, %edx
	divw	%r11w
	movq	%r10, 96(%rsp)
	movzwl	%dx, %eax
	movl	%eax, 108(%rsp)
	movzwl	%dx, %eax
	movq	%rax, 80(%rsp)
	imulq	$2000, %rax, %rax
	addq	%r10, %rax
	movq	(%r8,%rax,8), %r10
	leal	-1(%r9), %eax
	movw	%ax, 16(%rsp)
	movzwl	%ax, %eax
	movl	%eax, 72(%rsp)
	testq	%r10, %r10
	jne	.L44
	movq	24(%rsp), %r10
	cmpw	64(%rsp), %r9w
	jbe	.L21
	movslq	76(%rsp), %rax
	movq	0(%r13,%rax,8), %rax
	movq	%rax, 120(%rsp)
	cmpq	32(%rsp), %rax
	jbe	.L22
	movw	%r9w, 128(%rsp)
	leal	2(%rcx), %eax
	movzwl	%ax, %edx
	movw	%ax, 88(%rsp)
	movzwl	%ax, %eax
	movq	0(%r13,%rax,8), %rax
	movl	%edx, 132(%rsp)
	movq	%rax, 120(%rsp)
	movl	72(%rsp), %eax
	movl	%eax, 136(%rsp)
	movzwl	16(%rsp), %eax
	movw	%ax, 112(%rsp)
.L23:
	movzwl	88(%rsp), %eax
	xorl	%edx, %edx
	leal	1(%rax), %r10d
	movl	%r10d, %eax
	divw	%r11w
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%rsi, %rdx
	movq	(%r8,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L24
	cmpw	%r10w, 128(%rsp)
	jbe	.L24
	movzwl	%r10w, %r10d
	movl	%edi, %esi
	movl	%r11d, 140(%rsp)
	movl	%r10d, %edi
	movl	%r9d, 128(%rsp)
	call	dfs.part.0
	movl	140(%rsp), %r11d
	movl	128(%rsp), %r9d
	leaq	au8Memo(%rip), %r8
.L24:
	movq	120(%rsp), %r10
	xorl	%edx, %edx
	movq	0(%r13,%rbp,8), %rbp
	addq	%rax, %r10
	movzwl	112(%rsp), %eax
	divw	%r11w
	movzwl	88(%rsp), %eax
	movzwl	%dx, %esi
	xorl	%edx, %edx
	divw	%r11w
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%rsi, %rdx
	movq	(%r8,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L25
	movzwl	112(%rsp), %esi
	cmpw	%si, 88(%rsp)
	jnb	.L25
	movl	136(%rsp), %esi
	movl	132(%rsp), %edi
	movl	%r11d, 120(%rsp)
	movq	%r10, 112(%rsp)
	movl	%r9d, 88(%rsp)
	call	dfs.part.0
	movl	120(%rsp), %r11d
	movq	112(%rsp), %r10
	leaq	au8Memo(%rip), %r8
	movl	88(%rsp), %r9d
.L25:
	addq	%rax, %rbp
	cmpq	%r10, %rbp
	cmovnb	%rbp, %r10
	imulq	$2000, 80(%rsp), %rax
	addq	96(%rsp), %rax
	movq	%r10, (%r8,%rax,8)
.L44:
	addq	24(%rsp), %r10
.L21:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divw	%r11w
	movzwl	16(%rsp), %eax
	movl	%edx, %edi
	xorl	%edx, %edx
	divw	%r11w
	movzwl	%di, %eax
	movq	%rax, 88(%rsp)
	imulq	$2000, %rax, %rax
	movzwl	%dx, %esi
	movzwl	%dx, %edx
	addq	%rdx, %rax
	movq	%rdx, 96(%rsp)
	movq	(%r8,%rax,8), %rax
	testq	%rax, %rax
	jne	.L45
	cmpw	16(%rsp), %cx
	jnb	.L27
	movslq	72(%rsp), %rbp
	movq	24(%rsp), %rax
	cmpq	%rax, 0(%r13,%rbp,8)
	jnb	.L28
	movslq	76(%rsp), %rax
	leal	2(%rcx), %edi
	xorl	%edx, %edx
	movzwl	64(%rsp), %ecx
	movq	%rax, %r9
	movq	0(%r13,%rax,8), %rax
	movl	%r9d, 104(%rsp)
	movq	%rax, 24(%rsp)
	movzwl	%di, %eax
	movl	%eax, 76(%rsp)
	movl	%edi, %eax
	divw	%r11w
	movzwl	%dx, %eax
.L29:
	imulq	$2000, %rax, %rax
	addq	%rsi, %rax
	movq	(%r8,%rax,8), %r9
	testq	%r9, %r9
	jne	.L30
	cmpw	%di, 16(%rsp)
	jbe	.L30
	movl	72(%rsp), %esi
	movl	76(%rsp), %edi
	movl	%r11d, 108(%rsp)
	movq	%r10, 64(%rsp)
	call	dfs.part.0
	movl	108(%rsp), %r11d
	movq	64(%rsp), %r10
	leaq	au8Memo(%rip), %r8
	movq	%rax, %r9
.L30:
	movzwl	16(%rsp), %esi
	xorl	%edx, %edx
	movq	0(%r13,%rbp,8), %rbp
	addq	24(%rsp), %r9
	subl	$1, %esi
	movl	%esi, %eax
	divw	%r11w
	imulq	$2000, 80(%rsp), %rax
	movzwl	%dx, %edx
	addq	%rdx, %rax
	movq	(%r8,%rax,8), %rax
	testq	%rax, %rax
	jne	.L31
	cmpw	%si, %cx
	jnb	.L31
	movl	104(%rsp), %edi
	movzwl	%si, %esi
	movl	%r11d, 64(%rsp)
	movq	%r10, 24(%rsp)
	movq	%r9, 16(%rsp)
	call	dfs.part.0
	movl	64(%rsp), %r11d
	movq	24(%rsp), %r10
	leaq	au8Memo(%rip), %r8
	movq	16(%rsp), %r9
.L31:
	addq	%rax, %rbp
	cmpq	%r9, %rbp
	cmovb	%r9, %rbp
	addq	%rbp, 32(%rsp)
	imulq	$2000, 88(%rsp), %rax
	addq	96(%rsp), %rax
	movq	%rbp, (%r8,%rax,8)
.L27:
	movq	32(%rsp), %rax
	cmpq	%rax, %r10
	cmovb	%rax, %r10
	imulq	$2000, 40(%rsp), %rax
	addq	48(%rsp), %rax
	movq	%r10, (%r8,%rax,8)
	addq	%r10, %r12
.L17:
	movq	8(%rsp), %rax
	cmpq	%r12, %rax
	cmovnb	%rax, %r12
	addq	$1, %rbx
	addq	$8, %r15
	addl	$1, %r14d
	movq	%r12, 8(%rsp)
	cmpw	%r14w, 62(%rsp)
	je	.L14
.L32:
	movl	%ebx, %eax
	xorl	%edx, %edx
	movq	(%r15), %r12
	movl	%ebx, %ecx
	divw	%r11w
	movl	%r14d, %eax
	movl	%edx, %edi
	xorl	%edx, %edx
	divw	%r11w
	movzwl	%di, %eax
	movq	%rax, 40(%rsp)
	imulq	$2000, %rax, %rax
	movzwl	%dx, %esi
	movzwl	%dx, %edx
	addq	%rdx, %rax
	movq	%rdx, 48(%rsp)
	movq	(%r8,%rax,8), %rax
	testq	%rax, %rax
	je	.L16
	addq	%rax, %r12
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L18:
	leal	-1(%r14), %r9d
	xorl	%edx, %edx
	movl	%r9d, %eax
	movzwl	%r9w, %ebp
	movzwl	%r9w, %edi
	divw	%r11w
	movq	0(%r13,%rbp,8), %rax
	movq	%rax, 32(%rsp)
	movzwl	%dx, %esi
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L45:
	addq	%rax, 32(%rsp)
	jmp	.L27
.L15:
	movq	$0, 8(%rsp)
.L14:
	movq	8(%rsp), %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$152, %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
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	leal	-2(%r9), %eax
	xorl	%edx, %edx
	movzwl	%ax, %edi
	movzwl	%ax, %ebp
	divw	%r11w
	movl	%edi, 72(%rsp)
	movslq	108(%rsp), %rax
	movw	%bp, 16(%rsp)
	movzwl	64(%rsp), %edi
	movzwl	%dx, %esi
	movq	88(%rsp), %rdx
	movq	%rdx, 80(%rsp)
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L22:
	movzwl	16(%rsp), %eax
	xorl	%edx, %edx
	leal	-2(%r9), %edi
	movslq	72(%rsp), %rbp
	movw	%di, 112(%rsp)
	movzwl	%di, %edi
	divw	%r11w
	movzwl	16(%rsp), %eax
	movl	%edi, 136(%rsp)
	movw	%ax, 128(%rsp)
	movzwl	64(%rsp), %eax
	movw	%ax, 88(%rsp)
	movq	%rbp, %rdi
	movzwl	%dx, %esi
	movl	76(%rsp), %edx
	movl	%edx, 132(%rsp)
	jmp	.L23
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB24:
	.cfi_startproc
	endbr64
	movzwl	u2Num(%rip), %ecx
	movl	%esi, %eax
	xorl	%edx, %edx
	divw	%cx
	movl	%edi, %eax
	movzwl	%dx, %r8d
	xorl	%edx, %edx
	divw	%cx
	leaq	au8Memo(%rip), %rax
	movzwl	%dx, %edx
	imulq	$2000, %rdx, %rdx
	addq	%r8, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L46
	cmpw	%si, %di
	jnb	.L46
	movzwl	%si, %esi
	movzwl	%di, %edi
	jmp	dfs.part.0
	.p2align 4,,10
	.p2align 3
.L46:
	ret
	.cfi_endproc
.LFE24:
	.size	dfs, .-dfs
	.local	au8Memo
	.comm	au8Memo,32000000,32
	.local	au4Size
	.comm	au4Size,32000,32
	.local	u2Num
	.comm	u2Num,2,2
	.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 <stdio.h>

// 定数定義
#define MAX_PIECE   (2000)

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

// 汎用型宣言
typedef unsigned long long U8;
typedef unsigned long  U4;
typedef unsigned short U2;
typedef unsigned char  U1;

// 関数宣言
U8 dfs(U2 u2Lower, U2 u2Upper);

// グローバル変数（入力とメモ）
static U2 u2Num;
static U4 au4Size[MAX_PIECE * 2];

static U8 au8Memo[MAX_PIECE][MAX_PIECE] = {{0}}; // 初期化処理は省略

int main(){
    U2 u2Cnt;
    U8 u8Score;
    U8 u8Max;

    // 入力
    // ケーキのサイズは2週分のデータを格納して処理を簡略化する
    scanf("%hd",&u2Num);
    for(u2Cnt = 0; u2Cnt < u2Num; u2Cnt++){
        scanf("%ld",&au4Size[u2Cnt]);
        au4Size[u2Num + u2Cnt] = au4Size[u2Cnt];
    }

    // 初手は全探索 以降はメモ化再帰
    u8Max = 0;
    for(u2Cnt = 0; u2Cnt < u2Num; u2Cnt++){
        u8Score = au4Size[u2Cnt] + dfs(u2Cnt+1,u2Cnt+u2Num-1);
        u8Max = MAX(u8Max, u8Score);
    }

    // 出力
    printf("%lld\n", u8Max);

    return 0;
}


// 深さ優先探索（再帰）
// 残りのケーキの左右のインデックスを受け取り、そこから得られる最大点数を返す
U8 dfs(U2 u2Lower, U2 u2Upper){
    U8 u8Sum1;
    U8 u8Sum2;
    U2 u2NextLo;
    U2 u2NextUp;
    U8 u8Ans;

    // すでに計算済み
    if(au8Memo[u2Lower % u2Num][u2Upper % u2Num] > 0){
        return au8Memo[u2Lower % u2Num][u2Upper % u2Num];
    }

    // 残りケーキが0～1個だともう取れない
    if(u2Lower >= u2Upper){
        return 0;
    }

    // 相手が大きいほうを取る
    u2NextLo = u2Lower;
    u2NextUp = u2Upper;
    if(au4Size[u2NextLo] > au4Size[u2NextUp]){
        u2NextLo++;
    }else{
        u2NextUp--;
    }

    // 自分がどちらを取ればよいかは再帰して確認し結果が大きいほうを選ぶ
    u8Sum1 = au4Size[u2NextLo] + dfs(u2NextLo+1, u2NextUp);
    u8Sum2 = au4Size[u2NextUp] + dfs(u2NextLo, u2NextUp-1);
    u8Ans = MAX(u8Sum1, u8Sum2);

    // 計算結果を記憶
    au8Memo[u2Lower % u2Num][u2Upper % u2Num] = u8Ans;

    return u8Ans;
}


5
2
8
1
10
12
 5
2
8
1
10
13
 5
2
8
1
18
24
 5
3
8
0
18
24
 5
3
5
0
18
24
 5
3
5
0
17
4
 5
5
5
0
26
4
 5
2
8
1
0
9
 5
2
3
1
10
12
 5
4
8
1
18
13

21
 22
 33
 32
 29
 20
 31
 17
 16
 23

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

```c
#include <stdio.h>

// 定数定義
#define MAX_PIECE   (2000)

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

// 汎用型宣言
typedef unsigned long long U8;
typedef unsigned long  U4;
typedef unsigned short U2;
typedef unsigned char  U1;

// 関数宣言
U8 dfs(U2 u2Lower, U2 u2Upper);

// グローバル変数（入力とメモ）
static U2 u2Num;
static U4 au4Size[MAX_PIECE * 2];

static U8 au8Memo[MAX_PIECE][MAX_PIECE] = {{0}}; // 初期化処理は省略

int main(){
    U2 u2Cnt;
    U8 u8Score;
    U8 u8Max;

    // 入力
    // ケーキのサイズは2週分のデータを格納して処理を簡略化する
    scanf("%hd",&u2Num);
    for(u2Cnt = 0; u2Cnt < u2Num; u2Cnt++){
        scanf("%ld",&au4Size[u2Cnt]);
        au4Size[u2Num + u2Cnt] = au4Size[u2Cnt];
    }

    // 初手は全探索 以降はメモ化再帰
    u8Max = 0;
    for(u2Cnt = 0; u2Cnt < u2Num; u2Cnt++){
        u8Score = au4Size[u2Cnt] + dfs(u2Cnt+1,u2Cnt+u2Num-1);
        u8Max = MAX(u8Max, u8Score);
    }

    // 出力
    printf("%lld\n", u8Max);

    return 0;
}


// 深さ優先探索（再帰）
// 残りのケーキの左右のインデックスを受け取り、そこから得られる最大点数を返す
U8 dfs(U2 u2Lower, U2 u2Upper){
    U8 u8Sum1;
    U8 u8Sum2;
    U2 u2NextLo;
    U2 u2NextUp;
    U8 u8Ans;

    // すでに計算済み
    if(au8Memo[u2Lower % u2Num][u2Upper % u2Num] > 0){
        return au8Memo[u2Lower % u2Num][u2Upper % u2Num];
    }

    // 残りケーキが0～1個だともう取れない
    if(u2Lower >= u2Upper){
        return 0;
    }

    // 相手が大きいほうを取る
    u2NextLo = u2Lower;
    u2NextUp = u2Upper;
    if(au4Size[u2NextLo] > au4Size[u2NextUp]){
        u2NextLo++;
    }else{
        u2NextUp--;
    }

    // 自分がどちらを取ればよいかは再帰して確認し結果が大きいほうを選ぶ
    u8Sum1 = au4Size[u2NextLo] + dfs(u2NextLo+1, u2NextUp);
    u8Sum2 = au4Size[u2NextUp] + dfs(u2NextLo, u2NextUp-1);
    u8Ans = MAX(u8Sum1, u8Sum2);

    // 計算結果を記憶
    au8Memo[u2Lower % u2Num][u2Upper % u2Num] = u8Ans;

    return u8Ans;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	u2Num
	.comm	u2Num,2,2
	.local	au4Size
	.comm	au4Size,32000,32
	.local	au8Memo
	.comm	au8Memo,32000000,32
	.section	.rodata
.LC0:
	.string	"%hd"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	leaq	u2Num(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movw	$0, -34(%rbp)
	jmp	.L2
.L3:
	movzwl	-34(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzwl	-34(%rbp), %eax
	movzwl	u2Num(%rip), %edx
	movzwl	%dx, %ecx
	movzwl	-34(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	au4Size(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movzwl	-34(%rbp), %eax
	addl	$1, %eax
	movw	%ax, -34(%rbp)
.L2:
	movzwl	u2Num(%rip), %eax
	cmpw	%ax, -34(%rbp)
	jb	.L3
	movq	$0, -32(%rbp)
	movw	$0, -34(%rbp)
	jmp	.L4
.L5:
	movzwl	-34(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rbx
	movzwl	u2Num(%rip), %edx
	movzwl	-34(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movzwl	%ax, %edx
	movzwl	-34(%rbp), %eax
	addl	$1, %eax
	movzwl	%ax, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addq	%rbx, %rax
	movq	%rax, -24(%rbp)
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movq	%rax, -32(%rbp)
	movzwl	-34(%rbp), %eax
	addl	$1, %eax
	movw	%ax, -34(%rbp)
.L4:
	movzwl	u2Num(%rip), %eax
	cmpw	%ax, -34(%rbp)
	jb	.L5
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movl	%edi, %edx
	movl	%esi, %eax
	movw	%dx, -52(%rbp)
	movw	%ax, -56(%rbp)
	movzwl	u2Num(%rip), %ecx
	movzwl	-52(%rbp), %eax
	movl	$0, %edx
	divw	%cx
	movl	%edx, %eax
	movzwl	%ax, %ecx
	movzwl	u2Num(%rip), %esi
	movzwl	-56(%rbp), %eax
	movl	$0, %edx
	divw	%si
	movl	%edx, %eax
	movzwl	%ax, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2000, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	au8Memo(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	je	.L8
	movzwl	u2Num(%rip), %ecx
	movzwl	-52(%rbp), %eax
	movl	$0, %edx
	divw	%cx
	movl	%edx, %eax
	movzwl	%ax, %ecx
	movzwl	u2Num(%rip), %esi
	movzwl	-56(%rbp), %eax
	movl	$0, %edx
	divw	%si
	movl	%edx, %eax
	movzwl	%ax, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2000, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	au8Memo(%rip), %rax
	movq	(%rdx,%rax), %rax
	jmp	.L9
.L8:
	movzwl	-52(%rbp), %eax
	cmpw	-56(%rbp), %ax
	jb	.L10
	movl	$0, %eax
	jmp	.L9
.L10:
	movzwl	-52(%rbp), %eax
	movw	%ax, -44(%rbp)
	movzwl	-56(%rbp), %eax
	movw	%ax, -42(%rbp)
	movzwl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movzwl	-42(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	au4Size(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jbe	.L11
	movzwl	-44(%rbp), %eax
	addl	$1, %eax
	movw	%ax, -44(%rbp)
	jmp	.L12
.L11:
	movzwl	-42(%rbp), %eax
	subl	$1, %eax
	movw	%ax, -42(%rbp)
.L12:
	movzwl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rbx
	movzwl	-42(%rbp), %edx
	movzwl	-44(%rbp), %eax
	addl	$1, %eax
	movzwl	%ax, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addq	%rbx, %rax
	movq	%rax, -40(%rbp)
	movzwl	-42(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rbx
	movzwl	-42(%rbp), %eax
	subl	$1, %eax
	movzwl	%ax, %edx
	movzwl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addq	%rbx, %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movq	%rax, -24(%rbp)
	movzwl	u2Num(%rip), %ecx
	movzwl	-52(%rbp), %eax
	movl	$0, %edx
	divw	%cx
	movl	%edx, %eax
	movzwl	%ax, %ecx
	movzwl	u2Num(%rip), %esi
	movzwl	-56(%rbp), %eax
	movl	$0, %edx
	divw	%si
	movl	%edx, %eax
	movzwl	%ax, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2000, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	au8Memo(%rip), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movq	-24(%rbp), %rax
.L9:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	dfs, .-dfs
	.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
	.local	u2Num
	.comm	u2Num,2,2
	.local	au4Size
	.comm	au4Size,32000,32
	.local	au8Memo
	.comm	au8Memo,32000000,32
	.section	.rodata
.LC0:
	.string	"%hd"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	leaq	u2Num(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movw	$0, -34(%rbp)
	jmp	.L2
.L3:
	movzwl	-34(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzwl	-34(%rbp), %eax
	movzwl	u2Num(%rip), %edx
	movzwl	%dx, %ecx
	movzwl	-34(%rbp), %edx
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	au4Size(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movzwl	-34(%rbp), %eax
	addl	$1, %eax
	movw	%ax, -34(%rbp)
.L2:
	movzwl	u2Num(%rip), %eax
	cmpw	%ax, -34(%rbp)
	jb	.L3
	movq	$0, -32(%rbp)
	movw	$0, -34(%rbp)
	jmp	.L4
.L5:
	movzwl	-34(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rbx
	movzwl	u2Num(%rip), %edx
	movzwl	-34(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movzwl	%ax, %edx
	movzwl	-34(%rbp), %eax
	addl	$1, %eax
	movzwl	%ax, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addq	%rbx, %rax
	movq	%rax, -24(%rbp)
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movq	%rax, -32(%rbp)
	movzwl	-34(%rbp), %eax
	addl	$1, %eax
	movw	%ax, -34(%rbp)
.L4:
	movzwl	u2Num(%rip), %eax
	cmpw	%ax, -34(%rbp)
	jb	.L5
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	dfs
	.type	dfs, @function
dfs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 3, -24
	movl	%edi, %edx
	movl	%esi, %eax
	movw	%dx, -52(%rbp)
	movw	%ax, -56(%rbp)
	movzwl	u2Num(%rip), %ecx
	movzwl	-52(%rbp), %eax
	movl	$0, %edx
	divw	%cx
	movl	%edx, %eax
	movzwl	%ax, %ecx
	movzwl	u2Num(%rip), %esi
	movzwl	-56(%rbp), %eax
	movl	$0, %edx
	divw	%si
	movl	%edx, %eax
	movzwl	%ax, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2000, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	au8Memo(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	je	.L8
	movzwl	u2Num(%rip), %ecx
	movzwl	-52(%rbp), %eax
	movl	$0, %edx
	divw	%cx
	movl	%edx, %eax
	movzwl	%ax, %ecx
	movzwl	u2Num(%rip), %esi
	movzwl	-56(%rbp), %eax
	movl	$0, %edx
	divw	%si
	movl	%edx, %eax
	movzwl	%ax, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2000, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	au8Memo(%rip), %rax
	movq	(%rdx,%rax), %rax
	jmp	.L9
.L8:
	movzwl	-52(%rbp), %eax
	cmpw	-56(%rbp), %ax
	jb	.L10
	movl	$0, %eax
	jmp	.L9
.L10:
	movzwl	-52(%rbp), %eax
	movw	%ax, -44(%rbp)
	movzwl	-56(%rbp), %eax
	movw	%ax, -42(%rbp)
	movzwl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movzwl	-42(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	au4Size(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jbe	.L11
	movzwl	-44(%rbp), %eax
	addl	$1, %eax
	movw	%ax, -44(%rbp)
	jmp	.L12
.L11:
	movzwl	-42(%rbp), %eax
	subl	$1, %eax
	movw	%ax, -42(%rbp)
.L12:
	movzwl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rbx
	movzwl	-42(%rbp), %edx
	movzwl	-44(%rbp), %eax
	addl	$1, %eax
	movzwl	%ax, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addq	%rbx, %rax
	movq	%rax, -40(%rbp)
	movzwl	-42(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	au4Size(%rip), %rax
	movq	(%rdx,%rax), %rbx
	movzwl	-42(%rbp), %eax
	subl	$1, %eax
	movzwl	%ax, %edx
	movzwl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dfs
	addq	%rbx, %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	cmpq	%rax, %rdx
	cmovnb	%rdx, %rax
	movq	%rax, -24(%rbp)
	movzwl	u2Num(%rip), %ecx
	movzwl	-52(%rbp), %eax
	movl	$0, %edx
	divw	%cx
	movl	%edx, %eax
	movzwl	%ax, %ecx
	movzwl	u2Num(%rip), %esi
	movzwl	-56(%rbp), %eax
	movl	$0, %edx
	divw	%si
	movl	%edx, %eax
	movzwl	%ax, %eax
	movslq	%eax, %rdx
	movslq	%ecx, %rax
	imulq	$2000, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rcx
	leaq	au8Memo(%rip), %rdx
	movq	-24(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	movq	-24(%rbp), %rax
.L9:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	dfs, .-dfs
	.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:
