// File: /workspace/github_c_makefile_star2_O0/Cyan4973[P]FiniteStateEntropy/programs/zlibh.c
// Function: pqdownheap
static void pqdownheap(ct_data *tree, int *huf_heap, unsigned char *depth, int k)
{
    int v = huf_heap[k];
    int j = k << 1;  /* left son of k */
    while (j <= huf_heap[0]) {
        /* Set j to the smallest of the two sons: */
        if (j < huf_heap[0] &&
            smaller(tree, huf_heap[j+1], huf_heap[j], depth)) {
                j++;
        }
        /* Exit if v is smaller than both sons */
        if (smaller(tree, v, huf_heap[j], depth)) break;

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jg 0xdf4a
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xdeb3
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x24(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x24(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jl 0xdeaa
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x24(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x24(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jne 0xdeb3
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movl -0x24(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x24(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jg 0xdeb3
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x24(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jl 0xdf1f
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x24(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jne 0xdf21
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rdx
movslq -0x24(%rbp), %rsi
movslq (%rdx,%rsi,4), %rdx
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
jg 0xdf21
jmp 0xdf4a
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x24(%rbp), %eax
shll %eax
movl %eax, -0x24(%rbp)
jmp 0xddf9
movl -0x20(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
popq %rbp
retq
nopw (%rax,%rax)