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 binary_search(int* A, int size, int n) {
  int l = 0;
  int r = size;
  while(l < r) {
    int c = (l + r) / 2;
    if(A[c] == n) return 1;
    if(A[c] < n) l = c+1;
    else r = c;
  }
  return 0;
}
 
int main(){
  int S[100000];
  int T[50000];
  int n, q, i, cnt = 0;

  scanf("%d", &n);
  for(i = 0 ; i < n ; i++) { 
  scanf("%d",&S[i]);
  }
  scanf("%d",&q);

  for(i = 0; i < q; i++) scanf("%d",&T[i]);
  for(i = 0; i < q; i++) cnt += binary_search(S, n, T[i]);
  printf("%d\n", cnt);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$0, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L6:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jne	.L3
	movl	$1, %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L5
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L6
	movl	$0, %eax
.L4:
	popq	%rbp
	.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
	leaq	-598016(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2016, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -600020(%rbp)
	leaq	-600032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -600024(%rbp)
	jmp	.L8
.L9:
	leaq	-400016(%rbp), %rdx
	movl	-600024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -600024(%rbp)
.L8:
	movl	-600032(%rbp), %eax
	cmpl	%eax, -600024(%rbp)
	jl	.L9
	leaq	-600028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -600024(%rbp)
	jmp	.L10
.L11:
	leaq	-600016(%rbp), %rdx
	movl	-600024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -600024(%rbp)
.L10:
	movl	-600028(%rbp), %eax
	cmpl	%eax, -600024(%rbp)
	jl	.L11
	movl	$0, -600024(%rbp)
	jmp	.L12
.L13:
	movl	-600024(%rbp), %eax
	cltq
	movl	-600016(%rbp,%rax,4), %edx
	movl	-600032(%rbp), %ecx
	leaq	-400016(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	binary_search
	addl	%eax, -600020(%rbp)
	addl	$1, -600024(%rbp)
.L12:
	movl	-600028(%rbp), %eax
	cmpl	%eax, -600024(%rbp)
	jl	.L13
	movl	-600020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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
	xorl	%r8d, %r8d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%r8,%rsi), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movslq	%eax, %rcx
	cmpl	%edx, (%rdi,%rcx,4)
	je	.L6
	jl	.L9
	movl	%eax, %esi
.L4:
	cmpl	%esi, %r8d
	jl	.L5
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	leal	1(%rax), %r8d
	jmp	.L4
	.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	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-598016(%rsp), %r11
	.cfi_def_cfa 11, 598056
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2024, %rsp
	.cfi_def_cfa_offset 600080
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	200016(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L14
.L15:
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rbp
	testl	%eax, %eax
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L17
	testl	%eax, %eax
	jle	.L13
	subl	$1, %eax
	leaq	4(%r13), %r8
	movl	8(%rsp), %r11d
	xorl	%r9d, %r9d
	leaq	(%r8,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L23:
	movl	0(%r13), %edi
	movl	%r11d, %edx
	xorl	%ecx, %ecx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L22:
	leal	(%rdx,%rcx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	cmpl	200016(%rsp,%rsi,4), %edi
	je	.L33
	jg	.L34
	movl	%eax, %edx
.L21:
	cmpl	%ecx, %edx
	jg	.L22
	movq	%r8, %r13
	cmpq	%r8, %r10
	je	.L16
.L35:
	addq	$4, %r8
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L33:
	addl	$1, %r9d
	movq	%r8, %r13
	cmpq	%r8, %r10
	jne	.L35
.L16:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	leal	1(%rax), %ecx
	jmp	.L21
.L13:
	xorl	%r9d, %r9d
	jmp	.L16
.L36:
	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	binary_search
	.type	binary_search, @function
binary_search:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%r8,%rsi), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movslq	%eax, %rcx
	cmpl	%edx, (%rdi,%rcx,4)
	je	.L6
	jl	.L9
	movl	%eax, %esi
.L4:
	cmpl	%esi, %r8d
	jl	.L5
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	leal	1(%rax), %r8d
	jmp	.L4
	.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	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-598016(%rsp), %r11
	.cfi_def_cfa 11, 598056
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2024, %rsp
	.cfi_def_cfa_offset 600080
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 600024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	200016(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 8(%rsp)
	jg	.L14
.L15:
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rbp
	testl	%eax, %eax
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L17
	testl	%eax, %eax
	jle	.L13
	subl	$1, %eax
	leaq	4(%r13), %r8
	movl	8(%rsp), %r11d
	xorl	%r9d, %r9d
	leaq	(%r8,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L23:
	movl	0(%r13), %edi
	movl	%r11d, %edx
	xorl	%ecx, %ecx
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L22:
	leal	(%rdx,%rcx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	cmpl	200016(%rsp,%rsi,4), %edi
	je	.L33
	jg	.L34
	movl	%eax, %edx
.L21:
	cmpl	%ecx, %edx
	jg	.L22
	movq	%r8, %r13
	cmpq	%r8, %r10
	je	.L16
.L35:
	addq	$4, %r8
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L33:
	addl	$1, %r9d
	movq	%r8, %r13
	cmpq	%r8, %r10
	jne	.L35
.L16:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	600024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$600040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L34:
	.cfi_restore_state
	leal	1(%rax), %ecx
	jmp	.L21
.L13:
	xorl	%r9d, %r9d
	jmp	.L16
.L36:
	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 binary_search(int* A, int size, int n) {
  int l = 0;
  int r = size;
  while(l < r) {
    int c = (l + r) / 2;
    if(A[c] == n) return 1;
    if(A[c] < n) l = c+1;
    else r = c;
  }
  return 0;
}
 
int main(){
  int S[100000];
  int T[50000];
  int n, q, i, cnt = 0;

  scanf("%d", &n);
  for(i = 0 ; i < n ; i++) { 
  scanf("%d",&S[i]);
  }
  scanf("%d",&q);

  for(i = 0; i < q; i++) scanf("%d",&T[i]);
  for(i = 0; i < q; i++) cnt += binary_search(S, n, T[i]);
  printf("%d\n", cnt);
  return 0;
}

5
1 0 2 2 3
2
1 2
 3
2 2 3
1
5
 5
1 0 4 2 3
2
1 1
 5
1 2 3 4 1
5
2 4 1
 5
1 2 3 4 5
3
1 4 1
 5
1 0 4 2 3
2
1 2
 3
1 2 3
1
4
 5
1 4 3 4 5
3
1 4 1
 3
1 2 4
1
4
 5
1 4 3 4 6
3
1 4 1

1
 0
 0
 2
 3
 0
 0
 3
 1
 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 binary_search(int* A, int size, int n) {
  int l = 0;
  int r = size;
  while(l < r) {
    int c = (l + r) / 2;
    if(A[c] == n) return 1;
    if(A[c] < n) l = c+1;
    else r = c;
  }
  return 0;
}
 
int main(){
  int S[100000];
  int T[50000];
  int n, q, i, cnt = 0;

  scanf("%d", &n);
  for(i = 0 ; i < n ; i++) { 
  scanf("%d",&S[i]);
  }
  scanf("%d",&q);

  for(i = 0; i < q; i++) scanf("%d",&T[i]);
  for(i = 0; i < q; i++) cnt += binary_search(S, n, T[i]);
  printf("%d\n", cnt);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$0, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L6:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jne	.L3
	movl	$1, %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L5
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L6
	movl	$0, %eax
.L4:
	popq	%rbp
	.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
	leaq	-598016(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2016, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -600020(%rbp)
	leaq	-600032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -600024(%rbp)
	jmp	.L8
.L9:
	leaq	-400016(%rbp), %rdx
	movl	-600024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -600024(%rbp)
.L8:
	movl	-600032(%rbp), %eax
	cmpl	%eax, -600024(%rbp)
	jl	.L9
	leaq	-600028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -600024(%rbp)
	jmp	.L10
.L11:
	leaq	-600016(%rbp), %rdx
	movl	-600024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -600024(%rbp)
.L10:
	movl	-600028(%rbp), %eax
	cmpl	%eax, -600024(%rbp)
	jl	.L11
	movl	$0, -600024(%rbp)
	jmp	.L12
.L13:
	movl	-600024(%rbp), %eax
	cltq
	movl	-600016(%rbp,%rax,4), %edx
	movl	-600032(%rbp), %ecx
	leaq	-400016(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	binary_search
	addl	%eax, -600020(%rbp)
	addl	$1, -600024(%rbp)
.L12:
	movl	-600028(%rbp), %eax
	cmpl	%eax, -600024(%rbp)
	jl	.L13
	movl	-600020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	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
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$0, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L6:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jne	.L3
	movl	$1, %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -32(%rbp)
	jle	.L5
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L6
	movl	$0, %eax
.L4:
	popq	%rbp
	.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
	leaq	-598016(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2016, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -600020(%rbp)
	leaq	-600032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -600024(%rbp)
	jmp	.L8
.L9:
	leaq	-400016(%rbp), %rdx
	movl	-600024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -600024(%rbp)
.L8:
	movl	-600032(%rbp), %eax
	cmpl	%eax, -600024(%rbp)
	jl	.L9
	leaq	-600028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -600024(%rbp)
	jmp	.L10
.L11:
	leaq	-600016(%rbp), %rdx
	movl	-600024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -600024(%rbp)
.L10:
	movl	-600028(%rbp), %eax
	cmpl	%eax, -600024(%rbp)
	jl	.L11
	movl	$0, -600024(%rbp)
	jmp	.L12
.L13:
	movl	-600024(%rbp), %eax
	cltq
	movl	-600016(%rbp,%rax,4), %edx
	movl	-600032(%rbp), %ecx
	leaq	-400016(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	binary_search
	addl	%eax, -600020(%rbp)
	addl	$1, -600024(%rbp)
.L12:
	movl	-600028(%rbp), %eax
	cmpl	%eax, -600024(%rbp)
	jl	.L13
	movl	-600020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
