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

#define N 200000

int aa[N], bb[N];

int compare(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;

	return bb[i] - bb[j];
}

int main() {
	static int ii[N];
	int n, i, time;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d%d", &aa[i], &bb[i]);
		ii[i] = i;
	}
	qsort(ii, n, sizeof *ii, compare);
	time = 0;
	for (i = 0; i < n; i++) {
		time += aa[ii[i]];
		if (time > bb[ii[i]]) {
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	(%rdi), %rax
	movslq	(%rsi), %rcx
	leaq	bb(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	subl	(%rdx,%rcx,4), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	ii.0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jle	.L4
	xorl	%ebx, %ebx
	leaq	bb(%rip), %r14
	leaq	aa(%rip), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	0(,%rbx,4), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	(%r14,%rsi), %rdx
	addq	%r13, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movl	%ebx, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L5
.L4:
	movl	$4, %edx
	leaq	compare(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L6
	leaq	ii.0(%rip), %rax
	leal	-1(%rdx), %ecx
	leaq	4(%rax), %rdx
	leaq	bb(%rip), %r14
	leaq	(%rdx,%rcx,4), %rsi
	leaq	aa(%rip), %r13
	xorl	%edx, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$4, %rax
	cmpq	%rsi, %rax
	je	.L6
.L9:
	movslq	(%rax), %rcx
	addl	0(%r13,%rcx,4), %edx
	cmpl	%edx, (%r14,%rcx,4)
	jge	.L7
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L8
.L6:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L8:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.local	ii.0
	.comm	ii.0,800000,32
	.globl	bb
	.bss
	.align 32
	.type	bb, @object
	.size	bb, 800000
bb:
	.zero	800000
	.globl	aa
	.align 32
	.type	aa, @object
	.size	aa, 800000
aa:
	.zero	800000
	.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	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	(%rdi), %rax
	movslq	(%rsi), %rcx
	leaq	bb(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	subl	(%rdx,%rcx,4), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	ii.0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jle	.L4
	xorl	%ebx, %ebx
	leaq	bb(%rip), %r14
	leaq	aa(%rip), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	0(,%rbx,4), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	(%r14,%rsi), %rdx
	addq	%r13, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movl	%ebx, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L5
.L4:
	movl	$4, %edx
	leaq	compare(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L6
	leaq	ii.0(%rip), %rax
	leal	-1(%rdx), %ecx
	leaq	4(%rax), %rdx
	leaq	bb(%rip), %r14
	leaq	(%rdx,%rcx,4), %rsi
	leaq	aa(%rip), %r13
	xorl	%edx, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$4, %rax
	cmpq	%rsi, %rax
	je	.L6
.L9:
	movslq	(%rax), %rcx
	addl	0(%r13,%rcx,4), %edx
	cmpl	%edx, (%r14,%rcx,4)
	jge	.L7
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L8
.L6:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L8:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.local	ii.0
	.comm	ii.0,800000,32
	.globl	bb
	.bss
	.align 32
	.type	bb, @object
	.size	bb, 800000
bb:
	.zero	800000
	.globl	aa
	.align 32
	.type	aa, @object
	.size	aa, 800000
aa:
	.zero	800000
	.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	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	(%rdi), %rax
	movslq	(%rsi), %rcx
	leaq	bb(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	subl	(%rdx,%rcx,4), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	ii.0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jle	.L4
	xorl	%ebx, %ebx
	leaq	bb(%rip), %r14
	leaq	aa(%rip), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	0(,%rbx,4), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	(%r14,%rsi), %rdx
	addq	%r13, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movl	%ebx, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L5
.L4:
	movl	$4, %edx
	leaq	compare(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L6
	leaq	ii.0(%rip), %rax
	leal	-1(%rdx), %ecx
	leaq	4(%rax), %rdx
	leaq	bb(%rip), %r14
	leaq	(%rdx,%rcx,4), %rsi
	leaq	aa(%rip), %r13
	xorl	%edx, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$4, %rax
	cmpq	%rsi, %rax
	je	.L6
.L9:
	movslq	(%rax), %rcx
	addl	0(%r13,%rcx,4), %edx
	cmpl	%edx, (%r14,%rcx,4)
	jge	.L7
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L8
.L6:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L8:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.local	ii.0
	.comm	ii.0,800000,32
	.globl	bb
	.bss
	.align 32
	.type	bb, @object
	.size	bb, 800000
bb:
	.zero	800000
	.globl	aa
	.align 32
	.type	aa, @object
	.size	aa, 800000
aa:
	.zero	800000
	.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>
#include <stdlib.h>

#define N 200000

int aa[N], bb[N];

int compare(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;

	return bb[i] - bb[j];
}

int main() {
	static int ii[N];
	int n, i, time;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d%d", &aa[i], &bb[i]);
		ii[i] = i;
	}
	qsort(ii, n, sizeof *ii, compare);
	time = 0;
	for (i = 0; i < n; i++) {
		time += aa[ii[i]];
		if (time > bb[ii[i]]) {
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>

#define N 200000

int aa[N], bb[N];

int compare(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;

	return bb[i] - bb[j];
}

int main() {
	static int ii[N];
	int n, i, time;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d%d", &aa[i], &bb[i]);
		ii[i] = i;
	}
	qsort(ii, n, sizeof *ii, compare);
	time = 0;
	for (i = 0; i < n; i++) {
		time += aa[ii[i]];
		if (time > bb[ii[i]]) {
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	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:

3
334 1000
334 1000
334 1100
 30
384 8895
1725 9791
170 1024
4 11105
2 6
578 1815
702 3352
143 5141
1420 6980
24 1602
849 999
76 7586
85 5570
444 4991
719 11090
470 10708
1137 4547
455 9003
110 9901
15 8578
718 3692
104 1286
3 4
366 12143
7 6649
610 2374
152 7324
4 7042
292 11386
334 5720
 5
2 4
1 8
1 8
4 9
3 12
 3
334 1000
334 1100
334 1100
 5
2 4
1 8
0 8
4 9
3 12
 30
384 8895
1725 9791
170 1024
4 11105
2 6
578 1815
702 3352
143 5141
1420 11731
24 1602
849 999
76 7586
85 5570
444 4991
719 11090
470 10708
1137 4547
455 9003
110 9901
15 8578
718 3692
104 1286
3 4
366 12143
7 6649
610 2374
152 7324
4 7042
292 11386
334 5720
 3
334 1000
146 1100
334 1100
 5
2 4
1 8
0 8
4 9
3 4
 30
384 8895
1725 9791
170 1024
4 11105
2 6
578 1815
702 3352
143 5141
1420 11731
24 1602
849 999
76 7586
85 5570
444 4991
719 11090
470 10708
1137 4547
455 9003
110 9901
15 8578
718 3692
4 1286
3 4
366 12143
7 6649
610 2374
152 7324
4 7042
292 11386
334 5720
 3
334 1000
146 1100
334 1000

Yes
 No
 Yes
 Yes
 Yes
 No
 Yes
 No
 No
 Yes

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

#define N 200000

int aa[N], bb[N];

int compare(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;

	return bb[i] - bb[j];
}

int main() {
	static int ii[N];
	int n, i, time;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d%d", &aa[i], &bb[i]);
		ii[i] = i;
	}
	qsort(ii, n, sizeof *ii, compare);
	time = 0;
	for (i = 0; i < n; i++) {
		time += aa[ii[i]];
		if (time > bb[ii[i]]) {
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	(%rdi), %rax
	movslq	(%rsi), %rcx
	leaq	bb(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	subl	(%rdx,%rcx,4), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	ii.0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jle	.L4
	xorl	%ebx, %ebx
	leaq	bb(%rip), %r14
	leaq	aa(%rip), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	0(,%rbx,4), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	(%r14,%rsi), %rdx
	addq	%r13, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movl	%ebx, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L5
.L4:
	movl	$4, %edx
	leaq	compare(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L6
	leaq	ii.0(%rip), %rax
	leal	-1(%rdx), %ecx
	leaq	4(%rax), %rdx
	leaq	bb(%rip), %r14
	leaq	(%rdx,%rcx,4), %rsi
	leaq	aa(%rip), %r13
	xorl	%edx, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$4, %rax
	cmpq	%rsi, %rax
	je	.L6
.L9:
	movslq	(%rax), %rcx
	addl	0(%r13,%rcx,4), %edx
	cmpl	%edx, (%r14,%rcx,4)
	jge	.L7
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L8
.L6:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L8:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.local	ii.0
	.comm	ii.0,800000,32
	.globl	bb
	.bss
	.align 32
	.type	bb, @object
	.size	bb, 800000
bb:
	.zero	800000
	.globl	aa
	.align 32
	.type	aa, @object
	.size	aa, 800000
aa:
	.zero	800000
	.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	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movslq	(%rdi), %rax
	movslq	(%rsi), %rcx
	leaq	bb(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	subl	(%rdx,%rcx,4), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"No"
.LC3:
	.string	"Yes"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	ii.0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jle	.L4
	xorl	%ebx, %ebx
	leaq	bb(%rip), %r14
	leaq	aa(%rip), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	0(,%rbx,4), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	(%r14,%rsi), %rdx
	addq	%r13, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movl	%ebx, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L5
.L4:
	movl	$4, %edx
	leaq	compare(%rip), %rcx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L6
	leaq	ii.0(%rip), %rax
	leal	-1(%rdx), %ecx
	leaq	4(%rax), %rdx
	leaq	bb(%rip), %r14
	leaq	(%rdx,%rcx,4), %rsi
	leaq	aa(%rip), %r13
	xorl	%edx, %edx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$4, %rax
	cmpq	%rsi, %rax
	je	.L6
.L9:
	movslq	(%rax), %rcx
	addl	0(%r13,%rcx,4), %edx
	cmpl	%edx, (%r14,%rcx,4)
	jge	.L7
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L8
.L6:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L8:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.local	ii.0
	.comm	ii.0,800000,32
	.globl	bb
	.bss
	.align 32
	.type	bb, @object
	.size	bb, 800000
bb:
	.zero	800000
	.globl	aa
	.align 32
	.type	aa, @object
	.size	aa, 800000
aa:
	.zero	800000
	.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:
```