Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#define NMAX 100001
#define qMAX 50000
 
int S[NMAX];
int T[qMAX];
 
int binarySearch(int n,int key) {
    int left = 0;
    int right = n;
    int mid;
     
    while (left < right) {
        mid = (left + right) / 2;
        if (S[mid] == key) {
            return 1;
        } else if (key < S[mid]) {
            right = mid;
        } else {
            left = mid + 1;
        }
    }
    return 0;
}
 
int main(void)
{
    int n, i, j, q, cnt;
     
    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]);
    }
 
    cnt = 0;
    for (i = 0; i < q; ++i) {
        cnt += binarySearch(n, T[i]);
    }
    printf("%d\n", cnt);
     
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	binarySearch
	.type	binarySearch, @function
binarySearch:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%ecx, %ecx
	leaq	S(%rip), %r8
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%rcx,%rdi), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	cmpl	%esi, (%r8,%rdx,4)
	je	.L6
	jle	.L9
	movl	%eax, %edi
.L4:
	cmpl	%edi, %ecx
	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), %ecx
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	binarySearch, .-binarySearch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
.LC2:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	leaq	S(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, (%rsp)
	jg	.L14
.L15:
	movq	%r12, %rdi
	leaq	4(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leaq	T(%rip), %rbx
	leaq	.LC1(%rip), %r13
	movq	%rbx, %r12
	testl	%eax, %eax
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L17
	testl	%eax, %eax
	jle	.L13
	leal	-1(%rax), %edx
	movl	(%rsp), %r11d
	leaq	4+T(%rip), %rax
	xorl	%r9d, %r9d
	leaq	(%rax,%rdx,4), %r10
	leaq	S(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rbx), %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	(%r8,%rsi,4), %edi
	je	.L33
	jge	.L34
	movl	%eax, %edx
.L21:
	cmpl	%ecx, %edx
	jg	.L22
	addq	$4, %rbx
	cmpq	%rbx, %r10
	jne	.L23
.L16:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$24, %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
.L33:
	.cfi_restore_state
	addq	$4, %rbx
	addl	$1, %r9d
	cmpq	%rbx, %r10
	jne	.L23
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L34:
	leal	1(%rax), %ecx
	jmp	.L21
.L13:
	xorl	%r9d, %r9d
	jmp	.L16
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	T
	.bss
	.align 32
	.type	T, @object
	.size	T, 200000
T:
	.zero	200000
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 400004
S:
	.zero	400004
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	binarySearch
	.type	binarySearch, @function
binarySearch:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%ecx, %ecx
	leaq	S(%rip), %r8
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%rcx,%rdi), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	cmpl	%esi, (%r8,%rdx,4)
	je	.L6
	jle	.L9
	movl	%eax, %edi
.L4:
	cmpl	%edi, %ecx
	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), %ecx
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	binarySearch, .-binarySearch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
.LC2:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	leaq	S(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, (%rsp)
	jg	.L14
.L15:
	movq	%r12, %rdi
	leaq	4(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leaq	T(%rip), %rbx
	leaq	.LC1(%rip), %r13
	movq	%rbx, %r12
	testl	%eax, %eax
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L17
	testl	%eax, %eax
	jle	.L13
	leal	-1(%rax), %edx
	movl	(%rsp), %r11d
	leaq	4+T(%rip), %rax
	xorl	%r9d, %r9d
	leaq	(%rax,%rdx,4), %r10
	leaq	S(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rbx), %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	(%r8,%rsi,4), %edi
	je	.L33
	jge	.L34
	movl	%eax, %edx
.L21:
	cmpl	%ecx, %edx
	jg	.L22
	addq	$4, %rbx
	cmpq	%rbx, %r10
	jne	.L23
.L16:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$24, %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
.L33:
	.cfi_restore_state
	addq	$4, %rbx
	addl	$1, %r9d
	cmpq	%rbx, %r10
	jne	.L23
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L34:
	leal	1(%rax), %ecx
	jmp	.L21
.L13:
	xorl	%r9d, %r9d
	jmp	.L16
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	T
	.bss
	.align 32
	.type	T, @object
	.size	T, 200000
T:
	.zero	200000
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 400004
S:
	.zero	400004
	.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
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	binarySearch
	.type	binarySearch, @function
binarySearch:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%ecx, %ecx
	leaq	S(%rip), %r8
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%rcx,%rdi), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	cmpl	%esi, (%r8,%rdx,4)
	je	.L6
	jle	.L9
	movl	%eax, %edi
.L4:
	cmpl	%edi, %ecx
	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), %ecx
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	binarySearch, .-binarySearch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
.LC2:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	leaq	S(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, (%rsp)
	jg	.L14
.L15:
	movq	%r12, %rdi
	leaq	4(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leaq	T(%rip), %rbx
	leaq	.LC1(%rip), %r13
	movq	%rbx, %r12
	testl	%eax, %eax
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L17
	testl	%eax, %eax
	jle	.L13
	leal	-1(%rax), %edx
	movl	(%rsp), %r11d
	leaq	4+T(%rip), %rax
	xorl	%r9d, %r9d
	leaq	(%rax,%rdx,4), %r10
	leaq	S(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rbx), %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	(%r8,%rsi,4), %edi
	je	.L33
	jge	.L34
	movl	%eax, %edx
.L21:
	cmpl	%ecx, %edx
	jg	.L22
	addq	$4, %rbx
	cmpq	%rbx, %r10
	jne	.L23
.L16:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$24, %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
.L33:
	.cfi_restore_state
	addq	$4, %rbx
	addl	$1, %r9d
	cmpq	%rbx, %r10
	jne	.L23
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L34:
	leal	1(%rax), %ecx
	jmp	.L21
.L13:
	xorl	%r9d, %r9d
	jmp	.L16
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	T
	.bss
	.align 32
	.type	T, @object
	.size	T, 200000
T:
	.zero	200000
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 400004
S:
	.zero	400004
	.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:
```
```c
#include <stdio.h>
#define NMAX 100001
#define qMAX 50000
 
int S[NMAX];
int T[qMAX];
 
int binarySearch(int n,int key) {
    int left = 0;
    int right = n;
    int mid;
     
    while (left < right) {
        mid = (left + right) / 2;
        if (S[mid] == key) {
            return 1;
        } else if (key < S[mid]) {
            right = mid;
        } else {
            left = mid + 1;
        }
    }
    return 0;
}
 
int main(void)
{
    int n, i, j, q, cnt;
     
    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]);
    }
 
    cnt = 0;
    for (i = 0; i < q; ++i) {
        cnt += binarySearch(n, T[i]);
    }
    printf("%d\n", cnt);
     
    return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#define NMAX 100001
#define qMAX 50000
 
int S[NMAX];
int T[qMAX];
 
int binarySearch(int n,int key) {
    int left = 0;
    int right = n;
    int mid;
     
    while (left < right) {
        mid = (left + right) / 2;
        if (S[mid] == key) {
            return 1;
        } else if (key < S[mid]) {
            right = mid;
        } else {
            left = mid + 1;
        }
    }
    return 0;
}
 
int main(void)
{
    int n, i, j, q, cnt;
     
    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]);
    }
 
    cnt = 0;
    for (i = 0; i < q; ++i) {
        cnt += binarySearch(n, T[i]);
    }
    printf("%d\n", cnt);
     
    return 0;
}
```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#define NMAX 100001
#define qMAX 50000
 
int S[NMAX];
int T[qMAX];
 
int binarySearch(int n,int key) {
    int left = 0;
    int right = n;
    int mid;
     
    while (left < right) {
        mid = (left + right) / 2;
        if (S[mid] == key) {
            return 1;
        } else if (key < S[mid]) {
            right = mid;
        } else {
            left = mid + 1;
        }
    }
    return 0;
}
 
int main(void)
{
    int n, i, j, q, cnt;
     
    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]);
    }
 
    cnt = 0;
    for (i = 0; i < q; ++i) {
        cnt += binarySearch(n, T[i]);
    }
    printf("%d\n", cnt);
     
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	binarySearch
	.type	binarySearch, @function
binarySearch:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%ecx, %ecx
	leaq	S(%rip), %r8
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%rcx,%rdi), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	cmpl	%esi, (%r8,%rdx,4)
	je	.L6
	jle	.L9
	movl	%eax, %edi
.L4:
	cmpl	%edi, %ecx
	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), %ecx
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	binarySearch, .-binarySearch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
.LC2:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	leaq	S(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, (%rsp)
	jg	.L14
.L15:
	movq	%r12, %rdi
	leaq	4(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leaq	T(%rip), %rbx
	leaq	.LC1(%rip), %r13
	movq	%rbx, %r12
	testl	%eax, %eax
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L17
	testl	%eax, %eax
	jle	.L13
	leal	-1(%rax), %edx
	movl	(%rsp), %r11d
	leaq	4+T(%rip), %rax
	xorl	%r9d, %r9d
	leaq	(%rax,%rdx,4), %r10
	leaq	S(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rbx), %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	(%r8,%rsi,4), %edi
	je	.L33
	jge	.L34
	movl	%eax, %edx
.L21:
	cmpl	%ecx, %edx
	jg	.L22
	addq	$4, %rbx
	cmpq	%rbx, %r10
	jne	.L23
.L16:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$24, %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
.L33:
	.cfi_restore_state
	addq	$4, %rbx
	addl	$1, %r9d
	cmpq	%rbx, %r10
	jne	.L23
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L34:
	leal	1(%rax), %ecx
	jmp	.L21
.L13:
	xorl	%r9d, %r9d
	jmp	.L16
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	T
	.bss
	.align 32
	.type	T, @object
	.size	T, 200000
T:
	.zero	200000
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 400004
S:
	.zero	400004
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	binarySearch
	.type	binarySearch, @function
binarySearch:
.LFB23:
	.cfi_startproc
	endbr64
	xorl	%ecx, %ecx
	leaq	S(%rip), %r8
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	leal	(%rcx,%rdi), %edx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	cmpl	%esi, (%r8,%rdx,4)
	je	.L6
	jle	.L9
	movl	%eax, %edi
.L4:
	cmpl	%edi, %ecx
	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), %ecx
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	binarySearch, .-binarySearch
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
.LC2:
	.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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	leaq	S(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	xorl	%ebx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, (%rsp)
	jg	.L14
.L15:
	movq	%r12, %rdi
	leaq	4(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%ebp, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	leaq	T(%rip), %rbx
	leaq	.LC1(%rip), %r13
	movq	%rbx, %r12
	testl	%eax, %eax
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L17
	testl	%eax, %eax
	jle	.L13
	leal	-1(%rax), %edx
	movl	(%rsp), %r11d
	leaq	4+T(%rip), %rax
	xorl	%r9d, %r9d
	leaq	(%rax,%rdx,4), %r10
	leaq	S(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rbx), %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	(%r8,%rsi,4), %edi
	je	.L33
	jge	.L34
	movl	%eax, %edx
.L21:
	cmpl	%ecx, %edx
	jg	.L22
	addq	$4, %rbx
	cmpq	%rbx, %r10
	jne	.L23
.L16:
	xorl	%eax, %eax
	movl	%r9d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$24, %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
.L33:
	.cfi_restore_state
	addq	$4, %rbx
	addl	$1, %r9d
	cmpq	%rbx, %r10
	jne	.L23
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L34:
	leal	1(%rax), %ecx
	jmp	.L21
.L13:
	xorl	%r9d, %r9d
	jmp	.L16
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	T
	.bss
	.align 32
	.type	T, @object
	.size	T, 200000
T:
	.zero	200000
	.globl	S
	.align 32
	.type	S, @object
	.size	S, 400004
S:
	.zero	400004
	.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:
```