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>

volatile int stop[40];

int check(int a,int b){
	int i=a*1000+b;
	int j;
	for (j=0;j<40;j++){
		if (i==stop[j]){
			return 1;
		}
	}
	return 0;
}

int saiki(int a,int b){
	if(check(a,b)==1){
		return 0;
	}
	
	if (a==1&&b==1){
		return 1;
	}else if (a==1){
		return saiki(a,b-1);
	}else if(b==1){
		return saiki(a-1,b);
	}else{
		return saiki(a-1,b)+saiki(a,b-1);
	}
}


int main(void){
	for (;;){
		int a,b;
		scanf("%d %d",&a,&b);
		if (a==0&&b==0){
			return 0;
		}
		
		int i;
		for (i=0;i<40;i++){
			stop[i]=0;
		}
		
		int m;
		scanf("%d",&m);
		int s,j,k;
		for (s=0;s<m;s++){
			scanf("%d %d",&j,&k);
			stop[s]=j*1000+k;
		}
		
		printf("%d\n",saiki(a,b));
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	stop
	.bss
	.align 32
	.type	stop, @object
	.size	stop, 160
stop:
	.zero	160
	.text
	.globl	check
	.type	check, @function
check:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	imull	$1000, %eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stop(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L3
	movl	$1, %eax
	jmp	.L4
.L3:
	addl	$1, -8(%rbp)
.L2:
	cmpl	$39, -8(%rbp)
	jle	.L5
	movl	$0, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check, .-check
	.globl	saiki
	.type	saiki, @function
saiki:
.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	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	cmpl	$1, %eax
	jne	.L7
	movl	$0, %eax
	jmp	.L8
.L7:
	cmpl	$1, -20(%rbp)
	jne	.L9
	cmpl	$1, -24(%rbp)
	jne	.L9
	movl	$1, %eax
	jmp	.L8
.L9:
	cmpl	$1, -20(%rbp)
	jne	.L10
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	saiki
	jmp	.L8
.L10:
	cmpl	$1, -24(%rbp)
	jne	.L11
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	saiki
	jmp	.L8
.L11:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	saiki
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	saiki
	addl	%ebx, %eax
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	saiki, .-saiki
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L19:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	jmp	.L21
.L13:
	movl	$0, -16(%rbp)
	jmp	.L15
.L16:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stop(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L15:
	cmpl	$39, -16(%rbp)
	jle	.L16
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L17
.L18:
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	imull	$1000, %eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stop(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L17:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L18
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	saiki
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L21:
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	imull	$1000, %edi, %edi
	xorl	%eax, %eax
	leaq	stop(%rip), %rcx
	addl	%esi, %edi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L7
.L3:
	movslq	%eax, %rdx
	movl	(%rcx,%rdx,4), %edx
	cmpl	%edi, %edx
	jne	.L8
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.p2align 4
	.globl	saiki
	.type	saiki, @function
saiki:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	stop(%rip), %r10
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 40(%rsp)
	movl	%esi, 44(%rsp)
	movl	$0, 72(%rsp)
.L10:
	imull	$1000, 40(%rsp), %ecx
	xorl	%eax, %eax
	addl	44(%rsp), %ecx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L160:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L159
.L12:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L160
.L9:
	movl	72(%rsp), %eax
	addq	$104, %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
.L159:
	.cfi_restore_state
	cmpl	$1, 40(%rsp)
	jne	.L14
	cmpl	$1, 44(%rsp)
	je	.L161
	cmpl	$1, 40(%rsp)
	jne	.L14
	subl	$1, 44(%rsp)
	jmp	.L10
.L14:
	movl	40(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 28(%rsp)
	movl	44(%rsp), %eax
	cmpl	$1, %eax
	je	.L73
	movl	%eax, 36(%rsp)
	movl	$0, 68(%rsp)
.L16:
	imull	$1000, 28(%rsp), %ecx
	xorl	%eax, %eax
	addl	36(%rsp), %ecx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L163:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L162
.L18:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L163
	movl	68(%rsp), %ebx
	subl	$1, 44(%rsp)
	addl	%ebx, 72(%rsp)
	jmp	.L10
.L162:
	cmpl	$1, 28(%rsp)
	jne	.L20
	cmpl	$1, 36(%rsp)
	je	.L164
	cmpl	$1, 28(%rsp)
	jne	.L20
	subl	$1, 36(%rsp)
	jmp	.L16
.L20:
	movl	28(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 20(%rsp)
	movl	36(%rsp), %eax
	cmpl	$1, %eax
	je	.L74
	movl	%eax, 32(%rsp)
	movl	$0, 64(%rsp)
.L22:
	imull	$1000, 20(%rsp), %ecx
	xorl	%eax, %eax
	addl	32(%rsp), %ecx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L166:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L165
.L24:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L166
	movl	64(%rsp), %ebx
	subl	$1, 36(%rsp)
	addl	%ebx, 68(%rsp)
	jmp	.L16
.L165:
	cmpl	$1, 20(%rsp)
	jne	.L26
	cmpl	$1, 32(%rsp)
	je	.L167
	cmpl	$1, 20(%rsp)
	jne	.L26
	subl	$1, 32(%rsp)
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L26:
	movl	20(%rsp), %eax
	leal	-1(%rax), %r9d
	movl	32(%rsp), %eax
	cmpl	$1, %eax
	je	.L75
	movl	%eax, 24(%rsp)
	movl	$0, 60(%rsp)
	movl	%r9d, 16(%rsp)
.L28:
	imull	$1000, 16(%rsp), %ecx
	xorl	%eax, %eax
	addl	24(%rsp), %ecx
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L169:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L168
.L30:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L169
	movl	60(%rsp), %ebx
	subl	$1, 32(%rsp)
	addl	%ebx, 64(%rsp)
	jmp	.L22
.L168:
	cmpl	$1, 16(%rsp)
	jne	.L32
	cmpl	$1, 24(%rsp)
	je	.L170
	cmpl	$1, 16(%rsp)
	jne	.L32
	subl	$1, 24(%rsp)
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L32:
	movl	16(%rsp), %eax
	movl	24(%rsp), %r8d
	leal	-1(%rax), %r9d
	cmpl	$1, %r8d
	je	.L76
	movl	$0, 56(%rsp)
	movl	%r9d, 12(%rsp)
.L34:
	imull	$1000, 12(%rsp), %ecx
	xorl	%eax, %eax
	addl	%r8d, %ecx
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L172:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L171
.L36:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L172
	movl	56(%rsp), %ebx
	subl	$1, 24(%rsp)
	addl	%ebx, 60(%rsp)
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L171:
	cmpl	$1, 12(%rsp)
	jne	.L38
	cmpl	$1, %r8d
	je	.L173
	cmpl	$1, 12(%rsp)
	jne	.L38
	subl	$1, %r8d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L38:
	movl	12(%rsp), %eax
	leal	-1(%rax), %r9d
	cmpl	$1, %r8d
	je	.L77
	movl	$0, 52(%rsp)
	movl	%r8d, %r15d
.L40:
	imull	$1000, %r9d, %ecx
	xorl	%eax, %eax
	addl	%r15d, %ecx
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L175:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L174
.L42:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L175
	movl	52(%rsp), %ebx
	subl	$1, %r8d
	addl	%ebx, 56(%rsp)
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L174:
	cmpl	$1, %r9d
	jne	.L44
	cmpl	$1, %r15d
	je	.L176
	cmpl	$1, %r9d
	jne	.L44
	subl	$1, %r15d
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L44:
	leal	-1(%r9), %r13d
	cmpl	$1, %r15d
	je	.L78
	movl	$0, 48(%rsp)
	movl	%r15d, %r14d
.L46:
	imull	$1000, %r13d, %ecx
	xorl	%eax, %eax
	addl	%r14d, %ecx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L178:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L177
.L48:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L178
	movl	48(%rsp), %ebx
	subl	$1, %r15d
	addl	%ebx, 52(%rsp)
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L177:
	cmpl	$1, %r13d
	jne	.L50
	cmpl	$1, %r14d
	je	.L179
	cmpl	$1, %r13d
	jne	.L50
	subl	$1, %r14d
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L50:
	leal	-1(%r13), %ebp
	cmpl	$1, %r14d
	je	.L79
	movl	%r14d, %r12d
	xorl	%edx, %edx
.L52:
	imull	$1000, %ebp, %esi
	xorl	%eax, %eax
	addl	%r12d, %esi
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L181:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L180
.L54:
	movslq	%eax, %rcx
	movl	(%r10,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jne	.L181
	addl	%edx, 48(%rsp)
	subl	$1, %r14d
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L180:
	cmpl	$1, %ebp
	jne	.L56
	cmpl	$1, %r12d
	je	.L182
	cmpl	$1, %ebp
	jne	.L56
	subl	$1, %r12d
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L56:
	leal	-1(%rbp), %ebx
	cmpl	$1, %r12d
	je	.L80
	movl	%r12d, %esi
	xorl	%ecx, %ecx
.L58:
	imull	$1000, %ebx, %r11d
	xorl	%eax, %eax
	addl	%esi, %r11d
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L184:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L183
.L60:
	movslq	%eax, %rdi
	movl	(%r10,%rdi,4), %edi
	cmpl	%edi, %r11d
	jne	.L184
	subl	$1, %r12d
	addl	%ecx, %edx
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L183:
	cmpl	$1, %ebx
	jne	.L62
	cmpl	$1, %esi
	je	.L185
	cmpl	$1, %ebx
	jne	.L62
	subl	$1, %esi
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L62:
	leal	-1(%rbx), %edi
	cmpl	$1, %esi
	je	.L81
	movl	%ecx, 92(%rsp)
	movl	%edx, 88(%rsp)
	movl	%r9d, 84(%rsp)
	movl	%r8d, 80(%rsp)
	movl	%esi, 76(%rsp)
	call	saiki
	movl	76(%rsp), %esi
	movl	92(%rsp), %ecx
	leaq	stop(%rip), %r10
	movl	80(%rsp), %r8d
	movl	84(%rsp), %r9d
	movl	88(%rsp), %edx
	subl	$1, %esi
	addl	%eax, %ecx
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L81:
	movl	%edi, %ebx
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L80:
	movl	%ebx, %ebp
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L79:
	movl	%ebp, %r13d
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L78:
	movl	%r13d, %r9d
	jmp	.L40
.L77:
	movl	%r9d, 12(%rsp)
	jmp	.L34
.L185:
	addl	$1, %ecx
	subl	$1, %r12d
	addl	%ecx, %edx
	jmp	.L52
.L76:
	movl	%r9d, 16(%rsp)
	jmp	.L28
.L182:
	addl	$1, %edx
	subl	$1, %r14d
	addl	%edx, 48(%rsp)
	jmp	.L46
.L75:
	movl	%r9d, 20(%rsp)
	jmp	.L22
.L179:
	addl	$1, 48(%rsp)
	subl	$1, %r15d
	movl	48(%rsp), %ebx
	addl	%ebx, 52(%rsp)
	jmp	.L40
.L74:
	movl	20(%rsp), %eax
	movl	%eax, 28(%rsp)
	jmp	.L16
.L176:
	addl	$1, 52(%rsp)
	subl	$1, %r8d
	movl	52(%rsp), %ebx
	addl	%ebx, 56(%rsp)
	jmp	.L34
.L73:
	movl	28(%rsp), %eax
	movl	%eax, 40(%rsp)
	jmp	.L10
.L173:
	addl	$1, 56(%rsp)
	movl	56(%rsp), %ebx
	subl	$1, 24(%rsp)
	addl	%ebx, 60(%rsp)
	jmp	.L28
.L170:
	addl	$1, 60(%rsp)
	movl	60(%rsp), %ebx
	subl	$1, 32(%rsp)
	addl	%ebx, 64(%rsp)
	jmp	.L22
.L167:
	addl	$1, 64(%rsp)
	movl	64(%rsp), %ebx
	subl	$1, 36(%rsp)
	addl	%ebx, 68(%rsp)
	jmp	.L16
.L164:
	addl	$1, 68(%rsp)
	movl	68(%rsp), %ebx
	subl	$1, 44(%rsp)
	addl	%ebx, 72(%rsp)
	jmp	.L10
.L161:
	addl	$1, 72(%rsp)
	jmp	.L9
	.cfi_endproc
.LFE24:
	.size	saiki, .-saiki
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	stop(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	leaq	24(%rsp), %r14
	movq	%rax, (%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L196:
	movq	(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	orl	24(%rsp), %eax
	je	.L215
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L187:
	movslq	%eax, %rdx
	addl	$1, %eax
	movl	$0, (%r15,%rdx,4)
	cmpl	$40, %eax
	jne	.L187
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	leaq	36(%rsp), %r12
	leaq	.LC1(%rip), %rdi
	leaq	32(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L190
	.p2align 4,,10
	.p2align 3
.L188:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%r13d, %rdx
	imull	$1000, 32(%rsp), %eax
	addl	36(%rsp), %eax
	movl	%eax, (%r15,%rdx,4)
	addl	$1, %r13d
	cmpl	%r13d, 28(%rsp)
	jg	.L188
.L190:
	movl	24(%rsp), %r13d
	movl	20(%rsp), %ebp
	xorl	%r12d, %r12d
.L189:
	imull	$1000, %ebp, %edi
	xorl	%eax, %eax
	addl	%r13d, %edi
	jmp	.L192
	.p2align 4,,10
	.p2align 3
.L217:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L216
.L192:
	movslq	%eax, %rdx
	movl	(%r15,%rdx,4), %edx
	cmpl	%edx, %edi
	jne	.L217
.L191:
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L196
	.p2align 4,,10
	.p2align 3
.L216:
	cmpl	$1, %ebp
	jne	.L194
	cmpl	$1, %r13d
	je	.L218
	cmpl	$1, %ebp
	jne	.L194
	subl	$1, %r13d
	jmp	.L189
	.p2align 4,,10
	.p2align 3
.L194:
	leal	-1(%rbp), %edi
	cmpl	$1, %r13d
	je	.L201
	movl	%r13d, %esi
	subl	$1, %r13d
	call	saiki
	addl	%eax, %r12d
	jmp	.L189
	.p2align 4,,10
	.p2align 3
.L201:
	movl	%edi, %ebp
	jmp	.L189
.L218:
	addl	$1, %r12d
	jmp	.L191
.L215:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L219
	addq	$56, %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
.L219:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	stop
	.bss
	.align 32
	.type	stop, @object
	.size	stop, 160
stop:
	.zero	160
	.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	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	imull	$1000, %edi, %edi
	xorl	%eax, %eax
	leaq	stop(%rip), %rcx
	addl	%esi, %edi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L7
.L3:
	movslq	%eax, %rdx
	movl	(%rcx,%rdx,4), %edx
	cmpl	%edi, %edx
	jne	.L8
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.p2align 4
	.globl	saiki
	.type	saiki, @function
saiki:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	stop(%rip), %r10
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	%edi, 40(%rsp)
	movl	%esi, 44(%rsp)
	movl	$0, 72(%rsp)
.L10:
	imull	$1000, 40(%rsp), %ecx
	xorl	%eax, %eax
	addl	44(%rsp), %ecx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L160:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L159
.L12:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L160
.L9:
	movl	72(%rsp), %eax
	addq	$104, %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
.L159:
	.cfi_restore_state
	cmpl	$1, 40(%rsp)
	jne	.L14
	cmpl	$1, 44(%rsp)
	je	.L161
	cmpl	$1, 40(%rsp)
	jne	.L14
	subl	$1, 44(%rsp)
	jmp	.L10
.L14:
	movl	40(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 28(%rsp)
	movl	44(%rsp), %eax
	cmpl	$1, %eax
	je	.L73
	movl	%eax, 36(%rsp)
	movl	$0, 68(%rsp)
.L16:
	imull	$1000, 28(%rsp), %ecx
	xorl	%eax, %eax
	addl	36(%rsp), %ecx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L163:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L162
.L18:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L163
	movl	68(%rsp), %ebx
	subl	$1, 44(%rsp)
	addl	%ebx, 72(%rsp)
	jmp	.L10
.L162:
	cmpl	$1, 28(%rsp)
	jne	.L20
	cmpl	$1, 36(%rsp)
	je	.L164
	cmpl	$1, 28(%rsp)
	jne	.L20
	subl	$1, 36(%rsp)
	jmp	.L16
.L20:
	movl	28(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 20(%rsp)
	movl	36(%rsp), %eax
	cmpl	$1, %eax
	je	.L74
	movl	%eax, 32(%rsp)
	movl	$0, 64(%rsp)
.L22:
	imull	$1000, 20(%rsp), %ecx
	xorl	%eax, %eax
	addl	32(%rsp), %ecx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L166:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L165
.L24:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L166
	movl	64(%rsp), %ebx
	subl	$1, 36(%rsp)
	addl	%ebx, 68(%rsp)
	jmp	.L16
.L165:
	cmpl	$1, 20(%rsp)
	jne	.L26
	cmpl	$1, 32(%rsp)
	je	.L167
	cmpl	$1, 20(%rsp)
	jne	.L26
	subl	$1, 32(%rsp)
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L26:
	movl	20(%rsp), %eax
	leal	-1(%rax), %r9d
	movl	32(%rsp), %eax
	cmpl	$1, %eax
	je	.L75
	movl	%eax, 24(%rsp)
	movl	$0, 60(%rsp)
	movl	%r9d, 16(%rsp)
.L28:
	imull	$1000, 16(%rsp), %ecx
	xorl	%eax, %eax
	addl	24(%rsp), %ecx
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L169:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L168
.L30:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L169
	movl	60(%rsp), %ebx
	subl	$1, 32(%rsp)
	addl	%ebx, 64(%rsp)
	jmp	.L22
.L168:
	cmpl	$1, 16(%rsp)
	jne	.L32
	cmpl	$1, 24(%rsp)
	je	.L170
	cmpl	$1, 16(%rsp)
	jne	.L32
	subl	$1, 24(%rsp)
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L32:
	movl	16(%rsp), %eax
	movl	24(%rsp), %r8d
	leal	-1(%rax), %r9d
	cmpl	$1, %r8d
	je	.L76
	movl	$0, 56(%rsp)
	movl	%r9d, 12(%rsp)
.L34:
	imull	$1000, 12(%rsp), %ecx
	xorl	%eax, %eax
	addl	%r8d, %ecx
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L172:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L171
.L36:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L172
	movl	56(%rsp), %ebx
	subl	$1, 24(%rsp)
	addl	%ebx, 60(%rsp)
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L171:
	cmpl	$1, 12(%rsp)
	jne	.L38
	cmpl	$1, %r8d
	je	.L173
	cmpl	$1, 12(%rsp)
	jne	.L38
	subl	$1, %r8d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L38:
	movl	12(%rsp), %eax
	leal	-1(%rax), %r9d
	cmpl	$1, %r8d
	je	.L77
	movl	$0, 52(%rsp)
	movl	%r8d, %r15d
.L40:
	imull	$1000, %r9d, %ecx
	xorl	%eax, %eax
	addl	%r15d, %ecx
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L175:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L174
.L42:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L175
	movl	52(%rsp), %ebx
	subl	$1, %r8d
	addl	%ebx, 56(%rsp)
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L174:
	cmpl	$1, %r9d
	jne	.L44
	cmpl	$1, %r15d
	je	.L176
	cmpl	$1, %r9d
	jne	.L44
	subl	$1, %r15d
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L44:
	leal	-1(%r9), %r13d
	cmpl	$1, %r15d
	je	.L78
	movl	$0, 48(%rsp)
	movl	%r15d, %r14d
.L46:
	imull	$1000, %r13d, %ecx
	xorl	%eax, %eax
	addl	%r14d, %ecx
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L178:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L177
.L48:
	movslq	%eax, %rdx
	movl	(%r10,%rdx,4), %edx
	cmpl	%edx, %ecx
	jne	.L178
	movl	48(%rsp), %ebx
	subl	$1, %r15d
	addl	%ebx, 52(%rsp)
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L177:
	cmpl	$1, %r13d
	jne	.L50
	cmpl	$1, %r14d
	je	.L179
	cmpl	$1, %r13d
	jne	.L50
	subl	$1, %r14d
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L50:
	leal	-1(%r13), %ebp
	cmpl	$1, %r14d
	je	.L79
	movl	%r14d, %r12d
	xorl	%edx, %edx
.L52:
	imull	$1000, %ebp, %esi
	xorl	%eax, %eax
	addl	%r12d, %esi
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L181:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L180
.L54:
	movslq	%eax, %rcx
	movl	(%r10,%rcx,4), %ecx
	cmpl	%ecx, %esi
	jne	.L181
	addl	%edx, 48(%rsp)
	subl	$1, %r14d
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L180:
	cmpl	$1, %ebp
	jne	.L56
	cmpl	$1, %r12d
	je	.L182
	cmpl	$1, %ebp
	jne	.L56
	subl	$1, %r12d
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L56:
	leal	-1(%rbp), %ebx
	cmpl	$1, %r12d
	je	.L80
	movl	%r12d, %esi
	xorl	%ecx, %ecx
.L58:
	imull	$1000, %ebx, %r11d
	xorl	%eax, %eax
	addl	%esi, %r11d
	jmp	.L60
	.p2align 4,,10
	.p2align 3
.L184:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L183
.L60:
	movslq	%eax, %rdi
	movl	(%r10,%rdi,4), %edi
	cmpl	%edi, %r11d
	jne	.L184
	subl	$1, %r12d
	addl	%ecx, %edx
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L183:
	cmpl	$1, %ebx
	jne	.L62
	cmpl	$1, %esi
	je	.L185
	cmpl	$1, %ebx
	jne	.L62
	subl	$1, %esi
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L62:
	leal	-1(%rbx), %edi
	cmpl	$1, %esi
	je	.L81
	movl	%ecx, 92(%rsp)
	movl	%edx, 88(%rsp)
	movl	%r9d, 84(%rsp)
	movl	%r8d, 80(%rsp)
	movl	%esi, 76(%rsp)
	call	saiki
	movl	76(%rsp), %esi
	movl	92(%rsp), %ecx
	leaq	stop(%rip), %r10
	movl	80(%rsp), %r8d
	movl	84(%rsp), %r9d
	movl	88(%rsp), %edx
	subl	$1, %esi
	addl	%eax, %ecx
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L81:
	movl	%edi, %ebx
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L80:
	movl	%ebx, %ebp
	jmp	.L52
	.p2align 4,,10
	.p2align 3
.L79:
	movl	%ebp, %r13d
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L78:
	movl	%r13d, %r9d
	jmp	.L40
.L77:
	movl	%r9d, 12(%rsp)
	jmp	.L34
.L185:
	addl	$1, %ecx
	subl	$1, %r12d
	addl	%ecx, %edx
	jmp	.L52
.L76:
	movl	%r9d, 16(%rsp)
	jmp	.L28
.L182:
	addl	$1, %edx
	subl	$1, %r14d
	addl	%edx, 48(%rsp)
	jmp	.L46
.L75:
	movl	%r9d, 20(%rsp)
	jmp	.L22
.L179:
	addl	$1, 48(%rsp)
	subl	$1, %r15d
	movl	48(%rsp), %ebx
	addl	%ebx, 52(%rsp)
	jmp	.L40
.L74:
	movl	20(%rsp), %eax
	movl	%eax, 28(%rsp)
	jmp	.L16
.L176:
	addl	$1, 52(%rsp)
	subl	$1, %r8d
	movl	52(%rsp), %ebx
	addl	%ebx, 56(%rsp)
	jmp	.L34
.L73:
	movl	28(%rsp), %eax
	movl	%eax, 40(%rsp)
	jmp	.L10
.L173:
	addl	$1, 56(%rsp)
	movl	56(%rsp), %ebx
	subl	$1, 24(%rsp)
	addl	%ebx, 60(%rsp)
	jmp	.L28
.L170:
	addl	$1, 60(%rsp)
	movl	60(%rsp), %ebx
	subl	$1, 32(%rsp)
	addl	%ebx, 64(%rsp)
	jmp	.L22
.L167:
	addl	$1, 64(%rsp)
	movl	64(%rsp), %ebx
	subl	$1, 36(%rsp)
	addl	%ebx, 68(%rsp)
	jmp	.L16
.L164:
	addl	$1, 68(%rsp)
	movl	68(%rsp), %ebx
	subl	$1, 44(%rsp)
	addl	%ebx, 72(%rsp)
	jmp	.L10
.L161:
	addl	$1, 72(%rsp)
	jmp	.L9
	.cfi_endproc
.LFE24:
	.size	saiki, .-saiki
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	stop(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	leaq	24(%rsp), %r14
	movq	%rax, (%rsp)
	leaq	28(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L196:
	movq	(%rsp), %rsi
	xorl	%eax, %eax
	movq	%r14, %rdx
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	orl	24(%rsp), %eax
	je	.L215
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L187:
	movslq	%eax, %rdx
	addl	$1, %eax
	movl	$0, (%r15,%rdx,4)
	cmpl	$40, %eax
	jne	.L187
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	leaq	36(%rsp), %r12
	leaq	.LC1(%rip), %rdi
	leaq	32(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L190
	.p2align 4,,10
	.p2align 3
.L188:
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	%r13d, %rdx
	imull	$1000, 32(%rsp), %eax
	addl	36(%rsp), %eax
	movl	%eax, (%r15,%rdx,4)
	addl	$1, %r13d
	cmpl	%r13d, 28(%rsp)
	jg	.L188
.L190:
	movl	24(%rsp), %r13d
	movl	20(%rsp), %ebp
	xorl	%r12d, %r12d
.L189:
	imull	$1000, %ebp, %edi
	xorl	%eax, %eax
	addl	%r13d, %edi
	jmp	.L192
	.p2align 4,,10
	.p2align 3
.L217:
	addl	$1, %eax
	cmpl	$40, %eax
	je	.L216
.L192:
	movslq	%eax, %rdx
	movl	(%r15,%rdx,4), %edx
	cmpl	%edx, %edi
	jne	.L217
.L191:
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L196
	.p2align 4,,10
	.p2align 3
.L216:
	cmpl	$1, %ebp
	jne	.L194
	cmpl	$1, %r13d
	je	.L218
	cmpl	$1, %ebp
	jne	.L194
	subl	$1, %r13d
	jmp	.L189
	.p2align 4,,10
	.p2align 3
.L194:
	leal	-1(%rbp), %edi
	cmpl	$1, %r13d
	je	.L201
	movl	%r13d, %esi
	subl	$1, %r13d
	call	saiki
	addl	%eax, %r12d
	jmp	.L189
	.p2align 4,,10
	.p2align 3
.L201:
	movl	%edi, %ebp
	jmp	.L189
.L218:
	addl	$1, %r12d
	jmp	.L191
.L215:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L219
	addq	$56, %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
.L219:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	stop
	.bss
	.align 32
	.type	stop, @object
	.size	stop, 160
stop:
	.zero	160
	.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>

volatile int stop[40];

int check(int a,int b){
	int i=a*1000+b;
	int j;
	for (j=0;j<40;j++){
		if (i==stop[j]){
			return 1;
		}
	}
	return 0;
}

int saiki(int a,int b){
	if(check(a,b)==1){
		return 0;
	}
	
	if (a==1&&b==1){
		return 1;
	}else if (a==1){
		return saiki(a,b-1);
	}else if(b==1){
		return saiki(a-1,b);
	}else{
		return saiki(a-1,b)+saiki(a,b-1);
	}
}


int main(void){
	for (;;){
		int a,b;
		scanf("%d %d",&a,&b);
		if (a==0&&b==0){
			return 0;
		}
		
		int i;
		for (i=0;i<40;i++){
			stop[i]=0;
		}
		
		int m;
		scanf("%d",&m);
		int s,j,k;
		for (s=0;s<m;s++){
			scanf("%d %d",&j,&k);
			stop[s]=j*1000+k;
		}
		
		printf("%d\n",saiki(a,b));
	}
}
5 4
3
2 2
2 3
4 2
5 4
3
2 2
2 3
4 2
0 0

5
5

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>

volatile int stop[40];

int check(int a,int b){
	int i=a*1000+b;
	int j;
	for (j=0;j<40;j++){
		if (i==stop[j]){
			return 1;
		}
	}
	return 0;
}

int saiki(int a,int b){
	if(check(a,b)==1){
		return 0;
	}
	
	if (a==1&&b==1){
		return 1;
	}else if (a==1){
		return saiki(a,b-1);
	}else if(b==1){
		return saiki(a-1,b);
	}else{
		return saiki(a-1,b)+saiki(a,b-1);
	}
}


int main(void){
	for (;;){
		int a,b;
		scanf("%d %d",&a,&b);
		if (a==0&&b==0){
			return 0;
		}
		
		int i;
		for (i=0;i<40;i++){
			stop[i]=0;
		}
		
		int m;
		scanf("%d",&m);
		int s,j,k;
		for (s=0;s<m;s++){
			scanf("%d %d",&j,&k);
			stop[s]=j*1000+k;
		}
		
		printf("%d\n",saiki(a,b));
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	stop
	.bss
	.align 32
	.type	stop, @object
	.size	stop, 160
stop:
	.zero	160
	.text
	.globl	check
	.type	check, @function
check:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	imull	$1000, %eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stop(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L3
	movl	$1, %eax
	jmp	.L4
.L3:
	addl	$1, -8(%rbp)
.L2:
	cmpl	$39, -8(%rbp)
	jle	.L5
	movl	$0, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check, .-check
	.globl	saiki
	.type	saiki, @function
saiki:
.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	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	cmpl	$1, %eax
	jne	.L7
	movl	$0, %eax
	jmp	.L8
.L7:
	cmpl	$1, -20(%rbp)
	jne	.L9
	cmpl	$1, -24(%rbp)
	jne	.L9
	movl	$1, %eax
	jmp	.L8
.L9:
	cmpl	$1, -20(%rbp)
	jne	.L10
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	saiki
	jmp	.L8
.L10:
	cmpl	$1, -24(%rbp)
	jne	.L11
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	saiki
	jmp	.L8
.L11:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	saiki
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	saiki
	addl	%ebx, %eax
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	saiki, .-saiki
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L19:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	jmp	.L21
.L13:
	movl	$0, -16(%rbp)
	jmp	.L15
.L16:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stop(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L15:
	cmpl	$39, -16(%rbp)
	jle	.L16
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L17
.L18:
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	imull	$1000, %eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stop(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L17:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L18
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	saiki
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L21:
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	stop
	.bss
	.align 32
	.type	stop, @object
	.size	stop, 160
stop:
	.zero	160
	.text
	.globl	check
	.type	check, @function
check:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	imull	$1000, %eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L2
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stop(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L3
	movl	$1, %eax
	jmp	.L4
.L3:
	addl	$1, -8(%rbp)
.L2:
	cmpl	$39, -8(%rbp)
	jle	.L5
	movl	$0, %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check, .-check
	.globl	saiki
	.type	saiki, @function
saiki:
.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	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	check
	cmpl	$1, %eax
	jne	.L7
	movl	$0, %eax
	jmp	.L8
.L7:
	cmpl	$1, -20(%rbp)
	jne	.L9
	cmpl	$1, -24(%rbp)
	jne	.L9
	movl	$1, %eax
	jmp	.L8
.L9:
	cmpl	$1, -20(%rbp)
	jne	.L10
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	saiki
	jmp	.L8
.L10:
	cmpl	$1, -24(%rbp)
	jne	.L11
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	saiki
	jmp	.L8
.L11:
	movl	-20(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	saiki
	movl	%eax, %ebx
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	saiki
	addl	%ebx, %eax
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	saiki, .-saiki
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L19:
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	jne	.L13
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	jmp	.L21
.L13:
	movl	$0, -16(%rbp)
	jmp	.L15
.L16:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stop(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L15:
	cmpl	$39, -16(%rbp)
	jle	.L16
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L17
.L18:
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	imull	$1000, %eax, %edx
	movl	-20(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	stop(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L17:
	movl	-28(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L18
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	saiki
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L21:
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
