// File: /workspace/github_c_makefile_star2_O0/zpole[P]IICV/vl/aib.c
// Function: vl_aib_process
VL_EXPORT
void vl_aib_process(VlAIB *aib)
{
    vl_uint i, besti, bestj, newnode, nodei, nodej;
    double I, H;
    double minbeta;

    /* Calculate initial value of cost function */
    vl_aib_calculate_information (aib, &I, &H) ;
    aib->costs[0] = I;

    /* Initially which = all */

    /* For each merge */
    for(i = 0 ; i < aib->nvalues - 1 ; i++) {

      /* update entries in aib-> which */
      vl_aib_update_beta(aib);

      /* find best pair of nodes to merge */
      vl_aib_min_beta (aib, &besti, &bestj, &minbeta);

      if(minbeta == BETA_MAX)
        /* only null-probability entries remain */
        break;

      /* Add the parent pointers for the new node */
      newnode = aib->nvalues + i ;
      nodei = aib->nodes[besti];
      nodej = aib->nodes[bestj];

      aib->parents [nodei] = newnode ;
      aib->parents [nodej] = newnode ;
      aib->parents [newnode] = 0 ;

      /* Merge the nodes which produced the minimum beta */
      vl_aib_merge_nodes (aib, besti, bestj, newnode) ;
      vl_aib_calculate_information (aib, &I, &H) ;

      aib->costs[i+1] = I;

      if (aib->verbosity > 0) {
        VL_PRINTF ("aib: (%5d,%5d)=%5d dE: %10.3g I: %6.4g H: %6.4g updt: %5d\n",
                   nodei,
                   nodej,
                   newnode,
                   minbeta,
                   I,
                   H,
                   aib->nwhich) ;
      }
    }

    /* fill ignored entries with NaNs */
    for(; i < aib->nvalues - 1 ; i++)
        aib->costs[i+1] = VL_NAN_D ;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0xa750
movsd 0x10(%rsp), %xmm0
movq 0x30(%rsp), %rax
movq 0x58(%rax), %rax
movsd %xmm0, (%rax)
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
movq 0x30(%rsp), %rcx
movl 0x48(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0xadba
movq 0x30(%rsp), %rdi
callq 0xa350
movq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x24(%rsp), %rdx
movq %rsp, %rcx
callq 0x9fa0
movsd (%rsp), %xmm0
movsd 0x4e363(%rip), %xmm1    # 0x59000
ucomisd %xmm1, %xmm0
jne 0xacaa
jp 0xacaa
jmp 0xadba
movq 0x30(%rsp), %rax
movl 0x48(%rax), %eax
addl 0x2c(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl 0x28(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x1c(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %rax
movl 0x24(%rsp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x18(%rsp)
movl 0x20(%rsp), %edx
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x1c(%rsp), %ecx
movl %edx, (%rax,%rcx,4)
movl 0x20(%rsp), %edx
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x18(%rsp), %ecx
movl %edx, (%rax,%rcx,4)
movq 0x30(%rsp), %rax
movq 0x50(%rax), %rax
movl 0x20(%rsp), %ecx
movl $0x0, (%rax,%rcx,4)
movq 0x30(%rsp), %rdi
movl 0x28(%rsp), %esi
movl 0x24(%rsp), %edx
movl 0x20(%rsp), %ecx
callq 0xa070
movq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0xa750
movsd 0x10(%rsp), %xmm0
movq 0x30(%rsp), %rax
movq 0x58(%rax), %rax
movl 0x2c(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movsd %xmm0, (%rax,%rcx,8)
movq 0x30(%rsp), %rax
cmpl $0x0, 0x60(%rax)
jbe 0xada8
callq 0x91a0
movq %rax, %r9
movl 0x1c(%rsp), %esi
movl 0x18(%rsp), %edx
movl 0x20(%rsp), %ecx
movsd (%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
movsd 0x8(%rsp), %xmm2
movq 0x30(%rsp), %rax
movl 0x28(%rax), %r8d
leaq 0x4e265(%rip), %rdi     # 0x59008
movb $0x3, %al
callq *%r9
jmp 0xadaa
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0xac58
jmp 0xadbc
movl 0x2c(%rsp), %eax
movq 0x30(%rsp), %rcx
movl 0x48(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0xadfb
movsd 0x4e271(%rip), %xmm0    # 0x59048
movq 0x30(%rsp), %rax
movq 0x58(%rax), %rax
movl 0x2c(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movsd %xmm0, (%rax,%rcx,8)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0xadbc
addq $0x38, %rsp
retq