// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/structure.c
// Function: simulated_annealing_bn
bayesiangraphptr simulated_annealing_bn(char *graph_name, char *train_file, char *cv_file, char *test_file, ORDERING_TYPE ordering, double infthreshold)
{/*Last Changed 09.03.2001*/
 int i = 0, j, edgecount;
 bayesiangraphptr newnetwork;
 double **edges;
 newnetwork = (bayesiangraphptr) initial_graph_from_data(graph_name, train_file, cv_file, test_file);
 if (!newnetwork)
   return NULL;
 newnetwork->independence = zero_independence_test(newnetwork);
 newnetwork->one_independence = one_independence_test(newnetwork);
 edges = find_edges(newnetwork, infthreshold, &edgecount);
 switch (ordering)
  {
   case ORDERING_RANDOM  :random_ordering(newnetwork);
                          break;
   case ORDERING_STATE   :state_ordering(newnetwork);
                          break;
   case ORDERING_MINTABLE:min_table_ordering(newnetwork, edges, edgecount);
                          break;
   case ORDERING_ALARM   :alarm_ordering(newnetwork);
                          break;
   default               :printf(m1240, ordering);
                          break;
  }
 add_arcs_according_to_ordering(newnetwork, edges, edgecount);
 make_conditional_tables(newnetwork);
 while (i < 5)
  {
   j = myrand() % 2;
   if (j)
     if (!remove_operator(newnetwork))
       i++;
     else
       i = 0;
   else
     if (!modify_operator(newnetwork))
       i++;
     else
       i = 0;
  }
 return newnetwork;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movsd %xmm0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x36fc0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0xc5975
movq $0x0, -0x8(%rbp)
jmp 0xc5a9d
movq -0x50(%rbp), %rdi
callq 0x422d0
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x50(%rbp), %rdi
callq 0x42830
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x50(%rbp), %rdi
movsd -0x38(%rbp), %xmm0
leaq -0x44(%rbp), %rsi
callq 0x71800
movq %rax, -0x58(%rbp)
movl -0x2c(%rbp), %eax
movq %rax, -0x60(%rbp)
subq $0x3, %rax
ja 0xc5a07
movq -0x60(%rbp), %rax
leaq 0x285b9(%rip), %rcx     # 0xedf84
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x50(%rbp), %rdi
callq 0x786a0
jmp 0xc5a18
movq -0x50(%rbp), %rdi
callq 0x786f0
jmp 0xc5a18
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl -0x44(%rbp), %edx
callq 0x787e0
jmp 0xc5a18
movq -0x50(%rbp), %rdi
callq 0x78ab0
jmp 0xc5a18
movl -0x2c(%rbp), %esi
leaq 0x28593(%rip), %rdi     # 0xedfa4
movb $0x0, %al
callq 0x4030
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movl -0x44(%rbp), %edx
callq 0x71dd0
movq -0x50(%rbp), %rdi
callq 0x72260
cmpl $0x5, -0x3c(%rbp)
jge 0xc5a95
movb $0x0, %al
callq 0x54550
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0xc5a71
movq -0x50(%rbp), %rdi
callq 0x78290
cmpl $0x0, %eax
jne 0xc5a68
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc5a6f
movl $0x0, -0x3c(%rbp)
jmp 0xc5a93
movq -0x50(%rbp), %rdi
callq 0x78450
cmpl $0x0, %eax
jne 0xc5a8a
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xc5a91
movl $0x0, -0x3c(%rbp)
jmp 0xc5a93
jmp 0xc5a31
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)