// File: /workspace/github_c_makefile_star2_O0/DavidSM64[P]DKR-Decompressor/DKRGzip.c
// Function: pqdownheap(ct_data*, int)
void pqdownheap(ct_data* tree, int k){
    int v = heap[k];
    int j = k << 1;  /* left son of k */
    while (j <= heap_len) {
        /* Set j to the smallest of the two sons: */
        if (j < heap_len && smaller(tree, heap[j+1], heap[j])) j++;

        /* Exit if v is smaller than both sons */
        if (smaller(tree, v, heap[j])) break;

        /* Exchange v with the smallest son */
        heap[k] = heap[j];  k = j;

        /* And continue down the tree, setting j to the left son of k */
        j <<= 1;
    }
    heap[k] = v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x8a7a(%rip), %rax      # 0x11c00
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
shll %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl 0x9357(%rip), %eax      # 0x124f4
jg 0x9312
movl -0x14(%rbp), %eax
cmpl 0x9348(%rip), %eax      # 0x124f4
jge 0x9266
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x8a3a(%rip), %rcx      # 0x11c00
movslq (%rcx,%rdx,4), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movslq -0x14(%rbp), %rsi
leaq 0x8a23(%rip), %rdx      # 0x11c00
movslq (%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jl 0x925d
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x8a03(%rip), %rcx      # 0x11c00
movslq (%rcx,%rdx,4), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movslq -0x14(%rbp), %rsi
leaq 0x89ec(%rip), %rdx      # 0x11c00
movslq (%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jne 0x9266
movl -0x14(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x89d0(%rip), %rax      # 0x11c00
movslq (%rax,%rcx,4), %rcx
leaq 0x92c5(%rip), %rax      # 0x12500
movzbl (%rax,%rcx), %eax
movslq -0x14(%rbp), %rdx
leaq 0x89b6(%rip), %rcx      # 0x11c00
movslq (%rcx,%rdx,4), %rdx
leaq 0x92ab(%rip), %rcx      # 0x12500
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jg 0x9266
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movslq -0x14(%rbp), %rsi
leaq 0x897f(%rip), %rdx      # 0x11c00
movslq (%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jl 0x92e1
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movslq -0x14(%rbp), %rsi
leaq 0x8958(%rip), %rdx      # 0x11c00
movslq (%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jne 0x92e3
movslq -0x10(%rbp), %rcx
leaq 0x9241(%rip), %rax      # 0x12500
movzbl (%rax,%rcx), %eax
movslq -0x14(%rbp), %rdx
leaq 0x8932(%rip), %rcx      # 0x11c00
movslq (%rcx,%rdx,4), %rdx
leaq 0x9227(%rip), %rcx      # 0x12500
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jg 0x92e3
jmp 0x9312
movslq -0x14(%rbp), %rcx
leaq 0x8912(%rip), %rax      # 0x11c00
movl (%rax,%rcx,4), %edx
movslq -0xc(%rbp), %rcx
leaq 0x8904(%rip), %rax      # 0x11c00
movl %edx, (%rax,%rcx,4)
movl -0x14(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x14(%rbp), %eax
shll %eax
movl %eax, -0x14(%rbp)
jmp 0x9194
movl -0x10(%rbp), %edx
movslq -0xc(%rbp), %rcx
leaq 0x88e0(%rip), %rax      # 0x11c00
movl %edx, (%rax,%rcx,4)
popq %rbp
retq
nopw %cs:(%rax,%rax)