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 <memory.h>

#define MIN(x, y) ((x) <= (y) ? (x) : (y))
int get_uint() {
    int n = 0;
    int c = getchar_unlocked();
    if(c < 48 || 57 < c) return c;
    while(47 < c && c < 58) {
        n = 10 * n + (c & 0xf);
        c = getchar_unlocked();
    }
    return n;
}
void put_uint(int n) {
    if(!n) {
        putchar_unlocked('0');
        return;
    }
    char buf[11];
    int i = 0;
    while(n) buf[i++] = (char)(n % 10 + '0'), n /= 10;
    while(i--)putchar_unlocked(buf[i]);
}
void *partition(int *first, int *last) {
    int pivot = *(last - 1);
    int *p = first - 1;
    for(int *it = first; it != last - 1; ++it) {
        if(*it <= pivot) {
            p++;
            int tmp = *p;
            *p = *it;
            *it = tmp;
        }
    }
    int tmp = *++p;
    *p = pivot;
    *(last - 1) = tmp;
    return p;
}
void quick_sort(void *first, void *last, size_t N) {
    if(last - first <= N) return;
    void *mid = partition(first, last);
    quick_sort(first, mid, N);
    quick_sort(mid, last, N);
}
int mincost_sort(const int *a, const int N, const int minw) {
    int cnt = 0;
    int b[N];
    memcpy(b, a, N * sizeof(int));
    quick_sort(b, b + N, sizeof(int));
    int pos[10001];
    for(int i = 0; i < N; ++i) pos[b[i]] = i;
    int flag[1001] = {};
    for(int i = 0; i < N; ++i) {
        if(flag[i]) continue;
        int cur = i;
        int sum = 0;
        int num = 0;
        int mina = 1 << 29;
        while(!flag[cur]) {
            flag[cur] = 1;
            num++;
            sum += a[cur];
            mina = MIN(mina, a[cur]);
            cur = pos[a[cur]];
        }
        // [ sum + (num-2)*mina + 2(mina+minw) - (num-1)*(mina-minw) ] -> [ sum + mina + (n+1)*minw ]
        cnt += MIN(sum + (num - 2) * mina, sum + mina + (num + 1) * minw);
    }
    return cnt;
}
int main(int argc, char **argv) {
    int n = get_uint();
    int w[n];
    int minw = 1 << 29;
    for(int i = 0; i < n; ++i) {
        w[i] = get_uint();
        minw = MIN(minw, w[i]);
    }
    put_uint(mincost_sort(w, n, minw));
    putchar_unlocked('\n');
    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	get_uint
	.type	get_uint, @function
get_uint:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jle	.L2
	cmpl	$57, -4(%rbp)
	jle	.L5
.L2:
	movl	-4(%rbp), %eax
	jmp	.L4
.L7:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L5:
	cmpl	$47, -4(%rbp)
	jle	.L6
	cmpl	$57, -4(%rbp)
	jle	.L7
.L6:
	movl	-8(%rbp), %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	get_uint, .-get_uint
	.globl	put_uint
	.type	put_uint, @function
put_uint:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	cmpl	$0, -36(%rbp)
	jne	.L9
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L8
.L9:
	movl	$0, -24(%rbp)
	jmp	.L11
.L12:
	movl	-36(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -19(%rbp,%rax)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -36(%rbp)
.L11:
	cmpl	$0, -36(%rbp)
	jne	.L12
	jmp	.L13
.L14:
	movl	-24(%rbp), %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L13:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L14
.L8:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	put_uint, .-put_uint
	.globl	partition
	.type	partition, @function
partition:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-48(%rbp), %rax
	movl	-4(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	-40(%rbp), %rax
	subq	$4, %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L17
.L19:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L18
	addq	$4, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
.L18:
	addq	$4, -8(%rbp)
.L17:
	movq	-48(%rbp), %rax
	subq	$4, %rax
	cmpq	%rax, -8(%rbp)
	jne	.L19
	addq	$4, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rax
	movl	-28(%rbp), %edx
	movl	%edx, (%rax)
	movq	-48(%rbp), %rax
	leaq	-4(%rax), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	partition, .-partition
	.globl	quick_sort
	.type	quick_sort, @function
quick_sort:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-32(%rbp), %rax
	subq	-24(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jnb	.L24
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	partition
	movq	%rax, -8(%rbp)
	movq	-40(%rbp), %rdx
	movq	-8(%rbp), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	quick_sort
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rcx
	movq	-8(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	quick_sort
	jmp	.L21
.L24:
	nop
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	quick_sort, .-quick_sort
	.globl	mincost_sort
	.type	mincost_sort, @function
mincost_sort:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3144, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -44104(%rbp)
	movl	%esi, -44108(%rbp)
	movl	%edx, -44112(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -44092(%rbp)
	movl	-44108(%rbp), %eax
	cltq
	subq	$1, %rax
	movq	%rax, -44064(%rbp)
	movl	-44108(%rbp), %eax
	cltq
	movq	%rax, %r10
	movl	$0, %r11d
	movl	-44108(%rbp), %eax
	cltq
	movq	%rax, %r8
	movl	$0, %r9d
	movl	-44108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L26:
	cmpq	%rdx, %rsp
	je	.L27
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L26
.L27:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L28
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L28:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -44056(%rbp)
	movl	-44108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rcx
	movq	-44056(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	-44108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44056(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-44056(%rbp), %rax
	movl	$4, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	quick_sort
	movl	$0, -44088(%rbp)
	jmp	.L29
.L30:
	movq	-44056(%rbp), %rax
	movl	-44088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movl	-44088(%rbp), %edx
	movl	%edx, -40032(%rbp,%rax,4)
	addl	$1, -44088(%rbp)
.L29:
	movl	-44088(%rbp), %eax
	cmpl	-44108(%rbp), %eax
	jl	.L30
	leaq	-44048(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$0, -44084(%rbp)
	jmp	.L31
.L36:
	movl	-44084(%rbp), %eax
	cltq
	movl	-44048(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L39
	movl	-44084(%rbp), %eax
	movl	%eax, -44080(%rbp)
	movl	$0, -44076(%rbp)
	movl	$0, -44072(%rbp)
	movl	$536870912, -44068(%rbp)
	jmp	.L34
.L35:
	movl	-44080(%rbp), %eax
	cltq
	movl	$1, -44048(%rbp,%rax,4)
	addl	$1, -44072(%rbp)
	movl	-44080(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -44076(%rbp)
	movl	-44080(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-44068(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -44068(%rbp)
	movl	-44080(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	movl	-40032(%rbp,%rax,4), %eax
	movl	%eax, -44080(%rbp)
.L34:
	movl	-44080(%rbp), %eax
	cltq
	movl	-44048(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L35
	movl	-44072(%rbp), %eax
	subl	$2, %eax
	imull	-44068(%rbp), %eax
	movl	%eax, %edx
	movl	-44076(%rbp), %eax
	addl	%eax, %edx
	movl	-44076(%rbp), %ecx
	movl	-44068(%rbp), %eax
	addl	%eax, %ecx
	movl	-44072(%rbp), %eax
	addl	$1, %eax
	imull	-44112(%rbp), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	addl	%eax, -44092(%rbp)
	jmp	.L33
.L39:
	nop
.L33:
	addl	$1, -44084(%rbp)
.L31:
	movl	-44084(%rbp), %eax
	cmpl	-44108(%rbp), %eax
	jl	.L36
	movl	-44092(%rbp), %eax
	movq	%rbx, %rsp
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	mincost_sort, .-mincost_sort
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movl	%edi, -100(%rbp)
	movq	%rsi, -112(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, %eax
	call	get_uint
	movl	%eax, -76(%rbp)
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L41:
	cmpq	%rdx, %rsp
	je	.L42
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L41
.L42:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L43
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L43:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$536870912, -84(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L44
.L45:
	movl	$0, %eax
	call	get_uint
	movq	-64(%rbp), %rdx
	movl	-80(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	movq	-64(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	-84(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -84(%rbp)
	addl	$1, -80(%rbp)
.L44:
	movl	-80(%rbp), %eax
	cmpl	-76(%rbp), %eax
	jl	.L45
	movl	-84(%rbp), %edx
	movl	-76(%rbp), %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mincost_sort
	movl	%eax, %edi
	call	put_uint
	movl	$10, %edi
	call	putchar_unlocked@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L47
	call	__stack_chk_fail@PLT
.L47:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	get_uint
	.type	get_uint, @function
get_uint:
.LFB35:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jnb	.L13
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	leal	-48(%rax), %edx
	movl	%eax, %r12d
	cmpl	$9, %edx
	ja	.L1
	xorl	%r12d, %r12d
.L11:
	movq	stdin(%rip), %rdi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	leal	-48(%rax), %edx
	cmpl	$9, %edx
	ja	.L1
.L7:
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L5
	call	__uflow@PLT
	leal	-48(%rax), %edx
	cmpl	$9, %edx
	jbe	.L11
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	call	__uflow@PLT
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	get_uint, .-get_uint
	.p2align 4
	.globl	put_uint
	.type	put_uint, @function
put_uint:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	stdout(%rip), %r8
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	40(%r8), %rcx
	movq	48(%r8), %rsi
	testl	%edi, %edi
	je	.L84
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	movl	%eax, %ebx
	addl	%edx, %edx
	subl	%edx, %edi
	leal	48(%rdi), %ebp
	movb	%bpl, 13(%rsp)
	testl	%eax, %eax
	je	.L19
	movslq	%eax, %rdx
	movl	%eax, %edi
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %edi
	sarq	$34, %rdx
	subl	%edi, %edx
	leal	(%rdx,%rdx,4), %edi
	addl	%edi, %edi
	subl	%edi, %eax
	addl	$48, %eax
	movb	%al, 14(%rsp)
	testl	%edx, %edx
	je	.L43
	movslq	%edx, %rax
	movl	%edx, %edi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edi
	sarq	$34, %rax
	subl	%edi, %eax
	leal	(%rax,%rax,4), %edi
	addl	%edi, %edi
	subl	%edi, %edx
	addl	$48, %edx
	movb	%dl, 15(%rsp)
	testl	%eax, %eax
	je	.L44
	movslq	%eax, %rdx
	movl	%eax, %edi
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %edi
	sarq	$34, %rdx
	subl	%edi, %edx
	leal	(%rdx,%rdx,4), %edi
	addl	%edi, %edi
	subl	%edi, %eax
	addl	$48, %eax
	movb	%al, 16(%rsp)
	testl	%edx, %edx
	je	.L45
	movslq	%edx, %rax
	movl	%edx, %edi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edi
	sarq	$34, %rax
	subl	%edi, %eax
	leal	(%rax,%rax,4), %edi
	addl	%edi, %edi
	subl	%edi, %edx
	addl	$48, %edx
	movb	%dl, 17(%rsp)
	testl	%eax, %eax
	je	.L46
	movslq	%eax, %rdx
	movl	%eax, %edi
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %edi
	sarq	$34, %rdx
	subl	%edi, %edx
	leal	(%rdx,%rdx,4), %edi
	addl	%edi, %edi
	subl	%edi, %eax
	addl	$48, %eax
	movb	%al, 18(%rsp)
	testl	%edx, %edx
	je	.L47
	movslq	%edx, %rax
	movl	%edx, %edi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edi
	sarq	$34, %rax
	subl	%edi, %eax
	leal	(%rax,%rax,4), %edi
	addl	%edi, %edi
	subl	%edi, %edx
	addl	$48, %edx
	movb	%dl, 19(%rsp)
	testl	%eax, %eax
	je	.L48
	movslq	%eax, %rdx
	movl	%eax, %edi
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %edi
	sarq	$34, %rdx
	subl	%edi, %edx
	leal	(%rdx,%rdx,4), %edi
	addl	%edi, %edi
	subl	%edi, %eax
	addl	$48, %eax
	movb	%al, 20(%rsp)
	testl	%edx, %edx
	je	.L49
	movslq	%edx, %rax
	movl	%edx, %edi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edi
	sarq	$34, %rax
	subl	%edi, %eax
	leal	(%rax,%rax,4), %edi
	addl	%edi, %edi
	subl	%edi, %edx
	addl	$48, %edx
	movb	%dl, 21(%rsp)
	testl	%eax, %eax
	je	.L50
	addl	$48, %eax
	movl	$9, %ebx
	movb	%al, 22(%rsp)
.L19:
	movslq	%ebx, %rax
	movzbl	13(%rsp,%rax), %eax
	cmpq	%rsi, %rcx
	jnb	.L20
	leaq	1(%rcx), %rdx
	movq	%rdx, 40(%r8)
	movb	%al, (%rcx)
.L21:
	leal	-1(%rbx), %r12d
	testl	%ebx, %ebx
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r12d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	%rax, 48(%rdi)
	jbe	.L23
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L24:
	leal	-2(%rbx), %r13d
	testl	%r12d, %r12d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r13d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L25
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L26:
	leal	-3(%rbx), %r12d
	testl	%r13d, %r13d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r12d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L27
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L28:
	leal	-4(%rbx), %r13d
	testl	%r12d, %r12d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r13d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L29
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L30:
	leal	-5(%rbx), %r12d
	testl	%r13d, %r13d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r12d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L31
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L32:
	leal	-6(%rbx), %r13d
	testl	%r12d, %r12d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r13d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L33
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L34:
	leal	-7(%rbx), %r12d
	testl	%r13d, %r13d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r12d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L35
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L36:
	subl	$8, %ebx
	testl	%r12d, %r12d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%ebx, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L37
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L38:
	testl	%ebx, %ebx
	je	.L14
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L39
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%bpl, (%rax)
.L14:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L84:
	.cfi_restore_state
	cmpq	%rsi, %rcx
	jnb	.L85
	leaq	1(%rcx), %rax
	movq	%rax, 40(%r8)
	movb	$48, (%rcx)
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L44:
	movl	$2, %ebx
	jmp	.L19
.L25:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L43:
	movl	$1, %ebx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movzbl	%al, %esi
	movq	%r8, %rdi
	call	__overflow@PLT
	jmp	.L21
.L23:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L24
.L45:
	movl	$3, %ebx
	jmp	.L19
.L46:
	movl	$4, %ebx
	jmp	.L19
.L27:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L28
.L47:
	movl	$5, %ebx
	jmp	.L19
.L29:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L30
.L48:
	movl	$6, %ebx
	jmp	.L19
.L31:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L32
.L85:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	movl	$48, %esi
	movq	%r8, %rdi
.L82:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__overflow@PLT
.L33:
	.cfi_restore_state
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L34
.L49:
	movl	$7, %ebx
	jmp	.L19
.L35:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L36
.L50:
	movl	$8, %ebx
	jmp	.L19
.L37:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L38
.L39:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	movzbl	%bpl, %esi
	jmp	.L82
.L83:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	put_uint, .-put_uint
	.p2align 4
	.globl	partition
	.type	partition, @function
partition:
.LFB37:
	.cfi_startproc
	endbr64
	leaq	-4(%rsi), %r8
	movl	-4(%rsi), %ecx
	leaq	-4(%rdi), %rdx
	cmpq	%r8, %rdi
	je	.L87
	.p2align 4,,10
	.p2align 3
.L89:
	movl	(%rdi), %eax
	cmpl	%ecx, %eax
	jg	.L88
	movl	4(%rdx), %r9d
	movl	%eax, 4(%rdx)
	addq	$4, %rdx
	movl	%r9d, (%rdi)
.L88:
	addq	$4, %rdi
	cmpq	%r8, %rdi
	jne	.L89
	leaq	4(%rdx), %r8
.L87:
	movl	4(%rdx), %eax
	movl	%ecx, 4(%rdx)
	movl	%eax, -4(%rsi)
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE37:
	.size	partition, .-partition
	.section	.text.unlikely,"ax",@progbits
.LCOLDB0:
	.text
.LHOTB0:
	.p2align 4
	.globl	quick_sort
	.type	quick_sort, @function
quick_sort:
.LFB38:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r11
	movq	%rsi, %rax
	movq	%rsi, %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	subq	$4, %rdi
	subq	%r11, %rax
	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	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%rsi, 16(%rsp)
	movq	%rdi, 24(%rsp)
	cmpq	%rax, %rdx
	jnb	.L91
	movq	%rdx, %r15
	movq	%r11, %r14
.L98:
	movq	16(%rsp), %rax
	leaq	-4(%r14), %r11
	movq	%r11, %r10
	movl	-4(%rax), %edx
	cmpq	%r14, 24(%rsp)
	je	.L93
	movq	%r14, %rax
.L95:
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jl	.L94
	movl	4(%r10), %esi
	movl	%ecx, 4(%r10)
	addq	$4, %r10
	movl	%esi, (%rax)
.L94:
	addq	$4, %rax
	cmpq	%rax, 24(%rsp)
	jne	.L95
	movl	4(%r10), %eax
	movq	16(%rsp), %rsi
	leaq	4(%r10), %rdi
	movl	%edx, 4(%r10)
	movq	%rdi, 80(%rsp)
	movl	%eax, -4(%rsi)
	movq	%rdi, %rax
	subq	%r14, %rax
	cmpq	%rax, %r15
	jnb	.L103
	movq	%r10, 8(%rsp)
	movq	%r14, %r13
	movq	%r11, %r10
	movq	%r15, %r14
.L96:
	movq	8(%rsp), %rax
	movq	%r10, %r15
	movl	(%rax), %edx
	cmpq	%r13, %rax
	je	.L99
	movq	%r13, %rax
.L101:
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jl	.L100
	movl	4(%r15), %esi
	movl	%ecx, 4(%r15)
	addq	$4, %r15
	movl	%esi, (%rax)
.L100:
	addq	$4, %rax
	cmpq	%rax, 8(%rsp)
	jne	.L101
	movl	4(%r15), %eax
	movq	8(%rsp), %rsi
	leaq	4(%r15), %rdi
	movl	%edx, 4(%r15)
	movq	%rdi, 72(%rsp)
	movl	%eax, (%rsi)
	movq	%rdi, %rax
	subq	%r13, %rax
	cmpq	%rax, %r14
	jnb	.L108
	movq	%r15, (%rsp)
	movq	%r14, %r12
	movq	%r13, %r15
.L102:
	movq	(%rsp), %rax
	movq	%r10, %r13
	movl	(%rax), %edx
	cmpq	%r15, %rax
	je	.L104
	movq	%r15, %rax
.L106:
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jl	.L105
	movl	4(%r13), %esi
	movl	%ecx, 4(%r13)
	addq	$4, %r13
	movl	%esi, (%rax)
.L105:
	addq	$4, %rax
	cmpq	%rax, (%rsp)
	jne	.L106
	movl	4(%r13), %eax
	movq	(%rsp), %rsi
	leaq	4(%r13), %rdi
	movl	%edx, 4(%r13)
	movq	%rdi, 64(%rsp)
	movl	%eax, (%rsi)
	movq	%rdi, %rax
	subq	%r15, %rax
	cmpq	%rax, %r12
	jnb	.L113
	movq	%r12, %rax
	movq	%r13, %r12
	movq	%r10, %r14
	movl	(%r12), %ecx
	movq	%rax, %r13
	cmpq	%r15, %r12
	je	.L109
.L184:
	movq	%r15, %rax
.L111:
	movl	(%rax), %edx
	cmpl	%edx, %ecx
	jl	.L110
	movl	4(%r14), %esi
	movl	%edx, 4(%r14)
	addq	$4, %r14
	movl	%esi, (%rax)
.L110:
	addq	$4, %rax
	cmpq	%rax, %r12
	jne	.L111
	leaq	4(%r14), %rax
	movq	%rax, %rdi
	movq	%rax, 56(%rsp)
	movl	4(%r14), %eax
	movl	%ecx, 4(%r14)
	movl	%eax, (%r12)
	movq	%rdi, %rax
	subq	%r15, %rax
	cmpq	%rax, %r13
	jnb	.L118
	movq	%r13, %rax
	movq	%r14, %r13
	movq	%r12, 88(%rsp)
	movq	%rax, %r14
	movl	0(%r13), %r8d
	movq	%r10, %rax
	cmpq	%r15, %r13
	je	.L114
.L182:
	movq	%r15, %rcx
.L116:
	movl	(%rcx), %esi
	cmpl	%esi, %r8d
	jl	.L115
	movl	4(%rax), %edx
	movl	%esi, 4(%rax)
	addq	$4, %rax
	movl	%edx, (%rcx)
.L115:
	addq	$4, %rcx
	cmpq	%rcx, %r13
	jne	.L116
	movl	4(%rax), %ecx
	leaq	4(%rax), %rdi
	movl	%r8d, 4(%rax)
	movq	%rdi, 48(%rsp)
	subq	%r15, %rdi
	movl	%ecx, 0(%r13)
	cmpq	%rdi, %r14
	jnb	.L123
	movq	%r14, %r12
	movq	%rax, %r14
	movq	%r13, 96(%rsp)
	movq	%r10, %rbx
	movl	(%r14), %esi
	cmpq	%r15, %r14
	je	.L119
.L180:
	movq	%r15, %rdx
	.p2align 4,,10
	.p2align 3
.L121:
	movl	(%rdx), %eax
	cmpl	%eax, %esi
	jl	.L120
	movl	4(%rbx), %ecx
	movl	%eax, 4(%rbx)
	addq	$4, %rbx
	movl	%ecx, (%rdx)
.L120:
	addq	$4, %rdx
	cmpq	%rdx, %r14
	jne	.L121
	movl	4(%rbx), %edx
	leaq	4(%rbx), %rax
	movl	%esi, 4(%rbx)
	movq	%rax, 40(%rsp)
	movl	%edx, (%r14)
	movq	%rax, %rdx
	subq	%r15, %rdx
	cmpq	%rdx, %r12
	jnb	.L128
	movq	%r14, 104(%rsp)
	movq	%rbx, %r14
	movq	%r10, %rbp
	movl	(%r14), %edi
	cmpq	%r15, %r14
	je	.L124
.L178:
	movq	%r15, %rax
	.p2align 4,,10
	.p2align 3
.L126:
	movl	(%rax), %edx
	cmpl	%edx, %edi
	jl	.L125
	movl	4(%rbp), %ecx
	movl	%edx, 4(%rbp)
	addq	$4, %rbp
	movl	%ecx, (%rax)
.L125:
	addq	$4, %rax
	cmpq	%rax, %r14
	jne	.L126
	leaq	4(%rbp), %rax
	movq	%rax, %rsi
	movq	%rax, 32(%rsp)
	movl	4(%rbp), %eax
	movl	%edi, 4(%rbp)
	movl	%eax, (%r14)
	movq	%rsi, %rax
	subq	%r15, %rax
	cmpq	%rax, %r12
	jnb	.L133
	movq	%r14, 112(%rsp)
	movq	%r12, %r14
	movq	%r10, %r12
.L127:
	movl	0(%rbp), %esi
	movq	%r12, %rbx
	cmpq	%r15, %rbp
	je	.L137
	movq	%r15, %rax
	.p2align 4,,10
	.p2align 3
.L131:
	movl	(%rax), %edx
	cmpl	%edx, %esi
	jl	.L130
	movl	4(%rbx), %ecx
	movl	%edx, 4(%rbx)
	addq	$4, %rbx
	movl	%ecx, (%rax)
.L130:
	addq	$4, %rax
	cmpq	%rax, %rbp
	jne	.L131
	movl	4(%rbx), %eax
	leaq	4(%rbx), %rcx
	movl	%esi, 4(%rbx)
	movl	%eax, 0(%rbp)
	movq	%rcx, %rax
	subq	%r15, %rax
	cmpq	%rax, %r14
	jnb	.L176
	movl	(%rbx), %edi
	movq	%r12, %r13
	cmpq	%r15, %rbx
	je	.L134
.L177:
	movq	%r15, %rax
	.p2align 4,,10
	.p2align 3
.L136:
	movl	(%rax), %edx
	cmpl	%edx, %edi
	jl	.L135
	movl	4(%r13), %esi
	movl	%edx, 4(%r13)
	addq	$4, %r13
	movl	%esi, (%rax)
.L135:
	addq	$4, %rax
	cmpq	%rax, %rbx
	jne	.L136
	movl	4(%r13), %eax
	movl	%edi, 4(%r13)
	leaq	4(%r13), %r12
	movq	%r14, %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	movq	%rcx, 120(%rsp)
	movl	%eax, (%rbx)
	call	quick_sort
	movq	%rbx, %rax
	movq	120(%rsp), %rcx
	subq	%r13, %rax
	cmpq	%rax, %r14
	jb	.L141
.L176:
	movq	%rcx, %r15
.L137:
	movq	%rbp, %rax
	subq	%rbx, %rax
	cmpq	%rax, %r14
	jnb	.L174
	leaq	-4(%r15), %r12
	jmp	.L127
.L162:
	movq	%r14, %r15
.L103:
	movq	16(%rsp), %rax
	movq	80(%rsp), %r14
	subq	%r14, %rax
	cmpq	%r15, %rax
	ja	.L98
.L91:
	addq	$136, %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
.L99:
	.cfi_restore_state
	movq	%rax, 72(%rsp)
.L108:
	movq	8(%rsp), %rax
	subq	%r15, %rax
	cmpq	%rax, %r14
	jnb	.L162
	movq	72(%rsp), %r13
	leaq	-4(%r13), %r10
	jmp	.L96
.L104:
	movq	%rax, 64(%rsp)
.L113:
	movq	(%rsp), %rax
	subq	%r13, %rax
	cmpq	%rax, %r12
	jnb	.L164
.L186:
	movq	64(%rsp), %r15
	leaq	-4(%r15), %r10
	jmp	.L102
.L141:
	movq	%r12, %r15
	movq	%r13, %r12
	movl	(%rbx), %edi
	movq	%r12, %r13
	cmpq	%r15, %rbx
	jne	.L177
	.p2align 4,,10
	.p2align 3
.L134:
	movq	%rbx, %r13
	movq	%r14, %rdx
	movq	%rbx, %rsi
	movq	%rbx, %rdi
	subq	%r12, %r13
	movq	%rcx, 120(%rsp)
	call	quick_sort
	cmpq	%r13, %r14
	movq	120(%rsp), %rcx
	jnb	.L176
	movq	%rcx, %r12
	jmp	.L139
	.p2align 4,,10
	.p2align 3
.L174:
	movq	%r14, %r12
	movq	112(%rsp), %r14
.L133:
	movq	%r14, %rax
	subq	%rbp, %rax
	cmpq	%rax, %r12
	jnb	.L172
.L179:
	movq	32(%rsp), %r15
	movl	(%r14), %edi
	leaq	-4(%r15), %r10
	movq	%r10, %rbp
	cmpq	%r15, %r14
	jne	.L178
.L124:
	movq	%r14, %rax
	movq	%r14, 32(%rsp)
	subq	%rbp, %rax
	cmpq	%rax, %r12
	jb	.L179
.L172:
	movq	%r14, %rbx
	movq	104(%rsp), %r14
.L128:
	movq	%r14, %rdx
	subq	%rbx, %rdx
	cmpq	%rdx, %r12
	jnb	.L170
.L181:
	movq	40(%rsp), %r15
	movl	(%r14), %esi
	leaq	-4(%r15), %r10
	movq	%r10, %rbx
	cmpq	%r15, %r14
	jne	.L180
.L119:
	movq	%r14, %rdx
	movq	%r14, 40(%rsp)
	subq	%rbx, %rdx
	cmpq	%rdx, %r12
	jb	.L181
.L170:
	movq	96(%rsp), %r13
	movq	%r14, %rax
	movq	%r12, %r14
.L123:
	movq	%r13, %rcx
	subq	%rax, %rcx
	cmpq	%rcx, %r14
	jnb	.L168
.L183:
	movq	48(%rsp), %r15
	movl	0(%r13), %r8d
	leaq	-4(%r15), %r10
	movq	%r10, %rax
	cmpq	%r15, %r13
	jne	.L182
.L114:
	movq	%r13, %rcx
	movq	%r13, 48(%rsp)
	subq	%rax, %rcx
	cmpq	%rcx, %r14
	jb	.L183
.L168:
	movq	%r14, %rax
	movq	88(%rsp), %r12
	movq	%r13, %r14
	movq	%rax, %r13
.L118:
	movq	%r12, %rax
	subq	%r14, %rax
	cmpq	%rax, %r13
	jnb	.L166
.L185:
	movq	56(%rsp), %r15
	movl	(%r12), %ecx
	leaq	-4(%r15), %r10
	movq	%r10, %r14
	cmpq	%r15, %r12
	jne	.L184
.L109:
	movq	%r12, %rax
	movq	%r12, 56(%rsp)
	subq	%r14, %rax
	cmpq	%rax, %r13
	jb	.L185
.L166:
	movq	%r13, %rax
	movq	%r12, %r13
	movq	%rax, %r12
	movq	(%rsp), %rax
	subq	%r13, %rax
	cmpq	%rax, %r12
	jb	.L186
.L164:
	movq	(%rsp), %r15
	movq	%r12, %r14
	jmp	.L108
.L93:
	movq	24(%rsp), %rsi
	movq	%rax, %rdi
	movl	(%rsi), %eax
	movq	%rsi, 80(%rsp)
	movl	%edx, (%rsi)
	movl	%eax, -4(%rdi)
	jmp	.L103
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	quick_sort.cold, @function
quick_sort.cold:
.LFSB38:
.L139:
	.cfi_def_cfa_offset 192
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	(%rbx), %edx
	movl	(%r15), %eax
	movq	%r15, %rsi
	movq	%r15, %rdi
	movl	%edx, (%r15)
	movq	%r14, %rdx
	movl	%eax, (%rbx)
	call	quick_sort
	cmpq	%r13, %r14
	jb	.L139
	movq	%r12, %rcx
	jmp	.L176
	.cfi_endproc
.LFE38:
	.text
	.size	quick_sort, .-quick_sort
	.section	.text.unlikely
	.size	quick_sort.cold, .-quick_sort.cold
.LCOLDE0:
	.text
.LHOTE0:
	.p2align 4
	.globl	mincost_sort
	.type	mincost_sort, @function
mincost_sort:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3096, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movl	%esi, -44096(%rbp)
	movslq	%esi, %r13
	movq	%rsp, %rsi
	movq	%rdi, %r12
	movl	%edx, -44092(%rbp)
	leaq	0(,%r13,4), %rdx
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	15(%rdx), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L189
.L219:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L219
.L189:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L220
.L190:
	movq	%rsp, %r15
	movq	%r12, %rsi
	movq	%rdx, -44088(%rbp)
	movq	%r15, %rdi
	movq	%r15, %r14
	call	memcpy@PLT
	movq	-44088(%rbp), %rdx
	leaq	(%r15,%rdx), %rbx
	leaq	-4(%rbx), %r9
	cmpq	$4, %rdx
	jbe	.L200
	movl	-4(%rbx), %esi
	leaq	-4(%r14), %rcx
	cmpq	%r14, %r9
	je	.L194
.L221:
	movq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L196:
	movl	(%rax), %edx
	cmpl	%edx, %esi
	jl	.L195
	movl	4(%rcx), %r10d
	movl	%edx, 4(%rcx)
	addq	$4, %rcx
	movl	%r10d, (%rax)
.L195:
	addq	$4, %rax
	cmpq	%rax, %r9
	jne	.L196
	movl	4(%rcx), %edx
	movl	%esi, 4(%rcx)
	leaq	4(%rcx), %rax
	movq	%r14, %rdi
	movq	%rax, %rsi
	movq	%rax, -44088(%rbp)
	movl	%edx, -4(%rbx)
	movl	$4, %edx
	call	quick_sort
	movq	-44088(%rbp), %rax
	movq	%rbx, %rdx
	subq	%rax, %rdx
	cmpq	$4, %rdx
	jbe	.L200
	movq	%rax, %r14
	movl	-4(%rbx), %esi
	leaq	-4(%r14), %rcx
	cmpq	%r14, %r9
	jne	.L221
.L194:
	movl	(%r14), %eax
	movl	%esi, (%r14)
	movl	$4, %edx
	movq	%r14, %rsi
	movq	%r14, %rdi
	movl	%eax, -4(%rbx)
	call	quick_sort
	movq	%rbx, %rax
	subq	%r14, %rax
	cmpq	$4, %rax
	jbe	.L200
	.p2align 4,,10
	.p2align 3
.L199:
	movl	-4(%rbx), %edx
	movl	(%r14), %eax
	movq	%r14, %rsi
	movq	%r14, %rdi
	movl	%edx, (%r14)
	movl	$4, %edx
	movl	%eax, -4(%rbx)
	call	quick_sort
	jmp	.L199
	.p2align 4,,10
	.p2align 3
.L200:
	movl	-44096(%rbp), %ebx
	xorl	%eax, %eax
	xorl	%r10d, %r10d
	testl	%ebx, %ebx
	jle	.L187
	.p2align 4,,10
	.p2align 3
.L201:
	movslq	(%r15,%rax,4), %rdx
	movl	%eax, -40064(%rbp,%rdx,4)
	addq	$1, %rax
	cmpq	%r13, %rax
	jne	.L201
	leaq	-44080(%rbp), %r8
	xorl	%eax, %eax
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
	movl	$500, %ecx
	movq	%r8, %rdi
	rep stosq
	movl	$0, (%rdi)
	jmp	.L205
	.p2align 4,,10
	.p2align 3
.L203:
	addq	$1, %r9
	cmpq	%r13, %r9
	je	.L187
.L205:
	movl	(%r8,%r9,4), %edx
	movslq	%r9d, %rax
	testl	%edx, %edx
	jne	.L203
	xorl	%esi, %esi
	movl	$536870912, %ecx
	.p2align 4,,10
	.p2align 3
.L204:
	movl	$1, -44080(%rbp,%rax,4)
	movslq	(%r12,%rax,4), %rax
	movl	%edx, %edi
	addl	$1, %edx
	addl	%eax, %esi
	cmpl	%eax, %ecx
	cmovg	%eax, %ecx
	movslq	-40064(%rbp,%rax,4), %rax
	movl	-44080(%rbp,%rax,4), %r11d
	testl	%r11d, %r11d
	je	.L204
	leal	2(%rdi), %eax
	subl	$1, %edi
	leal	(%rsi,%rcx), %edx
	imull	-44092(%rbp), %eax
	imull	%ecx, %edi
	addl	%edx, %eax
	addl	%esi, %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	addq	$1, %r9
	addl	%eax, %r10d
	cmpq	%r13, %r9
	jne	.L205
.L187:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L222
	leaq	-40(%rbp), %rsp
	movl	%r10d, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L220:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L190
.L222:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	mincost_sort, .-mincost_sort
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	get_uint
	movq	%rsp, %rcx
	movl	%eax, %r12d
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L225
.L247:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L247
.L225:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L248
.L226:
	movq	%rsp, %rsi
	movq	%rsi, -72(%rbp)
	testl	%r12d, %r12d
	jle	.L238
	leal	-1(%r12), %eax
	movq	%rsi, %r15
	movl	$536870912, %r13d
	leaq	4(%rsi,%rax,4), %rbx
	.p2align 4,,10
	.p2align 3
.L234:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jnb	.L249
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rax), %eax
.L229:
	leal	-48(%rax), %ecx
	movl	%eax, %r14d
	cmpl	$9, %ecx
	ja	.L230
	xorl	%r14d, %r14d
.L246:
	movq	stdin(%rip), %rdi
	jmp	.L233
	.p2align 4,,10
	.p2align 3
.L231:
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rax), %eax
	leal	-48(%rax), %ecx
	cmpl	$9, %ecx
	ja	.L230
.L233:
	andl	$15, %eax
	leal	(%r14,%r14,4), %ecx
	leal	(%rax,%rcx,2), %r14d
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L231
	call	__uflow@PLT
	leal	-48(%rax), %ecx
	cmpl	$9, %ecx
	jbe	.L246
	.p2align 4,,10
	.p2align 3
.L230:
	cmpl	%r14d, %r13d
	movl	%r14d, (%r15)
	cmovg	%r14d, %r13d
	addq	$4, %r15
	cmpq	%r15, %rbx
	jne	.L234
.L227:
	movq	-72(%rbp), %rdi
	movl	%r13d, %edx
	movl	%r12d, %esi
	call	mincost_sort
	movl	%eax, %edi
	call	put_uint
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L250
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$10, (%rax)
.L236:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L251
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L249:
	.cfi_restore_state
	call	__uflow@PLT
	jmp	.L229
.L248:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L226
.L238:
	movl	$536870912, %r13d
	jmp	.L227
.L250:
	movl	$10, %esi
	call	__overflow@PLT
	jmp	.L236
.L251:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	get_uint
	.type	get_uint, @function
get_uint:
.LFB35:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jnb	.L13
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	leal	-48(%rax), %edx
	movl	%eax, %r12d
	cmpl	$9, %edx
	ja	.L1
	xorl	%r12d, %r12d
.L11:
	movq	stdin(%rip), %rdi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
	leal	-48(%rax), %edx
	cmpl	$9, %edx
	ja	.L1
.L7:
	andl	$15, %eax
	leal	(%r12,%r12,4), %edx
	leal	(%rax,%rdx,2), %r12d
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L5
	call	__uflow@PLT
	leal	-48(%rax), %edx
	cmpl	$9, %edx
	jbe	.L11
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	call	__uflow@PLT
	jmp	.L3
	.cfi_endproc
.LFE35:
	.size	get_uint, .-get_uint
	.p2align 4
	.globl	put_uint
	.type	put_uint, @function
put_uint:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	stdout(%rip), %r8
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	40(%r8), %rcx
	movq	48(%r8), %rsi
	testl	%edi, %edi
	je	.L84
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	movl	%eax, %ebx
	addl	%edx, %edx
	subl	%edx, %edi
	leal	48(%rdi), %ebp
	movb	%bpl, 13(%rsp)
	testl	%eax, %eax
	je	.L19
	movslq	%eax, %rdx
	movl	%eax, %edi
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %edi
	sarq	$34, %rdx
	subl	%edi, %edx
	leal	(%rdx,%rdx,4), %edi
	addl	%edi, %edi
	subl	%edi, %eax
	addl	$48, %eax
	movb	%al, 14(%rsp)
	testl	%edx, %edx
	je	.L43
	movslq	%edx, %rax
	movl	%edx, %edi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edi
	sarq	$34, %rax
	subl	%edi, %eax
	leal	(%rax,%rax,4), %edi
	addl	%edi, %edi
	subl	%edi, %edx
	addl	$48, %edx
	movb	%dl, 15(%rsp)
	testl	%eax, %eax
	je	.L44
	movslq	%eax, %rdx
	movl	%eax, %edi
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %edi
	sarq	$34, %rdx
	subl	%edi, %edx
	leal	(%rdx,%rdx,4), %edi
	addl	%edi, %edi
	subl	%edi, %eax
	addl	$48, %eax
	movb	%al, 16(%rsp)
	testl	%edx, %edx
	je	.L45
	movslq	%edx, %rax
	movl	%edx, %edi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edi
	sarq	$34, %rax
	subl	%edi, %eax
	leal	(%rax,%rax,4), %edi
	addl	%edi, %edi
	subl	%edi, %edx
	addl	$48, %edx
	movb	%dl, 17(%rsp)
	testl	%eax, %eax
	je	.L46
	movslq	%eax, %rdx
	movl	%eax, %edi
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %edi
	sarq	$34, %rdx
	subl	%edi, %edx
	leal	(%rdx,%rdx,4), %edi
	addl	%edi, %edi
	subl	%edi, %eax
	addl	$48, %eax
	movb	%al, 18(%rsp)
	testl	%edx, %edx
	je	.L47
	movslq	%edx, %rax
	movl	%edx, %edi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edi
	sarq	$34, %rax
	subl	%edi, %eax
	leal	(%rax,%rax,4), %edi
	addl	%edi, %edi
	subl	%edi, %edx
	addl	$48, %edx
	movb	%dl, 19(%rsp)
	testl	%eax, %eax
	je	.L48
	movslq	%eax, %rdx
	movl	%eax, %edi
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %edi
	sarq	$34, %rdx
	subl	%edi, %edx
	leal	(%rdx,%rdx,4), %edi
	addl	%edi, %edi
	subl	%edi, %eax
	addl	$48, %eax
	movb	%al, 20(%rsp)
	testl	%edx, %edx
	je	.L49
	movslq	%edx, %rax
	movl	%edx, %edi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edi
	sarq	$34, %rax
	subl	%edi, %eax
	leal	(%rax,%rax,4), %edi
	addl	%edi, %edi
	subl	%edi, %edx
	addl	$48, %edx
	movb	%dl, 21(%rsp)
	testl	%eax, %eax
	je	.L50
	addl	$48, %eax
	movl	$9, %ebx
	movb	%al, 22(%rsp)
.L19:
	movslq	%ebx, %rax
	movzbl	13(%rsp,%rax), %eax
	cmpq	%rsi, %rcx
	jnb	.L20
	leaq	1(%rcx), %rdx
	movq	%rdx, 40(%r8)
	movb	%al, (%rcx)
.L21:
	leal	-1(%rbx), %r12d
	testl	%ebx, %ebx
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r12d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	%rax, 48(%rdi)
	jbe	.L23
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L24:
	leal	-2(%rbx), %r13d
	testl	%r12d, %r12d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r13d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L25
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L26:
	leal	-3(%rbx), %r12d
	testl	%r13d, %r13d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r12d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L27
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L28:
	leal	-4(%rbx), %r13d
	testl	%r12d, %r12d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r13d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L29
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L30:
	leal	-5(%rbx), %r12d
	testl	%r13d, %r13d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r12d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L31
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L32:
	leal	-6(%rbx), %r13d
	testl	%r12d, %r12d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r13d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L33
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L34:
	leal	-7(%rbx), %r12d
	testl	%r13d, %r13d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%r12d, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L35
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L36:
	subl	$8, %ebx
	testl	%r12d, %r12d
	je	.L14
	movq	stdout(%rip), %rdi
	movslq	%ebx, %rax
	movzbl	13(%rsp,%rax), %edx
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L37
	leaq	1(%rax), %rcx
	movq	%rcx, 40(%rdi)
	movb	%dl, (%rax)
.L38:
	testl	%ebx, %ebx
	je	.L14
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L39
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	%bpl, (%rax)
.L14:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L84:
	.cfi_restore_state
	cmpq	%rsi, %rcx
	jnb	.L85
	leaq	1(%rcx), %rax
	movq	%rax, 40(%r8)
	movb	$48, (%rcx)
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L44:
	movl	$2, %ebx
	jmp	.L19
.L25:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L43:
	movl	$1, %ebx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movzbl	%al, %esi
	movq	%r8, %rdi
	call	__overflow@PLT
	jmp	.L21
.L23:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L24
.L45:
	movl	$3, %ebx
	jmp	.L19
.L46:
	movl	$4, %ebx
	jmp	.L19
.L27:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L28
.L47:
	movl	$5, %ebx
	jmp	.L19
.L29:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L30
.L48:
	movl	$6, %ebx
	jmp	.L19
.L31:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L32
.L85:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	movl	$48, %esi
	movq	%r8, %rdi
.L82:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	jmp	__overflow@PLT
.L33:
	.cfi_restore_state
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L34
.L49:
	movl	$7, %ebx
	jmp	.L19
.L35:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L36
.L50:
	movl	$8, %ebx
	jmp	.L19
.L37:
	movzbl	%dl, %esi
	call	__overflow@PLT
	jmp	.L38
.L39:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L83
	movzbl	%bpl, %esi
	jmp	.L82
.L83:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	put_uint, .-put_uint
	.p2align 4
	.globl	partition
	.type	partition, @function
partition:
.LFB37:
	.cfi_startproc
	endbr64
	leaq	-4(%rsi), %r8
	movl	-4(%rsi), %ecx
	leaq	-4(%rdi), %rdx
	cmpq	%r8, %rdi
	je	.L87
	.p2align 4,,10
	.p2align 3
.L89:
	movl	(%rdi), %eax
	cmpl	%ecx, %eax
	jg	.L88
	movl	4(%rdx), %r9d
	movl	%eax, 4(%rdx)
	addq	$4, %rdx
	movl	%r9d, (%rdi)
.L88:
	addq	$4, %rdi
	cmpq	%r8, %rdi
	jne	.L89
	leaq	4(%rdx), %r8
.L87:
	movl	4(%rdx), %eax
	movl	%ecx, 4(%rdx)
	movl	%eax, -4(%rsi)
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE37:
	.size	partition, .-partition
	.section	.text.unlikely,"ax",@progbits
.LCOLDB0:
	.text
.LHOTB0:
	.p2align 4
	.globl	quick_sort
	.type	quick_sort, @function
quick_sort:
.LFB38:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rdi, %r11
	movq	%rsi, %rax
	movq	%rsi, %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	subq	$4, %rdi
	subq	%r11, %rax
	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	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%rsi, 16(%rsp)
	movq	%rdi, 24(%rsp)
	cmpq	%rax, %rdx
	jnb	.L91
	movq	%rdx, %r15
	movq	%r11, %r14
.L98:
	movq	16(%rsp), %rax
	leaq	-4(%r14), %r11
	movq	%r11, %r10
	movl	-4(%rax), %edx
	cmpq	%r14, 24(%rsp)
	je	.L93
	movq	%r14, %rax
.L95:
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jl	.L94
	movl	4(%r10), %esi
	movl	%ecx, 4(%r10)
	addq	$4, %r10
	movl	%esi, (%rax)
.L94:
	addq	$4, %rax
	cmpq	%rax, 24(%rsp)
	jne	.L95
	movl	4(%r10), %eax
	movq	16(%rsp), %rsi
	leaq	4(%r10), %rdi
	movl	%edx, 4(%r10)
	movq	%rdi, 80(%rsp)
	movl	%eax, -4(%rsi)
	movq	%rdi, %rax
	subq	%r14, %rax
	cmpq	%rax, %r15
	jnb	.L103
	movq	%r10, 8(%rsp)
	movq	%r14, %r13
	movq	%r11, %r10
	movq	%r15, %r14
.L96:
	movq	8(%rsp), %rax
	movq	%r10, %r15
	movl	(%rax), %edx
	cmpq	%r13, %rax
	je	.L99
	movq	%r13, %rax
.L101:
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jl	.L100
	movl	4(%r15), %esi
	movl	%ecx, 4(%r15)
	addq	$4, %r15
	movl	%esi, (%rax)
.L100:
	addq	$4, %rax
	cmpq	%rax, 8(%rsp)
	jne	.L101
	movl	4(%r15), %eax
	movq	8(%rsp), %rsi
	leaq	4(%r15), %rdi
	movl	%edx, 4(%r15)
	movq	%rdi, 72(%rsp)
	movl	%eax, (%rsi)
	movq	%rdi, %rax
	subq	%r13, %rax
	cmpq	%rax, %r14
	jnb	.L108
	movq	%r15, (%rsp)
	movq	%r14, %r12
	movq	%r13, %r15
.L102:
	movq	(%rsp), %rax
	movq	%r10, %r13
	movl	(%rax), %edx
	cmpq	%r15, %rax
	je	.L104
	movq	%r15, %rax
.L106:
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jl	.L105
	movl	4(%r13), %esi
	movl	%ecx, 4(%r13)
	addq	$4, %r13
	movl	%esi, (%rax)
.L105:
	addq	$4, %rax
	cmpq	%rax, (%rsp)
	jne	.L106
	movl	4(%r13), %eax
	movq	(%rsp), %rsi
	leaq	4(%r13), %rdi
	movl	%edx, 4(%r13)
	movq	%rdi, 64(%rsp)
	movl	%eax, (%rsi)
	movq	%rdi, %rax
	subq	%r15, %rax
	cmpq	%rax, %r12
	jnb	.L113
	movq	%r12, %rax
	movq	%r13, %r12
	movq	%r10, %r14
	movl	(%r12), %ecx
	movq	%rax, %r13
	cmpq	%r15, %r12
	je	.L109
.L184:
	movq	%r15, %rax
.L111:
	movl	(%rax), %edx
	cmpl	%edx, %ecx
	jl	.L110
	movl	4(%r14), %esi
	movl	%edx, 4(%r14)
	addq	$4, %r14
	movl	%esi, (%rax)
.L110:
	addq	$4, %rax
	cmpq	%rax, %r12
	jne	.L111
	leaq	4(%r14), %rax
	movq	%rax, %rdi
	movq	%rax, 56(%rsp)
	movl	4(%r14), %eax
	movl	%ecx, 4(%r14)
	movl	%eax, (%r12)
	movq	%rdi, %rax
	subq	%r15, %rax
	cmpq	%rax, %r13
	jnb	.L118
	movq	%r13, %rax
	movq	%r14, %r13
	movq	%r12, 88(%rsp)
	movq	%rax, %r14
	movl	0(%r13), %r8d
	movq	%r10, %rax
	cmpq	%r15, %r13
	je	.L114
.L182:
	movq	%r15, %rcx
.L116:
	movl	(%rcx), %esi
	cmpl	%esi, %r8d
	jl	.L115
	movl	4(%rax), %edx
	movl	%esi, 4(%rax)
	addq	$4, %rax
	movl	%edx, (%rcx)
.L115:
	addq	$4, %rcx
	cmpq	%rcx, %r13
	jne	.L116
	movl	4(%rax), %ecx
	leaq	4(%rax), %rdi
	movl	%r8d, 4(%rax)
	movq	%rdi, 48(%rsp)
	subq	%r15, %rdi
	movl	%ecx, 0(%r13)
	cmpq	%rdi, %r14
	jnb	.L123
	movq	%r14, %r12
	movq	%rax, %r14
	movq	%r13, 96(%rsp)
	movq	%r10, %rbx
	movl	(%r14), %esi
	cmpq	%r15, %r14
	je	.L119
.L180:
	movq	%r15, %rdx
	.p2align 4,,10
	.p2align 3
.L121:
	movl	(%rdx), %eax
	cmpl	%eax, %esi
	jl	.L120
	movl	4(%rbx), %ecx
	movl	%eax, 4(%rbx)
	addq	$4, %rbx
	movl	%ecx, (%rdx)
.L120:
	addq	$4, %rdx
	cmpq	%rdx, %r14
	jne	.L121
	movl	4(%rbx), %edx
	leaq	4(%rbx), %rax
	movl	%esi, 4(%rbx)
	movq	%rax, 40(%rsp)
	movl	%edx, (%r14)
	movq	%rax, %rdx
	subq	%r15, %rdx
	cmpq	%rdx, %r12
	jnb	.L128
	movq	%r14, 104(%rsp)
	movq	%rbx, %r14
	movq	%r10, %rbp
	movl	(%r14), %edi
	cmpq	%r15, %r14
	je	.L124
.L178:
	movq	%r15, %rax
	.p2align 4,,10
	.p2align 3
.L126:
	movl	(%rax), %edx
	cmpl	%edx, %edi
	jl	.L125
	movl	4(%rbp), %ecx
	movl	%edx, 4(%rbp)
	addq	$4, %rbp
	movl	%ecx, (%rax)
.L125:
	addq	$4, %rax
	cmpq	%rax, %r14
	jne	.L126
	leaq	4(%rbp), %rax
	movq	%rax, %rsi
	movq	%rax, 32(%rsp)
	movl	4(%rbp), %eax
	movl	%edi, 4(%rbp)
	movl	%eax, (%r14)
	movq	%rsi, %rax
	subq	%r15, %rax
	cmpq	%rax, %r12
	jnb	.L133
	movq	%r14, 112(%rsp)
	movq	%r12, %r14
	movq	%r10, %r12
.L127:
	movl	0(%rbp), %esi
	movq	%r12, %rbx
	cmpq	%r15, %rbp
	je	.L137
	movq	%r15, %rax
	.p2align 4,,10
	.p2align 3
.L131:
	movl	(%rax), %edx
	cmpl	%edx, %esi
	jl	.L130
	movl	4(%rbx), %ecx
	movl	%edx, 4(%rbx)
	addq	$4, %rbx
	movl	%ecx, (%rax)
.L130:
	addq	$4, %rax
	cmpq	%rax, %rbp
	jne	.L131
	movl	4(%rbx), %eax
	leaq	4(%rbx), %rcx
	movl	%esi, 4(%rbx)
	movl	%eax, 0(%rbp)
	movq	%rcx, %rax
	subq	%r15, %rax
	cmpq	%rax, %r14
	jnb	.L176
	movl	(%rbx), %edi
	movq	%r12, %r13
	cmpq	%r15, %rbx
	je	.L134
.L177:
	movq	%r15, %rax
	.p2align 4,,10
	.p2align 3
.L136:
	movl	(%rax), %edx
	cmpl	%edx, %edi
	jl	.L135
	movl	4(%r13), %esi
	movl	%edx, 4(%r13)
	addq	$4, %r13
	movl	%esi, (%rax)
.L135:
	addq	$4, %rax
	cmpq	%rax, %rbx
	jne	.L136
	movl	4(%r13), %eax
	movl	%edi, 4(%r13)
	leaq	4(%r13), %r12
	movq	%r14, %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	movq	%rcx, 120(%rsp)
	movl	%eax, (%rbx)
	call	quick_sort
	movq	%rbx, %rax
	movq	120(%rsp), %rcx
	subq	%r13, %rax
	cmpq	%rax, %r14
	jb	.L141
.L176:
	movq	%rcx, %r15
.L137:
	movq	%rbp, %rax
	subq	%rbx, %rax
	cmpq	%rax, %r14
	jnb	.L174
	leaq	-4(%r15), %r12
	jmp	.L127
.L162:
	movq	%r14, %r15
.L103:
	movq	16(%rsp), %rax
	movq	80(%rsp), %r14
	subq	%r14, %rax
	cmpq	%r15, %rax
	ja	.L98
.L91:
	addq	$136, %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
.L99:
	.cfi_restore_state
	movq	%rax, 72(%rsp)
.L108:
	movq	8(%rsp), %rax
	subq	%r15, %rax
	cmpq	%rax, %r14
	jnb	.L162
	movq	72(%rsp), %r13
	leaq	-4(%r13), %r10
	jmp	.L96
.L104:
	movq	%rax, 64(%rsp)
.L113:
	movq	(%rsp), %rax
	subq	%r13, %rax
	cmpq	%rax, %r12
	jnb	.L164
.L186:
	movq	64(%rsp), %r15
	leaq	-4(%r15), %r10
	jmp	.L102
.L141:
	movq	%r12, %r15
	movq	%r13, %r12
	movl	(%rbx), %edi
	movq	%r12, %r13
	cmpq	%r15, %rbx
	jne	.L177
	.p2align 4,,10
	.p2align 3
.L134:
	movq	%rbx, %r13
	movq	%r14, %rdx
	movq	%rbx, %rsi
	movq	%rbx, %rdi
	subq	%r12, %r13
	movq	%rcx, 120(%rsp)
	call	quick_sort
	cmpq	%r13, %r14
	movq	120(%rsp), %rcx
	jnb	.L176
	movq	%rcx, %r12
	jmp	.L139
	.p2align 4,,10
	.p2align 3
.L174:
	movq	%r14, %r12
	movq	112(%rsp), %r14
.L133:
	movq	%r14, %rax
	subq	%rbp, %rax
	cmpq	%rax, %r12
	jnb	.L172
.L179:
	movq	32(%rsp), %r15
	movl	(%r14), %edi
	leaq	-4(%r15), %r10
	movq	%r10, %rbp
	cmpq	%r15, %r14
	jne	.L178
.L124:
	movq	%r14, %rax
	movq	%r14, 32(%rsp)
	subq	%rbp, %rax
	cmpq	%rax, %r12
	jb	.L179
.L172:
	movq	%r14, %rbx
	movq	104(%rsp), %r14
.L128:
	movq	%r14, %rdx
	subq	%rbx, %rdx
	cmpq	%rdx, %r12
	jnb	.L170
.L181:
	movq	40(%rsp), %r15
	movl	(%r14), %esi
	leaq	-4(%r15), %r10
	movq	%r10, %rbx
	cmpq	%r15, %r14
	jne	.L180
.L119:
	movq	%r14, %rdx
	movq	%r14, 40(%rsp)
	subq	%rbx, %rdx
	cmpq	%rdx, %r12
	jb	.L181
.L170:
	movq	96(%rsp), %r13
	movq	%r14, %rax
	movq	%r12, %r14
.L123:
	movq	%r13, %rcx
	subq	%rax, %rcx
	cmpq	%rcx, %r14
	jnb	.L168
.L183:
	movq	48(%rsp), %r15
	movl	0(%r13), %r8d
	leaq	-4(%r15), %r10
	movq	%r10, %rax
	cmpq	%r15, %r13
	jne	.L182
.L114:
	movq	%r13, %rcx
	movq	%r13, 48(%rsp)
	subq	%rax, %rcx
	cmpq	%rcx, %r14
	jb	.L183
.L168:
	movq	%r14, %rax
	movq	88(%rsp), %r12
	movq	%r13, %r14
	movq	%rax, %r13
.L118:
	movq	%r12, %rax
	subq	%r14, %rax
	cmpq	%rax, %r13
	jnb	.L166
.L185:
	movq	56(%rsp), %r15
	movl	(%r12), %ecx
	leaq	-4(%r15), %r10
	movq	%r10, %r14
	cmpq	%r15, %r12
	jne	.L184
.L109:
	movq	%r12, %rax
	movq	%r12, 56(%rsp)
	subq	%r14, %rax
	cmpq	%rax, %r13
	jb	.L185
.L166:
	movq	%r13, %rax
	movq	%r12, %r13
	movq	%rax, %r12
	movq	(%rsp), %rax
	subq	%r13, %rax
	cmpq	%rax, %r12
	jb	.L186
.L164:
	movq	(%rsp), %r15
	movq	%r12, %r14
	jmp	.L108
.L93:
	movq	24(%rsp), %rsi
	movq	%rax, %rdi
	movl	(%rsi), %eax
	movq	%rsi, 80(%rsp)
	movl	%edx, (%rsi)
	movl	%eax, -4(%rdi)
	jmp	.L103
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	quick_sort.cold, @function
quick_sort.cold:
.LFSB38:
.L139:
	.cfi_def_cfa_offset 192
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	movl	(%rbx), %edx
	movl	(%r15), %eax
	movq	%r15, %rsi
	movq	%r15, %rdi
	movl	%edx, (%r15)
	movq	%r14, %rdx
	movl	%eax, (%rbx)
	call	quick_sort
	cmpq	%r13, %r14
	jb	.L139
	movq	%r12, %rcx
	jmp	.L176
	.cfi_endproc
.LFE38:
	.text
	.size	quick_sort, .-quick_sort
	.section	.text.unlikely
	.size	quick_sort.cold, .-quick_sort.cold
.LCOLDE0:
	.text
.LHOTE0:
	.p2align 4
	.globl	mincost_sort
	.type	mincost_sort, @function
mincost_sort:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3096, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movl	%esi, -44096(%rbp)
	movslq	%esi, %r13
	movq	%rsp, %rsi
	movq	%rdi, %r12
	movl	%edx, -44092(%rbp)
	leaq	0(,%r13,4), %rdx
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	15(%rdx), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L189
.L219:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L219
.L189:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L220
.L190:
	movq	%rsp, %r15
	movq	%r12, %rsi
	movq	%rdx, -44088(%rbp)
	movq	%r15, %rdi
	movq	%r15, %r14
	call	memcpy@PLT
	movq	-44088(%rbp), %rdx
	leaq	(%r15,%rdx), %rbx
	leaq	-4(%rbx), %r9
	cmpq	$4, %rdx
	jbe	.L200
	movl	-4(%rbx), %esi
	leaq	-4(%r14), %rcx
	cmpq	%r14, %r9
	je	.L194
.L221:
	movq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L196:
	movl	(%rax), %edx
	cmpl	%edx, %esi
	jl	.L195
	movl	4(%rcx), %r10d
	movl	%edx, 4(%rcx)
	addq	$4, %rcx
	movl	%r10d, (%rax)
.L195:
	addq	$4, %rax
	cmpq	%rax, %r9
	jne	.L196
	movl	4(%rcx), %edx
	movl	%esi, 4(%rcx)
	leaq	4(%rcx), %rax
	movq	%r14, %rdi
	movq	%rax, %rsi
	movq	%rax, -44088(%rbp)
	movl	%edx, -4(%rbx)
	movl	$4, %edx
	call	quick_sort
	movq	-44088(%rbp), %rax
	movq	%rbx, %rdx
	subq	%rax, %rdx
	cmpq	$4, %rdx
	jbe	.L200
	movq	%rax, %r14
	movl	-4(%rbx), %esi
	leaq	-4(%r14), %rcx
	cmpq	%r14, %r9
	jne	.L221
.L194:
	movl	(%r14), %eax
	movl	%esi, (%r14)
	movl	$4, %edx
	movq	%r14, %rsi
	movq	%r14, %rdi
	movl	%eax, -4(%rbx)
	call	quick_sort
	movq	%rbx, %rax
	subq	%r14, %rax
	cmpq	$4, %rax
	jbe	.L200
	.p2align 4,,10
	.p2align 3
.L199:
	movl	-4(%rbx), %edx
	movl	(%r14), %eax
	movq	%r14, %rsi
	movq	%r14, %rdi
	movl	%edx, (%r14)
	movl	$4, %edx
	movl	%eax, -4(%rbx)
	call	quick_sort
	jmp	.L199
	.p2align 4,,10
	.p2align 3
.L200:
	movl	-44096(%rbp), %ebx
	xorl	%eax, %eax
	xorl	%r10d, %r10d
	testl	%ebx, %ebx
	jle	.L187
	.p2align 4,,10
	.p2align 3
.L201:
	movslq	(%r15,%rax,4), %rdx
	movl	%eax, -40064(%rbp,%rdx,4)
	addq	$1, %rax
	cmpq	%r13, %rax
	jne	.L201
	leaq	-44080(%rbp), %r8
	xorl	%eax, %eax
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
	movl	$500, %ecx
	movq	%r8, %rdi
	rep stosq
	movl	$0, (%rdi)
	jmp	.L205
	.p2align 4,,10
	.p2align 3
.L203:
	addq	$1, %r9
	cmpq	%r13, %r9
	je	.L187
.L205:
	movl	(%r8,%r9,4), %edx
	movslq	%r9d, %rax
	testl	%edx, %edx
	jne	.L203
	xorl	%esi, %esi
	movl	$536870912, %ecx
	.p2align 4,,10
	.p2align 3
.L204:
	movl	$1, -44080(%rbp,%rax,4)
	movslq	(%r12,%rax,4), %rax
	movl	%edx, %edi
	addl	$1, %edx
	addl	%eax, %esi
	cmpl	%eax, %ecx
	cmovg	%eax, %ecx
	movslq	-40064(%rbp,%rax,4), %rax
	movl	-44080(%rbp,%rax,4), %r11d
	testl	%r11d, %r11d
	je	.L204
	leal	2(%rdi), %eax
	subl	$1, %edi
	leal	(%rsi,%rcx), %edx
	imull	-44092(%rbp), %eax
	imull	%ecx, %edi
	addl	%edx, %eax
	addl	%esi, %edi
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	addq	$1, %r9
	addl	%eax, %r10d
	cmpq	%r13, %r9
	jne	.L205
.L187:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L222
	leaq	-40(%rbp), %rsp
	movl	%r10d, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L220:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L190
.L222:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	mincost_sort, .-mincost_sort
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	get_uint
	movq	%rsp, %rcx
	movl	%eax, %r12d
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L225
.L247:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L247
.L225:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L248
.L226:
	movq	%rsp, %rsi
	movq	%rsi, -72(%rbp)
	testl	%r12d, %r12d
	jle	.L238
	leal	-1(%r12), %eax
	movq	%rsi, %r15
	movl	$536870912, %r13d
	leaq	4(%rsi,%rax,4), %rbx
	.p2align 4,,10
	.p2align 3
.L234:
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jnb	.L249
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rax), %eax
.L229:
	leal	-48(%rax), %ecx
	movl	%eax, %r14d
	cmpl	$9, %ecx
	ja	.L230
	xorl	%r14d, %r14d
.L246:
	movq	stdin(%rip), %rdi
	jmp	.L233
	.p2align 4,,10
	.p2align 3
.L231:
	leaq	1(%rax), %rcx
	movq	%rcx, 8(%rdi)
	movzbl	(%rax), %eax
	leal	-48(%rax), %ecx
	cmpl	$9, %ecx
	ja	.L230
.L233:
	andl	$15, %eax
	leal	(%r14,%r14,4), %ecx
	leal	(%rax,%rcx,2), %r14d
	movq	8(%rdi), %rax
	cmpq	16(%rdi), %rax
	jb	.L231
	call	__uflow@PLT
	leal	-48(%rax), %ecx
	cmpl	$9, %ecx
	jbe	.L246
	.p2align 4,,10
	.p2align 3
.L230:
	cmpl	%r14d, %r13d
	movl	%r14d, (%r15)
	cmovg	%r14d, %r13d
	addq	$4, %r15
	cmpq	%r15, %rbx
	jne	.L234
.L227:
	movq	-72(%rbp), %rdi
	movl	%r13d, %edx
	movl	%r12d, %esi
	call	mincost_sort
	movl	%eax, %edi
	call	put_uint
	movq	stdout(%rip), %rdi
	movq	40(%rdi), %rax
	cmpq	48(%rdi), %rax
	jnb	.L250
	leaq	1(%rax), %rdx
	movq	%rdx, 40(%rdi)
	movb	$10, (%rax)
.L236:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L251
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L249:
	.cfi_restore_state
	call	__uflow@PLT
	jmp	.L229
.L248:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L226
.L238:
	movl	$536870912, %r13d
	jmp	.L227
.L250:
	movl	$10, %esi
	call	__overflow@PLT
	jmp	.L236
.L251:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <memory.h>

#define MIN(x, y) ((x) <= (y) ? (x) : (y))
int get_uint() {
    int n = 0;
    int c = getchar_unlocked();
    if(c < 48 || 57 < c) return c;
    while(47 < c && c < 58) {
        n = 10 * n + (c & 0xf);
        c = getchar_unlocked();
    }
    return n;
}
void put_uint(int n) {
    if(!n) {
        putchar_unlocked('0');
        return;
    }
    char buf[11];
    int i = 0;
    while(n) buf[i++] = (char)(n % 10 + '0'), n /= 10;
    while(i--)putchar_unlocked(buf[i]);
}
void *partition(int *first, int *last) {
    int pivot = *(last - 1);
    int *p = first - 1;
    for(int *it = first; it != last - 1; ++it) {
        if(*it <= pivot) {
            p++;
            int tmp = *p;
            *p = *it;
            *it = tmp;
        }
    }
    int tmp = *++p;
    *p = pivot;
    *(last - 1) = tmp;
    return p;
}
void quick_sort(void *first, void *last, size_t N) {
    if(last - first <= N) return;
    void *mid = partition(first, last);
    quick_sort(first, mid, N);
    quick_sort(mid, last, N);
}
int mincost_sort(const int *a, const int N, const int minw) {
    int cnt = 0;
    int b[N];
    memcpy(b, a, N * sizeof(int));
    quick_sort(b, b + N, sizeof(int));
    int pos[10001];
    for(int i = 0; i < N; ++i) pos[b[i]] = i;
    int flag[1001] = {};
    for(int i = 0; i < N; ++i) {
        if(flag[i]) continue;
        int cur = i;
        int sum = 0;
        int num = 0;
        int mina = 1 << 29;
        while(!flag[cur]) {
            flag[cur] = 1;
            num++;
            sum += a[cur];
            mina = MIN(mina, a[cur]);
            cur = pos[a[cur]];
        }
        // [ sum + (num-2)*mina + 2(mina+minw) - (num-1)*(mina-minw) ] -> [ sum + mina + (n+1)*minw ]
        cnt += MIN(sum + (num - 2) * mina, sum + mina + (num + 1) * minw);
    }
    return cnt;
}
int main(int argc, char **argv) {
    int n = get_uint();
    int w[n];
    int minw = 1 << 29;
    for(int i = 0; i < n; ++i) {
        w[i] = get_uint();
        minw = MIN(minw, w[i]);
    }
    put_uint(mincost_sort(w, n, minw));
    putchar_unlocked('\n');
    return 0;
}


4
8 3 2 1
 5
0 5 3 4 2
 5
0 5 3 1 2
 5
1 8 3 4 2
 5
0 9 3 1 2
 5
1 8 3 4 0
 5
0 15 3 1 2
 5
1 5 3 8 2
 5
0 5 6 4 2
 5
0 5 3 1 4

14
 7
 12
 10
 16
 9
 22
 17
 19
 11

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 <memory.h>

#define MIN(x, y) ((x) <= (y) ? (x) : (y))
int get_uint() {
    int n = 0;
    int c = getchar_unlocked();
    if(c < 48 || 57 < c) return c;
    while(47 < c && c < 58) {
        n = 10 * n + (c & 0xf);
        c = getchar_unlocked();
    }
    return n;
}
void put_uint(int n) {
    if(!n) {
        putchar_unlocked('0');
        return;
    }
    char buf[11];
    int i = 0;
    while(n) buf[i++] = (char)(n % 10 + '0'), n /= 10;
    while(i--)putchar_unlocked(buf[i]);
}
void *partition(int *first, int *last) {
    int pivot = *(last - 1);
    int *p = first - 1;
    for(int *it = first; it != last - 1; ++it) {
        if(*it <= pivot) {
            p++;
            int tmp = *p;
            *p = *it;
            *it = tmp;
        }
    }
    int tmp = *++p;
    *p = pivot;
    *(last - 1) = tmp;
    return p;
}
void quick_sort(void *first, void *last, size_t N) {
    if(last - first <= N) return;
    void *mid = partition(first, last);
    quick_sort(first, mid, N);
    quick_sort(mid, last, N);
}
int mincost_sort(const int *a, const int N, const int minw) {
    int cnt = 0;
    int b[N];
    memcpy(b, a, N * sizeof(int));
    quick_sort(b, b + N, sizeof(int));
    int pos[10001];
    for(int i = 0; i < N; ++i) pos[b[i]] = i;
    int flag[1001] = {};
    for(int i = 0; i < N; ++i) {
        if(flag[i]) continue;
        int cur = i;
        int sum = 0;
        int num = 0;
        int mina = 1 << 29;
        while(!flag[cur]) {
            flag[cur] = 1;
            num++;
            sum += a[cur];
            mina = MIN(mina, a[cur]);
            cur = pos[a[cur]];
        }
        // [ sum + (num-2)*mina + 2(mina+minw) - (num-1)*(mina-minw) ] -> [ sum + mina + (n+1)*minw ]
        cnt += MIN(sum + (num - 2) * mina, sum + mina + (num + 1) * minw);
    }
    return cnt;
}
int main(int argc, char **argv) {
    int n = get_uint();
    int w[n];
    int minw = 1 << 29;
    for(int i = 0; i < n; ++i) {
        w[i] = get_uint();
        minw = MIN(minw, w[i]);
    }
    put_uint(mincost_sort(w, n, minw));
    putchar_unlocked('\n');
    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	get_uint
	.type	get_uint, @function
get_uint:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jle	.L2
	cmpl	$57, -4(%rbp)
	jle	.L5
.L2:
	movl	-4(%rbp), %eax
	jmp	.L4
.L7:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L5:
	cmpl	$47, -4(%rbp)
	jle	.L6
	cmpl	$57, -4(%rbp)
	jle	.L7
.L6:
	movl	-8(%rbp), %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	get_uint, .-get_uint
	.globl	put_uint
	.type	put_uint, @function
put_uint:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	cmpl	$0, -36(%rbp)
	jne	.L9
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L8
.L9:
	movl	$0, -24(%rbp)
	jmp	.L11
.L12:
	movl	-36(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -19(%rbp,%rax)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -36(%rbp)
.L11:
	cmpl	$0, -36(%rbp)
	jne	.L12
	jmp	.L13
.L14:
	movl	-24(%rbp), %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L13:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L14
.L8:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	put_uint, .-put_uint
	.globl	partition
	.type	partition, @function
partition:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-48(%rbp), %rax
	movl	-4(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	-40(%rbp), %rax
	subq	$4, %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L17
.L19:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L18
	addq	$4, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
.L18:
	addq	$4, -8(%rbp)
.L17:
	movq	-48(%rbp), %rax
	subq	$4, %rax
	cmpq	%rax, -8(%rbp)
	jne	.L19
	addq	$4, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rax
	movl	-28(%rbp), %edx
	movl	%edx, (%rax)
	movq	-48(%rbp), %rax
	leaq	-4(%rax), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	partition, .-partition
	.globl	quick_sort
	.type	quick_sort, @function
quick_sort:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-32(%rbp), %rax
	subq	-24(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jnb	.L24
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	partition
	movq	%rax, -8(%rbp)
	movq	-40(%rbp), %rdx
	movq	-8(%rbp), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	quick_sort
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rcx
	movq	-8(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	quick_sort
	jmp	.L21
.L24:
	nop
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	quick_sort, .-quick_sort
	.globl	mincost_sort
	.type	mincost_sort, @function
mincost_sort:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3144, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -44104(%rbp)
	movl	%esi, -44108(%rbp)
	movl	%edx, -44112(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -44092(%rbp)
	movl	-44108(%rbp), %eax
	cltq
	subq	$1, %rax
	movq	%rax, -44064(%rbp)
	movl	-44108(%rbp), %eax
	cltq
	movq	%rax, %r10
	movl	$0, %r11d
	movl	-44108(%rbp), %eax
	cltq
	movq	%rax, %r8
	movl	$0, %r9d
	movl	-44108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L26:
	cmpq	%rdx, %rsp
	je	.L27
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L26
.L27:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L28
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L28:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -44056(%rbp)
	movl	-44108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rcx
	movq	-44056(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	-44108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44056(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-44056(%rbp), %rax
	movl	$4, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	quick_sort
	movl	$0, -44088(%rbp)
	jmp	.L29
.L30:
	movq	-44056(%rbp), %rax
	movl	-44088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movl	-44088(%rbp), %edx
	movl	%edx, -40032(%rbp,%rax,4)
	addl	$1, -44088(%rbp)
.L29:
	movl	-44088(%rbp), %eax
	cmpl	-44108(%rbp), %eax
	jl	.L30
	leaq	-44048(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$0, -44084(%rbp)
	jmp	.L31
.L36:
	movl	-44084(%rbp), %eax
	cltq
	movl	-44048(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L39
	movl	-44084(%rbp), %eax
	movl	%eax, -44080(%rbp)
	movl	$0, -44076(%rbp)
	movl	$0, -44072(%rbp)
	movl	$536870912, -44068(%rbp)
	jmp	.L34
.L35:
	movl	-44080(%rbp), %eax
	cltq
	movl	$1, -44048(%rbp,%rax,4)
	addl	$1, -44072(%rbp)
	movl	-44080(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -44076(%rbp)
	movl	-44080(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-44068(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -44068(%rbp)
	movl	-44080(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	movl	-40032(%rbp,%rax,4), %eax
	movl	%eax, -44080(%rbp)
.L34:
	movl	-44080(%rbp), %eax
	cltq
	movl	-44048(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L35
	movl	-44072(%rbp), %eax
	subl	$2, %eax
	imull	-44068(%rbp), %eax
	movl	%eax, %edx
	movl	-44076(%rbp), %eax
	addl	%eax, %edx
	movl	-44076(%rbp), %ecx
	movl	-44068(%rbp), %eax
	addl	%eax, %ecx
	movl	-44072(%rbp), %eax
	addl	$1, %eax
	imull	-44112(%rbp), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	addl	%eax, -44092(%rbp)
	jmp	.L33
.L39:
	nop
.L33:
	addl	$1, -44084(%rbp)
.L31:
	movl	-44084(%rbp), %eax
	cmpl	-44108(%rbp), %eax
	jl	.L36
	movl	-44092(%rbp), %eax
	movq	%rbx, %rsp
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	mincost_sort, .-mincost_sort
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movl	%edi, -100(%rbp)
	movq	%rsi, -112(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, %eax
	call	get_uint
	movl	%eax, -76(%rbp)
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L41:
	cmpq	%rdx, %rsp
	je	.L42
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L41
.L42:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L43
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L43:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$536870912, -84(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L44
.L45:
	movl	$0, %eax
	call	get_uint
	movq	-64(%rbp), %rdx
	movl	-80(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	movq	-64(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	-84(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -84(%rbp)
	addl	$1, -80(%rbp)
.L44:
	movl	-80(%rbp), %eax
	cmpl	-76(%rbp), %eax
	jl	.L45
	movl	-84(%rbp), %edx
	movl	-76(%rbp), %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mincost_sort
	movl	%eax, %edi
	call	put_uint
	movl	$10, %edi
	call	putchar_unlocked@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L47
	call	__stack_chk_fail@PLT
.L47:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	get_uint
	.type	get_uint, @function
get_uint:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jle	.L2
	cmpl	$57, -4(%rbp)
	jle	.L5
.L2:
	movl	-4(%rbp), %eax
	jmp	.L4
.L7:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L5:
	cmpl	$47, -4(%rbp)
	jle	.L6
	cmpl	$57, -4(%rbp)
	jle	.L7
.L6:
	movl	-8(%rbp), %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	get_uint, .-get_uint
	.globl	put_uint
	.type	put_uint, @function
put_uint:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	cmpl	$0, -36(%rbp)
	jne	.L9
	movl	$48, %edi
	call	putchar_unlocked@PLT
	jmp	.L8
.L9:
	movl	$0, -24(%rbp)
	jmp	.L11
.L12:
	movl	-36(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	leal	48(%rax), %ecx
	movl	-24(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -24(%rbp)
	movl	%ecx, %edx
	cltq
	movb	%dl, -19(%rbp,%rax)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -36(%rbp)
.L11:
	cmpl	$0, -36(%rbp)
	jne	.L12
	jmp	.L13
.L14:
	movl	-24(%rbp), %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar_unlocked@PLT
.L13:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L14
.L8:
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	put_uint, .-put_uint
	.globl	partition
	.type	partition, @function
partition:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-48(%rbp), %rax
	movl	-4(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	-40(%rbp), %rax
	subq	$4, %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	movq	%rax, -8(%rbp)
	jmp	.L17
.L19:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L18
	addq	$4, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
.L18:
	addq	$4, -8(%rbp)
.L17:
	movq	-48(%rbp), %rax
	subq	$4, %rax
	cmpq	%rax, -8(%rbp)
	jne	.L19
	addq	$4, -16(%rbp)
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	-16(%rbp), %rax
	movl	-28(%rbp), %edx
	movl	%edx, (%rax)
	movq	-48(%rbp), %rax
	leaq	-4(%rax), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	partition, .-partition
	.globl	quick_sort
	.type	quick_sort, @function
quick_sort:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-32(%rbp), %rax
	subq	-24(%rbp), %rax
	cmpq	%rax, -40(%rbp)
	jnb	.L24
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	partition
	movq	%rax, -8(%rbp)
	movq	-40(%rbp), %rdx
	movq	-8(%rbp), %rcx
	movq	-24(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	quick_sort
	movq	-40(%rbp), %rdx
	movq	-32(%rbp), %rcx
	movq	-8(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	quick_sort
	jmp	.L21
.L24:
	nop
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	quick_sort, .-quick_sort
	.globl	mincost_sort
	.type	mincost_sort, @function
mincost_sort:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3144, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -44104(%rbp)
	movl	%esi, -44108(%rbp)
	movl	%edx, -44112(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -44092(%rbp)
	movl	-44108(%rbp), %eax
	cltq
	subq	$1, %rax
	movq	%rax, -44064(%rbp)
	movl	-44108(%rbp), %eax
	cltq
	movq	%rax, %r10
	movl	$0, %r11d
	movl	-44108(%rbp), %eax
	cltq
	movq	%rax, %r8
	movl	$0, %r9d
	movl	-44108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L26:
	cmpq	%rdx, %rsp
	je	.L27
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L26
.L27:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L28
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L28:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -44056(%rbp)
	movl	-44108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rcx
	movq	-44056(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	memcpy@PLT
	movl	-44108(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44056(%rbp), %rax
	leaq	(%rdx,%rax), %rcx
	movq	-44056(%rbp), %rax
	movl	$4, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	quick_sort
	movl	$0, -44088(%rbp)
	jmp	.L29
.L30:
	movq	-44056(%rbp), %rax
	movl	-44088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	movl	-44088(%rbp), %edx
	movl	%edx, -40032(%rbp,%rax,4)
	addl	$1, -44088(%rbp)
.L29:
	movl	-44088(%rbp), %eax
	cmpl	-44108(%rbp), %eax
	jl	.L30
	leaq	-44048(%rbp), %rdx
	movl	$0, %eax
	movl	$500, %ecx
	movq	%rdx, %rdi
	rep stosq
	movq	%rdi, %rdx
	movl	%eax, (%rdx)
	addq	$4, %rdx
	movl	$0, -44084(%rbp)
	jmp	.L31
.L36:
	movl	-44084(%rbp), %eax
	cltq
	movl	-44048(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L39
	movl	-44084(%rbp), %eax
	movl	%eax, -44080(%rbp)
	movl	$0, -44076(%rbp)
	movl	$0, -44072(%rbp)
	movl	$536870912, -44068(%rbp)
	jmp	.L34
.L35:
	movl	-44080(%rbp), %eax
	cltq
	movl	$1, -44048(%rbp,%rax,4)
	addl	$1, -44072(%rbp)
	movl	-44080(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	addl	%eax, -44076(%rbp)
	movl	-44080(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-44068(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -44068(%rbp)
	movl	-44080(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-44104(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	movl	-40032(%rbp,%rax,4), %eax
	movl	%eax, -44080(%rbp)
.L34:
	movl	-44080(%rbp), %eax
	cltq
	movl	-44048(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L35
	movl	-44072(%rbp), %eax
	subl	$2, %eax
	imull	-44068(%rbp), %eax
	movl	%eax, %edx
	movl	-44076(%rbp), %eax
	addl	%eax, %edx
	movl	-44076(%rbp), %ecx
	movl	-44068(%rbp), %eax
	addl	%eax, %ecx
	movl	-44072(%rbp), %eax
	addl	$1, %eax
	imull	-44112(%rbp), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	addl	%eax, -44092(%rbp)
	jmp	.L33
.L39:
	nop
.L33:
	addl	$1, -44084(%rbp)
.L31:
	movl	-44084(%rbp), %eax
	cmpl	-44108(%rbp), %eax
	jl	.L36
	movl	-44092(%rbp), %eax
	movq	%rbx, %rsp
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L38
	call	__stack_chk_fail@PLT
.L38:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	mincost_sort, .-mincost_sort
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movl	%edi, -100(%rbp)
	movq	%rsi, -112(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, %eax
	call	get_uint
	movl	%eax, -76(%rbp)
	movl	-76(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L41:
	cmpq	%rdx, %rsp
	je	.L42
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L41
.L42:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L43
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L43:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$536870912, -84(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L44
.L45:
	movl	$0, %eax
	call	get_uint
	movq	-64(%rbp), %rdx
	movl	-80(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	movq	-64(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	-84(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -84(%rbp)
	addl	$1, -80(%rbp)
.L44:
	movl	-80(%rbp), %eax
	cmpl	-76(%rbp), %eax
	jl	.L45
	movl	-84(%rbp), %edx
	movl	-76(%rbp), %ecx
	movq	-64(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	mincost_sort
	movl	%eax, %edi
	call	put_uint
	movl	$10, %edi
	call	putchar_unlocked@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L47
	call	__stack_chk_fail@PLT
.L47:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
