// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/bam_sort.c
// Function: ks_introsort_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:
testq %rdi, %rdi
je 0x1d8b4
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rdi, %r15
cmpq $0x2, %rdi
movq %rsi, 0x20(%rsp)
jne 0x1d1f1
movl (%rsi), %ebp
movq 0x8(%rsi), %r12
movq 0x10(%rsi), %rbx
movl 0x20(%rsi), %r15d
movq 0x28(%rsi), %r13
movq 0x30(%rsi), %r14
cmpl $0x0, 0x13169(%rip)     # 0x30324
je 0x1d86a
movq 0x18(%rsi), %rcx
movq 0x38(%rsi), %rdx
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
sete %sil
orb %al, %sil
je 0x1d852
testb %al, %al
movq 0x20(%rsp), %rsi
jne 0x1d86f
jmp 0x1d8a3
movl $0x2, %ecx
movl $0xf0, %edi
movl $0x2, %ebx
movl $0x1, %eax
shlq %cl, %rax
incq %rcx
addq $0xc0, %rdi
addl $0x2, %ebx
cmpq %r15, %rax
jb 0x1d200
callq 0x31d0
shlq $0x5, %r15
movq 0x20(%rsp), %rdx
leaq (%rdx,%r15), %rcx
movq %rcx, 0x70(%rsp)
leaq (%rdx,%r15), %rdi
addq $-0x20, %rdi
movq %rax, 0x78(%rsp)
movq %rax, 0x28(%rsp)
movq %rdx, %rsi
movl $0x20, %eax
subq %rsi, %rax
movq %rax, 0x80(%rsp)
movq %rsi, 0x18(%rsp)
cmpq %rdi, %rsi
jae 0x1d6d1
decl %ebx
je 0x1d6c2
movl %ebx, 0x44(%rsp)
movq %rdi, 0x30(%rsp)
movq %rdi, %rbx
subq %rsi, %rbx
sarq $0x6, %rbx
shlq $0x5, %rbx
movl (%rsi), %r12d
movq 0x8(%rsi), %r13
movq 0x10(%rsi), %rdi
movl 0x20(%rsi,%rbx), %r15d
movq 0x28(%rsi,%rbx), %r14
movq 0x30(%rsi,%rbx), %rbp
cmpl $0x0, 0x13080(%rip)     # 0x30324
je 0x1d2ca
movq 0x18(%rsi), %rcx
movq 0x38(%rsi,%rbx), %rdx
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
sete %sil
orb %al, %sil
je 0x1d2e7
testb %al, %al
jne 0x1d306
jmp 0x1d3c8
cmpq %r13, %r14
ja 0x1d306
jne 0x1d3c8
cmpl %r12d, %r15d
jg 0x1d306
sete %cl
cmpq %rdi, %rbp
seta %al
andb %cl, %al
jmp 0x1d2c1
movq %rdi, 0x8(%rsp)
movq 0x30(%rdx), %rdi
movq 0x30(%rcx), %rsi
callq 0x1f89e
movq 0x8(%rsp), %rdx
testl %eax, %eax
jle 0x1d3c2
movq 0x18(%rsp), %rax
addq %rbx, %rax
movq 0x30(%rsp), %rcx
movl (%rcx), %ebp
movq 0x8(%rcx), %r13
movq 0x10(%rcx), %rsi
movl 0x20(%rax), %r12d
movq 0x28(%rax), %r14
movq 0x30(%rax), %r15
cmpl $0x0, 0x12ff4(%rip)     # 0x30324
je 0x1d39b
movq 0x38(%rax), %rax
testq %rax, %rax
sete %cl
je 0x1d43e
movq 0x30(%rsp), %rdx
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
je 0x1d43e
movq %rsi, 0x8(%rsp)
movq 0x30(%rax), %rdi
movq 0x30(%rdx), %rsi
callq 0x1f89e
movb $0x1, %cl
testl %eax, %eax
jg 0x1d43e
jne 0x1d43c
cmpq %r13, %r14
ja 0x1d43e
jne 0x1d43c
cmpl %ebp, %r12d
movq 0x8(%rsp), %rdx
jg 0x1d43e
sete %al
cmpq %rdx, %r15
jmp 0x1d3bb
movb $0x1, %cl
cmpq %r13, %r14
ja 0x1d43e
jne 0x1d43c
cmpl %ebp, %r12d
jg 0x1d43e
sete %al
cmpq %rsi, %r15
seta %cl
andb %al, %cl
jmp 0x1d43e
je 0x1d69f
movq 0x18(%rsp), %rax
movl (%rax), %ebp
movq 0x8(%rax), %r12
movq 0x10(%rax), %rbx
movq 0x30(%rsp), %rax
movl (%rax), %r15d
movq 0x8(%rax), %r13
movq 0x10(%rax), %r14
cmpl $0x0, 0x12f36(%rip)     # 0x30324
je 0x1d421
movq 0x18(%rax), %rax
testq %rax, %rax
sete %cl
je 0x1d45a
movq 0x18(%rsp), %rdx
movq 0x18(%rdx), %rdx
testq %rdx, %rdx
je 0x1d45a
movq 0x30(%rax), %rdi
movq 0x30(%rdx), %rsi
callq 0x1f89e
movb $0x1, %cl
testl %eax, %eax
jg 0x1d45a
jne 0x1d458
jmp 0x1d423
movb $0x1, %cl
cmpq %r12, %r13
ja 0x1d45a
jne 0x1d458
cmpl %ebp, %r15d
jg 0x1d45a
sete %al
cmpq %rbx, %r14
seta %cl
andb %al, %cl
jmp 0x1d45a
xorl %ecx, %ecx
movq 0x18(%rsp), %r15
leaq (%r15,%rbx), %rax
addq $0x20, %rax
testb %cl, %cl
movq 0x30(%rsp), %rbx
cmovneq %rbx, %rax
jmp 0x1d46d
xorl %ecx, %ecx
testb %cl, %cl
movq 0x30(%rsp), %rbx
movq %rbx, %rax
movq 0x18(%rsp), %r15
cmovneq %r15, %rax
movl (%rax), %ecx
movl %ecx, 0x14(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x48(%rsp)
movq 0x18(%rax), %rdx
cmpq %rbx, %rax
je 0x1d4be
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm1, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
testq %rdx, %rdx
sete %dil
movq %rdx, 0x38(%rsp)
movb %dil, 0x7(%rsp)
xorl %r13d, %r13d
movl 0x20(%r15,%r13), %ebp
movq 0x28(%r15,%r13), %r12
movq 0x30(%r15,%r13), %r14
cmpl $0x0, 0x12e3c(%rip)     # 0x30324
je 0x1d514
movq 0x38(%r15,%r13), %rcx
testq %rcx, %rcx
sete %al
je 0x1d530
testq %rdx, %rdx
je 0x1d530
movq 0x30(%rcx), %rdi
movq 0x30(%rdx), %rsi
callq 0x1f89e
movq 0x38(%rsp), %rdx
testl %eax, %eax
jg 0x1d534
jne 0x1d53a
cmpq 0x8(%rsp), %r12
ja 0x1d534
jne 0x1d53a
cmpl 0x14(%rsp), %ebp
jg 0x1d534
sete %cl
cmpq 0x48(%rsp), %r14
seta %al
andb %cl, %al
testb %al, %al
je 0x1d53a
addq $0x20, %r13
jmp 0x1d4d2
addq $-0x20, %rbx
leaq (%r15,%r13), %rsi
addq $0x20, %rsi
cmpq %rbx, %rsi
movb 0x7(%rsp), %dil
ja 0x1d5cd
movq %rsi, 0x88(%rsp)
movl (%rbx), %r12d
movq 0x8(%rbx), %rbp
movq 0x10(%rbx), %r14
cmpl $0x0, 0x12dba(%rip)     # 0x30324
je 0x1d5a3
movl %edi, %eax
testq %rdx, %rdx
je 0x1d5c0
movq 0x18(%rbx), %rcx
movl %edi, %eax
testq %rcx, %rcx
je 0x1d5c0
movq 0x30(%rdx), %rdi
movq 0x30(%rcx), %rsi
callq 0x1f89e
movb 0x7(%rsp), %dil
movq 0x88(%rsp), %rsi
movq 0x38(%rsp), %rdx
testl %eax, %eax
jg 0x1d5c4
jne 0x1d5cd
cmpq %rbp, 0x8(%rsp)
ja 0x1d5c4
jne 0x1d5cd
cmpl %r12d, 0x14(%rsp)
jg 0x1d5c4
sete %cl
cmpq %r14, 0x48(%rsp)
seta %al
andb %cl, %al
testb %al, %al
je 0x1d5cd
addq $-0x20, %rbx
cmpq %rbx, %rsi
jbe 0x1d558
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movaps %xmm1, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
cmpq %rsi, %rbx
jbe 0x1d60a
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movups %xmm0, (%rbx)
movups %xmm1, 0x10(%rbx)
movq %rsi, %r15
jmp 0x1d4cf
leaq (%r15,%r13), %rax
movq 0x30(%rsp), %rdi
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups %xmm1, 0x30(%r15,%r13)
movups %xmm0, 0x20(%r15,%r13)
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movups %xmm0, (%rdi)
movups %xmm1, 0x10(%rdi)
movq 0x80(%rsp), %rcx
addq %rax, %rcx
sarq $0x5, %rcx
movq %rdi, %rdx
subq %r15, %rdx
subq %r13, %rdx
addq $-0x20, %rdx
sarq $0x5, %rdx
cmpq %rdx, %rcx
jg 0x1d6f6
cmpq $0x11, %rdx
movl 0x44(%rsp), %ebx
jl 0x1d68a
leaq (%r15,%r13), %rdx
addq $0x40, %rdx
movq 0x28(%rsp), %rsi
movq %rdx, (%rsi)
movq %rdi, 0x8(%rsi)
movl %ebx, 0x10(%rsi)
addq $0x18, %rsi
movq %rsi, 0x28(%rsp)
cmpq $0x11, %rcx
movq 0x18(%rsp), %rsi
cmovlq %rsi, %rax
movq %rax, %rdi
jmp 0x1d25b
cmpq %r13, %r14
ja 0x1d306
jne 0x1d3c8
cmpl %r12d, %r15d
jg 0x1d306
sete %cl
cmpq %rdx, %rbp
jmp 0x1d2e0
subq %rsi, %rdi
sarq $0x5, %rdi
incq %rdi
callq 0x1ce83
movq 0x28(%rsp), %rax
cmpq 0x78(%rsp), %rax
je 0x1d72f
movq -0x18(%rax), %rsi
movq -0x10(%rax), %rdi
movl -0x8(%rax), %ebx
addq $-0x18, %rax
movq %rax, 0x28(%rsp)
jmp 0x1d246
cmpq $0x11, %rcx
movl 0x44(%rsp), %ebx
jl 0x1d71d
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rsi
movq %rsi, (%rcx)
movq %rax, 0x8(%rcx)
movl %ebx, 0x10(%rcx)
addq $0x18, %rcx
movq %rcx, 0x28(%rsp)
cmpq $0x11, %rdx
leaq 0x40(%r15,%r13), %rsi
cmovlq %rdi, %rsi
jmp 0x1d246
movq 0x78(%rsp), %rdi
callq 0x32c0
movq 0x20(%rsp), %rcx
leaq 0x20(%rcx), %rax
cmpq 0x70(%rsp), %rax
jae 0x1d8a3
movq %rax, 0x38(%rsp)
cmpq %rcx, %rax
jbe 0x1d844
movq 0x38(%rsp), %r14
movl -0x20(%r14), %r13d
movq -0x18(%r14), %rbx
movq -0x10(%r14), %rdi
movl (%r14), %r12d
movq 0x8(%r14), %r15
movq 0x10(%r14), %rbp
cmpl $0x0, 0x12ba6(%rip)     # 0x30324
je 0x1d7d4
movq -0x8(%r14), %rcx
movq 0x18(%r14), %rdx
testq %rdx, %rdx
sete %al
testq %rcx, %rcx
sete %sil
orb %al, %sil
jne 0x1d7eb
movq %rdi, 0x8(%rsp)
movq 0x30(%rdx), %rdi
movq 0x30(%rcx), %rsi
callq 0x1f89e
movq 0x8(%rsp), %rdx
testl %eax, %eax
movq 0x20(%rsp), %rcx
jg 0x1d7f4
jne 0x1d844
cmpq %rbx, %r15
ja 0x1d7f4
jne 0x1d844
cmpl %r13d, %r12d
jg 0x1d7f4
sete %cl
cmpq %rdx, %rbp
jmp 0x1d7e6
cmpq %rbx, %r15
ja 0x1d7f4
jne 0x1d844
cmpl %r13d, %r12d
jg 0x1d7f4
sete %cl
cmpq %rdi, %rbp
seta %al
andb %cl, %al
testb %al, %al
movq 0x20(%rsp), %rcx
je 0x1d844
leaq -0x20(%r14), %rax
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movaps %xmm1, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
movaps 0x90(%rsp), %xmm0
movaps 0xa0(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movq %rax, %r14
cmpq %rcx, %rax
ja 0x1d760
movq 0x38(%rsp), %rax
addq $0x20, %rax
jmp 0x1d742
movq 0x30(%rdx), %rdi
movq 0x30(%rcx), %rsi
callq 0x1f89e
testl %eax, %eax
movq 0x20(%rsp), %rsi
jg 0x1d86f
jne 0x1d8a3
cmpq %r12, %r13
jbe 0x1d8b5
leaq 0x20(%rsi), %rax
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movaps %xmm1, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%rsi)
movups %xmm0, (%rsi)
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jne 0x1d8a3
cmpl %ebp, %r15d
jg 0x1d86f
sete %cl
cmpq %rbx, %r14
seta %al
andb %cl, %al
jmp 0x1d1df