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 int long long
#define ms_valtype pair

typedef struct {
	int w;
	int b;
}pair;

//比較関数
int compare_ms(ms_valtype a, ms_valtype b){
	return (b.b + b.w) - (a.b + a.w);
}

//昇順
void sort_sub(ms_valtype *origin, int left, int right, ms_valtype *tmp){
	if(right - left > 1){
		int i, j, k, half = (left + right) / 2;
		sort_sub(origin, left, half, tmp);
		sort_sub(origin, half, right, tmp);
		for(i = left; i < right; i++){
			tmp[i] = origin[i];
		}
		for(i = left, j = left, k = half; i < right; i++){
			if(k == right){
				origin[i] = tmp[j];
				j++;
			}
			else if(compare_ms(tmp[j], tmp[k]) <= 0 && j < half){
				origin[i] = tmp[j];
				j++;
			}
			else{
				origin[i] = tmp[k];
				k++;
			}
		}
	}
}

void sort(ms_valtype *origin, int N){
	ms_valtype *tmp = (ms_valtype *)malloc(sizeof(ms_valtype) * N);
	sort_sub(origin, 0, N, tmp);
	free(tmp);
}

signed main(){
	int N, P, i, sum = 0;
	scanf("%lld%lld", &N, &P);
	pair *ps = (pair *)malloc(sizeof(pair) * N);
	for(i = 0; i < N; i++){
		scanf("%lld%lld", &ps[i].w, &ps[i].b);
		ps[i].w *= (100 - P);
		ps[i].b *= P;
		sum -= ps[i].b;
	}
	sort(ps, N);
	for(i = 0; i < N; i++){
		sum += ps[i].w + ps[i].b;
		if(sum >= 0){
			printf("%lld\n", i + 1);
			return 0;
		}
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_ms
	.type	compare_ms, @function
compare_ms:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rsi, %rax
	movq	%rdi, %r8
	movq	%r8, %rsi
	movq	%r9, %rdi
	movq	%rax, %rdi
	movq	%rsi, -16(%rbp)
	movq	%rdi, -8(%rbp)
	movq	%rdx, -32(%rbp)
	movq	%rcx, -24(%rbp)
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	subq	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_ms, .-compare_ms
	.globl	sort_sub
	.type	sort_sub, @function
sort_sub:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	%rdx, -56(%rbp)
	movq	%rcx, -64(%rbp)
	movq	-56(%rbp), %rax
	subq	-48(%rbp), %rax
	cmpq	$1, %rax
	jle	.L12
	movq	-48(%rbp), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-64(%rbp), %rcx
	movq	-8(%rbp), %rdx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort_sub
	movq	-64(%rbp), %rcx
	movq	-56(%rbp), %rdx
	movq	-8(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort_sub
	movq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	jmp	.L5
.L6:
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-64(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -32(%rbp)
.L5:
	movq	-32(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jl	.L6
	movq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L7
.L11:
	movq	-16(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jne	.L8
	movq	-24(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -24(%rbp)
	jmp	.L9
.L8:
	movq	-16(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-64(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	(%rcx), %rdi
	movq	8(%rcx), %rsi
	movq	%rdx, %rcx
	movq	%rax, %rdx
	call	compare_ms
	testq	%rax, %rax
	jg	.L10
	movq	-24(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jge	.L10
	movq	-24(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -24(%rbp)
	jmp	.L9
.L10:
	movq	-16(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -16(%rbp)
.L9:
	addq	$1, -32(%rbp)
.L7:
	movq	-32(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jl	.L11
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sort_sub, .-sort_sub
	.globl	sort
	.type	sort, @function
sort:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rcx
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	sort_sub
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sort, .-sort
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.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
	movq	$0, -24(%rbp)
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	$0, -32(%rbp)
	jmp	.L15
.L16:
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	addq	$8, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-40(%rbp), %rdx
	movl	$100, %ecx
	subq	%rdx, %rcx
	movq	-32(%rbp), %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	movq	-16(%rbp), %rdx
	addq	%rsi, %rdx
	imulq	%rcx, %rax
	movq	%rax, (%rdx)
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	8(%rax), %rcx
	movq	-40(%rbp), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	movq	-16(%rbp), %rdx
	addq	%rsi, %rdx
	imulq	%rcx, %rax
	movq	%rax, 8(%rdx)
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	8(%rax), %rax
	subq	%rax, -24(%rbp)
	addq	$1, -32(%rbp)
.L15:
	movq	-48(%rbp), %rax
	cmpq	%rax, -32(%rbp)
	jl	.L16
	movq	-48(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	sort
	movq	$0, -32(%rbp)
	jmp	.L17
.L20:
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movq	8(%rax), %rax
	addq	%rdx, %rax
	addq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	js	.L18
	movq	-32(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L19
.L18:
	addq	$1, -32(%rbp)
.L17:
	movq	-48(%rbp), %rax
	cmpq	%rax, -32(%rbp)
	jl	.L20
	movl	$0, %eax
.L19:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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
	.type	sort_sub.part.0, @function
sort_sub.part.0:
.LFB43:
	.cfi_startproc
	leaq	(%rdx,%rsi), %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rax, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdi, %r13
	shrq	$63, %r14
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	addq	%rax, %r14
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	sarq	%r14
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rcx, %rbx
	movq	%r14, %rax
	subq	%rsi, %rax
	cmpq	$1, %rax
	jle	.L2
	movq	%r14, %rdx
	call	sort_sub.part.0
.L2:
	movq	%r12, %rax
	subq	%r14, %rax
	cmpq	$1, %rax
	jle	.L3
	movq	%rbx, %rcx
	movq	%r12, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	sort_sub.part.0
.L3:
	movq	%rbp, %r9
	movq	%r12, %rdx
	salq	$4, %r9
	salq	$4, %rdx
	movq	%r9, %rax
	cmpq	%rbp, %r12
	jle	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	movdqu	0(%r13,%rax), %xmm0
	movups	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L5
	movq	%rbp, %rdx
	movq	%r14, %rsi
	addq	%r13, %r9
	movq	%rbp, %rax
	salq	$4, %rdx
	addq	%rbx, %rdx
	cmpq	%rsi, %r12
	je	.L26
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rsi, %rcx
	movq	8(%rdx), %rdi
	addq	(%rdx), %rdi
	salq	$4, %rcx
	addq	%rbx, %rcx
	movq	8(%rcx), %r8
	addq	(%rcx), %r8
	cmpq	%rdi, %r8
	jg	.L9
	cmpq	%rbp, %r14
	jg	.L27
.L9:
	movdqu	(%rcx), %xmm2
	addq	$1, %rsi
	movups	%xmm2, (%r9)
.L10:
	addq	$1, %rax
	cmpq	%rax, %r12
	je	.L1
	movq	%rbp, %rdx
	addq	$16, %r9
	salq	$4, %rdx
	addq	%rbx, %rdx
	cmpq	%rsi, %r12
	jne	.L6
.L26:
	movdqu	(%rdx), %xmm3
	addq	$1, %rax
	addq	$1, %rbp
	movups	%xmm3, (%r9)
	cmpq	%rax, %r12
	je	.L1
	salq	$4, %rbp
	leaq	(%rbx,%rbp), %rdx
.L12:
	movdqu	(%rdx), %xmm1
	movq	%rax, %rcx
	addq	$1, %rax
	addq	$16, %rdx
	salq	$4, %rcx
	movups	%xmm1, 0(%r13,%rcx)
	cmpq	%rax, %r12
	jg	.L12
.L1:
	popq	%rbx
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movdqu	(%rdx), %xmm4
	addq	$1, %rbp
	movups	%xmm4, (%r9)
	jmp	.L10
	.cfi_endproc
.LFE43:
	.size	sort_sub.part.0, .-sort_sub.part.0
	.p2align 4
	.globl	compare_ms
	.type	compare_ms, @function
compare_ms:
.LFB39:
	.cfi_startproc
	endbr64
	leaq	(%rcx,%rdx), %rax
	addq	%rdi, %rsi
	subq	%rsi, %rax
	ret
	.cfi_endproc
.LFE39:
	.size	compare_ms, .-compare_ms
	.p2align 4
	.globl	sort_sub
	.type	sort_sub, @function
sort_sub:
.LFB40:
	.cfi_startproc
	endbr64
	movq	%rdx, %rax
	subq	%rsi, %rax
	cmpq	$1, %rax
	jg	.L31
	ret
	.p2align 4,,10
	.p2align 3
.L31:
	jmp	sort_sub.part.0
	.cfi_endproc
.LFE40:
	.size	sort_sub, .-sort_sub
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	movq	%rsi, %rdi
	salq	$4, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	malloc@PLT
	movq	%rax, %r10
	cmpq	$1, %r12
	jle	.L33
	movq	%rax, %rcx
	movq	%r12, %rdx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	sort_sub.part.0
.L33:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	movq	%r10, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE41:
	.size	sort, .-sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rsi
	movq	%rsi, %rdi
	movq	%rsi, 8(%rsp)
	salq	$4, %rdi
	call	malloc@PLT
	movq	8(%rsp), %rsi
	movq	%rax, %rbp
	testq	%rsi, %rsi
	jle	.L44
	movq	%rax, %rbx
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	movl	$100, %r14d
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	8(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r14, %rdx
	addq	$1, %r15
	addq	$16, %rbx
	movq	32(%rsp), %rax
	movq	24(%rsp), %rsi
	subq	%rax, %rdx
	imulq	-8(%rbx), %rax
	imulq	-16(%rbx), %rdx
	movq	%rax, -8(%rbx)
	subq	%rax, %r12
	movq	%rdx, -16(%rbx)
	cmpq	%r15, %rsi
	jg	.L37
.L36:
	movq	%rbp, %rdi
	call	sort
	movq	24(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L38
	movq	0(%rbp), %rcx
	addq	8(%rbp), %rcx
	addq	%r12, %rcx
	jns	.L50
	addq	$16, %rbp
	xorl	%edx, %edx
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L42:
	movq	8(%rbp), %rax
	addq	0(%rbp), %rax
	addq	$16, %rbp
	addq	%rax, %rcx
	jns	.L39
.L41:
	addq	$1, %rdx
	cmpq	%rdx, %rsi
	jne	.L42
.L38:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	addq	$56, %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
.L50:
	.cfi_restore_state
	xorl	%edx, %edx
.L39:
	addq	$1, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
.L44:
	xorl	%r12d, %r12d
	jmp	.L36
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.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
	.type	sort_sub.part.0, @function
sort_sub.part.0:
.LFB43:
	.cfi_startproc
	leaq	(%rdx,%rsi), %rax
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rax, %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rdi, %r13
	shrq	$63, %r14
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	addq	%rax, %r14
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rsi, %rbp
	sarq	%r14
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rcx, %rbx
	movq	%r14, %rax
	subq	%rsi, %rax
	cmpq	$1, %rax
	jle	.L2
	movq	%r14, %rdx
	call	sort_sub.part.0
.L2:
	movq	%r12, %rax
	subq	%r14, %rax
	cmpq	$1, %rax
	jle	.L3
	movq	%rbx, %rcx
	movq	%r12, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	sort_sub.part.0
.L3:
	movq	%rbp, %r9
	movq	%r12, %rdx
	salq	$4, %r9
	salq	$4, %rdx
	movq	%r9, %rax
	cmpq	%rbp, %r12
	jle	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	movdqu	0(%r13,%rax), %xmm0
	movups	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L5
	movq	%rbp, %rdx
	movq	%r14, %rsi
	addq	%r13, %r9
	movq	%rbp, %rax
	salq	$4, %rdx
	addq	%rbx, %rdx
	cmpq	%rsi, %r12
	je	.L26
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rsi, %rcx
	movq	8(%rdx), %rdi
	addq	(%rdx), %rdi
	salq	$4, %rcx
	addq	%rbx, %rcx
	movq	8(%rcx), %r8
	addq	(%rcx), %r8
	cmpq	%rdi, %r8
	jg	.L9
	cmpq	%rbp, %r14
	jg	.L27
.L9:
	movdqu	(%rcx), %xmm2
	addq	$1, %rsi
	movups	%xmm2, (%r9)
.L10:
	addq	$1, %rax
	cmpq	%rax, %r12
	je	.L1
	movq	%rbp, %rdx
	addq	$16, %r9
	salq	$4, %rdx
	addq	%rbx, %rdx
	cmpq	%rsi, %r12
	jne	.L6
.L26:
	movdqu	(%rdx), %xmm3
	addq	$1, %rax
	addq	$1, %rbp
	movups	%xmm3, (%r9)
	cmpq	%rax, %r12
	je	.L1
	salq	$4, %rbp
	leaq	(%rbx,%rbp), %rdx
.L12:
	movdqu	(%rdx), %xmm1
	movq	%rax, %rcx
	addq	$1, %rax
	addq	$16, %rdx
	salq	$4, %rcx
	movups	%xmm1, 0(%r13,%rcx)
	cmpq	%rax, %r12
	jg	.L12
.L1:
	popq	%rbx
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	movdqu	(%rdx), %xmm4
	addq	$1, %rbp
	movups	%xmm4, (%r9)
	jmp	.L10
	.cfi_endproc
.LFE43:
	.size	sort_sub.part.0, .-sort_sub.part.0
	.p2align 4
	.globl	compare_ms
	.type	compare_ms, @function
compare_ms:
.LFB39:
	.cfi_startproc
	endbr64
	leaq	(%rcx,%rdx), %rax
	addq	%rdi, %rsi
	subq	%rsi, %rax
	ret
	.cfi_endproc
.LFE39:
	.size	compare_ms, .-compare_ms
	.p2align 4
	.globl	sort_sub
	.type	sort_sub, @function
sort_sub:
.LFB40:
	.cfi_startproc
	endbr64
	movq	%rdx, %rax
	subq	%rsi, %rax
	cmpq	$1, %rax
	jg	.L31
	ret
	.p2align 4,,10
	.p2align 3
.L31:
	jmp	sort_sub.part.0
	.cfi_endproc
.LFE40:
	.size	sort_sub, .-sort_sub
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rsi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	movq	%rsi, %rdi
	salq	$4, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	malloc@PLT
	movq	%rax, %r10
	cmpq	$1, %r12
	jle	.L33
	movq	%rax, %rcx
	movq	%r12, %rdx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	sort_sub.part.0
.L33:
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	movq	%r10, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE41:
	.size	sort, .-sort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB42:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rsi
	movq	%rsi, %rdi
	movq	%rsi, 8(%rsp)
	salq	$4, %rdi
	call	malloc@PLT
	movq	8(%rsp), %rsi
	movq	%rax, %rbp
	testq	%rsi, %rsi
	jle	.L44
	movq	%rax, %rbx
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	movl	$100, %r14d
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	8(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r14, %rdx
	addq	$1, %r15
	addq	$16, %rbx
	movq	32(%rsp), %rax
	movq	24(%rsp), %rsi
	subq	%rax, %rdx
	imulq	-8(%rbx), %rax
	imulq	-16(%rbx), %rdx
	movq	%rax, -8(%rbx)
	subq	%rax, %r12
	movq	%rdx, -16(%rbx)
	cmpq	%r15, %rsi
	jg	.L37
.L36:
	movq	%rbp, %rdi
	call	sort
	movq	24(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L38
	movq	0(%rbp), %rcx
	addq	8(%rbp), %rcx
	addq	%r12, %rcx
	jns	.L50
	addq	$16, %rbp
	xorl	%edx, %edx
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L42:
	movq	8(%rbp), %rax
	addq	0(%rbp), %rax
	addq	$16, %rbp
	addq	%rax, %rcx
	jns	.L39
.L41:
	addq	$1, %rdx
	cmpq	%rdx, %rsi
	jne	.L42
.L38:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	addq	$56, %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
.L50:
	.cfi_restore_state
	xorl	%edx, %edx
.L39:
	addq	$1, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
.L44:
	xorl	%r12d, %r12d
	jmp	.L36
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.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 int long long
#define ms_valtype pair

typedef struct {
	int w;
	int b;
}pair;

//比較関数
int compare_ms(ms_valtype a, ms_valtype b){
	return (b.b + b.w) - (a.b + a.w);
}

//昇順
void sort_sub(ms_valtype *origin, int left, int right, ms_valtype *tmp){
	if(right - left > 1){
		int i, j, k, half = (left + right) / 2;
		sort_sub(origin, left, half, tmp);
		sort_sub(origin, half, right, tmp);
		for(i = left; i < right; i++){
			tmp[i] = origin[i];
		}
		for(i = left, j = left, k = half; i < right; i++){
			if(k == right){
				origin[i] = tmp[j];
				j++;
			}
			else if(compare_ms(tmp[j], tmp[k]) <= 0 && j < half){
				origin[i] = tmp[j];
				j++;
			}
			else{
				origin[i] = tmp[k];
				k++;
			}
		}
	}
}

void sort(ms_valtype *origin, int N){
	ms_valtype *tmp = (ms_valtype *)malloc(sizeof(ms_valtype) * N);
	sort_sub(origin, 0, N, tmp);
	free(tmp);
}

signed main(){
	int N, P, i, sum = 0;
	scanf("%lld%lld", &N, &P);
	pair *ps = (pair *)malloc(sizeof(pair) * N);
	for(i = 0; i < N; i++){
		scanf("%lld%lld", &ps[i].w, &ps[i].b);
		ps[i].w *= (100 - P);
		ps[i].b *= P;
		sum -= ps[i].b;
	}
	sort(ps, N);
	for(i = 0; i < N; i++){
		sum += ps[i].w + ps[i].b;
		if(sum >= 0){
			printf("%lld\n", i + 1);
			return 0;
		}
	}
}
5 60
6 3
5 9
3 4
7 0
4 7
 4 17
1 1
1 1
1 1
000 1
 4 75
1 1
1 1
1 1
000 2
 2 93
8 3
8 8
3 3
7 8
4 7
 5 87
6 3
5 9
3 4
7 8
4 7
 4 75
1 1
1 1
1 1
000 1
 5 60
11 3
5 9
3 4
7 0
4 7
 5 60
11 3
5 9
3 4
13 0
4 7
 4 17
1 1
1 1
1 1
001 1
 1 60
11 3
5 9
3 4
13 0
4 7

3
 1
 4
 2
 5
 3
 3
 3
 1
 1

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 int long long
#define ms_valtype pair

typedef struct {
	int w;
	int b;
}pair;

//比較関数
int compare_ms(ms_valtype a, ms_valtype b){
	return (b.b + b.w) - (a.b + a.w);
}

//昇順
void sort_sub(ms_valtype *origin, int left, int right, ms_valtype *tmp){
	if(right - left > 1){
		int i, j, k, half = (left + right) / 2;
		sort_sub(origin, left, half, tmp);
		sort_sub(origin, half, right, tmp);
		for(i = left; i < right; i++){
			tmp[i] = origin[i];
		}
		for(i = left, j = left, k = half; i < right; i++){
			if(k == right){
				origin[i] = tmp[j];
				j++;
			}
			else if(compare_ms(tmp[j], tmp[k]) <= 0 && j < half){
				origin[i] = tmp[j];
				j++;
			}
			else{
				origin[i] = tmp[k];
				k++;
			}
		}
	}
}

void sort(ms_valtype *origin, int N){
	ms_valtype *tmp = (ms_valtype *)malloc(sizeof(ms_valtype) * N);
	sort_sub(origin, 0, N, tmp);
	free(tmp);
}

signed main(){
	int N, P, i, sum = 0;
	scanf("%lld%lld", &N, &P);
	pair *ps = (pair *)malloc(sizeof(pair) * N);
	for(i = 0; i < N; i++){
		scanf("%lld%lld", &ps[i].w, &ps[i].b);
		ps[i].w *= (100 - P);
		ps[i].b *= P;
		sum -= ps[i].b;
	}
	sort(ps, N);
	for(i = 0; i < N; i++){
		sum += ps[i].w + ps[i].b;
		if(sum >= 0){
			printf("%lld\n", i + 1);
			return 0;
		}
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_ms
	.type	compare_ms, @function
compare_ms:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rsi, %rax
	movq	%rdi, %r8
	movq	%r8, %rsi
	movq	%r9, %rdi
	movq	%rax, %rdi
	movq	%rsi, -16(%rbp)
	movq	%rdi, -8(%rbp)
	movq	%rdx, -32(%rbp)
	movq	%rcx, -24(%rbp)
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	subq	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_ms, .-compare_ms
	.globl	sort_sub
	.type	sort_sub, @function
sort_sub:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	%rdx, -56(%rbp)
	movq	%rcx, -64(%rbp)
	movq	-56(%rbp), %rax
	subq	-48(%rbp), %rax
	cmpq	$1, %rax
	jle	.L12
	movq	-48(%rbp), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-64(%rbp), %rcx
	movq	-8(%rbp), %rdx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort_sub
	movq	-64(%rbp), %rcx
	movq	-56(%rbp), %rdx
	movq	-8(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort_sub
	movq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	jmp	.L5
.L6:
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-64(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -32(%rbp)
.L5:
	movq	-32(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jl	.L6
	movq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L7
.L11:
	movq	-16(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jne	.L8
	movq	-24(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -24(%rbp)
	jmp	.L9
.L8:
	movq	-16(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-64(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	(%rcx), %rdi
	movq	8(%rcx), %rsi
	movq	%rdx, %rcx
	movq	%rax, %rdx
	call	compare_ms
	testq	%rax, %rax
	jg	.L10
	movq	-24(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jge	.L10
	movq	-24(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -24(%rbp)
	jmp	.L9
.L10:
	movq	-16(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -16(%rbp)
.L9:
	addq	$1, -32(%rbp)
.L7:
	movq	-32(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jl	.L11
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sort_sub, .-sort_sub
	.globl	sort
	.type	sort, @function
sort:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rcx
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	sort_sub
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sort, .-sort
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.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
	movq	$0, -24(%rbp)
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	$0, -32(%rbp)
	jmp	.L15
.L16:
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	addq	$8, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-40(%rbp), %rdx
	movl	$100, %ecx
	subq	%rdx, %rcx
	movq	-32(%rbp), %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	movq	-16(%rbp), %rdx
	addq	%rsi, %rdx
	imulq	%rcx, %rax
	movq	%rax, (%rdx)
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	8(%rax), %rcx
	movq	-40(%rbp), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	movq	-16(%rbp), %rdx
	addq	%rsi, %rdx
	imulq	%rcx, %rax
	movq	%rax, 8(%rdx)
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	8(%rax), %rax
	subq	%rax, -24(%rbp)
	addq	$1, -32(%rbp)
.L15:
	movq	-48(%rbp), %rax
	cmpq	%rax, -32(%rbp)
	jl	.L16
	movq	-48(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	sort
	movq	$0, -32(%rbp)
	jmp	.L17
.L20:
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movq	8(%rax), %rax
	addq	%rdx, %rax
	addq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	js	.L18
	movq	-32(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L19
.L18:
	addq	$1, -32(%rbp)
.L17:
	movq	-48(%rbp), %rax
	cmpq	%rax, -32(%rbp)
	jl	.L20
	movl	$0, %eax
.L19:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	compare_ms
	.type	compare_ms, @function
compare_ms:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rsi, %rax
	movq	%rdi, %r8
	movq	%r8, %rsi
	movq	%r9, %rdi
	movq	%rax, %rdi
	movq	%rsi, -16(%rbp)
	movq	%rdi, -8(%rbp)
	movq	%rdx, -32(%rbp)
	movq	%rcx, -24(%rbp)
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	-8(%rbp), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	subq	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_ms, .-compare_ms
	.globl	sort_sub
	.type	sort_sub, @function
sort_sub:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	%rdx, -56(%rbp)
	movq	%rcx, -64(%rbp)
	movq	-56(%rbp), %rax
	subq	-48(%rbp), %rax
	cmpq	$1, %rax
	jle	.L12
	movq	-48(%rbp), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	movq	-64(%rbp), %rcx
	movq	-8(%rbp), %rdx
	movq	-48(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort_sub
	movq	-64(%rbp), %rcx
	movq	-56(%rbp), %rdx
	movq	-8(%rbp), %rsi
	movq	-40(%rbp), %rax
	movq	%rax, %rdi
	call	sort_sub
	movq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	jmp	.L5
.L6:
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-64(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -32(%rbp)
.L5:
	movq	-32(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jl	.L6
	movq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -24(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, -16(%rbp)
	jmp	.L7
.L11:
	movq	-16(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jne	.L8
	movq	-24(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -24(%rbp)
	jmp	.L9
.L8:
	movq	-16(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-24(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-64(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	(%rcx), %rdi
	movq	8(%rcx), %rsi
	movq	%rdx, %rcx
	movq	%rax, %rdx
	call	compare_ms
	testq	%rax, %rax
	jg	.L10
	movq	-24(%rbp), %rax
	cmpq	-8(%rbp), %rax
	jge	.L10
	movq	-24(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -24(%rbp)
	jmp	.L9
.L10:
	movq	-16(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addq	$1, -16(%rbp)
.L9:
	addq	$1, -32(%rbp)
.L7:
	movq	-32(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jl	.L11
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	sort_sub, .-sort_sub
	.globl	sort
	.type	sort, @function
sort:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rcx
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movl	$0, %esi
	movq	%rax, %rdi
	call	sort_sub
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	sort, .-sort
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.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
	movq	$0, -24(%rbp)
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movq	$0, -32(%rbp)
	jmp	.L15
.L16:
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	addq	$8, %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	%rdx, %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	-40(%rbp), %rdx
	movl	$100, %ecx
	subq	%rdx, %rcx
	movq	-32(%rbp), %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	movq	-16(%rbp), %rdx
	addq	%rsi, %rdx
	imulq	%rcx, %rax
	movq	%rax, (%rdx)
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	8(%rax), %rcx
	movq	-40(%rbp), %rax
	movq	-32(%rbp), %rdx
	movq	%rdx, %rsi
	salq	$4, %rsi
	movq	-16(%rbp), %rdx
	addq	%rsi, %rdx
	imulq	%rcx, %rax
	movq	%rax, 8(%rdx)
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	8(%rax), %rax
	subq	%rax, -24(%rbp)
	addq	$1, -32(%rbp)
.L15:
	movq	-48(%rbp), %rax
	cmpq	%rax, -32(%rbp)
	jl	.L16
	movq	-48(%rbp), %rdx
	movq	-16(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	sort
	movq	$0, -32(%rbp)
	jmp	.L17
.L20:
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	salq	$4, %rax
	movq	%rax, %rcx
	movq	-16(%rbp), %rax
	addq	%rcx, %rax
	movq	8(%rax), %rax
	addq	%rdx, %rax
	addq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	js	.L18
	movq	-32(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L19
.L18:
	addq	$1, -32(%rbp)
.L17:
	movq	-48(%rbp), %rax
	cmpq	%rax, -32(%rbp)
	jl	.L20
	movl	$0, %eax
.L19:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
