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>
#define FOR(i,a,n) for(i=a;i<n;i++)

int binary_lower(int a[],int n,int k){
	int left=-1; int right=n;
	while(right-left>1){
		int mid=(left+right)/2;
		if(a[mid]<k) left=mid;
		else right=mid;
	}
	return right;
}
int binary_upper(int a[],int n,int k){
	int left=-1; int right=n;
	while(right-left>1){
		int mid=(left+right)/2;
		if(a[mid]<=k) left=mid;
		else right=mid;
	}
	return left;
}
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
int pos[100000];
int x[100000],w[100000];
int main(void)
{
	int n,l,t,cnt=0,a,s,k,d,i;
	scanf("%d%d%d",&n,&l,&t);
	FOR(i,0,n){
		scanf("%d%d",&x[i],&w[i]);
		if(w[i]==1) pos[i]=(x[i]+t%l)%l;
		else pos[i]=(x[i]-t%l+l)%l;
	}
	a=pos[0];
	qsort(pos,n,sizeof(int),comp);
	if(w[0]==1){
		FOR(i,0,n){
			d=x[i]-x[0];
			if(w[i]==2&&d<2*t){
				cnt+=1+(2*t-d-1)/l;
				cnt%=n;
			}
		}
		k=cnt%n;
		s=binary_lower(pos,n,a);
	}
	else{
		FOR(i,0,n){
			d=l-x[i]+x[0];
			if(w[i]==1&&d<2*t){
				cnt+=1+(2*t-d-1)/l;
				cnt%=n;
			}
		}
		k=(n-cnt)%n;
		s=binary_upper(pos,n,a);
	}
	d=(s-k+n)%n;
	FOR(i,0,n) printf("%d\n",pos[(d+i)%n]);
	return 0;
}
    
    
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	binary_lower
	.type	binary_lower, @function
binary_lower:
.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	$-1, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L4:
	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)
	jle	.L3
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$1, %eax
	jg	.L4
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	binary_lower, .-binary_lower
	.globl	binary_upper
	.type	binary_upper, @function
binary_upper:
.LFB1:
	.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	$-1, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L7
.L9:
	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)
	jl	.L8
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$1, %eax
	jg	.L9
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	binary_upper, .-binary_upper
	.globl	comp
	.type	comp, @function
comp:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	comp, .-comp
	.globl	pos
	.bss
	.align 32
	.type	pos, @object
	.size	pos, 400000
pos:
	.zero	400000
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 400000
x:
	.zero	400000
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 400000
w:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	movl	$0, -32(%rbp)
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L14
.L17:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	addq	%rax, %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	x(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-36(%rbp), %eax
	movl	-40(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	addl	%esi, %eax
	movl	-40(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pos(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L16
.L15:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-36(%rbp), %eax
	movl	-40(%rbp), %esi
	cltd
	idivl	%esi
	movl	%edx, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	-40(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pos(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L16:
	addl	$1, -20(%rbp)
.L14:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L17
	movl	pos(%rip), %eax
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movl	%eax, %esi
	leaq	pos(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	w(%rip), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	$0, -20(%rbp)
	jmp	.L19
.L21:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	x(%rip), %edx
	subl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2, %eax
	jne	.L20
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L20
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	subl	-12(%rbp), %eax
	subl	$1, %eax
	movl	-40(%rbp), %edi
	cltd
	idivl	%edi
	addl	$1, %eax
	addl	%eax, -32(%rbp)
	movl	-44(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, -32(%rbp)
.L20:
	addl	$1, -20(%rbp)
.L19:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L21
	movl	-44(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, -24(%rbp)
	movl	-44(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%eax, %esi
	leaq	pos(%rip), %rax
	movq	%rax, %rdi
	call	binary_lower
	movl	%eax, -28(%rbp)
	jmp	.L22
.L18:
	movl	$0, -20(%rbp)
	jmp	.L23
.L25:
	movl	-40(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	x(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	x(%rip), %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L24
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L24
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	subl	-12(%rbp), %eax
	subl	$1, %eax
	movl	-40(%rbp), %edi
	cltd
	idivl	%edi
	addl	$1, %eax
	addl	%eax, -32(%rbp)
	movl	-44(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, -32(%rbp)
.L24:
	addl	$1, -20(%rbp)
.L23:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L25
	movl	-44(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	-44(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -24(%rbp)
	movl	-44(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%eax, %esi
	leaq	pos(%rip), %rax
	movq	%rax, %rdi
	call	binary_upper
	movl	%eax, -28(%rbp)
.L22:
	movl	-28(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-44(%rbp), %eax
	addl	%edx, %eax
	movl	-44(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -12(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L26
.L27:
	movl	-12(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	-44(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pos(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -20(%rbp)
.L26:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L27
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	comp
	.type	comp, @function
comp:
.LFB25:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE25:
	.size	comp, .-comp
	.p2align 4
	.globl	binary_lower
	.type	binary_lower, @function
binary_lower:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%esi, %eax
	movl	$-1, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	leal	(%rsi,%rax), %r8d
	movl	%r8d, %ecx
	shrl	$31, %ecx
	addl	%r8d, %ecx
	sarl	%ecx
	movslq	%ecx, %r8
	cmpl	%edx, (%rdi,%r8,4)
	cmovge	%ecx, %eax
	cmovl	%ecx, %esi
.L5:
	movl	%eax, %ecx
	subl	%esi, %ecx
	cmpl	$1, %ecx
	jg	.L6
	ret
	.cfi_endproc
.LFE23:
	.size	binary_lower, .-binary_lower
	.p2align 4
	.globl	binary_upper
	.type	binary_upper, @function
binary_upper:
.LFB24:
	.cfi_startproc
	endbr64
	movl	$-1, %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	leal	(%r8,%rsi), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movslq	%eax, %rcx
	cmpl	%edx, (%rdi,%rcx,4)
	cmovg	%eax, %esi
	cmovle	%eax, %r8d
.L10:
	movl	%esi, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jg	.L11
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	binary_upper, .-binary_upper
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	pos(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jle	.L14
	leaq	x(%rip), %r13
	leaq	w(%rip), %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r14
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	idivl	%ecx
	movl	0(%r13), %eax
	addl	%ecx, %eax
	subl	%edx, %eax
.L51:
	cltd
	movl	12(%rsp), %esi
	addq	$4, %r13
	addq	$4, %r12
	idivl	%ecx
	movl	%edx, (%rbx,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %esi
	jle	.L14
.L17:
	movq	%r12, %rdx
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movl	16(%rsp), %ecx
	cltd
	cmpl	$1, (%r12)
	jne	.L15
	idivl	%ecx
	movl	0(%r13), %eax
	addl	%edx, %eax
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L14:
	xorl	%eax, %eax
	movl	$4, %edx
	movq	%rbx, %rdi
	movl	pos(%rip), %ebp
	leaq	comp(%rip), %rcx
	call	qsort@PLT
	cmpl	$1, w(%rip)
	movl	12(%rsp), %esi
	je	.L18
	movl	%esi, %edi
	testl	%esi, %esi
	jle	.L38
	movl	20(%rsp), %eax
	movl	16(%rsp), %r11d
	movl	x(%rip), %r13d
	leal	(%rax,%rax), %r10d
	cmpl	$1, %esi
	je	.L38
	movslq	%esi, %r9
	movl	$1, %ecx
	xorl	%r12d, %r12d
	leaq	w(%rip), %r8
	leaq	x(%rip), %r14
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L30:
	addq	$1, %rcx
	cmpq	%r9, %rcx
	je	.L19
.L31:
	cmpl	$1, (%r8,%rcx,4)
	jne	.L30
	movl	%r11d, %edx
	subl	(%r14,%rcx,4), %edx
	addl	%r13d, %edx
	cmpl	%edx, %r10d
	jle	.L30
	movl	%r10d, %eax
	addq	$1, %rcx
	subl	%edx, %eax
	subl	$1, %eax
	cltd
	idivl	%r11d
	leal	1(%r12,%rax), %eax
	cltd
	idivl	%esi
	movl	%edx, %r12d
	cmpq	%r9, %rcx
	jne	.L31
.L19:
	movl	%esi, %eax
	orl	$-1, %ecx
	subl	%r12d, %eax
	cltd
	idivl	%esi
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L34:
	leal	(%rcx,%rdi), %r8d
	movl	%r8d, %eax
	shrl	$31, %eax
	addl	%r8d, %eax
	sarl	%eax
	movslq	%eax, %r8
	cmpl	(%rbx,%r8,4), %ebp
	cmovl	%eax, %edi
	cmovge	%eax, %ecx
.L33:
	movl	%edi, %eax
	subl	%ecx, %eax
	cmpl	$1, %eax
	jg	.L34
.L29:
	subl	%edx, %ecx
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r13
	leal	(%rcx,%rsi), %eax
	cltd
	idivl	%esi
	movl	%edx, %r12d
	testl	%esi, %esi
	jle	.L36
	.p2align 4,,10
	.p2align 3
.L35:
	leal	(%r12,%rbp), %eax
	movl	$1, %edi
	addl	$1, %ebp
	cltd
	idivl	%esi
	movq	%r13, %rsi
	xorl	%eax, %eax
	movslq	%edx, %rdx
	movl	(%rbx,%rdx,4), %edx
	call	__printf_chk@PLT
	movl	12(%rsp), %esi
	cmpl	%ebp, %esi
	jg	.L35
.L36:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	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
.L18:
	.cfi_restore_state
	movl	%esi, %ecx
	testl	%esi, %esi
	jle	.L39
	movl	20(%rsp), %eax
	movl	x(%rip), %r14d
	movl	16(%rsp), %r13d
	leal	(%rax,%rax), %r11d
	cmpl	$1, %esi
	je	.L39
	movslq	%esi, %r10
	movl	$1, %edi
	xorl	%r12d, %r12d
	leaq	w(%rip), %r8
	leaq	x(%rip), %r15
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$1, %rdi
	cmpq	%rdi, %r10
	je	.L22
.L25:
	cmpl	$2, (%r8,%rdi,4)
	jne	.L24
	movl	(%r15,%rdi,4), %r9d
	subl	%r14d, %r9d
	cmpl	%r9d, %r11d
	jle	.L24
	movl	%r11d, %eax
	subl	%r9d, %eax
	subl	$1, %eax
	cltd
	idivl	%r13d
	leal	1(%r12,%rax), %eax
	cltd
	idivl	%esi
	movl	%edx, %r12d
	jmp	.L24
.L39:
	xorl	%r12d, %r12d
.L22:
	movl	%r12d, %eax
	orl	$-1, %edi
	cltd
	idivl	%esi
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L28:
	leal	(%rdi,%rcx), %r8d
	movl	%r8d, %eax
	shrl	$31, %eax
	addl	%r8d, %eax
	sarl	%eax
	movslq	%eax, %r8
	cmpl	(%rbx,%r8,4), %ebp
	cmovle	%eax, %ecx
	cmovg	%eax, %edi
.L27:
	movl	%ecx, %eax
	subl	%edi, %eax
	cmpl	$1, %eax
	jg	.L28
	jmp	.L29
.L38:
	xorl	%r12d, %r12d
	jmp	.L19
.L52:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	w
	.bss
	.align 32
	.type	w, @object
	.size	w, 400000
w:
	.zero	400000
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 400000
x:
	.zero	400000
	.globl	pos
	.align 32
	.type	pos, @object
	.size	pos, 400000
pos:
	.zero	400000
	.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	comp
	.type	comp, @function
comp:
.LFB25:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE25:
	.size	comp, .-comp
	.p2align 4
	.globl	binary_lower
	.type	binary_lower, @function
binary_lower:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%esi, %eax
	movl	$-1, %esi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	leal	(%rsi,%rax), %r8d
	movl	%r8d, %ecx
	shrl	$31, %ecx
	addl	%r8d, %ecx
	sarl	%ecx
	movslq	%ecx, %r8
	cmpl	%edx, (%rdi,%r8,4)
	cmovge	%ecx, %eax
	cmovl	%ecx, %esi
.L5:
	movl	%eax, %ecx
	subl	%esi, %ecx
	cmpl	$1, %ecx
	jg	.L6
	ret
	.cfi_endproc
.LFE23:
	.size	binary_lower, .-binary_lower
	.p2align 4
	.globl	binary_upper
	.type	binary_upper, @function
binary_upper:
.LFB24:
	.cfi_startproc
	endbr64
	movl	$-1, %r8d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	leal	(%r8,%rsi), %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	movslq	%eax, %rcx
	cmpl	%edx, (%rdi,%rcx,4)
	cmovg	%eax, %esi
	cmovle	%eax, %r8d
.L10:
	movl	%esi, %eax
	subl	%r8d, %eax
	cmpl	$1, %eax
	jg	.L11
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	binary_upper, .-binary_upper
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	pos(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	20(%rsp), %rcx
	leaq	16(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jle	.L14
	leaq	x(%rip), %r13
	leaq	w(%rip), %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r14
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	idivl	%ecx
	movl	0(%r13), %eax
	addl	%ecx, %eax
	subl	%edx, %eax
.L51:
	cltd
	movl	12(%rsp), %esi
	addq	$4, %r13
	addq	$4, %r12
	idivl	%ecx
	movl	%edx, (%rbx,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %esi
	jle	.L14
.L17:
	movq	%r12, %rdx
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movl	16(%rsp), %ecx
	cltd
	cmpl	$1, (%r12)
	jne	.L15
	idivl	%ecx
	movl	0(%r13), %eax
	addl	%edx, %eax
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L14:
	xorl	%eax, %eax
	movl	$4, %edx
	movq	%rbx, %rdi
	movl	pos(%rip), %ebp
	leaq	comp(%rip), %rcx
	call	qsort@PLT
	cmpl	$1, w(%rip)
	movl	12(%rsp), %esi
	je	.L18
	movl	%esi, %edi
	testl	%esi, %esi
	jle	.L38
	movl	20(%rsp), %eax
	movl	16(%rsp), %r11d
	movl	x(%rip), %r13d
	leal	(%rax,%rax), %r10d
	cmpl	$1, %esi
	je	.L38
	movslq	%esi, %r9
	movl	$1, %ecx
	xorl	%r12d, %r12d
	leaq	w(%rip), %r8
	leaq	x(%rip), %r14
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L30:
	addq	$1, %rcx
	cmpq	%r9, %rcx
	je	.L19
.L31:
	cmpl	$1, (%r8,%rcx,4)
	jne	.L30
	movl	%r11d, %edx
	subl	(%r14,%rcx,4), %edx
	addl	%r13d, %edx
	cmpl	%edx, %r10d
	jle	.L30
	movl	%r10d, %eax
	addq	$1, %rcx
	subl	%edx, %eax
	subl	$1, %eax
	cltd
	idivl	%r11d
	leal	1(%r12,%rax), %eax
	cltd
	idivl	%esi
	movl	%edx, %r12d
	cmpq	%r9, %rcx
	jne	.L31
.L19:
	movl	%esi, %eax
	orl	$-1, %ecx
	subl	%r12d, %eax
	cltd
	idivl	%esi
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L34:
	leal	(%rcx,%rdi), %r8d
	movl	%r8d, %eax
	shrl	$31, %eax
	addl	%r8d, %eax
	sarl	%eax
	movslq	%eax, %r8
	cmpl	(%rbx,%r8,4), %ebp
	cmovl	%eax, %edi
	cmovge	%eax, %ecx
.L33:
	movl	%edi, %eax
	subl	%ecx, %eax
	cmpl	$1, %eax
	jg	.L34
.L29:
	subl	%edx, %ecx
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r13
	leal	(%rcx,%rsi), %eax
	cltd
	idivl	%esi
	movl	%edx, %r12d
	testl	%esi, %esi
	jle	.L36
	.p2align 4,,10
	.p2align 3
.L35:
	leal	(%r12,%rbp), %eax
	movl	$1, %edi
	addl	$1, %ebp
	cltd
	idivl	%esi
	movq	%r13, %rsi
	xorl	%eax, %eax
	movslq	%edx, %rdx
	movl	(%rbx,%rdx,4), %edx
	call	__printf_chk@PLT
	movl	12(%rsp), %esi
	cmpl	%ebp, %esi
	jg	.L35
.L36:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	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
.L18:
	.cfi_restore_state
	movl	%esi, %ecx
	testl	%esi, %esi
	jle	.L39
	movl	20(%rsp), %eax
	movl	x(%rip), %r14d
	movl	16(%rsp), %r13d
	leal	(%rax,%rax), %r11d
	cmpl	$1, %esi
	je	.L39
	movslq	%esi, %r10
	movl	$1, %edi
	xorl	%r12d, %r12d
	leaq	w(%rip), %r8
	leaq	x(%rip), %r15
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L24:
	addq	$1, %rdi
	cmpq	%rdi, %r10
	je	.L22
.L25:
	cmpl	$2, (%r8,%rdi,4)
	jne	.L24
	movl	(%r15,%rdi,4), %r9d
	subl	%r14d, %r9d
	cmpl	%r9d, %r11d
	jle	.L24
	movl	%r11d, %eax
	subl	%r9d, %eax
	subl	$1, %eax
	cltd
	idivl	%r13d
	leal	1(%r12,%rax), %eax
	cltd
	idivl	%esi
	movl	%edx, %r12d
	jmp	.L24
.L39:
	xorl	%r12d, %r12d
.L22:
	movl	%r12d, %eax
	orl	$-1, %edi
	cltd
	idivl	%esi
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L28:
	leal	(%rdi,%rcx), %r8d
	movl	%r8d, %eax
	shrl	$31, %eax
	addl	%r8d, %eax
	sarl	%eax
	movslq	%eax, %r8
	cmpl	(%rbx,%r8,4), %ebp
	cmovle	%eax, %ecx
	cmovg	%eax, %edi
.L27:
	movl	%ecx, %eax
	subl	%edi, %eax
	cmpl	$1, %eax
	jg	.L28
	jmp	.L29
.L38:
	xorl	%r12d, %r12d
	jmp	.L19
.L52:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	w
	.bss
	.align 32
	.type	w, @object
	.size	w, 400000
w:
	.zero	400000
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 400000
x:
	.zero	400000
	.globl	pos
	.align 32
	.type	pos, @object
	.size	pos, 400000
pos:
	.zero	400000
	.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>
#define FOR(i,a,n) for(i=a;i<n;i++)

int binary_lower(int a[],int n,int k){
	int left=-1; int right=n;
	while(right-left>1){
		int mid=(left+right)/2;
		if(a[mid]<k) left=mid;
		else right=mid;
	}
	return right;
}
int binary_upper(int a[],int n,int k){
	int left=-1; int right=n;
	while(right-left>1){
		int mid=(left+right)/2;
		if(a[mid]<=k) left=mid;
		else right=mid;
	}
	return left;
}
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
int pos[100000];
int x[100000],w[100000];
int main(void)
{
	int n,l,t,cnt=0,a,s,k,d,i;
	scanf("%d%d%d",&n,&l,&t);
	FOR(i,0,n){
		scanf("%d%d",&x[i],&w[i]);
		if(w[i]==1) pos[i]=(x[i]+t%l)%l;
		else pos[i]=(x[i]-t%l+l)%l;
	}
	a=pos[0];
	qsort(pos,n,sizeof(int),comp);
	if(w[0]==1){
		FOR(i,0,n){
			d=x[i]-x[0];
			if(w[i]==2&&d<2*t){
				cnt+=1+(2*t-d-1)/l;
				cnt%=n;
			}
		}
		k=cnt%n;
		s=binary_lower(pos,n,a);
	}
	else{
		FOR(i,0,n){
			d=l-x[i]+x[0];
			if(w[i]==1&&d<2*t){
				cnt+=1+(2*t-d-1)/l;
				cnt%=n;
			}
		}
		k=(n-cnt)%n;
		s=binary_upper(pos,n,a);
	}
	d=(s-k+n)%n;
	FOR(i,0,n) printf("%d\n",pos[(d+i)%n]);
	return 0;
}
    
    

3 8 3
0 2
3 2
6 1
 4 20 18
7 2
9 1
12 1
18 1
 2 8 3
0 1
3 2
6 1
 3 8 3
1 2
3 2
6 1
 4 20 18
3 2
9 1
12 1
18 1
 1 8 3
1 2
3 2
6 1
 1 8 0
1 2
3 4
6 1
 1 8 1
1 2
3 4
6 1
 2 8 3
1 1
3 2
6 1
 1 5 3
1 2
6 2
6 1

0
1
5
 10
16
7
9
 0
3
 0
1
6
 10
16
5
7
 6
 1
 0
 0
4
 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>
#define FOR(i,a,n) for(i=a;i<n;i++)

int binary_lower(int a[],int n,int k){
	int left=-1; int right=n;
	while(right-left>1){
		int mid=(left+right)/2;
		if(a[mid]<k) left=mid;
		else right=mid;
	}
	return right;
}
int binary_upper(int a[],int n,int k){
	int left=-1; int right=n;
	while(right-left>1){
		int mid=(left+right)/2;
		if(a[mid]<=k) left=mid;
		else right=mid;
	}
	return left;
}
int comp(const void* a,const void* b){
	return *(int*)a-*(int*)b;
}
int pos[100000];
int x[100000],w[100000];
int main(void)
{
	int n,l,t,cnt=0,a,s,k,d,i;
	scanf("%d%d%d",&n,&l,&t);
	FOR(i,0,n){
		scanf("%d%d",&x[i],&w[i]);
		if(w[i]==1) pos[i]=(x[i]+t%l)%l;
		else pos[i]=(x[i]-t%l+l)%l;
	}
	a=pos[0];
	qsort(pos,n,sizeof(int),comp);
	if(w[0]==1){
		FOR(i,0,n){
			d=x[i]-x[0];
			if(w[i]==2&&d<2*t){
				cnt+=1+(2*t-d-1)/l;
				cnt%=n;
			}
		}
		k=cnt%n;
		s=binary_lower(pos,n,a);
	}
	else{
		FOR(i,0,n){
			d=l-x[i]+x[0];
			if(w[i]==1&&d<2*t){
				cnt+=1+(2*t-d-1)/l;
				cnt%=n;
			}
		}
		k=(n-cnt)%n;
		s=binary_upper(pos,n,a);
	}
	d=(s-k+n)%n;
	FOR(i,0,n) printf("%d\n",pos[(d+i)%n]);
	return 0;
}
    
    
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	binary_lower
	.type	binary_lower, @function
binary_lower:
.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	$-1, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L4:
	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)
	jle	.L3
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$1, %eax
	jg	.L4
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	binary_lower, .-binary_lower
	.globl	binary_upper
	.type	binary_upper, @function
binary_upper:
.LFB1:
	.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	$-1, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L7
.L9:
	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)
	jl	.L8
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$1, %eax
	jg	.L9
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	binary_upper, .-binary_upper
	.globl	comp
	.type	comp, @function
comp:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	comp, .-comp
	.globl	pos
	.bss
	.align 32
	.type	pos, @object
	.size	pos, 400000
pos:
	.zero	400000
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 400000
x:
	.zero	400000
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 400000
w:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	movl	$0, -32(%rbp)
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L14
.L17:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	addq	%rax, %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	x(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-36(%rbp), %eax
	movl	-40(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	addl	%esi, %eax
	movl	-40(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pos(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L16
.L15:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-36(%rbp), %eax
	movl	-40(%rbp), %esi
	cltd
	idivl	%esi
	movl	%edx, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	-40(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pos(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L16:
	addl	$1, -20(%rbp)
.L14:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L17
	movl	pos(%rip), %eax
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movl	%eax, %esi
	leaq	pos(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	w(%rip), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	$0, -20(%rbp)
	jmp	.L19
.L21:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	x(%rip), %edx
	subl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2, %eax
	jne	.L20
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L20
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	subl	-12(%rbp), %eax
	subl	$1, %eax
	movl	-40(%rbp), %edi
	cltd
	idivl	%edi
	addl	$1, %eax
	addl	%eax, -32(%rbp)
	movl	-44(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, -32(%rbp)
.L20:
	addl	$1, -20(%rbp)
.L19:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L21
	movl	-44(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, -24(%rbp)
	movl	-44(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%eax, %esi
	leaq	pos(%rip), %rax
	movq	%rax, %rdi
	call	binary_lower
	movl	%eax, -28(%rbp)
	jmp	.L22
.L18:
	movl	$0, -20(%rbp)
	jmp	.L23
.L25:
	movl	-40(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	x(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	x(%rip), %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L24
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L24
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	subl	-12(%rbp), %eax
	subl	$1, %eax
	movl	-40(%rbp), %edi
	cltd
	idivl	%edi
	addl	$1, %eax
	addl	%eax, -32(%rbp)
	movl	-44(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, -32(%rbp)
.L24:
	addl	$1, -20(%rbp)
.L23:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L25
	movl	-44(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	-44(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -24(%rbp)
	movl	-44(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%eax, %esi
	leaq	pos(%rip), %rax
	movq	%rax, %rdi
	call	binary_upper
	movl	%eax, -28(%rbp)
.L22:
	movl	-28(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-44(%rbp), %eax
	addl	%edx, %eax
	movl	-44(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -12(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L26
.L27:
	movl	-12(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	-44(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pos(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -20(%rbp)
.L26:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L27
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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_lower
	.type	binary_lower, @function
binary_lower:
.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	$-1, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L4:
	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)
	jle	.L3
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$1, %eax
	jg	.L4
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	binary_lower, .-binary_lower
	.globl	binary_upper
	.type	binary_upper, @function
binary_upper:
.LFB1:
	.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	$-1, -12(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L7
.L9:
	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)
	jl	.L8
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$1, %eax
	jg	.L9
	movl	-12(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	binary_upper, .-binary_upper
	.globl	comp
	.type	comp, @function
comp:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	comp, .-comp
	.globl	pos
	.bss
	.align 32
	.type	pos, @object
	.size	pos, 400000
pos:
	.zero	400000
	.globl	x
	.align 32
	.type	x, @object
	.size	x, 400000
x:
	.zero	400000
	.globl	w
	.align 32
	.type	w, @object
	.size	w, 400000
w:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	movl	$0, -32(%rbp)
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L14
.L17:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	addq	%rax, %rdx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	x(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %esi
	movl	-36(%rbp), %eax
	movl	-40(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	addl	%esi, %eax
	movl	-40(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pos(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L16
.L15:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-36(%rbp), %eax
	movl	-40(%rbp), %esi
	cltd
	idivl	%esi
	movl	%edx, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movl	-40(%rbp), %eax
	addl	%edx, %eax
	movl	-40(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pos(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L16:
	addl	$1, -20(%rbp)
.L14:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L17
	movl	pos(%rip), %eax
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movl	%eax, %esi
	leaq	pos(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	w(%rip), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	$0, -20(%rbp)
	jmp	.L19
.L21:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	x(%rip), %edx
	subl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$2, %eax
	jne	.L20
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L20
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	subl	-12(%rbp), %eax
	subl	$1, %eax
	movl	-40(%rbp), %edi
	cltd
	idivl	%edi
	addl	$1, %eax
	addl	%eax, -32(%rbp)
	movl	-44(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, -32(%rbp)
.L20:
	addl	$1, -20(%rbp)
.L19:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L21
	movl	-44(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, -24(%rbp)
	movl	-44(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%eax, %esi
	leaq	pos(%rip), %rax
	movq	%rax, %rdi
	call	binary_lower
	movl	%eax, -28(%rbp)
	jmp	.L22
.L18:
	movl	$0, -20(%rbp)
	jmp	.L23
.L25:
	movl	-40(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	x(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	x(%rip), %eax
	addl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	w(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$1, %eax
	jne	.L24
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, -12(%rbp)
	jge	.L24
	movl	-36(%rbp), %eax
	addl	%eax, %eax
	subl	-12(%rbp), %eax
	subl	$1, %eax
	movl	-40(%rbp), %edi
	cltd
	idivl	%edi
	addl	$1, %eax
	addl	%eax, -32(%rbp)
	movl	-44(%rbp), %ecx
	movl	-32(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, -32(%rbp)
.L24:
	addl	$1, -20(%rbp)
.L23:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L25
	movl	-44(%rbp), %eax
	subl	-32(%rbp), %eax
	movl	-44(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -24(%rbp)
	movl	-44(%rbp), %eax
	movl	-16(%rbp), %edx
	movl	%eax, %esi
	leaq	pos(%rip), %rax
	movq	%rax, %rdi
	call	binary_upper
	movl	%eax, -28(%rbp)
.L22:
	movl	-28(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-44(%rbp), %eax
	addl	%edx, %eax
	movl	-44(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, -12(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L26
.L27:
	movl	-12(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	-44(%rbp), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pos(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -20(%rbp)
.L26:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L27
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
