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>
#include <stdlib.h>


#define	ll_int	long long int


int Binary_Search(ll_int *box, int n, ll_int num)
{
	int mid;
	int left, right;


	left = 0;
	right = n - 1;
	while(left <= right){
		mid = (left + right) / 2;

		if(num == box[mid])
			return mid;
		else if(num < box[mid])
			right = mid - 1;
		else if(box[mid] < num)
			left = mid + 1;
	}

	return left;
}


int main()
{
	int n, q;
	ll_int *box, num;
	int pos, pos2;
	int i, j;


	scanf("%d", &n);

	box = (ll_int *)malloc(sizeof(ll_int) * n);

	for(i = 0; i < n; i++)
		scanf("%lld", &box[i]);


	scanf("%d", &q);

	for(i = 0; i < q; i++){
		scanf("%lld", &num);

		pos = Binary_Search(box, n, num);
		if(0 <= pos && pos < n){
			while(0 <= pos && num <= box[pos])
				pos--;

			pos2 = pos;
			while(++pos2 <= n - 1 && box[pos2] <= num);

			printf("%d %d\n", pos + 1, pos2);
		}else
			printf("%d %d\n", n, n);
	}

	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	Binary_Search
	.type	Binary_Search, @function
Binary_Search:
.LFB6:
	.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)
	movq	%rdx, -40(%rbp)
	movl	$0, -12(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %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,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	%rax, -40(%rbp)
	jne	.L3
	movl	-4(%rbp), %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	%rax, -40(%rbp)
	jge	.L5
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	%rax, -40(%rbp)
	jle	.L2
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L6
	movl	-12(%rbp), %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	Binary_Search, .-Binary_Search
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L8
.L9:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -28(%rbp)
.L8:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L9
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L10
.L18:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rdx
	movl	-44(%rbp), %ecx
	movq	-16(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Binary_Search
	movl	%eax, -36(%rbp)
	cmpl	$0, -36(%rbp)
	js	.L11
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jge	.L11
	jmp	.L12
.L14:
	subl	$1, -36(%rbp)
.L12:
	cmpl	$0, -36(%rbp)
	js	.L13
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jge	.L14
.L13:
	movl	-36(%rbp), %eax
	movl	%eax, -32(%rbp)
	nop
.L16:
	addl	$1, -32(%rbp)
	movl	-44(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jge	.L15
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L16
.L15:
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %eax
	movl	%eax, %edx
	movl	%ecx, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L11:
	movl	-44(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -28(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L18
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	subl	$1, %esi
	js	.L6
	xorl	%ecx, %ecx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	leal	-1(%rax), %esi
.L4:
	cmpl	%ecx, %esi
	jl	.L9
.L5:
	leal	(%rcx,%rsi), %eax
	sarl	%eax
	movslq	%eax, %r8
	cmpq	%rdx, (%rdi,%r8,8)
	je	.L1
	jg	.L10
	jge	.L4
	leal	1(%rax), %ecx
	cmpl	%ecx, %esi
	jge	.L5
.L9:
	movl	%ecx, %eax
	ret
.L6:
	xorl	%eax, %eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	Binary_Search, .-Binary_Search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	8(%rsp), %rdi
	movq	%rdi, %r15
	salq	$3, %rdi
	call	malloc@PLT
	movq	%rax, %r14
	movq	%rax, %r12
	testl	%r15d, %r15d
	jle	.L16
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$8, %r12
	cmpl	%ebx, 8(%rsp)
	jg	.L15
.L16:
	movq	%r13, %rdi
	leaq	12(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leaq	.LC1(%rip), %rbp
	leaq	16(%rsp), %r12
	leaq	.LC2(%rip), %r13
	testl	%eax, %eax
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbp, %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r8d
	movq	16(%rsp), %rdi
	movl	%r8d, %edx
	subl	$1, %edx
	js	.L30
	xorl	%ecx, %ecx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L42:
	leal	-1(%rax), %edx
.L19:
	cmpl	%ecx, %edx
	jl	.L41
.L20:
	leal	(%rdx,%rcx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	cmpq	(%r14,%rsi,8), %rdi
	je	.L17
	jl	.L42
	jle	.L19
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jge	.L20
.L41:
	movl	%ecx, %eax
.L17:
	cmpl	%eax, %r8d
	jg	.L43
	movl	%r8d, %ecx
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L25:
	addl	$1, %ebx
	cmpl	%ebx, 12(%rsp)
	jg	.L13
.L14:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L43:
	.cfi_restore_state
	cltq
	.p2align 4,,10
	.p2align 3
.L27:
	cmpq	(%r14,%rax,8), %rdi
	jg	.L45
	subq	$1, %rax
	cmpl	$-1, %eax
	jne	.L27
	xorl	%r9d, %r9d
	leal	1(%rax), %eax
.L21:
	cltq
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L46:
	addq	$1, %rax
	cmpq	-8(%r14,%rax,8), %rdi
	jl	.L23
.L24:
	movl	%eax, %ecx
	cmpl	%eax, %r8d
	jg	.L46
.L23:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L45:
	leal	1(%rax), %eax
	movl	%eax, %r9d
	jmp	.L21
.L30:
	xorl	%eax, %eax
	jmp	.L17
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	subl	$1, %esi
	js	.L6
	xorl	%ecx, %ecx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L10:
	leal	-1(%rax), %esi
.L4:
	cmpl	%ecx, %esi
	jl	.L9
.L5:
	leal	(%rcx,%rsi), %eax
	sarl	%eax
	movslq	%eax, %r8
	cmpq	%rdx, (%rdi,%r8,8)
	je	.L1
	jg	.L10
	jge	.L4
	leal	1(%rax), %ecx
	cmpl	%ecx, %esi
	jge	.L5
.L9:
	movl	%ecx, %eax
	ret
.L6:
	xorl	%eax, %eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	Binary_Search, .-Binary_Search
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	8(%rsp), %rdi
	movq	%rdi, %r15
	salq	$3, %rdi
	call	malloc@PLT
	movq	%rax, %r14
	movq	%rax, %r12
	testl	%r15d, %r15d
	jle	.L16
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$8, %r12
	cmpl	%ebx, 8(%rsp)
	jg	.L15
.L16:
	movq	%r13, %rdi
	leaq	12(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leaq	.LC1(%rip), %rbp
	leaq	16(%rsp), %r12
	leaq	.LC2(%rip), %r13
	testl	%eax, %eax
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbp, %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r8d
	movq	16(%rsp), %rdi
	movl	%r8d, %edx
	subl	$1, %edx
	js	.L30
	xorl	%ecx, %ecx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L42:
	leal	-1(%rax), %edx
.L19:
	cmpl	%ecx, %edx
	jl	.L41
.L20:
	leal	(%rdx,%rcx), %eax
	sarl	%eax
	movslq	%eax, %rsi
	cmpq	(%r14,%rsi,8), %rdi
	je	.L17
	jl	.L42
	jle	.L19
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jge	.L20
.L41:
	movl	%ecx, %eax
.L17:
	cmpl	%eax, %r8d
	jg	.L43
	movl	%r8d, %ecx
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L25:
	addl	$1, %ebx
	cmpl	%ebx, 12(%rsp)
	jg	.L13
.L14:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L43:
	.cfi_restore_state
	cltq
	.p2align 4,,10
	.p2align 3
.L27:
	cmpq	(%r14,%rax,8), %rdi
	jg	.L45
	subq	$1, %rax
	cmpl	$-1, %eax
	jne	.L27
	xorl	%r9d, %r9d
	leal	1(%rax), %eax
.L21:
	cltq
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L46:
	addq	$1, %rax
	cmpq	-8(%r14,%rax,8), %rdi
	jl	.L23
.L24:
	movl	%eax, %ecx
	cmpl	%eax, %r8d
	jg	.L46
.L23:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L45:
	leal	1(%rax), %eax
	movl	%eax, %r9d
	jmp	.L21
.L30:
	xorl	%eax, %eax
	jmp	.L17
.L44:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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>
#include <stdlib.h>


#define	ll_int	long long int


int Binary_Search(ll_int *box, int n, ll_int num)
{
	int mid;
	int left, right;


	left = 0;
	right = n - 1;
	while(left <= right){
		mid = (left + right) / 2;

		if(num == box[mid])
			return mid;
		else if(num < box[mid])
			right = mid - 1;
		else if(box[mid] < num)
			left = mid + 1;
	}

	return left;
}


int main()
{
	int n, q;
	ll_int *box, num;
	int pos, pos2;
	int i, j;


	scanf("%d", &n);

	box = (ll_int *)malloc(sizeof(ll_int) * n);

	for(i = 0; i < n; i++)
		scanf("%lld", &box[i]);


	scanf("%d", &q);

	for(i = 0; i < q; i++){
		scanf("%lld", &num);

		pos = Binary_Search(box, n, num);
		if(0 <= pos && pos < n){
			while(0 <= pos && num <= box[pos])
				pos--;

			pos2 = pos;
			while(++pos2 <= n - 1 && box[pos2] <= num);

			printf("%d %d\n", pos + 1, pos2);
		}else
			printf("%d %d\n", n, n);
	}

	return 0;
}

4
1 2 2 4
3
2
3
5

1 3
3 3
4 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>
#include <stdlib.h>


#define	ll_int	long long int


int Binary_Search(ll_int *box, int n, ll_int num)
{
	int mid;
	int left, right;


	left = 0;
	right = n - 1;
	while(left <= right){
		mid = (left + right) / 2;

		if(num == box[mid])
			return mid;
		else if(num < box[mid])
			right = mid - 1;
		else if(box[mid] < num)
			left = mid + 1;
	}

	return left;
}


int main()
{
	int n, q;
	ll_int *box, num;
	int pos, pos2;
	int i, j;


	scanf("%d", &n);

	box = (ll_int *)malloc(sizeof(ll_int) * n);

	for(i = 0; i < n; i++)
		scanf("%lld", &box[i]);


	scanf("%d", &q);

	for(i = 0; i < q; i++){
		scanf("%lld", &num);

		pos = Binary_Search(box, n, num);
		if(0 <= pos && pos < n){
			while(0 <= pos && num <= box[pos])
				pos--;

			pos2 = pos;
			while(++pos2 <= n - 1 && box[pos2] <= num);

			printf("%d %d\n", pos + 1, pos2);
		}else
			printf("%d %d\n", n, n);
	}

	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	Binary_Search
	.type	Binary_Search, @function
Binary_Search:
.LFB6:
	.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)
	movq	%rdx, -40(%rbp)
	movl	$0, -12(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %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,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	%rax, -40(%rbp)
	jne	.L3
	movl	-4(%rbp), %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	%rax, -40(%rbp)
	jge	.L5
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	%rax, -40(%rbp)
	jle	.L2
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L6
	movl	-12(%rbp), %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	Binary_Search, .-Binary_Search
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L8
.L9:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -28(%rbp)
.L8:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L9
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L10
.L18:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rdx
	movl	-44(%rbp), %ecx
	movq	-16(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Binary_Search
	movl	%eax, -36(%rbp)
	cmpl	$0, -36(%rbp)
	js	.L11
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jge	.L11
	jmp	.L12
.L14:
	subl	$1, -36(%rbp)
.L12:
	cmpl	$0, -36(%rbp)
	js	.L13
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jge	.L14
.L13:
	movl	-36(%rbp), %eax
	movl	%eax, -32(%rbp)
	nop
.L16:
	addl	$1, -32(%rbp)
	movl	-44(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jge	.L15
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L16
.L15:
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %eax
	movl	%eax, %edx
	movl	%ecx, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L11:
	movl	-44(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -28(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L18
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
.LFB6:
	.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)
	movq	%rdx, -40(%rbp)
	movl	$0, -12(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %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,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	%rax, -40(%rbp)
	jne	.L3
	movl	-4(%rbp), %eax
	jmp	.L4
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	%rax, -40(%rbp)
	jge	.L5
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	cmpq	%rax, -40(%rbp)
	jle	.L2
	movl	-4(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -12(%rbp)
.L2:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L6
	movl	-12(%rbp), %eax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	Binary_Search, .-Binary_Search
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cltq
	salq	$3, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L8
.L9:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -28(%rbp)
.L8:
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L9
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L10
.L18:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rdx
	movl	-44(%rbp), %ecx
	movq	-16(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	Binary_Search
	movl	%eax, -36(%rbp)
	cmpl	$0, -36(%rbp)
	js	.L11
	movl	-44(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jge	.L11
	jmp	.L12
.L14:
	subl	$1, -36(%rbp)
.L12:
	cmpl	$0, -36(%rbp)
	js	.L13
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jge	.L14
.L13:
	movl	-36(%rbp), %eax
	movl	%eax, -32(%rbp)
	nop
.L16:
	addl	$1, -32(%rbp)
	movl	-44(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jge	.L15
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-24(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L16
.L15:
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %eax
	movl	%eax, %edx
	movl	%ecx, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L17
.L11:
	movl	-44(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -28(%rbp)
.L10:
	movl	-40(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L18
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
