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 MAX_N 101000

int isPrime[ MAX_N + 1 ] = { 0, 0, 1 };

void quickSort( int *, int, int );
int median( int, int, int );
void insertionSort( int *, int );

int main( void ) {
	int i, j, N, P, cnt, p[ 22 ], sum[ 253 ];

	for ( i = 3; i <= MAX_N; i += 2 )
		isPrime[ i ] = 1;

	for ( i = 3; i * i <= MAX_N; i += 2 )
		if ( isPrime[ i ] )
			for ( j = i * 2; j <= MAX_N; j += i )
				isPrime[ j ] = 0;

	for ( ; scanf( "%d %d", &N, &P ), N != -1; printf( "%d\n", sum[ P - 1 ] ) ) {
		cnt = 0;
		for ( i = N + 1; cnt < 22; i++ )
			if ( isPrime[ i ] )
				p[ cnt++ ] = i;

		cnt = 0;
		for ( i = 0; i < 22; i++ )
			for ( j = i; j < 22; j++ )
				sum[ cnt++ ] = p[ i ] + p[ j ];

		quickSort( sum, 0, 179 );
	}

	return 0;
}

void quickSort( int *data, int l, int r ) {
	if ( l < r ) {
		int i = l, j = r, pivot = median( data[ i ], data[ ( i + j ) / 2 ], data[ j ] ), tmp;

		while ( 1 ) {
			for ( ; data[ i ] < pivot; i++ ) ;
			for ( ; pivot < data [ j ]; j-- ) ;
			if ( i >= j )
				break;

			tmp = data[ i ];
			data[ i ] = data[ j ];
			data[ j ] = tmp;

			i++;
			j--;
		}

		if ( i - l < 20 )
			insertionSort( data + l, i - l );
		else
			quickSort( data, l, i - 1 );

		if ( r - j < 20 )
			insertionSort( data + j + 1, r - j );
		else
			quickSort( data, j + 1, r );
	}
}

int median( int x, int y, int z ) {
	if ( x < y )
		if ( y < z )
			return y;
		else if ( z < x )
			return x;
		else
			return z;
	else if ( z < y )
		return y;
	else if ( x < z )
		return x;
	else
		return z;
}

void insertionSort( int *data, int n ) {
	int i, j, tmp;

	for ( i = 1; i < n; i++ ) {
		tmp = data[ i ];

		for ( j = i; j && data[ j - 1 ] > tmp; j-- )
			data[ j ] = data[ j - 1 ];

		data[ j ] = tmp;
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	isPrime
	.data
	.align 32
	.type	isPrime, @object
	.size	isPrime, 404004
isPrime:
	.long	0
	.long	0
	.long	1
	.zero	403992
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1152, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$3, -1132(%rbp)
	jmp	.L2
.L3:
	movl	-1132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$2, -1132(%rbp)
.L2:
	cmpl	$101000, -1132(%rbp)
	jle	.L3
	movl	$3, -1132(%rbp)
	jmp	.L4
.L8:
	movl	-1132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-1132(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -1128(%rbp)
	jmp	.L6
.L7:
	movl	-1128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-1132(%rbp), %eax
	addl	%eax, -1128(%rbp)
.L6:
	cmpl	$101000, -1128(%rbp)
	jle	.L7
.L5:
	addl	$2, -1132(%rbp)
.L4:
	movl	-1132(%rbp), %eax
	imull	%eax, %eax
	cmpl	$101000, %eax
	jle	.L8
	jmp	.L9
.L17:
	movl	$0, -1124(%rbp)
	movl	-1140(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1132(%rbp)
	jmp	.L10
.L12:
	movl	-1132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L11
	movl	-1124(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1124(%rbp)
	cltq
	movl	-1132(%rbp), %edx
	movl	%edx, -1120(%rbp,%rax,4)
.L11:
	addl	$1, -1132(%rbp)
.L10:
	cmpl	$21, -1124(%rbp)
	jle	.L12
	movl	$0, -1124(%rbp)
	movl	$0, -1132(%rbp)
	jmp	.L13
.L16:
	movl	-1132(%rbp), %eax
	movl	%eax, -1128(%rbp)
	jmp	.L14
.L15:
	movl	-1132(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %esi
	movl	-1128(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %ecx
	movl	-1124(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1124(%rbp)
	leal	(%rsi,%rcx), %edx
	cltq
	movl	%edx, -1024(%rbp,%rax,4)
	addl	$1, -1128(%rbp)
.L14:
	cmpl	$21, -1128(%rbp)
	jle	.L15
	addl	$1, -1132(%rbp)
.L13:
	cmpl	$21, -1132(%rbp)
	jle	.L16
	leaq	-1024(%rbp), %rax
	movl	$179, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	quickSort
	movl	-1136(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-1024(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	leaq	-1136(%rbp), %rdx
	leaq	-1140(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1140(%rbp), %eax
	cmpl	$-1, %eax
	jne	.L17
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	quickSort
	.type	quickSort, @function
quickSort:
.LFB7:
	.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)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L33
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	median
	movl	%eax, -8(%rbp)
	jmp	.L22
.L23:
	addl	$1, -16(%rbp)
.L22:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L23
	jmp	.L24
.L25:
	subl	$1, -12(%rbp)
.L24:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L25
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L34
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -16(%rbp)
	subl	$1, -12(%rbp)
	jmp	.L22
.L34:
	nop
	movl	-16(%rbp), %eax
	subl	-28(%rbp), %eax
	cmpl	$19, %eax
	jg	.L29
	movl	-16(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L30
.L29:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	quickSort
.L30:
	movl	-32(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$19, %eax
	jg	.L31
	movl	-32(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L33
.L31:
	movl	-12(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	quickSort
.L33:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	quickSort, .-quickSort
	.globl	median
	.type	median, @function
median:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L36
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L37
	movl	-8(%rbp), %eax
	jmp	.L38
.L37:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L39
	movl	-4(%rbp), %eax
	jmp	.L38
.L39:
	movl	-12(%rbp), %eax
	jmp	.L38
.L36:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L40
	movl	-8(%rbp), %eax
	jmp	.L38
.L40:
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L41
	movl	-4(%rbp), %eax
	jmp	.L38
.L41:
	movl	-12(%rbp), %eax
.L38:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	median, .-median
	.globl	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB9:
	.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	$1, -12(%rbp)
	jmp	.L43
.L47:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L44
.L46:
	movl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	subl	$1, -8(%rbp)
.L44:
	cmpl	$0, -8(%rbp)
	je	.L45
	movl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L46
.L45:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -12(%rbp)
.L43:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L47
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	insertionSort, .-insertionSort
	.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	quickSort
	.type	quickSort, @function
quickSort:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%edx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	(%rdi,%r13,4), %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%rax, 8(%rsp)
	cmpl	%r13d, %esi
	jge	.L1
	movq	%rdi, %r14
	movl	%esi, %r11d
	movq	%r13, %r12
.L25:
	movq	8(%rsp), %rax
	leal	(%r12,%r11), %edx
	movl	(%rax), %ecx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cltq
	movl	(%r14,%rax,4), %esi
	movslq	%r11d, %rax
	leaq	(%r14,%rax,4), %r15
	movl	(%r15), %eax
	cmpl	%eax, %esi
	jle	.L3
	cmpl	%eax, %ecx
	cmovge	%ecx, %eax
	cmpl	%esi, %ecx
	cmovle	%eax, %esi
.L4:
	movl	%r11d, %r9d
	movq	%r15, %r8
	movl	%r12d, %ebx
	movq	%r13, %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%r8), %edi
	cmpl	%esi, %edi
	jl	.L6
	cmpl	%ecx, %esi
	jge	.L7
	leal	-1(%rbx), %eax
	leaq	-4(%r14,%rbp,4), %rdx
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rdx), %ecx
	movl	%eax, %ebx
	movq	%rdx, %r10
	movq	%rax, %rbp
	subq	$4, %rdx
	subq	$1, %rax
	cmpl	%esi, %ecx
	jg	.L8
	cmpl	%ebx, %r9d
	jge	.L10
.L36:
	subl	$1, %ebx
	movl	%ecx, (%r8)
	movslq	%ebx, %rbp
	movl	%edi, (%r10)
	movl	(%r14,%rbp,4), %ecx
.L6:
	addq	$4, %r8
	addl	$1, %r9d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	(%r14,%rbp,4), %r10
	cmpl	%ebx, %r9d
	jl	.L36
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r9d, %r8d
	subl	%r11d, %r8d
	cmpl	$19, %r8d
	jle	.L37
	leal	-1(%r9), %edx
	movl	%r11d, %esi
	movq	%r14, %rdi
	call	quickSort
.L13:
	movl	%r12d, %r9d
	subl	%ebx, %r9d
	cmpl	$19, %r9d
	jle	.L38
.L19:
	leal	1(%rbx), %r11d
	cmpl	%r12d, %r11d
	jl	.L25
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L37:
	.cfi_restore_state
	leaq	4(%r15), %rdi
	movl	$1, %r9d
	cmpl	$1, %r8d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%rdi), %esi
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L14:
	movl	-4(%rax), %edx
	movq	%rax, %rcx
	cmpl	%edx, %esi
	jge	.L15
	movl	%edx, (%rax)
	leaq	-4(%rcx), %rax
	cmpq	%rax, %r15
	jne	.L14
	movq	%r15, %rcx
.L15:
	addl	$1, %r9d
	movl	%esi, (%rcx)
	addq	$4, %rdi
	cmpl	%r9d, %r8d
	jne	.L17
	movl	%r12d, %r9d
	subl	%ebx, %r9d
	cmpl	$19, %r9d
	jg	.L19
.L38:
	leaq	4(%r14,%rbp,4), %rdi
	cmpl	$1, %r9d
	jle	.L1
	leaq	4(%rdi), %r8
	movl	$1, %r10d
	.p2align 4,,10
	.p2align 3
.L24:
	movl	(%r8), %esi
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L21:
	movl	-4(%rax), %edx
	movq	%rax, %rcx
	cmpl	%edx, %esi
	jge	.L22
	movl	%edx, (%rax)
	leaq	-4(%rcx), %rax
	cmpq	%rax, %rdi
	jne	.L21
	movq	%rdi, %rcx
.L22:
	addl	$1, %r10d
	movl	%esi, (%rcx)
	addq	$4, %r8
	cmpl	%r10d, %r9d
	jne	.L24
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L3:
	.cfi_restore_state
	cmpl	%eax, %ecx
	cmovle	%ecx, %eax
	cmpl	%esi, %ecx
	cmovge	%eax, %esi
	jmp	.L4
	.cfi_endproc
.LFE40:
	.size	quickSort, .-quickSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	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
	subq	$1160, %rsp
	.cfi_def_cfa_offset 1216
	movq	%fs:40, %rax
	movq	%rax, 1144(%rsp)
	leaq	12+isPrime(%rip), %rax
	leaq	403992(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L40:
	movl	$1, (%rax)
	addq	$8, %rax
	cmpq	%rdx, %rax
	jne	.L40
	movl	$6, %esi
	movl	$3, %edx
	leaq	isPrime(%rip), %r13
	jmp	.L42
.L44:
	leal	2(%rcx), %eax
	addq	$2, %rdx
	addq	$4, %rsi
	imull	%eax, %eax
	cmpl	$101000, %eax
	jg	.L114
.L42:
	movl	0(%r13,%rdx,4), %edi
	movl	%edx, %ecx
	testl	%edi, %edi
	je	.L44
	cmpq	$101000, %rsi
	ja	.L44
	movq	%rsi, %rax
.L45:
	movl	$0, 0(%r13,%rax,4)
	addq	%rdx, %rax
	cmpl	$101000, %eax
	jle	.L45
	jmp	.L44
.L114:
	leaq	24(%rsp), %rax
	leaq	28(%rsp), %rbp
	movq	%rax, 8(%rsp)
.L43:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	cmpl	$-1, %eax
	je	.L115
	addl	$1, %eax
	xorl	%edx, %edx
	cltq
.L49:
	movl	0(%r13,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L46
.L116:
	movslq	%edx, %rcx
	leal	1(%rdx), %esi
	movl	%eax, 32(%rsp,%rcx,4)
	addq	$1, %rax
	cmpl	$21, %edx
	je	.L48
	movl	0(%r13,%rax,4), %ecx
	movl	%esi, %edx
	testl	%ecx, %ecx
	jne	.L116
.L46:
	addq	$1, %rax
	cmpl	$22, %edx
	jne	.L49
.L48:
	leaq	32(%rsp), %rax
	movl	$22, %ecx
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	leaq	128(%rsp), %r14
	movl	$21, %r10d
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L117:
	movdqu	(%rax), %xmm1
	movd	%r8d, %xmm2
	movl	%ecx, %edi
	movslq	%edx, %rsi
	pshufd	$0, %xmm2, %xmm0
	leaq	(%r14,%rsi,4), %rsi
	shrl	$2, %edi
	paddd	%xmm0, %xmm1
	movups	%xmm1, (%rsi)
	cmpl	$1, %edi
	je	.L52
	movdqu	16(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 16(%rsi)
	cmpl	$2, %edi
	je	.L52
	movdqu	32(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 32(%rsi)
	cmpl	$3, %edi
	je	.L52
	movdqu	48(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 48(%rsi)
	cmpl	$5, %edi
	jne	.L52
	movdqu	64(%rax), %xmm3
	paddd	%xmm3, %xmm0
	movups	%xmm0, 64(%rsi)
.L52:
	movl	%ecx, %esi
	andl	$-4, %esi
	leal	(%r9,%rsi), %r11d
	leal	(%rdx,%rsi), %edi
	cmpl	%ecx, %esi
	je	.L51
.L54:
	movslq	%r11d, %r12
	movslq	%edi, %rbx
	leal	1(%rdi), %esi
	movl	32(%rsp,%r12,4), %r15d
	addl	%r8d, %r15d
	movl	%r15d, 128(%rsp,%rbx,4)
	leal	1(%r11), %ebx
	cmpl	$21, %r11d
	je	.L51
	movslq	%ebx, %rbx
	movslq	%esi, %rsi
	addl	$2, %edi
	movl	32(%rsp,%rbx,4), %r15d
	addl	%r8d, %r15d
	movl	%r15d, 128(%rsp,%rsi,4)
	leal	2(%r11), %esi
	cmpl	$20, %r11d
	je	.L51
	movslq	%esi, %rsi
	movslq	%edi, %rdi
	addl	32(%rsp,%rsi,4), %r8d
	movl	%r8d, 128(%rsp,%rdi,4)
.L51:
	addl	$22, %edx
	addq	$4, %rax
	subl	%r9d, %edx
	addl	$1, %r9d
	subl	$1, %ecx
	je	.L81
.L50:
	movl	%r10d, %esi
	movl	(%rax), %r8d
	subl	%r9d, %esi
	cmpl	$2, %esi
	ja	.L117
	movl	%edx, %edi
	movl	%r9d, %r11d
	jmp	.L54
.L81:
	xorl	%r11d, %r11d
.L53:
	leal	179(%r11), %ecx
	movl	844(%rsp), %edx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	cltq
	movl	128(%rsp,%rax,4), %edi
	movslq	%r11d, %rax
	leaq	(%r14,%rax,4), %r9
	movl	(%r9), %eax
	cmpl	%eax, %edi
	jle	.L56
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	cmpl	%edi, %edx
	cmovle	%eax, %edi
.L57:
	movl	%r11d, %r10d
	movq	%r9, %r8
	movl	$179, %ebx
	movl	$179, %edx
	.p2align 4,,10
	.p2align 3
.L58:
	movl	(%r8), %r15d
	leaq	(%r14,%rdx,4), %rsi
	movq	%rdx, %r12
	movl	(%rsi), %ecx
	cmpl	%edi, %r15d
	jl	.L59
	cmpl	%ecx, %edi
	jge	.L60
	leal	-1(%rbx), %eax
	leaq	-4(%r14,%rdx,4), %rdx
	cltq
	.p2align 4,,10
	.p2align 3
.L61:
	movl	(%rdx), %ecx
	movl	%eax, %ebx
	movq	%rdx, %rsi
	movq	%rax, %r12
	subq	$4, %rdx
	subq	$1, %rax
	cmpl	%ecx, %edi
	jl	.L61
.L60:
	cmpl	%r10d, %ebx
	jle	.L62
	movl	%ecx, (%r8)
	subl	$1, %ebx
	movl	%r15d, (%rsi)
	movslq	%ebx, %rdx
.L59:
	addq	$4, %r8
	addl	$1, %r10d
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L62:
	movl	%r10d, %r15d
	subl	%r11d, %r15d
	cmpl	$19, %r15d
	jg	.L63
	leaq	4(%r9), %rdi
	movl	$1, %r8d
	cmpl	$1, %r15d
	jle	.L65
	.p2align 4,,10
	.p2align 3
.L69:
	movl	(%rdi), %esi
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L66:
	movl	-4(%rax), %edx
	movq	%rax, %rcx
	cmpl	%edx, %esi
	jge	.L67
	movl	%edx, (%rax)
	leaq	-4(%rcx), %rax
	cmpq	%r9, %rax
	jne	.L66
	movq	%r9, %rcx
.L67:
	addl	$1, %r8d
	movl	%esi, (%rcx)
	addq	$4, %rdi
	cmpl	%r8d, %r15d
	jne	.L69
.L65:
	movl	$179, %r8d
	subl	%ebx, %r8d
	cmpl	$19, %r8d
	jle	.L118
.L71:
	leal	1(%rbx), %r11d
	cmpl	$178, %r11d
	jle	.L53
.L77:
	movl	28(%rsp), %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	subl	$1, %eax
	cltq
	movl	128(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L43
.L63:
	leal	-1(%r10), %edx
	movl	%r11d, %esi
	movq	%r14, %rdi
	call	quickSort
	movl	$179, %r8d
	subl	%ebx, %r8d
	cmpl	$19, %r8d
	jg	.L71
.L118:
	leaq	4(%r14,%r12,4), %rdi
	movl	$1, %r10d
	leaq	4(%rdi), %r9
	cmpl	$1, %r8d
	jle	.L77
	.p2align 4,,10
	.p2align 3
.L76:
	movl	(%r9), %esi
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L73:
	movl	-4(%rax), %edx
	movq	%rax, %rcx
	cmpl	%edx, %esi
	jge	.L74
	movl	%edx, (%rax)
	leaq	-4(%rcx), %rax
	cmpq	%rax, %rdi
	jne	.L73
	movq	%rdi, %rcx
.L74:
	addl	$1, %r10d
	movl	%esi, (%rcx)
	addq	$4, %r9
	cmpl	%r10d, %r8d
	jne	.L76
	jmp	.L77
.L56:
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	cmpl	%edi, %edx
	cmovge	%eax, %edi
	jmp	.L57
.L115:
	movq	1144(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L119
	addq	$1160, %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
.L119:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	median
	.type	median, @function
median:
.LFB41:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	jge	.L121
	cmpl	%edx, %edi
	movl	%esi, %eax
	cmovl	%edx, %edi
	cmpl	%edx, %esi
	cmovge	%edi, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L121:
	cmpl	%edx, %edi
	movl	%esi, %eax
	cmovg	%edx, %edi
	cmpl	%edx, %esi
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	median, .-median
	.p2align 4
	.globl	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB42:
	.cfi_startproc
	endbr64
	leaq	4(%rdi), %r9
	movl	$1, %r10d
	cmpl	$1, %esi
	jle	.L125
	.p2align 4,,10
	.p2align 3
.L130:
	movl	(%r9), %r8d
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L127:
	movl	-4(%rax), %edx
	movq	%rax, %rcx
	cmpl	%r8d, %edx
	jle	.L128
	movl	%edx, (%rax)
	leaq	-4(%rcx), %rax
	cmpq	%rdi, %rax
	jne	.L127
	movq	%rdi, %rcx
.L128:
	addl	$1, %r10d
	movl	%r8d, (%rcx)
	addq	$4, %r9
	cmpl	%r10d, %esi
	jne	.L130
.L125:
	ret
	.cfi_endproc
.LFE42:
	.size	insertionSort, .-insertionSort
	.globl	isPrime
	.data
	.align 32
	.type	isPrime, @object
	.size	isPrime, 404004
isPrime:
	.long	0
	.long	0
	.long	1
	.zero	403992
	.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	quickSort
	.type	quickSort, @function
quickSort:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movslq	%edx, %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	(%rdi,%r13,4), %rax
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%rax, 8(%rsp)
	cmpl	%r13d, %esi
	jge	.L1
	movq	%rdi, %r14
	movl	%esi, %r11d
	movq	%r13, %r12
.L25:
	movq	8(%rsp), %rax
	leal	(%r12,%r11), %edx
	movl	(%rax), %ecx
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cltq
	movl	(%r14,%rax,4), %esi
	movslq	%r11d, %rax
	leaq	(%r14,%rax,4), %r15
	movl	(%r15), %eax
	cmpl	%eax, %esi
	jle	.L3
	cmpl	%eax, %ecx
	cmovge	%ecx, %eax
	cmpl	%esi, %ecx
	cmovle	%eax, %esi
.L4:
	movl	%r11d, %r9d
	movq	%r15, %r8
	movl	%r12d, %ebx
	movq	%r13, %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%r8), %edi
	cmpl	%esi, %edi
	jl	.L6
	cmpl	%ecx, %esi
	jge	.L7
	leal	-1(%rbx), %eax
	leaq	-4(%r14,%rbp,4), %rdx
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rdx), %ecx
	movl	%eax, %ebx
	movq	%rdx, %r10
	movq	%rax, %rbp
	subq	$4, %rdx
	subq	$1, %rax
	cmpl	%esi, %ecx
	jg	.L8
	cmpl	%ebx, %r9d
	jge	.L10
.L36:
	subl	$1, %ebx
	movl	%ecx, (%r8)
	movslq	%ebx, %rbp
	movl	%edi, (%r10)
	movl	(%r14,%rbp,4), %ecx
.L6:
	addq	$4, %r8
	addl	$1, %r9d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	leaq	(%r14,%rbp,4), %r10
	cmpl	%ebx, %r9d
	jl	.L36
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r9d, %r8d
	subl	%r11d, %r8d
	cmpl	$19, %r8d
	jle	.L37
	leal	-1(%r9), %edx
	movl	%r11d, %esi
	movq	%r14, %rdi
	call	quickSort
.L13:
	movl	%r12d, %r9d
	subl	%ebx, %r9d
	cmpl	$19, %r9d
	jle	.L38
.L19:
	leal	1(%rbx), %r11d
	cmpl	%r12d, %r11d
	jl	.L25
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L37:
	.cfi_restore_state
	leaq	4(%r15), %rdi
	movl	$1, %r9d
	cmpl	$1, %r8d
	jle	.L13
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%rdi), %esi
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L14:
	movl	-4(%rax), %edx
	movq	%rax, %rcx
	cmpl	%edx, %esi
	jge	.L15
	movl	%edx, (%rax)
	leaq	-4(%rcx), %rax
	cmpq	%rax, %r15
	jne	.L14
	movq	%r15, %rcx
.L15:
	addl	$1, %r9d
	movl	%esi, (%rcx)
	addq	$4, %rdi
	cmpl	%r9d, %r8d
	jne	.L17
	movl	%r12d, %r9d
	subl	%ebx, %r9d
	cmpl	$19, %r9d
	jg	.L19
.L38:
	leaq	4(%r14,%rbp,4), %rdi
	cmpl	$1, %r9d
	jle	.L1
	leaq	4(%rdi), %r8
	movl	$1, %r10d
	.p2align 4,,10
	.p2align 3
.L24:
	movl	(%r8), %esi
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L21:
	movl	-4(%rax), %edx
	movq	%rax, %rcx
	cmpl	%edx, %esi
	jge	.L22
	movl	%edx, (%rax)
	leaq	-4(%rcx), %rax
	cmpq	%rax, %rdi
	jne	.L21
	movq	%rdi, %rcx
.L22:
	addl	$1, %r10d
	movl	%esi, (%rcx)
	addq	$4, %r8
	cmpl	%r10d, %r9d
	jne	.L24
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L3:
	.cfi_restore_state
	cmpl	%eax, %ecx
	cmovle	%ecx, %eax
	cmpl	%esi, %ecx
	cmovge	%eax, %esi
	jmp	.L4
	.cfi_endproc
.LFE40:
	.size	quickSort, .-quickSort
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	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
	subq	$1160, %rsp
	.cfi_def_cfa_offset 1216
	movq	%fs:40, %rax
	movq	%rax, 1144(%rsp)
	leaq	12+isPrime(%rip), %rax
	leaq	403992(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L40:
	movl	$1, (%rax)
	addq	$8, %rax
	cmpq	%rdx, %rax
	jne	.L40
	movl	$6, %esi
	movl	$3, %edx
	leaq	isPrime(%rip), %r13
	jmp	.L42
.L44:
	leal	2(%rcx), %eax
	addq	$2, %rdx
	addq	$4, %rsi
	imull	%eax, %eax
	cmpl	$101000, %eax
	jg	.L114
.L42:
	movl	0(%r13,%rdx,4), %edi
	movl	%edx, %ecx
	testl	%edi, %edi
	je	.L44
	cmpq	$101000, %rsi
	ja	.L44
	movq	%rsi, %rax
.L45:
	movl	$0, 0(%r13,%rax,4)
	addq	%rdx, %rax
	cmpl	$101000, %eax
	jle	.L45
	jmp	.L44
.L114:
	leaq	24(%rsp), %rax
	leaq	28(%rsp), %rbp
	movq	%rax, 8(%rsp)
.L43:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdx
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	cmpl	$-1, %eax
	je	.L115
	addl	$1, %eax
	xorl	%edx, %edx
	cltq
.L49:
	movl	0(%r13,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L46
.L116:
	movslq	%edx, %rcx
	leal	1(%rdx), %esi
	movl	%eax, 32(%rsp,%rcx,4)
	addq	$1, %rax
	cmpl	$21, %edx
	je	.L48
	movl	0(%r13,%rax,4), %ecx
	movl	%esi, %edx
	testl	%ecx, %ecx
	jne	.L116
.L46:
	addq	$1, %rax
	cmpl	$22, %edx
	jne	.L49
.L48:
	leaq	32(%rsp), %rax
	movl	$22, %ecx
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	leaq	128(%rsp), %r14
	movl	$21, %r10d
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L117:
	movdqu	(%rax), %xmm1
	movd	%r8d, %xmm2
	movl	%ecx, %edi
	movslq	%edx, %rsi
	pshufd	$0, %xmm2, %xmm0
	leaq	(%r14,%rsi,4), %rsi
	shrl	$2, %edi
	paddd	%xmm0, %xmm1
	movups	%xmm1, (%rsi)
	cmpl	$1, %edi
	je	.L52
	movdqu	16(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 16(%rsi)
	cmpl	$2, %edi
	je	.L52
	movdqu	32(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 32(%rsi)
	cmpl	$3, %edi
	je	.L52
	movdqu	48(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 48(%rsi)
	cmpl	$5, %edi
	jne	.L52
	movdqu	64(%rax), %xmm3
	paddd	%xmm3, %xmm0
	movups	%xmm0, 64(%rsi)
.L52:
	movl	%ecx, %esi
	andl	$-4, %esi
	leal	(%r9,%rsi), %r11d
	leal	(%rdx,%rsi), %edi
	cmpl	%ecx, %esi
	je	.L51
.L54:
	movslq	%r11d, %r12
	movslq	%edi, %rbx
	leal	1(%rdi), %esi
	movl	32(%rsp,%r12,4), %r15d
	addl	%r8d, %r15d
	movl	%r15d, 128(%rsp,%rbx,4)
	leal	1(%r11), %ebx
	cmpl	$21, %r11d
	je	.L51
	movslq	%ebx, %rbx
	movslq	%esi, %rsi
	addl	$2, %edi
	movl	32(%rsp,%rbx,4), %r15d
	addl	%r8d, %r15d
	movl	%r15d, 128(%rsp,%rsi,4)
	leal	2(%r11), %esi
	cmpl	$20, %r11d
	je	.L51
	movslq	%esi, %rsi
	movslq	%edi, %rdi
	addl	32(%rsp,%rsi,4), %r8d
	movl	%r8d, 128(%rsp,%rdi,4)
.L51:
	addl	$22, %edx
	addq	$4, %rax
	subl	%r9d, %edx
	addl	$1, %r9d
	subl	$1, %ecx
	je	.L81
.L50:
	movl	%r10d, %esi
	movl	(%rax), %r8d
	subl	%r9d, %esi
	cmpl	$2, %esi
	ja	.L117
	movl	%edx, %edi
	movl	%r9d, %r11d
	jmp	.L54
.L81:
	xorl	%r11d, %r11d
.L53:
	leal	179(%r11), %ecx
	movl	844(%rsp), %edx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	cltq
	movl	128(%rsp,%rax,4), %edi
	movslq	%r11d, %rax
	leaq	(%r14,%rax,4), %r9
	movl	(%r9), %eax
	cmpl	%eax, %edi
	jle	.L56
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	cmpl	%edi, %edx
	cmovle	%eax, %edi
.L57:
	movl	%r11d, %r10d
	movq	%r9, %r8
	movl	$179, %ebx
	movl	$179, %edx
	.p2align 4,,10
	.p2align 3
.L58:
	movl	(%r8), %r15d
	leaq	(%r14,%rdx,4), %rsi
	movq	%rdx, %r12
	movl	(%rsi), %ecx
	cmpl	%edi, %r15d
	jl	.L59
	cmpl	%ecx, %edi
	jge	.L60
	leal	-1(%rbx), %eax
	leaq	-4(%r14,%rdx,4), %rdx
	cltq
	.p2align 4,,10
	.p2align 3
.L61:
	movl	(%rdx), %ecx
	movl	%eax, %ebx
	movq	%rdx, %rsi
	movq	%rax, %r12
	subq	$4, %rdx
	subq	$1, %rax
	cmpl	%ecx, %edi
	jl	.L61
.L60:
	cmpl	%r10d, %ebx
	jle	.L62
	movl	%ecx, (%r8)
	subl	$1, %ebx
	movl	%r15d, (%rsi)
	movslq	%ebx, %rdx
.L59:
	addq	$4, %r8
	addl	$1, %r10d
	jmp	.L58
	.p2align 4,,10
	.p2align 3
.L62:
	movl	%r10d, %r15d
	subl	%r11d, %r15d
	cmpl	$19, %r15d
	jg	.L63
	leaq	4(%r9), %rdi
	movl	$1, %r8d
	cmpl	$1, %r15d
	jle	.L65
	.p2align 4,,10
	.p2align 3
.L69:
	movl	(%rdi), %esi
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L66:
	movl	-4(%rax), %edx
	movq	%rax, %rcx
	cmpl	%edx, %esi
	jge	.L67
	movl	%edx, (%rax)
	leaq	-4(%rcx), %rax
	cmpq	%r9, %rax
	jne	.L66
	movq	%r9, %rcx
.L67:
	addl	$1, %r8d
	movl	%esi, (%rcx)
	addq	$4, %rdi
	cmpl	%r8d, %r15d
	jne	.L69
.L65:
	movl	$179, %r8d
	subl	%ebx, %r8d
	cmpl	$19, %r8d
	jle	.L118
.L71:
	leal	1(%rbx), %r11d
	cmpl	$178, %r11d
	jle	.L53
.L77:
	movl	28(%rsp), %eax
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	subl	$1, %eax
	cltq
	movl	128(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L43
.L63:
	leal	-1(%r10), %edx
	movl	%r11d, %esi
	movq	%r14, %rdi
	call	quickSort
	movl	$179, %r8d
	subl	%ebx, %r8d
	cmpl	$19, %r8d
	jg	.L71
.L118:
	leaq	4(%r14,%r12,4), %rdi
	movl	$1, %r10d
	leaq	4(%rdi), %r9
	cmpl	$1, %r8d
	jle	.L77
	.p2align 4,,10
	.p2align 3
.L76:
	movl	(%r9), %esi
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L73:
	movl	-4(%rax), %edx
	movq	%rax, %rcx
	cmpl	%edx, %esi
	jge	.L74
	movl	%edx, (%rax)
	leaq	-4(%rcx), %rax
	cmpq	%rax, %rdi
	jne	.L73
	movq	%rdi, %rcx
.L74:
	addl	$1, %r10d
	movl	%esi, (%rcx)
	addq	$4, %r9
	cmpl	%r10d, %r8d
	jne	.L76
	jmp	.L77
.L56:
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	cmpl	%edi, %edx
	cmovge	%eax, %edi
	jmp	.L57
.L115:
	movq	1144(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L119
	addq	$1160, %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
.L119:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	median
	.type	median, @function
median:
.LFB41:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	jge	.L121
	cmpl	%edx, %edi
	movl	%esi, %eax
	cmovl	%edx, %edi
	cmpl	%edx, %esi
	cmovge	%edi, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L121:
	cmpl	%edx, %edi
	movl	%esi, %eax
	cmovg	%edx, %edi
	cmpl	%edx, %esi
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE41:
	.size	median, .-median
	.p2align 4
	.globl	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB42:
	.cfi_startproc
	endbr64
	leaq	4(%rdi), %r9
	movl	$1, %r10d
	cmpl	$1, %esi
	jle	.L125
	.p2align 4,,10
	.p2align 3
.L130:
	movl	(%r9), %r8d
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L127:
	movl	-4(%rax), %edx
	movq	%rax, %rcx
	cmpl	%r8d, %edx
	jle	.L128
	movl	%edx, (%rax)
	leaq	-4(%rcx), %rax
	cmpq	%rdi, %rax
	jne	.L127
	movq	%rdi, %rcx
.L128:
	addl	$1, %r10d
	movl	%r8d, (%rcx)
	addq	$4, %r9
	cmpl	%r10d, %esi
	jne	.L130
.L125:
	ret
	.cfi_endproc
.LFE42:
	.size	insertionSort, .-insertionSort
	.globl	isPrime
	.data
	.align 32
	.type	isPrime, @object
	.size	isPrime, 404004
isPrime:
	.long	0
	.long	0
	.long	1
	.zero	403992
	.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 MAX_N 101000

int isPrime[ MAX_N + 1 ] = { 0, 0, 1 };

void quickSort( int *, int, int );
int median( int, int, int );
void insertionSort( int *, int );

int main( void ) {
	int i, j, N, P, cnt, p[ 22 ], sum[ 253 ];

	for ( i = 3; i <= MAX_N; i += 2 )
		isPrime[ i ] = 1;

	for ( i = 3; i * i <= MAX_N; i += 2 )
		if ( isPrime[ i ] )
			for ( j = i * 2; j <= MAX_N; j += i )
				isPrime[ j ] = 0;

	for ( ; scanf( "%d %d", &N, &P ), N != -1; printf( "%d\n", sum[ P - 1 ] ) ) {
		cnt = 0;
		for ( i = N + 1; cnt < 22; i++ )
			if ( isPrime[ i ] )
				p[ cnt++ ] = i;

		cnt = 0;
		for ( i = 0; i < 22; i++ )
			for ( j = i; j < 22; j++ )
				sum[ cnt++ ] = p[ i ] + p[ j ];

		quickSort( sum, 0, 179 );
	}

	return 0;
}

void quickSort( int *data, int l, int r ) {
	if ( l < r ) {
		int i = l, j = r, pivot = median( data[ i ], data[ ( i + j ) / 2 ], data[ j ] ), tmp;

		while ( 1 ) {
			for ( ; data[ i ] < pivot; i++ ) ;
			for ( ; pivot < data [ j ]; j-- ) ;
			if ( i >= j )
				break;

			tmp = data[ i ];
			data[ i ] = data[ j ];
			data[ j ] = tmp;

			i++;
			j--;
		}

		if ( i - l < 20 )
			insertionSort( data + l, i - l );
		else
			quickSort( data, l, i - 1 );

		if ( r - j < 20 )
			insertionSort( data + j + 1, r - j );
		else
			quickSort( data, j + 1, r );
	}
}

int median( int x, int y, int z ) {
	if ( x < y )
		if ( y < z )
			return y;
		else if ( z < x )
			return x;
		else
			return z;
	else if ( z < y )
		return y;
	else if ( x < z )
		return x;
	else
		return z;
}

void insertionSort( int *data, int n ) {
	int i, j, tmp;

	for ( i = 1; i < n; i++ ) {
		tmp = data[ i ];

		for ( j = i; j && data[ j - 1 ] > tmp; j-- )
			data[ j ] = data[ j - 1 ];

		data[ j ] = tmp;
	}
}
0 55
0 1
0 2
0 3
10 1
10 2
10 3
10 4
10 5
10 6
11 1
11 2
11 3
100001 100
-1 -1
 0 55
0 1
0 2
0 3
10 1
10 2
10 3
10 4
10 5
10 1
11 1
11 2
11 3
100001 100
-1 -1
 0 55
0 1
0 2
0 3
10 1
10 2
10 3
10 4
10 5
19 6
11 1
11 2
11 3
100000 100
-1 -1
 0 55
0 1
0 2
0 3
10 1
10 2
10 3
10 4
10 5
10 1
10 1
11 2
11 3
100001 100
-1 -1
 0 55
0 1
0 2
0 3
10 1
10 2
10 3
10 4
10 5
10 1
10 1
18 2
11 3
100001 100
-1 -1
 0 55
0 1
0 2
0 3
10 1
10 2
10 3
10 4
10 1
10 1
10 1
18 2
11 3
100001 100
-1 -1
 0 55
0 1
0 2
0 3
10 1
10 2
19 3
10 4
10 1
10 1
10 1
18 2
11 3
100001 100
-1 -1
 0 55
0 1
0 2
0 3
10 1
10 1
10 3
10 4
10 5
10 6
11 1
11 2
11 3
100000 100
-1 -1
 0 55
0 1
0 2
0 3
10 1
13 2
10 3
10 4
10 5
10 6
11 1
11 2
11 3
100001 100
-1 -1
 0 19
0 1
0 2
0 3
10 1
10 2
10 3
10 4
10 5
19 6
11 1
11 2
11 3
100000 100
-1 -1

42
4
5
6
22
24
26
28
30
30
26
30
32
200274
 42
4
5
6
22
24
26
28
30
22
26
30
32
200274
 42
4
5
6
22
24
26
28
30
60
26
30
32
200274
 42
4
5
6
22
24
26
28
30
22
22
30
32
200274
 42
4
5
6
22
24
26
28
30
22
22
42
32
200274
 42
4
5
6
22
24
26
28
22
22
22
42
32
200274
 42
4
5
6
22
24
54
28
22
22
22
42
32
200274
 42
4
5
6
22
22
26
28
30
30
26
30
32
200274
 42
4
5
6
22
36
26
28
30
30
26
30
32
200274
 20
4
5
6
22
24
26
28
30
60
26
30
32
200274

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 MAX_N 101000

int isPrime[ MAX_N + 1 ] = { 0, 0, 1 };

void quickSort( int *, int, int );
int median( int, int, int );
void insertionSort( int *, int );

int main( void ) {
	int i, j, N, P, cnt, p[ 22 ], sum[ 253 ];

	for ( i = 3; i <= MAX_N; i += 2 )
		isPrime[ i ] = 1;

	for ( i = 3; i * i <= MAX_N; i += 2 )
		if ( isPrime[ i ] )
			for ( j = i * 2; j <= MAX_N; j += i )
				isPrime[ j ] = 0;

	for ( ; scanf( "%d %d", &N, &P ), N != -1; printf( "%d\n", sum[ P - 1 ] ) ) {
		cnt = 0;
		for ( i = N + 1; cnt < 22; i++ )
			if ( isPrime[ i ] )
				p[ cnt++ ] = i;

		cnt = 0;
		for ( i = 0; i < 22; i++ )
			for ( j = i; j < 22; j++ )
				sum[ cnt++ ] = p[ i ] + p[ j ];

		quickSort( sum, 0, 179 );
	}

	return 0;
}

void quickSort( int *data, int l, int r ) {
	if ( l < r ) {
		int i = l, j = r, pivot = median( data[ i ], data[ ( i + j ) / 2 ], data[ j ] ), tmp;

		while ( 1 ) {
			for ( ; data[ i ] < pivot; i++ ) ;
			for ( ; pivot < data [ j ]; j-- ) ;
			if ( i >= j )
				break;

			tmp = data[ i ];
			data[ i ] = data[ j ];
			data[ j ] = tmp;

			i++;
			j--;
		}

		if ( i - l < 20 )
			insertionSort( data + l, i - l );
		else
			quickSort( data, l, i - 1 );

		if ( r - j < 20 )
			insertionSort( data + j + 1, r - j );
		else
			quickSort( data, j + 1, r );
	}
}

int median( int x, int y, int z ) {
	if ( x < y )
		if ( y < z )
			return y;
		else if ( z < x )
			return x;
		else
			return z;
	else if ( z < y )
		return y;
	else if ( x < z )
		return x;
	else
		return z;
}

void insertionSort( int *data, int n ) {
	int i, j, tmp;

	for ( i = 1; i < n; i++ ) {
		tmp = data[ i ];

		for ( j = i; j && data[ j - 1 ] > tmp; j-- )
			data[ j ] = data[ j - 1 ];

		data[ j ] = tmp;
	}
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	isPrime
	.data
	.align 32
	.type	isPrime, @object
	.size	isPrime, 404004
isPrime:
	.long	0
	.long	0
	.long	1
	.zero	403992
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1152, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$3, -1132(%rbp)
	jmp	.L2
.L3:
	movl	-1132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$2, -1132(%rbp)
.L2:
	cmpl	$101000, -1132(%rbp)
	jle	.L3
	movl	$3, -1132(%rbp)
	jmp	.L4
.L8:
	movl	-1132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-1132(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -1128(%rbp)
	jmp	.L6
.L7:
	movl	-1128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-1132(%rbp), %eax
	addl	%eax, -1128(%rbp)
.L6:
	cmpl	$101000, -1128(%rbp)
	jle	.L7
.L5:
	addl	$2, -1132(%rbp)
.L4:
	movl	-1132(%rbp), %eax
	imull	%eax, %eax
	cmpl	$101000, %eax
	jle	.L8
	jmp	.L9
.L17:
	movl	$0, -1124(%rbp)
	movl	-1140(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1132(%rbp)
	jmp	.L10
.L12:
	movl	-1132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L11
	movl	-1124(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1124(%rbp)
	cltq
	movl	-1132(%rbp), %edx
	movl	%edx, -1120(%rbp,%rax,4)
.L11:
	addl	$1, -1132(%rbp)
.L10:
	cmpl	$21, -1124(%rbp)
	jle	.L12
	movl	$0, -1124(%rbp)
	movl	$0, -1132(%rbp)
	jmp	.L13
.L16:
	movl	-1132(%rbp), %eax
	movl	%eax, -1128(%rbp)
	jmp	.L14
.L15:
	movl	-1132(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %esi
	movl	-1128(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %ecx
	movl	-1124(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1124(%rbp)
	leal	(%rsi,%rcx), %edx
	cltq
	movl	%edx, -1024(%rbp,%rax,4)
	addl	$1, -1128(%rbp)
.L14:
	cmpl	$21, -1128(%rbp)
	jle	.L15
	addl	$1, -1132(%rbp)
.L13:
	cmpl	$21, -1132(%rbp)
	jle	.L16
	leaq	-1024(%rbp), %rax
	movl	$179, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	quickSort
	movl	-1136(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-1024(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	leaq	-1136(%rbp), %rdx
	leaq	-1140(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1140(%rbp), %eax
	cmpl	$-1, %eax
	jne	.L17
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	quickSort
	.type	quickSort, @function
quickSort:
.LFB7:
	.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)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L33
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	median
	movl	%eax, -8(%rbp)
	jmp	.L22
.L23:
	addl	$1, -16(%rbp)
.L22:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L23
	jmp	.L24
.L25:
	subl	$1, -12(%rbp)
.L24:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L25
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L34
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -16(%rbp)
	subl	$1, -12(%rbp)
	jmp	.L22
.L34:
	nop
	movl	-16(%rbp), %eax
	subl	-28(%rbp), %eax
	cmpl	$19, %eax
	jg	.L29
	movl	-16(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L30
.L29:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	quickSort
.L30:
	movl	-32(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$19, %eax
	jg	.L31
	movl	-32(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L33
.L31:
	movl	-12(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	quickSort
.L33:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	quickSort, .-quickSort
	.globl	median
	.type	median, @function
median:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L36
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L37
	movl	-8(%rbp), %eax
	jmp	.L38
.L37:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L39
	movl	-4(%rbp), %eax
	jmp	.L38
.L39:
	movl	-12(%rbp), %eax
	jmp	.L38
.L36:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L40
	movl	-8(%rbp), %eax
	jmp	.L38
.L40:
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L41
	movl	-4(%rbp), %eax
	jmp	.L38
.L41:
	movl	-12(%rbp), %eax
.L38:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	median, .-median
	.globl	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB9:
	.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	$1, -12(%rbp)
	jmp	.L43
.L47:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L44
.L46:
	movl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	subl	$1, -8(%rbp)
.L44:
	cmpl	$0, -8(%rbp)
	je	.L45
	movl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L46
.L45:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -12(%rbp)
.L43:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L47
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	insertionSort, .-insertionSort
	.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	isPrime
	.data
	.align 32
	.type	isPrime, @object
	.size	isPrime, 404004
isPrime:
	.long	0
	.long	0
	.long	1
	.zero	403992
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1152, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$3, -1132(%rbp)
	jmp	.L2
.L3:
	movl	-1132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	$1, (%rdx,%rax)
	addl	$2, -1132(%rbp)
.L2:
	cmpl	$101000, -1132(%rbp)
	jle	.L3
	movl	$3, -1132(%rbp)
	jmp	.L4
.L8:
	movl	-1132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L5
	movl	-1132(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -1128(%rbp)
	jmp	.L6
.L7:
	movl	-1128(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	$0, (%rdx,%rax)
	movl	-1132(%rbp), %eax
	addl	%eax, -1128(%rbp)
.L6:
	cmpl	$101000, -1128(%rbp)
	jle	.L7
.L5:
	addl	$2, -1132(%rbp)
.L4:
	movl	-1132(%rbp), %eax
	imull	%eax, %eax
	cmpl	$101000, %eax
	jle	.L8
	jmp	.L9
.L17:
	movl	$0, -1124(%rbp)
	movl	-1140(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -1132(%rbp)
	jmp	.L10
.L12:
	movl	-1132(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	isPrime(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L11
	movl	-1124(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1124(%rbp)
	cltq
	movl	-1132(%rbp), %edx
	movl	%edx, -1120(%rbp,%rax,4)
.L11:
	addl	$1, -1132(%rbp)
.L10:
	cmpl	$21, -1124(%rbp)
	jle	.L12
	movl	$0, -1124(%rbp)
	movl	$0, -1132(%rbp)
	jmp	.L13
.L16:
	movl	-1132(%rbp), %eax
	movl	%eax, -1128(%rbp)
	jmp	.L14
.L15:
	movl	-1132(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %esi
	movl	-1128(%rbp), %eax
	cltq
	movl	-1120(%rbp,%rax,4), %ecx
	movl	-1124(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -1124(%rbp)
	leal	(%rsi,%rcx), %edx
	cltq
	movl	%edx, -1024(%rbp,%rax,4)
	addl	$1, -1128(%rbp)
.L14:
	cmpl	$21, -1128(%rbp)
	jle	.L15
	addl	$1, -1132(%rbp)
.L13:
	cmpl	$21, -1132(%rbp)
	jle	.L16
	leaq	-1024(%rbp), %rax
	movl	$179, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	quickSort
	movl	-1136(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-1024(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	leaq	-1136(%rbp), %rdx
	leaq	-1140(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1140(%rbp), %eax
	cmpl	$-1, %eax
	jne	.L17
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	quickSort
	.type	quickSort, @function
quickSort:
.LFB7:
	.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)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L33
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-16(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-24(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	median
	movl	%eax, -8(%rbp)
	jmp	.L22
.L23:
	addl	$1, -16(%rbp)
.L22:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L23
	jmp	.L24
.L25:
	subl	$1, -12(%rbp)
.L24:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L25
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L34
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-16(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -16(%rbp)
	subl	$1, -12(%rbp)
	jmp	.L22
.L34:
	nop
	movl	-16(%rbp), %eax
	subl	-28(%rbp), %eax
	cmpl	$19, %eax
	jg	.L29
	movl	-16(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	-28(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L30
.L29:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-28(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	quickSort
.L30:
	movl	-32(%rbp), %eax
	subl	-12(%rbp), %eax
	cmpl	$19, %eax
	jg	.L31
	movl	-32(%rbp), %eax
	subl	-12(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L33
.L31:
	movl	-12(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-32(%rbp), %edx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	quickSort
.L33:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	quickSort, .-quickSort
	.globl	median
	.type	median, @function
median:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L36
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L37
	movl	-8(%rbp), %eax
	jmp	.L38
.L37:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L39
	movl	-4(%rbp), %eax
	jmp	.L38
.L39:
	movl	-12(%rbp), %eax
	jmp	.L38
.L36:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L40
	movl	-8(%rbp), %eax
	jmp	.L38
.L40:
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L41
	movl	-4(%rbp), %eax
	jmp	.L38
.L41:
	movl	-12(%rbp), %eax
.L38:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	median, .-median
	.globl	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB9:
	.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	$1, -12(%rbp)
	jmp	.L43
.L47:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L44
.L46:
	movl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	-8(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	subl	$1, -8(%rbp)
.L44:
	cmpl	$0, -8(%rbp)
	je	.L45
	movl	-8(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L46
.L45:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -12(%rbp)
.L43:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L47
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	insertionSort, .-insertionSort
	.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:
