// File: /workspace/github_c_makefile_star2_O0/snej[P]zdelta/trees.c
// Function: pqdownheap
local void pqdownheap(s, tree, k)
    deflate_state *s;
    ct_data *tree;  /* the tree to restore */
    int k;               /* node to move down */
{
  int v = s->heap[k];
  int j = k << 1;  /* left son of k */
  while (j <= s->heap_len) {
    /* Set j to the smallest of the two sons: */
    if (j < s->heap_len &&
	smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
      j++;
    }
    /* Exit if v is smaller than both sons */
    if (smaller(tree, v, s->heap[j], s->depth)) break;
    
    /* Exchange v with the smallest son */
    s->heap[k] = s->heap[j];  k = j;
    
    /* And continue down the tree, setting j to the left son of k */
    j <<= 1;
  }
  s->heap[k] = v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl 0xef0(%rax,%rcx,4), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
shll %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x17ec(%rcx), %eax
jg 0x9bde
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x17ec(%rcx), %eax
jge 0x9b2b
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movslq 0xef0(%rcx,%rdx,4), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movslq -0x1c(%rbp), %rsi
movslq 0xef0(%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jl 0x9b22
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movslq 0xef0(%rcx,%rdx,4), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movslq -0x1c(%rbp), %rsi
movslq 0xef0(%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jne 0x9b2b
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movslq 0xef0(%rcx,%rdx,4), %rcx
movzbl 0x17f4(%rax,%rcx), %eax
movq -0x8(%rbp), %rcx
movq -0x8(%rbp), %rdx
movslq -0x1c(%rbp), %rsi
movslq 0xef0(%rdx,%rsi,4), %rdx
movzbl 0x17f4(%rcx,%rdx), %ecx
cmpl %ecx, %eax
jg 0x9b2b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movslq -0x1c(%rbp), %rsi
movslq 0xef0(%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jl 0x9bab
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movzwl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rdx
movslq -0x1c(%rbp), %rsi
movslq 0xef0(%rdx,%rsi,4), %rdx
movzwl (%rcx,%rdx,4), %ecx
cmpl %ecx, %eax
jne 0x9bad
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movzbl 0x17f4(%rax,%rcx), %eax
movq -0x8(%rbp), %rcx
movq -0x8(%rbp), %rdx
movslq -0x1c(%rbp), %rsi
movslq 0xef0(%rdx,%rsi,4), %rdx
movzbl 0x17f4(%rcx,%rdx), %ecx
cmpl %ecx, %eax
jg 0x9bad
jmp 0x9bde
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl 0xef0(%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, 0xef0(%rax,%rcx,4)
movl -0x1c(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x1c(%rbp)
jmp 0x9a49
movl -0x18(%rbp), %edx
movq -0x8(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl %edx, 0xef0(%rax,%rcx,4)
popq %rbp
retq
nopw %cs:(%rax,%rax)