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
#define SWAP( a, b ) do { int tmp; tmp = a; a = b; b = tmp; } while( 0 )

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

void insertionSort( int *, int );
void quickSort( int *, int );
int median( int, 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, 253 );
	}

	return 0;
}

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

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

		if ( data[ i - 1 ] > tmp ) {
			j = i;
			do {
				data[ j ] = data[ j - 1 ];

				j--;
			} while ( j && data[ j - 1 ] > tmp );

			data[ j ] = tmp;
		}
	}
}

void quickSort( int *data, int n ) {
	int low[ 30 ] = { 0 }, high[ 30 ] = { n - 1 }, sp = 1;

	while ( sp-- ) {
		int l = low[ sp ], r = high[ sp ];

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

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

				SWAP( data[ i ], data[ j ] );

				i++;
				j--;
			}

			if ( i - l < 20 )
				insertionSort( data + l, i - l );
			else {
				low[ sp ] = l;
				high[ sp ] = i - 1;
				sp++;
			}

			if ( r - j < 20 )
				insertionSort( data + j + 1, r - j );
			else {
				low[ sp ] = j + 1;
				high[ sp ] = r;
				sp++;
			}
		}
	}
}

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;
}```

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	$253, %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	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB7:
	.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	.L21
.L25:
	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
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L22
	movl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
.L24:
	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)
	cmpl	$0, -8(%rbp)
	je	.L23
	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	.L24
.L23:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L22:
	addl	$1, -12(%rbp)
.L21:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L25
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	insertionSort, .-insertionSort
	.globl	quickSort
	.type	quickSort, @function
quickSort:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$304, %rsp
	movq	%rdi, -296(%rbp)
	movl	%esi, -300(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-256(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-128(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	-300(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -128(%rbp)
	movl	$1, -284(%rbp)
	jmp	.L27
.L38:
	movl	-284(%rbp), %eax
	cltq
	movl	-256(%rbp,%rax,4), %eax
	movl	%eax, -272(%rbp)
	movl	-284(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movl	%eax, -268(%rbp)
	movl	-272(%rbp), %eax
	cmpl	-268(%rbp), %eax
	jge	.L27
	movl	-272(%rbp), %eax
	movl	%eax, -280(%rbp)
	movl	-268(%rbp), %eax
	movl	%eax, -276(%rbp)
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-280(%rbp), %ecx
	movl	-276(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-296(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-296(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	median
	movl	%eax, -264(%rbp)
	jmp	.L28
.L29:
	addl	$1, -280(%rbp)
.L28:
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -264(%rbp)
	jg	.L29
	jmp	.L30
.L31:
	subl	$1, -276(%rbp)
.L30:
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -264(%rbp)
	jl	.L31
	movl	-280(%rbp), %eax
	cmpl	-276(%rbp), %eax
	jge	.L41
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -260(%rbp)
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	-280(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-296(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rax, %rdx
	movl	-260(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -280(%rbp)
	subl	$1, -276(%rbp)
	jmp	.L28
.L41:
	nop
	movl	-280(%rbp), %eax
	subl	-272(%rbp), %eax
	cmpl	$19, %eax
	jg	.L35
	movl	-280(%rbp), %eax
	subl	-272(%rbp), %eax
	movl	-272(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-296(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L36
.L35:
	movl	-284(%rbp), %eax
	cltq
	movl	-272(%rbp), %edx
	movl	%edx, -256(%rbp,%rax,4)
	movl	-280(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-284(%rbp), %eax
	cltq
	movl	%edx, -128(%rbp,%rax,4)
	addl	$1, -284(%rbp)
.L36:
	movl	-268(%rbp), %eax
	subl	-276(%rbp), %eax
	cmpl	$19, %eax
	jg	.L37
	movl	-268(%rbp), %eax
	subl	-276(%rbp), %eax
	movl	-276(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-296(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L27
.L37:
	movl	-276(%rbp), %eax
	leal	1(%rax), %edx
	movl	-284(%rbp), %eax
	cltq
	movl	%edx, -256(%rbp,%rax,4)
	movl	-284(%rbp), %eax
	cltq
	movl	-268(%rbp), %edx
	movl	%edx, -128(%rbp,%rax,4)
	addl	$1, -284(%rbp)
.L27:
	movl	-284(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -284(%rbp)
	testl	%eax, %eax
	jne	.L38
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	quickSort, .-quickSort
	.globl	median
	.type	median, @function
median:
.LFB9:
	.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	.L43
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L44
	movl	-8(%rbp), %eax
	jmp	.L45
.L44:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L46
	movl	-4(%rbp), %eax
	jmp	.L45
.L46:
	movl	-12(%rbp), %eax
	jmp	.L45
.L43:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L47
	movl	-8(%rbp), %eax
	jmp	.L45
.L47:
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L48
	movl	-4(%rbp), %eax
	jmp	.L45
.L48:
	movl	-12(%rbp), %eax
.L45:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	median, .-median
	.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	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB40:
	.cfi_startproc
	endbr64
	cmpl	$1, %esi
	jle	.L1
	leal	-1(%rsi), %r10d
	movl	$1, %r8d
	xorl	%esi, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rsi
	addq	$1, %r8
	cmpq	%r10, %rsi
	je	.L1
.L6:
	movl	(%rdi,%r8,4), %ecx
	cmpl	%ecx, (%rdi,%rsi,4)
	jle	.L3
	movq	%r8, %rdx
	leaq	0(,%rsi,4), %rax
	subq	%rsi, %rdx
	leaq	-4(,%rdx,4), %r9
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	-4(%rax), %rdx
	cmpl	%ecx, -4(%rdi,%rax)
	jle	.L12
	movq	%rdx, %rax
.L5:
	movl	(%rdi,%rax), %edx
	movl	%edx, 4(%rdi,%rax)
	cmpq	%r9, %rax
	jne	.L13
	movq	%rdi, %rax
	movl	%ecx, (%rax)
.L14:
	addq	$1, %rsi
	addq	$1, %r8
	cmpq	%r10, %rsi
	jne	.L6
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	addq	%rdi, %rax
	movl	%ecx, (%rax)
	jmp	.L14
	.cfi_endproc
.LFE40:
	.size	insertionSort, .-insertionSort
	.p2align 4
	.globl	quickSort
	.type	quickSort, @function
quickSort:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$15, %ecx
	movq	%rdi, %r15
	subl	$1, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	$1, %r9d
	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	$296, %rsp
	.cfi_def_cfa_offset 352
	movq	%fs:40, %rax
	movq	%rax, 280(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdi
	movq	%rdi, 8(%rsp)
	rep stosq
	leaq	160(%rsp), %rdi
	movl	$15, %ecx
	rep stosq
	leaq	164(%rsp), %rax
	movl	%esi, 160(%rsp)
	movq	%rax, 16(%rsp)
.L16:
	movslq	%r9d, %rax
	movq	8(%rsp), %rcx
	movq	16(%rsp), %rsi
	leaq	-4(,%rax,4), %rax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L38:
	movl	(%rcx,%rax), %r13d
	subq	$4, %rax
	movl	(%rsi,%rax), %r12d
	cmpl	%r12d, %r13d
	jl	.L51
.L17:
	movl	%r9d, %edx
	subl	$1, %r9d
	jnb	.L38
	movq	280(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	addq	$296, %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
	.p2align 4,,10
	.p2align 3
.L51:
	.cfi_restore_state
	movslq	%r12d, %rax
	movl	%edx, 28(%rsp)
	leal	0(%r13,%r12), %edx
	movl	(%r15,%rax,4), %esi
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cltq
	movl	(%r15,%rax,4), %edi
	movslq	%r13d, %rax
	leaq	(%r15,%rax,4), %r14
	movl	(%r14), %eax
	cmpl	%eax, %edi
	jg	.L53
	cmpl	%eax, %esi
	cmovle	%esi, %eax
	cmpl	%edi, %esi
	cmovge	%eax, %edi
.L19:
	movq	%r14, %r11
	movl	%r13d, %ebx
	movl	%r12d, %edx
	movslq	%r12d, %r8
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%r11), %r10d
	cmpl	%edi, %r10d
	jl	.L21
	cmpl	%esi, %edi
	jge	.L22
	leal	-1(%rdx), %eax
	leaq	-4(%r15,%r8,4), %rcx
	cltq
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rcx), %esi
	movl	%eax, %edx
	movq	%rcx, %rbp
	movq	%rax, %r8
	subq	$4, %rcx
	subq	$1, %rax
	cmpl	%edi, %esi
	jg	.L23
.L24:
	cmpl	%edx, %ebx
	jge	.L25
	subl	$1, %edx
	movl	%esi, (%r11)
	movslq	%edx, %r8
	movl	%r10d, 0(%rbp)
	movl	(%r15,%r8,4), %esi
.L21:
	addq	$4, %r11
	addl	$1, %ebx
	jmp	.L20
.L53:
	cmpl	%eax, %esi
	cmovge	%esi, %eax
	cmpl	%edi, %esi
	cmovle	%eax, %edi
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%ebx, %eax
	subl	%r13d, %eax
	cmpl	$19, %eax
	jle	.L54
	movslq	%r9d, %r9
	subl	$1, %ebx
	movl	%ebx, 160(%rsp,%r9,4)
.L27:
	movl	%r12d, %eax
	subl	%edx, %eax
	cmpl	$19, %eax
	jle	.L55
	movslq	28(%rsp), %rax
	addl	$1, %edx
	movl	%edx, 32(%rsp,%rax,4)
	leal	1(%rax), %r9d
	movl	%r12d, 160(%rsp,%rax,4)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L22:
	leaq	(%r15,%r8,4), %rbp
	jmp	.L24
.L55:
	leaq	4(%r15,%r8,4), %rdx
	cmpl	$1, %eax
	jle	.L43
	leal	-1(%rax), %r10d
	movl	$1, %r8d
	xorl	%edi, %edi
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L34:
	addq	$1, %rdi
	addq	$1, %r8
	cmpq	%rdi, %r10
	je	.L43
.L37:
	movl	(%rdx,%r8,4), %esi
	cmpl	(%rdx,%rdi,4), %esi
	jge	.L34
	movq	%r8, %rcx
	leaq	0(,%rdi,4), %rax
	subq	%rdi, %rcx
	leaq	-4(,%rcx,4), %r9
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L57:
	leaq	-4(%rax), %rcx
	cmpl	-4(%rdx,%rax), %esi
	jge	.L56
	movq	%rcx, %rax
.L36:
	movl	(%rdx,%rax), %ecx
	movl	%ecx, 4(%rdx,%rax)
	cmpq	%rax, %r9
	jne	.L57
	movq	%rdx, %rax
	movl	%esi, (%rax)
.L58:
	addq	$1, %rdi
	addq	$1, %r8
	cmpq	%rdi, %r10
	jne	.L37
.L43:
	movl	28(%rsp), %r9d
	jmp	.L16
.L56:
	addq	%rdx, %rax
	movl	%esi, (%rax)
	jmp	.L58
.L54:
	cmpl	$1, %eax
	jle	.L40
	leal	-1(%rax), %r11d
	movl	$1, %r10d
	xorl	%edi, %edi
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$1, %rdi
	addq	$1, %r10
	cmpq	%rdi, %r11
	je	.L40
.L31:
	movl	(%r14,%r10,4), %esi
	cmpl	(%r14,%rdi,4), %esi
	jge	.L28
	movq	%r10, %rcx
	leaq	0(,%rdi,4), %rax
	subq	%rdi, %rcx
	leaq	-4(,%rcx,4), %rbx
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L60:
	leaq	-4(%rax), %rcx
	cmpl	-4(%r14,%rax), %esi
	jge	.L59
	movq	%rcx, %rax
.L30:
	movl	(%r14,%rax), %ecx
	movl	%ecx, 4(%r14,%rax)
	cmpq	%rax, %rbx
	jne	.L60
	movq	%r14, %rax
	movl	%esi, (%rax)
.L61:
	addq	$1, %rdi
	addq	$1, %r10
	cmpq	%rdi, %r11
	jne	.L31
.L40:
	movl	%r9d, 28(%rsp)
	jmp	.L27
.L59:
	addq	%r14, %rax
	movl	%esi, (%rax)
	jmp	.L61
.L52:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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
.L63:
	movl	$1, (%rax)
	addq	$8, %rax
	cmpq	%rdx, %rax
	jne	.L63
	movl	$6, %esi
	movl	$3, %ecx
	leaq	isPrime(%rip), %r12
	jmp	.L66
.L64:
	leal	2(%rdx), %eax
	addq	$2, %rcx
	addq	$4, %rsi
	imull	%eax, %eax
	cmpl	$101000, %eax
	jg	.L104
.L66:
	movl	(%r12,%rcx,4), %edi
	movl	%ecx, %edx
	testl	%edi, %edi
	je	.L64
	cmpq	$101000, %rsi
	ja	.L64
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L65:
	movl	$0, (%r12,%rax,4)
	addq	%rcx, %rax
	cmpl	$101000, %eax
	jle	.L65
	jmp	.L64
.L104:
	leaq	28(%rsp), %rbp
	leaq	24(%rsp), %rbx
.L67:
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	cmpl	$-1, %eax
	je	.L105
	addl	$1, %eax
	xorl	%edx, %edx
	cltq
.L71:
	movl	(%r12,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L68
.L106:
	movslq	%edx, %rcx
	leal	1(%rdx), %esi
	movl	%eax, 32(%rsp,%rcx,4)
	addq	$1, %rax
	cmpl	$21, %edx
	je	.L70
	movl	(%r12,%rax,4), %ecx
	movl	%esi, %edx
	testl	%ecx, %ecx
	jne	.L106
.L68:
	addq	$1, %rax
	cmpl	$22, %edx
	jne	.L71
.L70:
	movq	%rbx, 8(%rsp)
	leaq	32(%rsp), %rax
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	movl	$22, %ecx
	leaq	128(%rsp), %r10
	movl	$21, %r11d
	jmp	.L72
	.p2align 4,,10
	.p2align 3
.L107:
	movdqu	(%rax), %xmm1
	movd	%r8d, %xmm2
	movl	%ecx, %edi
	movslq	%edx, %rsi
	pshufd	$0, %xmm2, %xmm0
	leaq	(%r10,%rsi,4), %rsi
	shrl	$2, %edi
	paddd	%xmm0, %xmm1
	movups	%xmm1, (%rsi)
	cmpl	$1, %edi
	je	.L74
	movdqu	16(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 16(%rsi)
	cmpl	$2, %edi
	je	.L74
	movdqu	32(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 32(%rsi)
	cmpl	$3, %edi
	je	.L74
	movdqu	48(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 48(%rsi)
	cmpl	$5, %edi
	jne	.L74
	movdqu	64(%rax), %xmm3
	paddd	%xmm3, %xmm0
	movups	%xmm0, 64(%rsi)
.L74:
	movl	%ecx, %esi
	andl	$-4, %esi
	leal	(%r9,%rsi), %r13d
	leal	(%rdx,%rsi), %edi
	cmpl	%esi, %ecx
	je	.L73
.L76:
	movslq	%r13d, %r15
	movslq	%edi, %r14
	leal	1(%rdi), %esi
	movl	32(%rsp,%r15,4), %ebx
	addl	%r8d, %ebx
	movl	%ebx, 128(%rsp,%r14,4)
	leal	1(%r13), %r14d
	cmpl	$21, %r13d
	je	.L73
	movslq	%r14d, %r14
	movslq	%esi, %rsi
	addl	$2, %edi
	movl	32(%rsp,%r14,4), %ebx
	addl	%r8d, %ebx
	movl	%ebx, 128(%rsp,%rsi,4)
	leal	2(%r13), %esi
	cmpl	$20, %r13d
	je	.L73
	movslq	%esi, %rsi
	movslq	%edi, %rdi
	addl	32(%rsp,%rsi,4), %r8d
	movl	%r8d, 128(%rsp,%rdi,4)
.L73:
	addl	$22, %edx
	addq	$4, %rax
	subl	%r9d, %edx
	addl	$1, %r9d
	subl	$1, %ecx
	je	.L75
.L72:
	movl	%r11d, %esi
	movl	(%rax), %r8d
	subl	%r9d, %esi
	cmpl	$2, %esi
	ja	.L107
	movl	%edx, %edi
	movl	%r9d, %r13d
	jmp	.L76
.L75:
	movq	%r10, %rdi
	movl	$253, %esi
	movq	8(%rsp), %rbx
	call	quickSort
	movl	28(%rsp), %eax
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	subl	$1, %eax
	cltq
	movl	128(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L67
.L105:
	movq	1144(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L108
	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
.L108:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	median
	.type	median, @function
median:
.LFB42:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	jge	.L110
	cmpl	%edx, %edi
	movl	%esi, %eax
	cmovl	%edx, %edi
	cmpl	%edx, %esi
	cmovge	%edi, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L110:
	cmpl	%edx, %edi
	movl	%esi, %eax
	cmovg	%edx, %edi
	cmpl	%edx, %esi
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE42:
	.size	median, .-median
	.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	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB40:
	.cfi_startproc
	endbr64
	cmpl	$1, %esi
	jle	.L1
	leal	-1(%rsi), %r10d
	movl	$1, %r8d
	xorl	%esi, %esi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rsi
	addq	$1, %r8
	cmpq	%r10, %rsi
	je	.L1
.L6:
	movl	(%rdi,%r8,4), %ecx
	cmpl	%ecx, (%rdi,%rsi,4)
	jle	.L3
	movq	%r8, %rdx
	leaq	0(,%rsi,4), %rax
	subq	%rsi, %rdx
	leaq	-4(,%rdx,4), %r9
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	-4(%rax), %rdx
	cmpl	%ecx, -4(%rdi,%rax)
	jle	.L12
	movq	%rdx, %rax
.L5:
	movl	(%rdi,%rax), %edx
	movl	%edx, 4(%rdi,%rax)
	cmpq	%r9, %rax
	jne	.L13
	movq	%rdi, %rax
	movl	%ecx, (%rax)
.L14:
	addq	$1, %rsi
	addq	$1, %r8
	cmpq	%r10, %rsi
	jne	.L6
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	addq	%rdi, %rax
	movl	%ecx, (%rax)
	jmp	.L14
	.cfi_endproc
.LFE40:
	.size	insertionSort, .-insertionSort
	.p2align 4
	.globl	quickSort
	.type	quickSort, @function
quickSort:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$15, %ecx
	movq	%rdi, %r15
	subl	$1, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	$1, %r9d
	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	$296, %rsp
	.cfi_def_cfa_offset 352
	movq	%fs:40, %rax
	movq	%rax, 280(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdi
	movq	%rdi, 8(%rsp)
	rep stosq
	leaq	160(%rsp), %rdi
	movl	$15, %ecx
	rep stosq
	leaq	164(%rsp), %rax
	movl	%esi, 160(%rsp)
	movq	%rax, 16(%rsp)
.L16:
	movslq	%r9d, %rax
	movq	8(%rsp), %rcx
	movq	16(%rsp), %rsi
	leaq	-4(,%rax,4), %rax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L38:
	movl	(%rcx,%rax), %r13d
	subq	$4, %rax
	movl	(%rsi,%rax), %r12d
	cmpl	%r12d, %r13d
	jl	.L51
.L17:
	movl	%r9d, %edx
	subl	$1, %r9d
	jnb	.L38
	movq	280(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	addq	$296, %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
	.p2align 4,,10
	.p2align 3
.L51:
	.cfi_restore_state
	movslq	%r12d, %rax
	movl	%edx, 28(%rsp)
	leal	0(%r13,%r12), %edx
	movl	(%r15,%rax,4), %esi
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	cltq
	movl	(%r15,%rax,4), %edi
	movslq	%r13d, %rax
	leaq	(%r15,%rax,4), %r14
	movl	(%r14), %eax
	cmpl	%eax, %edi
	jg	.L53
	cmpl	%eax, %esi
	cmovle	%esi, %eax
	cmpl	%edi, %esi
	cmovge	%eax, %edi
.L19:
	movq	%r14, %r11
	movl	%r13d, %ebx
	movl	%r12d, %edx
	movslq	%r12d, %r8
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%r11), %r10d
	cmpl	%edi, %r10d
	jl	.L21
	cmpl	%esi, %edi
	jge	.L22
	leal	-1(%rdx), %eax
	leaq	-4(%r15,%r8,4), %rcx
	cltq
	.p2align 4,,10
	.p2align 3
.L23:
	movl	(%rcx), %esi
	movl	%eax, %edx
	movq	%rcx, %rbp
	movq	%rax, %r8
	subq	$4, %rcx
	subq	$1, %rax
	cmpl	%edi, %esi
	jg	.L23
.L24:
	cmpl	%edx, %ebx
	jge	.L25
	subl	$1, %edx
	movl	%esi, (%r11)
	movslq	%edx, %r8
	movl	%r10d, 0(%rbp)
	movl	(%r15,%r8,4), %esi
.L21:
	addq	$4, %r11
	addl	$1, %ebx
	jmp	.L20
.L53:
	cmpl	%eax, %esi
	cmovge	%esi, %eax
	cmpl	%edi, %esi
	cmovle	%eax, %edi
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%ebx, %eax
	subl	%r13d, %eax
	cmpl	$19, %eax
	jle	.L54
	movslq	%r9d, %r9
	subl	$1, %ebx
	movl	%ebx, 160(%rsp,%r9,4)
.L27:
	movl	%r12d, %eax
	subl	%edx, %eax
	cmpl	$19, %eax
	jle	.L55
	movslq	28(%rsp), %rax
	addl	$1, %edx
	movl	%edx, 32(%rsp,%rax,4)
	leal	1(%rax), %r9d
	movl	%r12d, 160(%rsp,%rax,4)
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L22:
	leaq	(%r15,%r8,4), %rbp
	jmp	.L24
.L55:
	leaq	4(%r15,%r8,4), %rdx
	cmpl	$1, %eax
	jle	.L43
	leal	-1(%rax), %r10d
	movl	$1, %r8d
	xorl	%edi, %edi
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L34:
	addq	$1, %rdi
	addq	$1, %r8
	cmpq	%rdi, %r10
	je	.L43
.L37:
	movl	(%rdx,%r8,4), %esi
	cmpl	(%rdx,%rdi,4), %esi
	jge	.L34
	movq	%r8, %rcx
	leaq	0(,%rdi,4), %rax
	subq	%rdi, %rcx
	leaq	-4(,%rcx,4), %r9
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L57:
	leaq	-4(%rax), %rcx
	cmpl	-4(%rdx,%rax), %esi
	jge	.L56
	movq	%rcx, %rax
.L36:
	movl	(%rdx,%rax), %ecx
	movl	%ecx, 4(%rdx,%rax)
	cmpq	%rax, %r9
	jne	.L57
	movq	%rdx, %rax
	movl	%esi, (%rax)
.L58:
	addq	$1, %rdi
	addq	$1, %r8
	cmpq	%rdi, %r10
	jne	.L37
.L43:
	movl	28(%rsp), %r9d
	jmp	.L16
.L56:
	addq	%rdx, %rax
	movl	%esi, (%rax)
	jmp	.L58
.L54:
	cmpl	$1, %eax
	jle	.L40
	leal	-1(%rax), %r11d
	movl	$1, %r10d
	xorl	%edi, %edi
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L28:
	addq	$1, %rdi
	addq	$1, %r10
	cmpq	%rdi, %r11
	je	.L40
.L31:
	movl	(%r14,%r10,4), %esi
	cmpl	(%r14,%rdi,4), %esi
	jge	.L28
	movq	%r10, %rcx
	leaq	0(,%rdi,4), %rax
	subq	%rdi, %rcx
	leaq	-4(,%rcx,4), %rbx
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L60:
	leaq	-4(%rax), %rcx
	cmpl	-4(%r14,%rax), %esi
	jge	.L59
	movq	%rcx, %rax
.L30:
	movl	(%r14,%rax), %ecx
	movl	%ecx, 4(%r14,%rax)
	cmpq	%rax, %rbx
	jne	.L60
	movq	%r14, %rax
	movl	%esi, (%rax)
.L61:
	addq	$1, %rdi
	addq	$1, %r10
	cmpq	%rdi, %r11
	jne	.L31
.L40:
	movl	%r9d, 28(%rsp)
	jmp	.L27
.L59:
	addq	%r14, %rax
	movl	%esi, (%rax)
	jmp	.L61
.L52:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE41:
	.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
.L63:
	movl	$1, (%rax)
	addq	$8, %rax
	cmpq	%rdx, %rax
	jne	.L63
	movl	$6, %esi
	movl	$3, %ecx
	leaq	isPrime(%rip), %r12
	jmp	.L66
.L64:
	leal	2(%rdx), %eax
	addq	$2, %rcx
	addq	$4, %rsi
	imull	%eax, %eax
	cmpl	$101000, %eax
	jg	.L104
.L66:
	movl	(%r12,%rcx,4), %edi
	movl	%ecx, %edx
	testl	%edi, %edi
	je	.L64
	cmpq	$101000, %rsi
	ja	.L64
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L65:
	movl	$0, (%r12,%rax,4)
	addq	%rcx, %rax
	cmpl	$101000, %eax
	jle	.L65
	jmp	.L64
.L104:
	leaq	28(%rsp), %rbp
	leaq	24(%rsp), %rbx
.L67:
	movq	%rbp, %rdx
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	cmpl	$-1, %eax
	je	.L105
	addl	$1, %eax
	xorl	%edx, %edx
	cltq
.L71:
	movl	(%r12,%rax,4), %ecx
	testl	%ecx, %ecx
	je	.L68
.L106:
	movslq	%edx, %rcx
	leal	1(%rdx), %esi
	movl	%eax, 32(%rsp,%rcx,4)
	addq	$1, %rax
	cmpl	$21, %edx
	je	.L70
	movl	(%r12,%rax,4), %ecx
	movl	%esi, %edx
	testl	%ecx, %ecx
	jne	.L106
.L68:
	addq	$1, %rax
	cmpl	$22, %edx
	jne	.L71
.L70:
	movq	%rbx, 8(%rsp)
	leaq	32(%rsp), %rax
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	movl	$22, %ecx
	leaq	128(%rsp), %r10
	movl	$21, %r11d
	jmp	.L72
	.p2align 4,,10
	.p2align 3
.L107:
	movdqu	(%rax), %xmm1
	movd	%r8d, %xmm2
	movl	%ecx, %edi
	movslq	%edx, %rsi
	pshufd	$0, %xmm2, %xmm0
	leaq	(%r10,%rsi,4), %rsi
	shrl	$2, %edi
	paddd	%xmm0, %xmm1
	movups	%xmm1, (%rsi)
	cmpl	$1, %edi
	je	.L74
	movdqu	16(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 16(%rsi)
	cmpl	$2, %edi
	je	.L74
	movdqu	32(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 32(%rsi)
	cmpl	$3, %edi
	je	.L74
	movdqu	48(%rax), %xmm1
	paddd	%xmm0, %xmm1
	movups	%xmm1, 48(%rsi)
	cmpl	$5, %edi
	jne	.L74
	movdqu	64(%rax), %xmm3
	paddd	%xmm3, %xmm0
	movups	%xmm0, 64(%rsi)
.L74:
	movl	%ecx, %esi
	andl	$-4, %esi
	leal	(%r9,%rsi), %r13d
	leal	(%rdx,%rsi), %edi
	cmpl	%esi, %ecx
	je	.L73
.L76:
	movslq	%r13d, %r15
	movslq	%edi, %r14
	leal	1(%rdi), %esi
	movl	32(%rsp,%r15,4), %ebx
	addl	%r8d, %ebx
	movl	%ebx, 128(%rsp,%r14,4)
	leal	1(%r13), %r14d
	cmpl	$21, %r13d
	je	.L73
	movslq	%r14d, %r14
	movslq	%esi, %rsi
	addl	$2, %edi
	movl	32(%rsp,%r14,4), %ebx
	addl	%r8d, %ebx
	movl	%ebx, 128(%rsp,%rsi,4)
	leal	2(%r13), %esi
	cmpl	$20, %r13d
	je	.L73
	movslq	%esi, %rsi
	movslq	%edi, %rdi
	addl	32(%rsp,%rsi,4), %r8d
	movl	%r8d, 128(%rsp,%rdi,4)
.L73:
	addl	$22, %edx
	addq	$4, %rax
	subl	%r9d, %edx
	addl	$1, %r9d
	subl	$1, %ecx
	je	.L75
.L72:
	movl	%r11d, %esi
	movl	(%rax), %r8d
	subl	%r9d, %esi
	cmpl	$2, %esi
	ja	.L107
	movl	%edx, %edi
	movl	%r9d, %r13d
	jmp	.L76
.L75:
	movq	%r10, %rdi
	movl	$253, %esi
	movq	8(%rsp), %rbx
	call	quickSort
	movl	28(%rsp), %eax
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	subl	$1, %eax
	cltq
	movl	128(%rsp,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L67
.L105:
	movq	1144(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L108
	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
.L108:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	median
	.type	median, @function
median:
.LFB42:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	jge	.L110
	cmpl	%edx, %edi
	movl	%esi, %eax
	cmovl	%edx, %edi
	cmpl	%edx, %esi
	cmovge	%edi, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L110:
	cmpl	%edx, %edi
	movl	%esi, %eax
	cmovg	%edx, %edi
	cmpl	%edx, %esi
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE42:
	.size	median, .-median
	.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
#define SWAP( a, b ) do { int tmp; tmp = a; a = b; b = tmp; } while( 0 )

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

void insertionSort( int *, int );
void quickSort( int *, int );
int median( int, 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, 253 );
	}

	return 0;
}

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

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

		if ( data[ i - 1 ] > tmp ) {
			j = i;
			do {
				data[ j ] = data[ j - 1 ];

				j--;
			} while ( j && data[ j - 1 ] > tmp );

			data[ j ] = tmp;
		}
	}
}

void quickSort( int *data, int n ) {
	int low[ 30 ] = { 0 }, high[ 30 ] = { n - 1 }, sp = 1;

	while ( sp-- ) {
		int l = low[ sp ], r = high[ sp ];

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

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

				SWAP( data[ i ], data[ j ] );

				i++;
				j--;
			}

			if ( i - l < 20 )
				insertionSort( data + l, i - l );
			else {
				low[ sp ] = l;
				high[ sp ] = i - 1;
				sp++;
			}

			if ( r - j < 20 )
				insertionSort( data + j + 1, r - j );
			else {
				low[ sp ] = j + 1;
				high[ sp ] = r;
				sp++;
			}
		}
	}
}

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;
}
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
#define SWAP( a, b ) do { int tmp; tmp = a; a = b; b = tmp; } while( 0 )

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

void insertionSort( int *, int );
void quickSort( int *, int );
int median( int, 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, 253 );
	}

	return 0;
}

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

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

		if ( data[ i - 1 ] > tmp ) {
			j = i;
			do {
				data[ j ] = data[ j - 1 ];

				j--;
			} while ( j && data[ j - 1 ] > tmp );

			data[ j ] = tmp;
		}
	}
}

void quickSort( int *data, int n ) {
	int low[ 30 ] = { 0 }, high[ 30 ] = { n - 1 }, sp = 1;

	while ( sp-- ) {
		int l = low[ sp ], r = high[ sp ];

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

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

				SWAP( data[ i ], data[ j ] );

				i++;
				j--;
			}

			if ( i - l < 20 )
				insertionSort( data + l, i - l );
			else {
				low[ sp ] = l;
				high[ sp ] = i - 1;
				sp++;
			}

			if ( r - j < 20 )
				insertionSort( data + j + 1, r - j );
			else {
				low[ sp ] = j + 1;
				high[ sp ] = r;
				sp++;
			}
		}
	}
}

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;
}```

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	$253, %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	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB7:
	.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	.L21
.L25:
	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
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L22
	movl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
.L24:
	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)
	cmpl	$0, -8(%rbp)
	je	.L23
	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	.L24
.L23:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L22:
	addl	$1, -12(%rbp)
.L21:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L25
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	insertionSort, .-insertionSort
	.globl	quickSort
	.type	quickSort, @function
quickSort:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$304, %rsp
	movq	%rdi, -296(%rbp)
	movl	%esi, -300(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-256(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-128(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	-300(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -128(%rbp)
	movl	$1, -284(%rbp)
	jmp	.L27
.L38:
	movl	-284(%rbp), %eax
	cltq
	movl	-256(%rbp,%rax,4), %eax
	movl	%eax, -272(%rbp)
	movl	-284(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movl	%eax, -268(%rbp)
	movl	-272(%rbp), %eax
	cmpl	-268(%rbp), %eax
	jge	.L27
	movl	-272(%rbp), %eax
	movl	%eax, -280(%rbp)
	movl	-268(%rbp), %eax
	movl	%eax, -276(%rbp)
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-280(%rbp), %ecx
	movl	-276(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-296(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-296(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	median
	movl	%eax, -264(%rbp)
	jmp	.L28
.L29:
	addl	$1, -280(%rbp)
.L28:
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -264(%rbp)
	jg	.L29
	jmp	.L30
.L31:
	subl	$1, -276(%rbp)
.L30:
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -264(%rbp)
	jl	.L31
	movl	-280(%rbp), %eax
	cmpl	-276(%rbp), %eax
	jge	.L41
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -260(%rbp)
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	-280(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-296(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rax, %rdx
	movl	-260(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -280(%rbp)
	subl	$1, -276(%rbp)
	jmp	.L28
.L41:
	nop
	movl	-280(%rbp), %eax
	subl	-272(%rbp), %eax
	cmpl	$19, %eax
	jg	.L35
	movl	-280(%rbp), %eax
	subl	-272(%rbp), %eax
	movl	-272(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-296(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L36
.L35:
	movl	-284(%rbp), %eax
	cltq
	movl	-272(%rbp), %edx
	movl	%edx, -256(%rbp,%rax,4)
	movl	-280(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-284(%rbp), %eax
	cltq
	movl	%edx, -128(%rbp,%rax,4)
	addl	$1, -284(%rbp)
.L36:
	movl	-268(%rbp), %eax
	subl	-276(%rbp), %eax
	cmpl	$19, %eax
	jg	.L37
	movl	-268(%rbp), %eax
	subl	-276(%rbp), %eax
	movl	-276(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-296(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L27
.L37:
	movl	-276(%rbp), %eax
	leal	1(%rax), %edx
	movl	-284(%rbp), %eax
	cltq
	movl	%edx, -256(%rbp,%rax,4)
	movl	-284(%rbp), %eax
	cltq
	movl	-268(%rbp), %edx
	movl	%edx, -128(%rbp,%rax,4)
	addl	$1, -284(%rbp)
.L27:
	movl	-284(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -284(%rbp)
	testl	%eax, %eax
	jne	.L38
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	quickSort, .-quickSort
	.globl	median
	.type	median, @function
median:
.LFB9:
	.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	.L43
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L44
	movl	-8(%rbp), %eax
	jmp	.L45
.L44:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L46
	movl	-4(%rbp), %eax
	jmp	.L45
.L46:
	movl	-12(%rbp), %eax
	jmp	.L45
.L43:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L47
	movl	-8(%rbp), %eax
	jmp	.L45
.L47:
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L48
	movl	-4(%rbp), %eax
	jmp	.L45
.L48:
	movl	-12(%rbp), %eax
.L45:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	median, .-median
	.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.
val
	.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	$253, %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	insertionSort
	.type	insertionSort, @function
insertionSort:
.LFB7:
	.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	.L21
.L25:
	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
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jge	.L22
	movl	-12(%rbp), %eax
	movl	%eax, -8(%rbp)
.L24:
	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)
	cmpl	$0, -8(%rbp)
	je	.L23
	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	.L24
.L23:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L22:
	addl	$1, -12(%rbp)
.L21:
	movl	-12(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jl	.L25
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	insertionSort, .-insertionSort
	.globl	quickSort
	.type	quickSort, @function
quickSort:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$304, %rsp
	movq	%rdi, -296(%rbp)
	movl	%esi, -300(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-256(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	leaq	-128(%rbp), %rdx
	movl	$0, %eax
	movl	$15, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	-300(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -128(%rbp)
	movl	$1, -284(%rbp)
	jmp	.L27
.L38:
	movl	-284(%rbp), %eax
	cltq
	movl	-256(%rbp,%rax,4), %eax
	movl	%eax, -272(%rbp)
	movl	-284(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	movl	%eax, -268(%rbp)
	movl	-272(%rbp), %eax
	cmpl	-268(%rbp), %eax
	jge	.L27
	movl	-272(%rbp), %eax
	movl	%eax, -280(%rbp)
	movl	-268(%rbp), %eax
	movl	%eax, -276(%rbp)
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-280(%rbp), %ecx
	movl	-276(%rbp), %eax
	addl	%ecx, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-296(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %ecx
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rsi
	movq	-296(%rbp), %rax
	addq	%rsi, %rax
	movl	(%rax), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	median
	movl	%eax, -264(%rbp)
	jmp	.L28
.L29:
	addl	$1, -280(%rbp)
.L28:
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -264(%rbp)
	jg	.L29
	jmp	.L30
.L31:
	subl	$1, -276(%rbp)
.L30:
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -264(%rbp)
	jl	.L31
	movl	-280(%rbp), %eax
	cmpl	-276(%rbp), %eax
	jge	.L41
	movl	-280(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -260(%rbp)
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rdx, %rax
	movl	-280(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-296(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-276(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-296(%rbp), %rax
	addq	%rax, %rdx
	movl	-260(%rbp), %eax
	movl	%eax, (%rdx)
	addl	$1, -280(%rbp)
	subl	$1, -276(%rbp)
	jmp	.L28
.L41:
	nop
	movl	-280(%rbp), %eax
	subl	-272(%rbp), %eax
	cmpl	$19, %eax
	jg	.L35
	movl	-280(%rbp), %eax
	subl	-272(%rbp), %eax
	movl	-272(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-296(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L36
.L35:
	movl	-284(%rbp), %eax
	cltq
	movl	-272(%rbp), %edx
	movl	%edx, -256(%rbp,%rax,4)
	movl	-280(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-284(%rbp), %eax
	cltq
	movl	%edx, -128(%rbp,%rax,4)
	addl	$1, -284(%rbp)
.L36:
	movl	-268(%rbp), %eax
	subl	-276(%rbp), %eax
	cmpl	$19, %eax
	jg	.L37
	movl	-268(%rbp), %eax
	subl	-276(%rbp), %eax
	movl	-276(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-296(%rbp), %rdx
	addq	%rcx, %rdx
	movl	%eax, %esi
	movq	%rdx, %rdi
	call	insertionSort
	jmp	.L27
.L37:
	movl	-276(%rbp), %eax
	leal	1(%rax), %edx
	movl	-284(%rbp), %eax
	cltq
	movl	%edx, -256(%rbp,%rax,4)
	movl	-284(%rbp), %eax
	cltq
	movl	-268(%rbp), %edx
	movl	%edx, -128(%rbp,%rax,4)
	addl	$1, -284(%rbp)
.L27:
	movl	-284(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -284(%rbp)
	testl	%eax, %eax
	jne	.L38
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	quickSort, .-quickSort
	.globl	median
	.type	median, @function
median:
.LFB9:
	.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	.L43
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L44
	movl	-8(%rbp), %eax
	jmp	.L45
.L44:
	movl	-12(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L46
	movl	-4(%rbp), %eax
	jmp	.L45
.L46:
	movl	-12(%rbp), %eax
	jmp	.L45
.L43:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jge	.L47
	movl	-8(%rbp), %eax
	jmp	.L45
.L47:
	movl	-4(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L48
	movl	-4(%rbp), %eax
	jmp	.L45
.L48:
	movl	-12(%rbp), %eax
.L45:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	median, .-median
	.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:
