// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_sort.c
// Function: ks_mergesort_heap
static void swap_header_text(bam_header_t *h1, bam_header_t *h2)
{
	int tempi;
	char *temps;
	tempi = h1->l_text, h1->l_text = h2->l_text, h2->l_text = tempi;
	temps = h1->text, h1->text = h2->text, h2->text = temps;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rbp
movq %rsi, 0xc0(%rsp)
movq %rdx, %rdi
testq %rdx, %rdx
jne 0x1ccd9
movq %rbp, %rdi
shlq $0x5, %rdi
callq 0x31d0
movq %rax, %rdi
movq %rdi, 0xc8(%rsp)
cmpq $0x2, %rbp
jb 0x1d010
movq %rdi, 0x68(%rsp)
movq %rbx, 0x78(%rsp)
movq %rbp, %rcx
shlq $0x5, %rcx
movq %rcx, 0x48(%rsp)
leaq -0x20(%rcx), %rax
movq %rax, 0x80(%rsp)
xorl %ecx, %ecx
movl $0x1, %eax
movq %rax, 0x50(%rsp)
movq %r14, 0x70(%rsp)
movq %r14, 0x40(%rsp)
xorl %eax, %eax
movq %rbp, 0xa0(%rsp)
movq 0x40(%rsp), %rsi
movl $0x1, %edx
movl %eax, 0x5c(%rsp)
subl %eax, %edx
movq %rdx, 0x88(%rsp)
movq 0xc0(%rsp,%rdx,8), %rax
movq %rax, 0x40(%rsp)
testq %rcx, %rcx
movq %rcx, 0x90(%rsp)
je 0x1ced3
movq 0x50(%rsp), %rax
movl $0x2, %edx
shlq %cl, %rdx
movq %rdx, 0x60(%rsp)
shlq $0x5, %rax
movq %rax, 0xb0(%rsp)
addq %rsi, %rax
movq %rax, 0x98(%rsp)
movq 0x48(%rsp), %rax
addq %rsi, %rax
movq %rax, 0xa8(%rsp)
xorl %r13d, %r13d
movq %rsi, 0xb8(%rsp)
movq 0x50(%rsp), %rax
addq %r13, %rax
movq 0xa8(%rsp), %r15
movq %rsi, %r14
cmpq %rbp, %rax
ja 0x1cde5
movq %r13, %r15
shlq $0x5, %r15
addq 0x98(%rsp), %r15
movq 0x60(%rsp), %rax
leaq (%rax,%r13), %r14
cmpq %rbp, %r14
cmovaeq %rbp, %r14
shlq $0x5, %r14
addq %rsi, %r14
movq %r13, %rbx
shlq $0x5, %rbx
leaq (%rsi,%rbx), %rdx
movq 0xb0(%rsp), %rax
leaq (%rdx,%rax), %rcx
addq 0x40(%rsp), %rbx
cmpq %r15, %rdx
jae 0x1ce6a
cmpq %r14, %rcx
jae 0x1ce6a
movq %rdx, %rbp
movq %rcx, %r12
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups %xmm1, 0x30(%rsp)
movups %xmm0, 0x20(%rsp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x1d036
xorl %ecx, %ecx
xorl %edx, %edx
testl %eax, %eax
setne %cl
sete %dl
movq %r12, %rax
cmoveq %rbp, %rax
shll $0x5, %edx
addq %rbp, %rdx
shll $0x5, %ecx
addq %r12, %rcx
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm0, (%rbx)
movups %xmm1, 0x10(%rbx)
addq $0x20, %rbx
jmp 0x1ce01
cmpq %r15, %rdx
jae 0x1ce8d
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
addq $0x20, %rbx
leaq 0x20(%rdx), %rax
movq %rax, %rdx
cmpq %r15, %rax
jb 0x1ce6f
cmpq %r14, %rcx
movq 0xa0(%rsp), %rbp
movq 0xb8(%rsp), %rsi
jae 0x1cec0
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
addq $0x20, %rbx
leaq 0x20(%rcx), %rax
movq %rax, %rcx
cmpq %r14, %rax
jb 0x1cea2
addq 0x60(%rsp), %r13
cmpq %rbp, %r13
jb 0x1cda7
jmp 0x1cfa3
testq %rbp, %rbp
jle 0x1cfa3
movq 0x48(%rsp), %rax
leaq (%rsi,%rax), %rbx
movq 0x80(%rsp), %r14
movq 0x40(%rsp), %r15
testq %r14, %r14
je 0x1cf51
leaq 0x20(%rsi), %r12
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups 0x20(%rsi), %xmm2
movups 0x30(%rsi), %xmm3
movups %xmm1, 0x30(%rsp)
movups %xmm0, 0x20(%rsp)
movups %xmm3, 0x10(%rsp)
movups %xmm2, (%rsp)
movq %rsi, %r13
callq 0x1d036
leaq 0x20(%r15), %rdx
leaq 0x40(%r15), %rcx
testl %eax, %eax
je 0x1cf67
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
jmp 0x1cf85
leaq 0x20(%r15), %rcx
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
jmp 0x1cf8f
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups %xmm1, 0x10(%rdx)
movups %xmm0, (%rdx)
movq %r13, %rsi
addq $0x40, %rsi
addq $-0x40, %r14
movq %rcx, %r15
cmpq %rbx, %rsi
jb 0x1cef2
movl $0x2, %edx
movq 0x90(%rsp), %rcx
shlq %cl, %rdx
incq %rcx
movq %rdx, 0x50(%rsp)
cmpq %rbp, %rdx
movq 0x88(%rsp), %rax
jb 0x1cd2d
cmpl $0x1, 0x5c(%rsp)
movq 0x78(%rsp), %rbx
movq 0x70(%rsp), %rdx
movq 0x68(%rsp), %rdi
movq 0x48(%rsp), %rsi
je 0x1d010
testq %rbp, %rbp
jle 0x1d010
addq %rdx, %rsi
movq %rdi, %rax
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%rdx)
movups %xmm0, (%rdx)
leaq 0x20(%rdx), %rcx
addq $0x20, %rax
movq %rcx, %rdx
cmpq %rsi, %rcx
jb 0x1cff2
addq $0xd8, %rsp
testq %rbx, %rbx
je 0x1d027
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32c0