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>

int motomeru(int s, int d) {
	int i;
	int answer = 0;
	while (s < d) {
		int limit = -1;
		int umetai = -1;
		for (i = 0; (1 << i) <= d; i++) {
			int delta = 1 << i;
			if ((s & delta) && limit < 0) limit = delta;
			if (!(s & delta) && (d & delta)) umetai = delta;
		}
		s += limit > 0 && limit < umetai ? limit : umetai;
		answer++;
	}
	return answer;
}

int main(void) {
	int N;
	int s[128], d[128];
	int i;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d%d", &s[i], &d[i]) != 2) return 1;
	}
	for (i = 0; i < N; i++) {
		if (0 <= s[i]) printf("%d\n", motomeru(s[i], d[i]));
		else if (0 <= d[i]) printf("%d\n", motomeru(0, -s[i]) + motomeru(0, d[i]));
		else printf("%d\n", motomeru(-d[i], -s[i]));
	}
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	motomeru
	.type	motomeru, @function
motomeru:
.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, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L2
.L9:
	movl	$-1, -12(%rbp)
	movl	$-1, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L3
.L6:
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-36(%rbp), %eax
	andl	-4(%rbp), %eax
	testl	%eax, %eax
	je	.L4
	cmpl	$0, -12(%rbp)
	jns	.L4
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
.L4:
	movl	-36(%rbp), %eax
	andl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L5
	movl	-40(%rbp), %eax
	andl	-4(%rbp), %eax
	testl	%eax, %eax
	je	.L5
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L5:
	addl	$1, -20(%rbp)
.L3:
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -40(%rbp)
	jge	.L6
	cmpl	$0, -12(%rbp)
	jle	.L7
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L7
	movl	-12(%rbp), %eax
	jmp	.L8
.L7:
	movl	-8(%rbp), %eax
.L8:
	addl	%eax, -36(%rbp)
	addl	$1, -16(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jl	.L9
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	motomeru, .-motomeru
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.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
	pushq	%rbx
	subq	$1064, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-1064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L12
	movl	$1, %eax
	jmp	.L22
.L12:
	movl	$0, -1060(%rbp)
	jmp	.L14
.L16:
	leaq	-544(%rbp), %rdx
	movl	-1060(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1056(%rbp), %rcx
	movl	-1060(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L15
	movl	$1, %eax
	jmp	.L22
.L15:
	addl	$1, -1060(%rbp)
.L14:
	movl	-1064(%rbp), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L16
	movl	$0, -1060(%rbp)
	jmp	.L17
.L21:
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L18
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %edx
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	motomeru
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L18:
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L20
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	negl	%eax
	movl	%eax, %esi
	movl	$0, %edi
	call	motomeru
	movl	%eax, %ebx
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	motomeru
	addl	%ebx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L20:
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	negl	%eax
	movl	%eax, %edx
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	negl	%eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	motomeru
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L19:
	addl	$1, -1060(%rbp)
.L17:
	movl	-1064(%rbp), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L21
	movl	$0, %eax
.L22:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	movq	-8(%rbp), %rbx
	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	motomeru
	.type	motomeru, @function
motomeru:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%r10d, %r10d
	movl	$1, %r9d
	cmpl	%esi, %edi
	jge	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$-1, %edx
	testl	%esi, %esi
	jle	.L7
	movl	$-1, %r8d
	movl	$-1, %edx
	xorl	%ecx, %ecx
	movl	$1, %eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	testl	%edx, %edx
	cmovs	%eax, %edx
	addl	$1, %ecx
	movl	%r9d, %eax
	sall	%cl, %eax
	cmpl	%eax, %esi
	jl	.L20
.L6:
	testl	%eax, %edi
	jne	.L21
	testl	%eax, %esi
	cmovne	%eax, %r8d
	addl	$1, %ecx
	movl	%r9d, %eax
	sall	%cl, %eax
	cmpl	%eax, %esi
	jge	.L6
.L20:
	testl	%edx, %edx
	jle	.L13
	cmpl	%edx, %r8d
	jle	.L13
.L7:
	addl	%edx, %edi
	addl	$1, %r10d
	cmpl	%edi, %esi
	jg	.L2
.L1:
	movl	%r10d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r8d, %edx
	addl	$1, %r10d
	addl	%edx, %edi
	cmpl	%edi, %esi
	jg	.L2
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	motomeru, .-motomeru
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$1056, %rsp
	.cfi_def_cfa_offset 1104
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L26
	cmpl	$0, 12(%rsp)
	jle	.L28
	leaq	16(%rsp), %r13
	xorl	%ebx, %ebx
	leaq	528(%rsp), %r12
	movq	%r13, %rbp
	leaq	.LC1(%rip), %r14
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L39:
	movl	12(%rsp), %eax
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jle	.L38
.L27:
	xorl	%eax, %eax
	leaq	(%r12,%rbx,4), %rdx
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L39
.L26:
	movl	$1, %eax
.L22:
	movq	1048(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L40
	addq	$1056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L28:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L22
.L38:
	testl	%eax, %eax
	jle	.L28
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %rbp
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L41:
	movl	%edi, %esi
	negl	%esi
	testl	%r11d, %r11d
	js	.L31
	xorl	%edi, %edi
	call	motomeru
	movl	%r11d, %esi
	xorl	%edi, %edi
	movl	%eax, %r14d
	call	motomeru
	movq	%rbp, %rsi
	movl	$1, %edi
	leal	(%r14,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L30:
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jle	.L28
.L32:
	movl	(%r12,%rbx,4), %r11d
	movl	0(%r13,%rbx,4), %edi
	movl	%r11d, %esi
	testl	%edi, %edi
	js	.L41
.L37:
	call	motomeru
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L30
.L31:
	movl	%r11d, %edi
	negl	%edi
	jmp	.L37
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	motomeru
	.type	motomeru, @function
motomeru:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%r10d, %r10d
	movl	$1, %r9d
	cmpl	%esi, %edi
	jge	.L1
	.p2align 4,,10
	.p2align 3
.L2:
	movl	$-1, %edx
	testl	%esi, %esi
	jle	.L7
	movl	$-1, %r8d
	movl	$-1, %edx
	xorl	%ecx, %ecx
	movl	$1, %eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	testl	%edx, %edx
	cmovs	%eax, %edx
	addl	$1, %ecx
	movl	%r9d, %eax
	sall	%cl, %eax
	cmpl	%eax, %esi
	jl	.L20
.L6:
	testl	%eax, %edi
	jne	.L21
	testl	%eax, %esi
	cmovne	%eax, %r8d
	addl	$1, %ecx
	movl	%r9d, %eax
	sall	%cl, %eax
	cmpl	%eax, %esi
	jge	.L6
.L20:
	testl	%edx, %edx
	jle	.L13
	cmpl	%edx, %r8d
	jle	.L13
.L7:
	addl	%edx, %edi
	addl	$1, %r10d
	cmpl	%edi, %esi
	jg	.L2
.L1:
	movl	%r10d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r8d, %edx
	addl	$1, %r10d
	addl	%edx, %edi
	cmpl	%edi, %esi
	jg	.L2
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	motomeru, .-motomeru
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$1056, %rsp
	.cfi_def_cfa_offset 1104
	movq	%fs:40, %rax
	movq	%rax, 1048(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L26
	cmpl	$0, 12(%rsp)
	jle	.L28
	leaq	16(%rsp), %r13
	xorl	%ebx, %ebx
	leaq	528(%rsp), %r12
	movq	%r13, %rbp
	leaq	.LC1(%rip), %r14
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L39:
	movl	12(%rsp), %eax
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jle	.L38
.L27:
	xorl	%eax, %eax
	leaq	(%r12,%rbx,4), %rdx
	movq	%rbp, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L39
.L26:
	movl	$1, %eax
.L22:
	movq	1048(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L40
	addq	$1056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L28:
	.cfi_restore_state
	xorl	%eax, %eax
	jmp	.L22
.L38:
	testl	%eax, %eax
	jle	.L28
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %rbp
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L41:
	movl	%edi, %esi
	negl	%esi
	testl	%r11d, %r11d
	js	.L31
	xorl	%edi, %edi
	call	motomeru
	movl	%r11d, %esi
	xorl	%edi, %edi
	movl	%eax, %r14d
	call	motomeru
	movq	%rbp, %rsi
	movl	$1, %edi
	leal	(%r14,%rax), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L30:
	addq	$1, %rbx
	cmpl	%ebx, 12(%rsp)
	jle	.L28
.L32:
	movl	(%r12,%rbx,4), %r11d
	movl	0(%r13,%rbx,4), %edi
	movl	%r11d, %esi
	testl	%edi, %edi
	js	.L41
.L37:
	call	motomeru
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L30
.L31:
	movl	%r11d, %edi
	negl	%edi
	jmp	.L37
.L40:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

#include <stdio.h>

int motomeru(int s, int d) {
	int i;
	int answer = 0;
	while (s < d) {
		int limit = -1;
		int umetai = -1;
		for (i = 0; (1 << i) <= d; i++) {
			int delta = 1 << i;
			if ((s & delta) && limit < 0) limit = delta;
			if (!(s & delta) && (d & delta)) umetai = delta;
		}
		s += limit > 0 && limit < umetai ? limit : umetai;
		answer++;
	}
	return answer;
}

int main(void) {
	int N;
	int s[128], d[128];
	int i;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d%d", &s[i], &d[i]) != 2) return 1;
	}
	for (i = 0; i < N; i++) {
		if (0 <= s[i]) printf("%d\n", motomeru(s[i], d[i]));
		else if (0 <= d[i]) printf("%d\n", motomeru(0, -s[i]) + motomeru(0, d[i]));
		else printf("%d\n", motomeru(-d[i], -s[i]));
	}
	return 0;
}


3
0 7
-1048576 0
-3 5

3
1
4

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>

int motomeru(int s, int d) {
	int i;
	int answer = 0;
	while (s < d) {
		int limit = -1;
		int umetai = -1;
		for (i = 0; (1 << i) <= d; i++) {
			int delta = 1 << i;
			if ((s & delta) && limit < 0) limit = delta;
			if (!(s & delta) && (d & delta)) umetai = delta;
		}
		s += limit > 0 && limit < umetai ? limit : umetai;
		answer++;
	}
	return answer;
}

int main(void) {
	int N;
	int s[128], d[128];
	int i;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%d%d", &s[i], &d[i]) != 2) return 1;
	}
	for (i = 0; i < N; i++) {
		if (0 <= s[i]) printf("%d\n", motomeru(s[i], d[i]));
		else if (0 <= d[i]) printf("%d\n", motomeru(0, -s[i]) + motomeru(0, d[i]));
		else printf("%d\n", motomeru(-d[i], -s[i]));
	}
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	motomeru
	.type	motomeru, @function
motomeru:
.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, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L2
.L9:
	movl	$-1, -12(%rbp)
	movl	$-1, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L3
.L6:
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-36(%rbp), %eax
	andl	-4(%rbp), %eax
	testl	%eax, %eax
	je	.L4
	cmpl	$0, -12(%rbp)
	jns	.L4
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
.L4:
	movl	-36(%rbp), %eax
	andl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L5
	movl	-40(%rbp), %eax
	andl	-4(%rbp), %eax
	testl	%eax, %eax
	je	.L5
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L5:
	addl	$1, -20(%rbp)
.L3:
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -40(%rbp)
	jge	.L6
	cmpl	$0, -12(%rbp)
	jle	.L7
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L7
	movl	-12(%rbp), %eax
	jmp	.L8
.L7:
	movl	-8(%rbp), %eax
.L8:
	addl	%eax, -36(%rbp)
	addl	$1, -16(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jl	.L9
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	motomeru, .-motomeru
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.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
	pushq	%rbx
	subq	$1064, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-1064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L12
	movl	$1, %eax
	jmp	.L22
.L12:
	movl	$0, -1060(%rbp)
	jmp	.L14
.L16:
	leaq	-544(%rbp), %rdx
	movl	-1060(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1056(%rbp), %rcx
	movl	-1060(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L15
	movl	$1, %eax
	jmp	.L22
.L15:
	addl	$1, -1060(%rbp)
.L14:
	movl	-1064(%rbp), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L16
	movl	$0, -1060(%rbp)
	jmp	.L17
.L21:
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L18
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %edx
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	motomeru
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L18:
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L20
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	negl	%eax
	movl	%eax, %esi
	movl	$0, %edi
	call	motomeru
	movl	%eax, %ebx
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	motomeru
	addl	%ebx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L20:
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	negl	%eax
	movl	%eax, %edx
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	negl	%eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	motomeru
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L19:
	addl	$1, -1060(%rbp)
.L17:
	movl	-1064(%rbp), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L21
	movl	$0, %eax
.L22:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	movq	-8(%rbp), %rbx
	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	motomeru
	.type	motomeru, @function
motomeru:
.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, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L2
.L9:
	movl	$-1, -12(%rbp)
	movl	$-1, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L3
.L6:
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-36(%rbp), %eax
	andl	-4(%rbp), %eax
	testl	%eax, %eax
	je	.L4
	cmpl	$0, -12(%rbp)
	jns	.L4
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
.L4:
	movl	-36(%rbp), %eax
	andl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L5
	movl	-40(%rbp), %eax
	andl	-4(%rbp), %eax
	testl	%eax, %eax
	je	.L5
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L5:
	addl	$1, -20(%rbp)
.L3:
	movl	-20(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cmpl	%eax, -40(%rbp)
	jge	.L6
	cmpl	$0, -12(%rbp)
	jle	.L7
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L7
	movl	-12(%rbp), %eax
	jmp	.L8
.L7:
	movl	-8(%rbp), %eax
.L8:
	addl	%eax, -36(%rbp)
	addl	$1, -16(%rbp)
.L2:
	movl	-36(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jl	.L9
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	motomeru, .-motomeru
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.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
	pushq	%rbx
	subq	$1064, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-1064(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L12
	movl	$1, %eax
	jmp	.L22
.L12:
	movl	$0, -1060(%rbp)
	jmp	.L14
.L16:
	leaq	-544(%rbp), %rdx
	movl	-1060(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1056(%rbp), %rcx
	movl	-1060(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L15
	movl	$1, %eax
	jmp	.L22
.L15:
	addl	$1, -1060(%rbp)
.L14:
	movl	-1064(%rbp), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L16
	movl	$0, -1060(%rbp)
	jmp	.L17
.L21:
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L18
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %edx
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	motomeru
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L18:
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L20
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	negl	%eax
	movl	%eax, %esi
	movl	$0, %edi
	call	motomeru
	movl	%eax, %ebx
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	motomeru
	addl	%ebx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L20:
	movl	-1060(%rbp), %eax
	cltq
	movl	-1056(%rbp,%rax,4), %eax
	negl	%eax
	movl	%eax, %edx
	movl	-1060(%rbp), %eax
	cltq
	movl	-544(%rbp,%rax,4), %eax
	negl	%eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	motomeru
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L19:
	addl	$1, -1060(%rbp)
.L17:
	movl	-1064(%rbp), %eax
	cmpl	%eax, -1060(%rbp)
	jl	.L21
	movl	$0, %eax
.L22:
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	movq	-8(%rbp), %rbx
	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:
