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>
#include <string.h>

#define HIGASHI 0
#define KITA 1

int w, h;
int memo[101][101][2][2];

//	(i, j), 前回の方向, 曲がったか
int getWay(int i, int j, int d, int turn)
{
	int ret = 0;
	
	if (memo[i][j][d][turn] != -1){
		return (memo[i][j][d][turn]);
	}
	
	if (i == w && j == h){
		return (1);
	}
	
	//	前回曲がってないなら曲がるのも含める
	if (turn == 0){
		
		//	東
		if (i + 1 <= w){
			ret += (getWay(i + 1, j, HIGASHI, (d != HIGASHI ? 1 : 0)) % 100000);
		}
		//	北
		if (j + 1 <= h){
			ret += (getWay(i, j + 1, KITA, (d != KITA ? 1 : 0)) % 100000);
		}
	}
	else {
		//	まっすぐだけ
		
		if (d == HIGASHI && i + 1 <= w){
			ret += (getWay(i + 1, j, HIGASHI, 0) % 100000);
		}
		else if (d == KITA && j + 1 <= h){
			ret += (getWay(i, j + 1, KITA, 0) % 100000);
		}
	}
	
	return (memo[i][j][d][turn] = (ret % 100000));
}

int main(void)
{
	int ret = 0;
	
	scanf("%d%d", &w, &h);
	while (w != 0){
		memset(memo, -1, sizeof(memo));
		
		ret += (getWay(2, 1, HIGASHI, 0) % 100000);
		ret += (getWay(1, 2, KITA, 0) % 100000);
		printf("%d\n", ret % 100000);
		scanf("%d%d", &w, &h);
		ret = 0;
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	w
	.bss
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	memo
	.align 32
	.type	memo, @object
	.size	memo, 163216
memo:
	.zero	163216
	.text
	.globl	getWay
	.type	getWay, @function
getWay:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	$0, -4(%rbp)
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	movl	-28(%rbp), %eax
	cltq
	addq	%rdx, %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	memo(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L2
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	movl	-28(%rbp), %eax
	cltq
	addq	%rdx, %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	memo(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L3
.L2:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L4
	movl	h(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	cmpl	$0, -32(%rbp)
	jne	.L5
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L6
	cmpl	$0, -28(%rbp)
	setne	%al
	movzbl	%al, %edx
	movl	-20(%rbp), %eax
	leal	1(%rax), %edi
	movl	-24(%rbp), %eax
	movl	%edx, %ecx
	movl	$0, %edx
	movl	%eax, %esi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
.L6:
	movl	h(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L7
	cmpl	$1, -28(%rbp)
	setne	%al
	movzbl	%al, %edx
	movl	-24(%rbp), %eax
	leal	1(%rax), %esi
	movl	-20(%rbp), %eax
	movl	%edx, %ecx
	movl	$1, %edx
	movl	%eax, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	jmp	.L7
.L5:
	cmpl	$0, -28(%rbp)
	jne	.L8
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L8
	movl	-20(%rbp), %eax
	leal	1(%rax), %edi
	movl	-24(%rbp), %eax
	movl	$0, %ecx
	movl	$0, %edx
	movl	%eax, %esi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	jmp	.L7
.L8:
	cmpl	$1, -28(%rbp)
	jne	.L7
	movl	h(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L7
	movl	-24(%rbp), %eax
	leal	1(%rax), %esi
	movl	-20(%rbp), %eax
	movl	$0, %ecx
	movl	$1, %edx
	movl	%eax, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdi
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %r8
	addq	%r8, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	(%rax,%rdi), %rcx
	movl	-28(%rbp), %eax
	cltq
	addq	%rcx, %rcx
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	memo(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	movl	-28(%rbp), %eax
	cltq
	addq	%rdx, %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	memo(%rip), %rax
	movl	(%rdx,%rax), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getWay, .-getWay
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L10
.L11:
	movl	$163216, %edx
	movl	$-1, %esi
	leaq	memo(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, %ecx
	movl	$0, %edx
	movl	$1, %esi
	movl	$2, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	movl	$0, %ecx
	movl	$1, %edx
	movl	$2, %esi
	movl	$1, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	movl	-4(%rbp), %edx
	movslq	%edx, %rax
	imulq	$351843721, %rax, %rax
	shrq	$32, %rax
	sarl	$13, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
.L10:
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	getWay
	.type	getWay, @function
getWay:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edx, %r9
	movslq	%ecx, %r10
	leaq	memo(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%esi, %r13
	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
	movslq	%edi, %rbx
	leaq	(%rbx,%rbx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rbx,%rdx,4), %rdx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	addq	%r13, %rdx
	leaq	(%r9,%rdx,2), %rdx
	leaq	(%r10,%rdx,2), %rdx
	movl	(%r15,%rdx,4), %r12d
	cmpl	$-1, %r12d
	jne	.L1
	movl	w(%rip), %edx
	movq	%rbx, %rbp
	movq	%r9, %r14
	cmpl	%edx, %ebx
	je	.L21
	testl	%r10d, %r10d
	jne	.L5
	cmpl	%edx, %ebx
	jl	.L6
	movl	h(%rip), %edx
	xorl	%r12d, %r12d
.L7:
	cmpl	%edx, %esi
	jl	.L22
.L8:
	leaq	(%rbx,%rbx,4), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rbx,%rax,4), %rax
	addq	%r13, %rax
	leaq	(%r9,%rax,2), %rax
	leaq	(%r10,%rax,2), %rax
	movl	%r12d, (%r15,%rax,4)
.L1:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
.L21:
	.cfi_restore_state
	movl	h(%rip), %edx
	movl	$1, %r12d
	cmpl	%edx, %esi
	je	.L1
	xorl	%r12d, %r12d
	testl	%r10d, %r10d
	je	.L7
	testl	%r9d, %r9d
	je	.L8
.L9:
	xorl	%r12d, %r12d
	cmpl	$1, %r14d
	jne	.L8
	cmpl	h(%rip), %esi
	jge	.L8
	movl	$1, %edx
	addl	$1, %esi
	xorl	%ecx, %ecx
	movl	%ebp, %edi
	movq	%r10, 16(%rsp)
	movq	%r9, 8(%rsp)
	call	getWay
	movq	16(%rsp), %r10
	movq	8(%rsp), %r9
	movslq	%eax, %r12
	cltd
	imulq	$351843721, %r12, %r12
	sarq	$45, %r12
	subl	%edx, %r12d
	imull	$100000, %r12d, %edx
	subl	%edx, %eax
	movl	%eax, %r12d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%r9d, %r9d
	jne	.L9
	xorl	%r12d, %r12d
	cmpl	%edx, %ebx
	jge	.L8
	leal	1(%rbx), %edi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movq	%r10, 16(%rsp)
	movq	%r9, 8(%rsp)
	call	getWay
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%ecx, %ecx
	testl	%r9d, %r9d
	leal	1(%rbx), %edi
	movq	%r10, 24(%rsp)
	setne	%cl
	xorl	%edx, %edx
	movq	%r9, 16(%rsp)
	movl	%esi, 8(%rsp)
	call	getWay
	movl	8(%rsp), %esi
	movq	16(%rsp), %r9
	movslq	%eax, %r12
	cltd
	movq	24(%rsp), %r10
	imulq	$351843721, %r12, %r12
	sarq	$45, %r12
	subl	%edx, %r12d
	imull	$100000, %r12d, %edx
	subl	%edx, %eax
	movl	h(%rip), %edx
	movl	%eax, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	xorl	%ecx, %ecx
	cmpl	$1, %r14d
	movl	$1, %edx
	movl	%ebp, %edi
	setne	%cl
	addl	$1, %esi
	movq	%r10, 16(%rsp)
	movq	%r9, 8(%rsp)
	call	getWay
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$351843721, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$45, %rdx
	subl	%ecx, %edx
	imull	$100000, %edx, %edx
	subl	%edx, %eax
	addl	%r12d, %eax
.L19:
	movslq	%eax, %r12
	cltd
	movq	8(%rsp), %r9
	movq	16(%rsp), %r10
	imulq	$351843721, %r12, %r12
	sarq	$45, %r12
	subl	%edx, %r12d
	imull	$100000, %r12d, %edx
	subl	%edx, %eax
	movl	%eax, %r12d
	jmp	.L8
	.cfi_endproc
.LFE35:
	.size	getWay, .-getWay
	.p2align 4
	.type	getWay.part.0, @function
getWay.part.0:
.LFB37:
	.cfi_startproc
	movl	w(%rip), %eax
	movslq	%edi, %r8
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movslq	%esi, %r11
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movslq	%ecx, %rbx
	cmpl	%r8d, %eax
	je	.L44
	testl	%ebx, %ebx
	jne	.L27
	cmpl	%r8d, %eax
	jg	.L28
	movl	h(%rip), %eax
	xorl	%r12d, %r12d
.L29:
	cmpl	%eax, %r11d
	jl	.L45
.L30:
	leaq	(%r8,%r8,4), %rax
	movslq	%ebp, %rdx
	leaq	(%rax,%rax,4), %rax
	leaq	(%r8,%rax,4), %rax
	addq	%rax, %r11
	leaq	(%rdx,%r11,2), %rax
	leaq	(%rbx,%rax,2), %rdx
	leaq	memo(%rip), %rax
	movl	%r12d, (%rax,%rdx,4)
.L23:
	movl	%r12d, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	testl	%edx, %edx
	jne	.L31
	xorl	%r12d, %r12d
	cmpl	%r8d, %eax
	jle	.L30
	leal	1(%r8), %edi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movl	%r11d, %esi
.L43:
	call	getWay
.L42:
	movslq	%eax, %r12
	cltd
	imulq	$351843721, %r12, %r12
	sarq	$45, %r12
	subl	%edx, %r12d
	imull	$100000, %r12d, %edx
	subl	%edx, %eax
	movl	%eax, %r12d
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L44:
	movl	h(%rip), %eax
	movl	$1, %r12d
	cmpl	%r11d, %eax
	je	.L23
	xorl	%r12d, %r12d
	testl	%ebx, %ebx
	je	.L29
	testl	%edx, %edx
	je	.L30
.L31:
	xorl	%r12d, %r12d
	cmpl	$1, %ebp
	jne	.L30
	cmpl	h(%rip), %r11d
	jge	.L30
	leal	1(%r11), %esi
	xorl	%ecx, %ecx
	movl	$1, %edx
	movl	%r8d, %edi
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L28:
	xorl	%ecx, %ecx
	testl	%edx, %edx
	leal	1(%r8), %edi
	movl	%r11d, %esi
	setne	%cl
	xorl	%edx, %edx
	call	getWay
	movslq	%eax, %r12
	cltd
	imulq	$351843721, %r12, %r12
	sarq	$45, %r12
	subl	%edx, %r12d
	imull	$100000, %r12d, %edx
	subl	%edx, %eax
	movl	%eax, %r12d
	movl	h(%rip), %eax
	cmpl	%eax, %r11d
	jge	.L30
.L45:
	xorl	%ecx, %ecx
	cmpl	$1, %ebp
	movl	$1, %edx
	movl	%r8d, %edi
	setne	%cl
	leal	1(%r11), %esi
	call	getWay
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$351843721, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$45, %rdx
	subl	%ecx, %edx
	imull	$100000, %edx, %edx
	subl	%edx, %eax
	addl	%r12d, %eax
	jmp	.L42
	.cfi_endproc
.LFE37:
	.size	getWay.part.0, .-getWay.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	h(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	w(%rip), %r12
	movq	%r13, %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	movq	%r12, %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	movl	w(%rip), %ebx
	testl	%ebx, %ebx
	je	.L71
	leaq	memo(%rip), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L47:
	movl	$163216, %edx
	movl	$-1, %esi
	movq	%r15, %rdi
	call	memset@PLT
	cmpl	$2, %ebx
	je	.L75
	jg	.L51
	movl	h(%rip), %eax
.L73:
	xorl	%ebx, %ebx
.L50:
	cmpl	$1, %eax
	jg	.L76
.L52:
	movl	%ebx, 3248+memo(%rip)
.L49:
	movl	1656+memo(%rip), %eax
	cmpl	$-1, %eax
	je	.L54
	movslq	%eax, %r8
	cltd
	imulq	$351843721, %r8, %r8
	sarq	$45, %r8
	subl	%edx, %r8d
	imull	$100000, %r8d, %edx
	subl	%edx, %eax
	movl	%eax, %r8d
.L55:
	leal	(%rbx,%r8), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$351843721, %rax, %rax
	sarl	$31, %ecx
	sarq	$45, %rax
	subl	%ecx, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %ebx
	testl	%ebx, %ebx
	jne	.L47
.L71:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L54:
	.cfi_restore_state
	movl	w(%rip), %r8d
	cmpl	$1, %r8d
	je	.L77
	jg	.L58
	movl	h(%rip), %eax
.L74:
	xorl	%r8d, %r8d
.L57:
	cmpl	$2, %eax
	jg	.L78
.L60:
	movl	%r8d, 1656+memo(%rip)
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L75:
	movl	h(%rip), %eax
	movl	$1, %ebx
	cmpl	$1, %eax
	jne	.L73
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L76:
	movl	3276+memo(%rip), %eax
	cmpl	$-1, %eax
	jne	.L53
	movl	$1, %ecx
	movl	$1, %edx
	movl	$2, %esi
	movl	$2, %edi
	call	getWay.part.0
.L53:
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$351843721, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$45, %rdx
	subl	%ecx, %edx
	imull	$100000, %edx, %edx
	subl	%edx, %eax
	addl	%ebx, %eax
	movslq	%eax, %rbx
	cltd
	imulq	$351843721, %rbx, %rbx
	sarq	$45, %rbx
	subl	%edx, %ebx
	imull	$100000, %ebx, %edx
	subl	%edx, %eax
	movl	%eax, %ebx
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L51:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %esi
	movl	$3, %edi
	call	getWay.part.0
	movslq	%eax, %rbx
	cltd
	imulq	$351843721, %rbx, %rbx
	sarq	$45, %rbx
	subl	%edx, %ebx
	imull	$100000, %ebx, %edx
	subl	%edx, %eax
	movl	%eax, %ebx
	movl	h(%rip), %eax
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L77:
	movl	h(%rip), %eax
	cmpl	$2, %eax
	jne	.L74
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L78:
	movl	1672+memo(%rip), %eax
	cmpl	$-1, %eax
	jne	.L61
	xorl	%ecx, %ecx
	movl	$1, %edx
	movl	$3, %esi
	movl	$1, %edi
	movl	%r8d, 12(%rsp)
	call	getWay.part.0
	movl	12(%rsp), %r8d
.L61:
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$351843721, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$45, %rdx
	subl	%ecx, %edx
	imull	$100000, %edx, %edx
	subl	%edx, %eax
	addl	%r8d, %eax
	movslq	%eax, %r8
	cltd
	imulq	$351843721, %r8, %r8
	sarq	$45, %r8
	subl	%edx, %r8d
	imull	$100000, %r8d, %edx
	subl	%edx, %eax
	movl	%eax, %r8d
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L58:
	movl	3268+memo(%rip), %eax
	cmpl	$-1, %eax
	jne	.L59
	movl	$1, %ecx
	xorl	%edx, %edx
	movl	$2, %esi
	movl	$2, %edi
	call	getWay.part.0
.L59:
	movslq	%eax, %r8
	cltd
	imulq	$351843721, %r8, %r8
	sarq	$45, %r8
	subl	%edx, %r8d
	imull	$100000, %r8d, %edx
	subl	%edx, %eax
	movl	%eax, %r8d
	movl	h(%rip), %eax
	jmp	.L57
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	memo
	.bss
	.align 32
	.type	memo, @object
	.size	memo, 163216
memo:
	.zero	163216
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.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	getWay
	.type	getWay, @function
getWay:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edx, %r9
	movslq	%ecx, %r10
	leaq	memo(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%esi, %r13
	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
	movslq	%edi, %rbx
	leaq	(%rbx,%rbx,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rbx,%rdx,4), %rdx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	addq	%r13, %rdx
	leaq	(%r9,%rdx,2), %rdx
	leaq	(%r10,%rdx,2), %rdx
	movl	(%r15,%rdx,4), %r12d
	cmpl	$-1, %r12d
	jne	.L1
	movl	w(%rip), %edx
	movq	%rbx, %rbp
	movq	%r9, %r14
	cmpl	%edx, %ebx
	je	.L21
	testl	%r10d, %r10d
	jne	.L5
	cmpl	%edx, %ebx
	jl	.L6
	movl	h(%rip), %edx
	xorl	%r12d, %r12d
.L7:
	cmpl	%edx, %esi
	jl	.L22
.L8:
	leaq	(%rbx,%rbx,4), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rbx,%rax,4), %rax
	addq	%r13, %rax
	leaq	(%r9,%rax,2), %rax
	leaq	(%r10,%rax,2), %rax
	movl	%r12d, (%r15,%rax,4)
.L1:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
.L21:
	.cfi_restore_state
	movl	h(%rip), %edx
	movl	$1, %r12d
	cmpl	%edx, %esi
	je	.L1
	xorl	%r12d, %r12d
	testl	%r10d, %r10d
	je	.L7
	testl	%r9d, %r9d
	je	.L8
.L9:
	xorl	%r12d, %r12d
	cmpl	$1, %r14d
	jne	.L8
	cmpl	h(%rip), %esi
	jge	.L8
	movl	$1, %edx
	addl	$1, %esi
	xorl	%ecx, %ecx
	movl	%ebp, %edi
	movq	%r10, 16(%rsp)
	movq	%r9, 8(%rsp)
	call	getWay
	movq	16(%rsp), %r10
	movq	8(%rsp), %r9
	movslq	%eax, %r12
	cltd
	imulq	$351843721, %r12, %r12
	sarq	$45, %r12
	subl	%edx, %r12d
	imull	$100000, %r12d, %edx
	subl	%edx, %eax
	movl	%eax, %r12d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%r9d, %r9d
	jne	.L9
	xorl	%r12d, %r12d
	cmpl	%edx, %ebx
	jge	.L8
	leal	1(%rbx), %edi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movq	%r10, 16(%rsp)
	movq	%r9, 8(%rsp)
	call	getWay
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%ecx, %ecx
	testl	%r9d, %r9d
	leal	1(%rbx), %edi
	movq	%r10, 24(%rsp)
	setne	%cl
	xorl	%edx, %edx
	movq	%r9, 16(%rsp)
	movl	%esi, 8(%rsp)
	call	getWay
	movl	8(%rsp), %esi
	movq	16(%rsp), %r9
	movslq	%eax, %r12
	cltd
	movq	24(%rsp), %r10
	imulq	$351843721, %r12, %r12
	sarq	$45, %r12
	subl	%edx, %r12d
	imull	$100000, %r12d, %edx
	subl	%edx, %eax
	movl	h(%rip), %edx
	movl	%eax, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	xorl	%ecx, %ecx
	cmpl	$1, %r14d
	movl	$1, %edx
	movl	%ebp, %edi
	setne	%cl
	addl	$1, %esi
	movq	%r10, 16(%rsp)
	movq	%r9, 8(%rsp)
	call	getWay
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$351843721, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$45, %rdx
	subl	%ecx, %edx
	imull	$100000, %edx, %edx
	subl	%edx, %eax
	addl	%r12d, %eax
.L19:
	movslq	%eax, %r12
	cltd
	movq	8(%rsp), %r9
	movq	16(%rsp), %r10
	imulq	$351843721, %r12, %r12
	sarq	$45, %r12
	subl	%edx, %r12d
	imull	$100000, %r12d, %edx
	subl	%edx, %eax
	movl	%eax, %r12d
	jmp	.L8
	.cfi_endproc
.LFE35:
	.size	getWay, .-getWay
	.p2align 4
	.type	getWay.part.0, @function
getWay.part.0:
.LFB37:
	.cfi_startproc
	movl	w(%rip), %eax
	movslq	%edi, %r8
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movslq	%esi, %r11
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movslq	%ecx, %rbx
	cmpl	%r8d, %eax
	je	.L44
	testl	%ebx, %ebx
	jne	.L27
	cmpl	%r8d, %eax
	jg	.L28
	movl	h(%rip), %eax
	xorl	%r12d, %r12d
.L29:
	cmpl	%eax, %r11d
	jl	.L45
.L30:
	leaq	(%r8,%r8,4), %rax
	movslq	%ebp, %rdx
	leaq	(%rax,%rax,4), %rax
	leaq	(%r8,%rax,4), %rax
	addq	%rax, %r11
	leaq	(%rdx,%r11,2), %rax
	leaq	(%rbx,%rax,2), %rdx
	leaq	memo(%rip), %rax
	movl	%r12d, (%rax,%rdx,4)
.L23:
	movl	%r12d, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	testl	%edx, %edx
	jne	.L31
	xorl	%r12d, %r12d
	cmpl	%r8d, %eax
	jle	.L30
	leal	1(%r8), %edi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	movl	%r11d, %esi
.L43:
	call	getWay
.L42:
	movslq	%eax, %r12
	cltd
	imulq	$351843721, %r12, %r12
	sarq	$45, %r12
	subl	%edx, %r12d
	imull	$100000, %r12d, %edx
	subl	%edx, %eax
	movl	%eax, %r12d
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L44:
	movl	h(%rip), %eax
	movl	$1, %r12d
	cmpl	%r11d, %eax
	je	.L23
	xorl	%r12d, %r12d
	testl	%ebx, %ebx
	je	.L29
	testl	%edx, %edx
	je	.L30
.L31:
	xorl	%r12d, %r12d
	cmpl	$1, %ebp
	jne	.L30
	cmpl	h(%rip), %r11d
	jge	.L30
	leal	1(%r11), %esi
	xorl	%ecx, %ecx
	movl	$1, %edx
	movl	%r8d, %edi
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L28:
	xorl	%ecx, %ecx
	testl	%edx, %edx
	leal	1(%r8), %edi
	movl	%r11d, %esi
	setne	%cl
	xorl	%edx, %edx
	call	getWay
	movslq	%eax, %r12
	cltd
	imulq	$351843721, %r12, %r12
	sarq	$45, %r12
	subl	%edx, %r12d
	imull	$100000, %r12d, %edx
	subl	%edx, %eax
	movl	%eax, %r12d
	movl	h(%rip), %eax
	cmpl	%eax, %r11d
	jge	.L30
.L45:
	xorl	%ecx, %ecx
	cmpl	$1, %ebp
	movl	$1, %edx
	movl	%r8d, %edi
	setne	%cl
	leal	1(%r11), %esi
	call	getWay
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$351843721, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$45, %rdx
	subl	%ecx, %edx
	imull	$100000, %edx, %edx
	subl	%edx, %eax
	addl	%r12d, %eax
	jmp	.L42
	.cfi_endproc
.LFE37:
	.size	getWay.part.0, .-getWay.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	h(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	w(%rip), %r12
	movq	%r13, %rdx
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	movq	%r12, %rsi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	call	__isoc99_scanf@PLT
	movl	w(%rip), %ebx
	testl	%ebx, %ebx
	je	.L71
	leaq	memo(%rip), %r15
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L47:
	movl	$163216, %edx
	movl	$-1, %esi
	movq	%r15, %rdi
	call	memset@PLT
	cmpl	$2, %ebx
	je	.L75
	jg	.L51
	movl	h(%rip), %eax
.L73:
	xorl	%ebx, %ebx
.L50:
	cmpl	$1, %eax
	jg	.L76
.L52:
	movl	%ebx, 3248+memo(%rip)
.L49:
	movl	1656+memo(%rip), %eax
	cmpl	$-1, %eax
	je	.L54
	movslq	%eax, %r8
	cltd
	imulq	$351843721, %r8, %r8
	sarq	$45, %r8
	subl	%edx, %r8d
	imull	$100000, %r8d, %edx
	subl	%edx, %eax
	movl	%eax, %r8d
.L55:
	leal	(%rbx,%r8), %edx
	movq	%r14, %rsi
	movl	$1, %edi
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$351843721, %rax, %rax
	sarl	$31, %ecx
	sarq	$45, %rax
	subl	%ecx, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	w(%rip), %ebx
	testl	%ebx, %ebx
	jne	.L47
.L71:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L54:
	.cfi_restore_state
	movl	w(%rip), %r8d
	cmpl	$1, %r8d
	je	.L77
	jg	.L58
	movl	h(%rip), %eax
.L74:
	xorl	%r8d, %r8d
.L57:
	cmpl	$2, %eax
	jg	.L78
.L60:
	movl	%r8d, 1656+memo(%rip)
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L75:
	movl	h(%rip), %eax
	movl	$1, %ebx
	cmpl	$1, %eax
	jne	.L73
	jmp	.L49
	.p2align 4,,10
	.p2align 3
.L76:
	movl	3276+memo(%rip), %eax
	cmpl	$-1, %eax
	jne	.L53
	movl	$1, %ecx
	movl	$1, %edx
	movl	$2, %esi
	movl	$2, %edi
	call	getWay.part.0
.L53:
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$351843721, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$45, %rdx
	subl	%ecx, %edx
	imull	$100000, %edx, %edx
	subl	%edx, %eax
	addl	%ebx, %eax
	movslq	%eax, %rbx
	cltd
	imulq	$351843721, %rbx, %rbx
	sarq	$45, %rbx
	subl	%edx, %ebx
	imull	$100000, %ebx, %edx
	subl	%edx, %eax
	movl	%eax, %ebx
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L51:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %esi
	movl	$3, %edi
	call	getWay.part.0
	movslq	%eax, %rbx
	cltd
	imulq	$351843721, %rbx, %rbx
	sarq	$45, %rbx
	subl	%edx, %ebx
	imull	$100000, %ebx, %edx
	subl	%edx, %eax
	movl	%eax, %ebx
	movl	h(%rip), %eax
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L77:
	movl	h(%rip), %eax
	cmpl	$2, %eax
	jne	.L74
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L78:
	movl	1672+memo(%rip), %eax
	cmpl	$-1, %eax
	jne	.L61
	xorl	%ecx, %ecx
	movl	$1, %edx
	movl	$3, %esi
	movl	$1, %edi
	movl	%r8d, 12(%rsp)
	call	getWay.part.0
	movl	12(%rsp), %r8d
.L61:
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$351843721, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$45, %rdx
	subl	%ecx, %edx
	imull	$100000, %edx, %edx
	subl	%edx, %eax
	addl	%r8d, %eax
	movslq	%eax, %r8
	cltd
	imulq	$351843721, %r8, %r8
	sarq	$45, %r8
	subl	%edx, %r8d
	imull	$100000, %r8d, %edx
	subl	%edx, %eax
	movl	%eax, %r8d
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L58:
	movl	3268+memo(%rip), %eax
	cmpl	$-1, %eax
	jne	.L59
	movl	$1, %ecx
	xorl	%edx, %edx
	movl	$2, %esi
	movl	$2, %edi
	call	getWay.part.0
.L59:
	movslq	%eax, %r8
	cltd
	imulq	$351843721, %r8, %r8
	sarq	$45, %r8
	subl	%edx, %r8d
	imull	$100000, %r8d, %edx
	subl	%edx, %eax
	movl	%eax, %r8d
	movl	h(%rip), %eax
	jmp	.L57
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	memo
	.bss
	.align 32
	.type	memo, @object
	.size	memo, 163216
memo:
	.zero	163216
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	w
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.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 <stdio.h>
#include <string.h>

#define HIGASHI 0
#define KITA 1

int w, h;
int memo[101][101][2][2];

//	(i, j), 前回の方向, 曲がったか
int getWay(int i, int j, int d, int turn)
{
	int ret = 0;
	
	if (memo[i][j][d][turn] != -1){
		return (memo[i][j][d][turn]);
	}
	
	if (i == w && j == h){
		return (1);
	}
	
	//	前回曲がってないなら曲がるのも含める
	if (turn == 0){
		
		//	東
		if (i + 1 <= w){
			ret += (getWay(i + 1, j, HIGASHI, (d != HIGASHI ? 1 : 0)) % 100000);
		}
		//	北
		if (j + 1 <= h){
			ret += (getWay(i, j + 1, KITA, (d != KITA ? 1 : 0)) % 100000);
		}
	}
	else {
		//	まっすぐだけ
		
		if (d == HIGASHI && i + 1 <= w){
			ret += (getWay(i + 1, j, HIGASHI, 0) % 100000);
		}
		else if (d == KITA && j + 1 <= h){
			ret += (getWay(i, j + 1, KITA, 0) % 100000);
		}
	}
	
	return (memo[i][j][d][turn] = (ret % 100000));
}

int main(void)
{
	int ret = 0;
	
	scanf("%d%d", &w, &h);
	while (w != 0){
		memset(memo, -1, sizeof(memo));
		
		ret += (getWay(2, 1, HIGASHI, 0) % 100000);
		ret += (getWay(1, 2, KITA, 0) % 100000);
		printf("%d\n", ret % 100000);
		scanf("%d%d", &w, &h);
		ret = 0;
	}
	
	return (0);
}
3 4
15 20
0 0
 3 4
15 24
0 0
 3 4
15 34
0 0
 4 4
15 34
0 0
 3 4
15 16
0 0
 3 5
15 34
0 0
 4 4
12 34
0 0
 1 4
15 16
0 0
 2 4
12 34
0 0
 2 1
12 34
0 0

5
58046
 5
8663
 5
73960
 8
73960
 5
25033
 6
73960
 8
55628
 1
25033
 2
55628
 1
55628

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>
#include <string.h>

#define HIGASHI 0
#define KITA 1

int w, h;
int memo[101][101][2][2];

//	(i, j), 前回の方向, 曲がったか
int getWay(int i, int j, int d, int turn)
{
	int ret = 0;
	
	if (memo[i][j][d][turn] != -1){
		return (memo[i][j][d][turn]);
	}
	
	if (i == w && j == h){
		return (1);
	}
	
	//	前回曲がってないなら曲がるのも含める
	if (turn == 0){
		
		//	東
		if (i + 1 <= w){
			ret += (getWay(i + 1, j, HIGASHI, (d != HIGASHI ? 1 : 0)) % 100000);
		}
		//	北
		if (j + 1 <= h){
			ret += (getWay(i, j + 1, KITA, (d != KITA ? 1 : 0)) % 100000);
		}
	}
	else {
		//	まっすぐだけ
		
		if (d == HIGASHI && i + 1 <= w){
			ret += (getWay(i + 1, j, HIGASHI, 0) % 100000);
		}
		else if (d == KITA && j + 1 <= h){
			ret += (getWay(i, j + 1, KITA, 0) % 100000);
		}
	}
	
	return (memo[i][j][d][turn] = (ret % 100000));
}

int main(void)
{
	int ret = 0;
	
	scanf("%d%d", &w, &h);
	while (w != 0){
		memset(memo, -1, sizeof(memo));
		
		ret += (getWay(2, 1, HIGASHI, 0) % 100000);
		ret += (getWay(1, 2, KITA, 0) % 100000);
		printf("%d\n", ret % 100000);
		scanf("%d%d", &w, &h);
		ret = 0;
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	w
	.bss
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	memo
	.align 32
	.type	memo, @object
	.size	memo, 163216
memo:
	.zero	163216
	.text
	.globl	getWay
	.type	getWay, @function
getWay:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	$0, -4(%rbp)
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	movl	-28(%rbp), %eax
	cltq
	addq	%rdx, %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	memo(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L2
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	movl	-28(%rbp), %eax
	cltq
	addq	%rdx, %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	memo(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L3
.L2:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L4
	movl	h(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	cmpl	$0, -32(%rbp)
	jne	.L5
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L6
	cmpl	$0, -28(%rbp)
	setne	%al
	movzbl	%al, %edx
	movl	-20(%rbp), %eax
	leal	1(%rax), %edi
	movl	-24(%rbp), %eax
	movl	%edx, %ecx
	movl	$0, %edx
	movl	%eax, %esi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
.L6:
	movl	h(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L7
	cmpl	$1, -28(%rbp)
	setne	%al
	movzbl	%al, %edx
	movl	-24(%rbp), %eax
	leal	1(%rax), %esi
	movl	-20(%rbp), %eax
	movl	%edx, %ecx
	movl	$1, %edx
	movl	%eax, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	jmp	.L7
.L5:
	cmpl	$0, -28(%rbp)
	jne	.L8
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L8
	movl	-20(%rbp), %eax
	leal	1(%rax), %edi
	movl	-24(%rbp), %eax
	movl	$0, %ecx
	movl	$0, %edx
	movl	%eax, %esi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	jmp	.L7
.L8:
	cmpl	$1, -28(%rbp)
	jne	.L7
	movl	h(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L7
	movl	-24(%rbp), %eax
	leal	1(%rax), %esi
	movl	-20(%rbp), %eax
	movl	$0, %ecx
	movl	$1, %edx
	movl	%eax, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdi
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %r8
	addq	%r8, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	(%rax,%rdi), %rcx
	movl	-28(%rbp), %eax
	cltq
	addq	%rcx, %rcx
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	memo(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	movl	-28(%rbp), %eax
	cltq
	addq	%rdx, %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	memo(%rip), %rax
	movl	(%rdx,%rax), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getWay, .-getWay
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L10
.L11:
	movl	$163216, %edx
	movl	$-1, %esi
	leaq	memo(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, %ecx
	movl	$0, %edx
	movl	$1, %esi
	movl	$2, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	movl	$0, %ecx
	movl	$1, %edx
	movl	$2, %esi
	movl	$1, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	movl	-4(%rbp), %edx
	movslq	%edx, %rax
	imulq	$351843721, %rax, %rax
	shrq	$32, %rax
	sarl	$13, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
.L10:
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	w
	.bss
	.align 4
	.type	w, @object
	.size	w, 4
w:
	.zero	4
	.globl	h
	.align 4
	.type	h, @object
	.size	h, 4
h:
	.zero	4
	.globl	memo
	.align 32
	.type	memo, @object
	.size	memo, 163216
memo:
	.zero	163216
	.text
	.globl	getWay
	.type	getWay, @function
getWay:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	%ecx, -32(%rbp)
	movl	$0, -4(%rbp)
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	movl	-28(%rbp), %eax
	cltq
	addq	%rdx, %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	memo(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L2
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	movl	-28(%rbp), %eax
	cltq
	addq	%rdx, %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	memo(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L3
.L2:
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jne	.L4
	movl	h(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	cmpl	$0, -32(%rbp)
	jne	.L5
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L6
	cmpl	$0, -28(%rbp)
	setne	%al
	movzbl	%al, %edx
	movl	-20(%rbp), %eax
	leal	1(%rax), %edi
	movl	-24(%rbp), %eax
	movl	%edx, %ecx
	movl	$0, %edx
	movl	%eax, %esi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
.L6:
	movl	h(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L7
	cmpl	$1, -28(%rbp)
	setne	%al
	movzbl	%al, %edx
	movl	-24(%rbp), %eax
	leal	1(%rax), %esi
	movl	-20(%rbp), %eax
	movl	%edx, %ecx
	movl	$1, %edx
	movl	%eax, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	jmp	.L7
.L5:
	cmpl	$0, -28(%rbp)
	jne	.L8
	movl	w(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jge	.L8
	movl	-20(%rbp), %eax
	leal	1(%rax), %edi
	movl	-24(%rbp), %eax
	movl	$0, %ecx
	movl	$0, %edx
	movl	%eax, %esi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	jmp	.L7
.L8:
	cmpl	$1, -28(%rbp)
	jne	.L7
	movl	h(%rip), %eax
	cmpl	%eax, -24(%rbp)
	jge	.L7
	movl	-24(%rbp), %eax
	leal	1(%rax), %esi
	movl	-20(%rbp), %eax
	movl	$0, %ecx
	movl	$1, %edx
	movl	%eax, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-32(%rbp), %eax
	movslq	%eax, %rsi
	movl	-24(%rbp), %eax
	movslq	%eax, %rdi
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %r8
	addq	%r8, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	(%rax,%rdi), %rcx
	movl	-28(%rbp), %eax
	cltq
	addq	%rcx, %rcx
	addq	%rcx, %rax
	addq	%rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rcx
	leaq	memo(%rip), %rax
	movl	%edx, (%rcx,%rax)
	movl	-32(%rbp), %eax
	movslq	%eax, %rcx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdi
	addq	%rdi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rsi), %rdx
	movl	-28(%rbp), %eax
	cltq
	addq	%rdx, %rdx
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	memo(%rip), %rax
	movl	(%rdx,%rax), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getWay, .-getWay
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -4(%rbp)
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L10
.L11:
	movl	$163216, %edx
	movl	$-1, %esi
	leaq	memo(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, %ecx
	movl	$0, %edx
	movl	$1, %esi
	movl	$2, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	movl	$0, %ecx
	movl	$1, %edx
	movl	$2, %esi
	movl	$1, %edi
	call	getWay
	movslq	%eax, %rdx
	imulq	$351843721, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$13, %edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	imull	$100000, %edx, %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	addl	%edx, -4(%rbp)
	movl	-4(%rbp), %edx
	movslq	%edx, %rax
	imulq	$351843721, %rax, %rax
	shrq	$32, %rax
	sarl	$13, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	leaq	h(%rip), %rax
	movq	%rax, %rdx
	leaq	w(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -4(%rbp)
.L10:
	movl	w(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
