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 count;

int binary_search(int array[], int data, int l, int r)
{
	int c = (l + r) / 2;
	
	if (l > r){
		return count;
	}
	count++;
	if (data == array[c]){
		return count;
	}
	else if (data < array[c]){
		return binary_search(array, data, l, c - 1);
	}
	else {
		return binary_search(array, data, c + 1, r);
	}
}

int main(void)
{
	int n;
	int array[100];
	
	while (scanf("%d", &n) * n != 0){
		int i;
		int data;
		
		count = 0;
		for (i = 0; i < n; i++){
			scanf("%d", array + i);
		}
		scanf("%d", &data);
		printf("%d\n", binary_search(array, data, 0, n - 1));
	}
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.text
	.globl	binary_search
	.type	binary_search, @function
binary_search:
.LFB0:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	%ecx, -36(%rbp)
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L2
	movl	count(%rip), %eax
	jmp	.L3
.L2:
	movl	count(%rip), %eax
	addl	$1, %eax
	movl	%eax, count(%rip)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L4
	movl	count(%rip), %eax
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jge	.L5
	movl	-4(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	binary_search
	jmp	.L3
.L5:
	movl	-4(%rbp), %eax
	leal	1(%rax), %edi
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-24(%rbp), %rax
	movl	%edx, %ecx
	movl	%edi, %edx
	movq	%rax, %rdi
	call	binary_search
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	binary_search, .-binary_search
	.section	.rodata
.LC0:
	.string	"%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	$432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L7
.L10:
	movl	$0, count(%rip)
	movl	$0, -420(%rbp)
	jmp	.L8
.L9:
	movl	-420(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	-416(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -420(%rbp)
.L8:
	movl	-428(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jl	.L9
	leaq	-424(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-428(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-424(%rbp), %esi
	leaq	-416(%rbp), %rax
	movl	%edx, %ecx
	movl	$0, %edx
	movq	%rax, %rdi
	call	binary_search
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	leaq	-428(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-428(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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	binary_search
	.type	binary_search, @function
binary_search:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%esi, %r9d
	movl	%edx, %esi
	leal	(%rdx,%rcx), %edx
	movl	count(%rip), %r10d
	movl	%edx, %eax
	movq	%rdi, %r8
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%ecx, %esi
	jg	.L1
	leal	1(%r10), %edx
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	%eax, %rdi
	movl	%edx, count(%rip)
	movl	%edx, %r10d
	cmpl	%r9d, (%r8,%rdi,4)
	je	.L1
	jle	.L6
	leal	-1(%rax), %ecx
	addl	$1, %edx
	leal	(%rcx,%rsi), %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	cmpl	%esi, %ecx
	jge	.L4
.L1:
	movl	%r10d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	leal	1(%rax), %esi
	addl	$1, %edx
	leal	(%rsi,%rcx), %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	cmpl	%ecx, %esi
	jle	.L4
	movl	%r10d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	binary_search, .-binary_search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L29
	movl	$0, count(%rip)
	leaq	16(%rsp), %r14
	xorl	%r13d, %r13d
	testl	%edx, %edx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	addq	$4, %r14
	cmpl	%r13d, 8(%rsp)
	jg	.L14
.L15:
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	movl	12(%rsp), %r8d
	leal	-1(%rax), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	testl	%ecx, %ecx
	js	.L30
	movl	count(%rip), %edx
	xorl	%esi, %esi
	addl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%eax, %rdi
	movl	%edx, %r9d
	cmpl	16(%rsp,%rdi,4), %r8d
	je	.L19
	jge	.L20
	leal	-1(%rax), %ecx
	addl	$1, %edx
	leal	(%rcx,%rsi), %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	cmpl	%esi, %ecx
	jge	.L17
.L19:
	movl	%r9d, count(%rip)
.L18:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L20:
	leal	1(%rax), %esi
	addl	$1, %edx
	leal	(%rsi,%rcx), %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	cmpl	%ecx, %esi
	jle	.L17
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L29:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$432, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
.L30:
	.cfi_restore_state
	movl	count(%rip), %r9d
	jmp	.L18
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.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	binary_search
	.type	binary_search, @function
binary_search:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%esi, %r9d
	movl	%edx, %esi
	leal	(%rdx,%rcx), %edx
	movl	count(%rip), %r10d
	movl	%edx, %eax
	movq	%rdi, %r8
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cmpl	%ecx, %esi
	jg	.L1
	leal	1(%r10), %edx
	.p2align 4,,10
	.p2align 3
.L4:
	movslq	%eax, %rdi
	movl	%edx, count(%rip)
	movl	%edx, %r10d
	cmpl	%r9d, (%r8,%rdi,4)
	je	.L1
	jle	.L6
	leal	-1(%rax), %ecx
	addl	$1, %edx
	leal	(%rcx,%rsi), %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	cmpl	%esi, %ecx
	jge	.L4
.L1:
	movl	%r10d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	leal	1(%rax), %esi
	addl	$1, %edx
	leal	(%rsi,%rcx), %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	cmpl	%ecx, %esi
	jle	.L4
	movl	%r10d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	binary_search, .-binary_search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	subq	$432, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	je	.L29
	movl	$0, count(%rip)
	leaq	16(%rsp), %r14
	xorl	%r13d, %r13d
	testl	%edx, %edx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	addq	$4, %r14
	cmpl	%r13d, 8(%rsp)
	jg	.L14
.L15:
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	movl	12(%rsp), %r8d
	leal	-1(%rax), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	testl	%ecx, %ecx
	js	.L30
	movl	count(%rip), %edx
	xorl	%esi, %esi
	addl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%eax, %rdi
	movl	%edx, %r9d
	cmpl	16(%rsp,%rdi,4), %r8d
	je	.L19
	jge	.L20
	leal	-1(%rax), %ecx
	addl	$1, %edx
	leal	(%rcx,%rsi), %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	cmpl	%esi, %ecx
	jge	.L17
.L19:
	movl	%r9d, count(%rip)
.L18:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L20:
	leal	1(%rax), %esi
	addl	$1, %edx
	leal	(%rsi,%rcx), %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	cmpl	%ecx, %esi
	jle	.L17
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L29:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$432, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	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
.L30:
	.cfi_restore_state
	movl	count(%rip), %r9d
	jmp	.L18
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.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>

int count;

int binary_search(int array[], int data, int l, int r)
{
	int c = (l + r) / 2;
	
	if (l > r){
		return count;
	}
	count++;
	if (data == array[c]){
		return count;
	}
	else if (data < array[c]){
		return binary_search(array, data, l, c - 1);
	}
	else {
		return binary_search(array, data, c + 1, r);
	}
}

int main(void)
{
	int n;
	int array[100];
	
	while (scanf("%d", &n) * n != 0){
		int i;
		int data;
		
		count = 0;
		for (i = 0; i < n; i++){
			scanf("%d", array + i);
		}
		scanf("%d", &data);
		printf("%d\n", binary_search(array, data, 0, n - 1));
	}
	
	return 0;
}
7
11
15
0
36
51
61
86
51
4
1
2
3
5
4
0
 7
11
15
0
42
51
61
86
51
4
1
2
4
5
4
0
 7
11
8
-2
53
51
17
109
42
4
1
0
3
1
0
0
 7
11
15
0
42
51
61
86
61
4
1
2
4
5
4
0
 7
11
8
-2
53
51
1
109
42
0
1
0
3
1
0
0
 7
0
15
0
42
51
61
48
61
0
1
3
4
5
4
0
 7
11
15
0
42
51
61
86
51
4
1
2
3
5
4
0
 7
11
20
0
42
51
61
86
51
4
1
2
4
5
4
0
 7
11
20
0
42
51
61
86
51
4
1
1
4
5
4
0
 7
11
15
23
36
51
61
86
51
4
1
2
3
7
4
0

3
3
 3
2
 3
1
 2
2
 3
 2
 3
3
 3
2
 3
2
 3
3

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 count;

int binary_search(int array[], int data, int l, int r)
{
	int c = (l + r) / 2;
	
	if (l > r){
		return count;
	}
	count++;
	if (data == array[c]){
		return count;
	}
	else if (data < array[c]){
		return binary_search(array, data, l, c - 1);
	}
	else {
		return binary_search(array, data, c + 1, r);
	}
}

int main(void)
{
	int n;
	int array[100];
	
	while (scanf("%d", &n) * n != 0){
		int i;
		int data;
		
		count = 0;
		for (i = 0; i < n; i++){
			scanf("%d", array + i);
		}
		scanf("%d", &data);
		printf("%d\n", binary_search(array, data, 0, n - 1));
	}
	
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.text
	.globl	binary_search
	.type	binary_search, @function
binary_search:
.LFB0:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	%ecx, -36(%rbp)
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L2
	movl	count(%rip), %eax
	jmp	.L3
.L2:
	movl	count(%rip), %eax
	addl	$1, %eax
	movl	%eax, count(%rip)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L4
	movl	count(%rip), %eax
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jge	.L5
	movl	-4(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	binary_search
	jmp	.L3
.L5:
	movl	-4(%rbp), %eax
	leal	1(%rax), %edi
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-24(%rbp), %rax
	movl	%edx, %ecx
	movl	%edi, %edx
	movq	%rax, %rdi
	call	binary_search
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	binary_search, .-binary_search
	.section	.rodata
.LC0:
	.string	"%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	$432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L7
.L10:
	movl	$0, count(%rip)
	movl	$0, -420(%rbp)
	jmp	.L8
.L9:
	movl	-420(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	-416(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -420(%rbp)
.L8:
	movl	-428(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jl	.L9
	leaq	-424(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-428(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-424(%rbp), %esi
	leaq	-416(%rbp), %rax
	movl	%edx, %ecx
	movl	$0, %edx
	movq	%rax, %rdi
	call	binary_search
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	leaq	-428(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-428(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.text
	.globl	binary_search
	.type	binary_search, @function
binary_search:
.LFB0:
	.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	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	%ecx, -36(%rbp)
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-32(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jle	.L2
	movl	count(%rip), %eax
	jmp	.L3
.L2:
	movl	count(%rip), %eax
	addl	$1, %eax
	movl	%eax, count(%rip)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L4
	movl	count(%rip), %eax
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jge	.L5
	movl	-4(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	binary_search
	jmp	.L3
.L5:
	movl	-4(%rbp), %eax
	leal	1(%rax), %edi
	movl	-36(%rbp), %edx
	movl	-28(%rbp), %esi
	movq	-24(%rbp), %rax
	movl	%edx, %ecx
	movl	%edi, %edx
	movq	%rax, %rdi
	call	binary_search
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	binary_search, .-binary_search
	.section	.rodata
.LC0:
	.string	"%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	$432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L7
.L10:
	movl	$0, count(%rip)
	movl	$0, -420(%rbp)
	jmp	.L8
.L9:
	movl	-420(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	-416(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -420(%rbp)
.L8:
	movl	-428(%rbp), %eax
	cmpl	%eax, -420(%rbp)
	jl	.L9
	leaq	-424(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-428(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-424(%rbp), %esi
	leaq	-416(%rbp), %rax
	movl	%edx, %ecx
	movl	$0, %edx
	movq	%rax, %rdi
	call	binary_search
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	leaq	-428(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-428(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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:
