// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/readnet.c
// Function: read_network_net
bayesiangraphptr read_network_net(char *f_name)
{
/*!Last Changed 24.12.2000*/
 FILE *myfile;
 bayesiangraphptr result;
 nodeptr current;
 int pos, var, parents, prob, res, parent_count, i, Index, where, table_index, currentp;
 int parent[MAXPARENT];
 char myline[READLINELENGTH];
 char *st;
 char st1[7];
 st1[0] = ' ';
 st1[1] = '\n';
 st1[2] = ':';
 st1[3] = '(';
 st1[4] = ')';
 st1[5] = '\t';
 st1[6] = '\0';
 if ((myfile = fopen(f_name, "r")) == NULL)
  {
   printf(m1308, f_name);
   return NULL;
  }
 pos = -1;
 var = 0;
 parents = 0;
 while (fgets(myline, READLINELENGTH, myfile))
  {
   st = strtok(myline, st1);
   while (st)
    {
     switch (listindex(st, net_words, 4)) 
      {
       case -1:switch (pos)
                {
                 case -1:return NULL;
                 case  0:result = create_graph(st);
                         break;
                 case  1:return NULL;
                 case  2:if (var == 0)
                          {
                           current = add_one_node(result, st);
                           var = 1;
                          }
                         else
                           add_one_value(current, st);
                         break;
                 case  3:if (parents == 0)
                          {
                           currentp = node_in(result, st);
                           if (currentp == -1)
                             return NULL;
                           current = &(result->nodes[currentp]);
                           parents = 1;
                          }
                         else
                           if ((parents == 1) && (isalpha(st[0])))
                            {
                             res = node_in(result, st);
                             if (res != -1)
                              {
                               add_parent_counts(result, current, res);
                               add_one_arc(result);
                               add_one_pointer(result, current, res);
                              }
                             else
                              {
                               prob = 1;
                               parent_count = 0;
                               for (i = 0; i < MAXPARENT; i++)
                                 parent[i] = 0;
                               parents = 2;
                               Index = 0;
                               alloc_conditional_table(current);
                              }
                            }
                           else
                             if (parents == 1)
                              {/*No parents*/
                               if (current->parents != 0)
                                 return NULL;
                               parents = 2;
                               prob = 0;
                               Index = 0;
                               alloc_conditional_table(current);
                              }
                         if (parents == 2)
                          {
                           if (prob == 0)/*No parents*/
                            {
                             current->table[0][Index] = (double) atof(st);
                             Index++;
                            }
                           else
                             if (isalpha(st[0]))
                              {
                               prob = 1;
                               where = parent_index(result, currentp, parent_count);
                               parent[parent_count] = listindex(st, result->nodes[where].values, result->nodes[where].value_count);
                               parent_count++;
                              }
                             else
                              {
                               if (prob == 1)
                                {
                                 parent_count = 0;
                                 Index = 0;
                                 table_index = table_pos(result->nodes[currentp], parent);
                                 current->table[table_index][0] = (double) atof(st);
                                 prob = 2;
                                }
                               else
                                {
                                 Index++;
                                 current->table[table_index][Index] = (double) atof(st);
                                }
                              }
                          }
                         break;
                 default:return NULL;
               }
               break;
       case  0:if (pos == -1)
                 pos = 0;
               else
                 return NULL;
               break;
       case  1:if (pos == 0)
                 pos = 1;
               else
                 return NULL;
               break;
       case  2:if (pos == 1)
                 pos = 2;
               else
                 if (pos == 2)
                   var = 0;
                 else
                   return NULL;
               break;
       case  3:if (pos == 2)
                 pos = 3;
               else
                 if (pos == 3)
                   parents = 0;
               break;
       default:return NULL;
     }
     st = strtok(NULL, st1);
    }
  }
 fclose(myfile);
 return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x7a240, %rsp          # imm = 0x7A240
movq %rdi, -0x10(%rbp)
movb $0x20, -0x7a1df(%rbp)
movb $0xa, -0x7a1de(%rbp)
movb $0x3a, -0x7a1dd(%rbp)
movb $0x28, -0x7a1dc(%rbp)
movb $0x29, -0x7a1db(%rbp)
movb $0x9, -0x7a1da(%rbp)
movb $0x0, -0x7a1d9(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x4858b(%rip), %rsi     # 0xe81a6
callq 0x40c0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x9fc49
movq -0x10(%rbp), %rsi
leaq 0x4c549(%rip), %rdi     # 0xec17e
movb $0x0, %al
callq 0x4030
movq $0x0, -0x8(%rbp)
jmp 0xa0134
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
leaq -0x7a1d0(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x7a120, %esi          # imm = 0x7A120
callq 0x40f0
cmpq $0x0, %rax
je 0xa0123
leaq -0x7a1d0(%rbp), %rdi
leaq -0x7a1df(%rbp), %rsi
callq 0x4230
movq %rax, -0x7a1d8(%rbp)
cmpq $0x0, -0x7a1d8(%rbp)
je 0xa011e
movq -0x7a1d8(%rbp), %rdi
leaq 0x6562d(%rip), %rsi     # 0x1052e0
movl $0x4, %edx
callq 0x54910
incl %eax
movl %eax, %ecx
movq %rcx, -0x7a1e8(%rbp)
subl $0x4, %eax
ja 0xa00f8
movq -0x7a1e8(%rbp), %rax
leaq 0x4c375(%rip), %rcx     # 0xec054
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, %ecx
movq %rcx, -0x7a1f0(%rbp)
subl $0x4, %eax
ja 0xa005e
movq -0x7a1f0(%rbp), %rax
leaq 0x4c35b(%rip), %rcx     # 0xec068
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x0, -0x8(%rbp)
jmp 0xa0134
movq -0x7a1d8(%rbp), %rdi
callq 0x70f80
movq %rax, -0x20(%rbp)
jmp 0xa006b
movq $0x0, -0x8(%rbp)
jmp 0xa0134
cmpl $0x0, -0x30(%rbp)
jne 0x9fd68
movq -0x20(%rbp), %rdi
movq -0x7a1d8(%rbp), %rsi
callq 0x70530
movq %rax, -0x28(%rbp)
movl $0x1, -0x30(%rbp)
jmp 0x9fd78
movq -0x28(%rbp), %rdi
movq -0x7a1d8(%rbp), %rsi
callq 0x70d80
jmp 0xa006b
cmpl $0x0, -0x34(%rbp)
jne 0x9fdcc
movq -0x20(%rbp), %rdi
movq -0x7a1d8(%rbp), %rsi
callq 0x702b0
movl %eax, -0x54(%rbp)
cmpl $-0x1, -0x54(%rbp)
jne 0x9fda9
movq $0x0, -0x8(%rbp)
jmp 0xa0134
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x54(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movl $0x1, -0x34(%rbp)
jmp 0x9fece
cmpl $0x1, -0x34(%rbp)
jne 0x9fe8f
callq 0x4160
movq (%rax), %rax
movq -0x7a1d8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x9fe8f
movq -0x20(%rbp), %rdi
movq -0x7a1d8(%rbp), %rsi
callq 0x702b0
movl %eax, -0x3c(%rbp)
cmpl $-0x1, -0x3c(%rbp)
je 0x9fe41
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x3c(%rbp), %edx
callq 0x70c80
movq -0x20(%rbp), %rdi
callq 0x70a70
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x3c(%rbp), %edx
callq 0x70b20
jmp 0x9fe8d
movl $0x1, -0x38(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x14, -0x44(%rbp)
jge 0x9fe76
movslq -0x44(%rbp), %rax
movl $0x0, -0xb0(%rbp,%rax,4)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x9fe56
movl $0x2, -0x34(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x70d30
jmp 0x9fecc
cmpl $0x1, -0x34(%rbp)
jne 0x9feca
movq -0x28(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x9feac
movq $0x0, -0x8(%rbp)
jmp 0xa0134
movl $0x2, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x28(%rbp), %rdi
callq 0x70d30
jmp 0x9fecc
jmp 0x9fece
cmpl $0x2, -0x34(%rbp)
jne 0xa005c
cmpl $0x0, -0x38(%rbp)
jne 0x9ff0c
movq -0x7a1d8(%rbp), %rdi
callq 0x4100
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movslq -0x48(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xa005a
callq 0x4160
movq (%rax), %rax
movq -0x7a1d8(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x9ff9c
movl $0x1, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movl -0x54(%rbp), %esi
movl -0x40(%rbp), %edx
callq 0x704c0
movl %eax, -0x4c(%rbp)
movq -0x7a1d8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x4c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %edx
callq 0x54910
movl %eax, %ecx
movslq -0x40(%rbp), %rax
movl %ecx, -0xb0(%rbp,%rax,4)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0xa0058
cmpl $0x1, -0x38(%rbp)
jne 0xa0028
movl $0x0, -0x40(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movslq -0x54(%rbp), %rax
imulq $0x48, %rax, %rax
addq %rax, %rcx
leaq -0xb0(%rbp), %rdi
movq 0x40(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x40(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movups 0x30(%rcx), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x703b0
movl %eax, -0x50(%rbp)
movq -0x7a1d8(%rbp), %rdi
callq 0x4100
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsd %xmm0, (%rax)
movl $0x2, -0x38(%rbp)
jmp 0xa0056
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
movq -0x7a1d8(%rbp), %rdi
callq 0x4100
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x48(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0xa0058
jmp 0xa005a
jmp 0xa005c
jmp 0xa006b
movq $0x0, -0x8(%rbp)
jmp 0xa0134
jmp 0xa0102
cmpl $-0x1, -0x2c(%rbp)
jne 0xa007f
movl $0x0, -0x2c(%rbp)
jmp 0xa008c
movq $0x0, -0x8(%rbp)
jmp 0xa0134
jmp 0xa0102
cmpl $0x0, -0x2c(%rbp)
jne 0xa009d
movl $0x1, -0x2c(%rbp)
jmp 0xa00aa
movq $0x0, -0x8(%rbp)
jmp 0xa0134
jmp 0xa0102
cmpl $0x1, -0x2c(%rbp)
jne 0xa00bb
movl $0x2, -0x2c(%rbp)
jmp 0xa00d6
cmpl $0x2, -0x2c(%rbp)
jne 0xa00ca
movl $0x0, -0x30(%rbp)
jmp 0xa00d4
movq $0x0, -0x8(%rbp)
jmp 0xa0134
jmp 0xa00d6
jmp 0xa0102
cmpl $0x2, -0x2c(%rbp)
jne 0xa00e7
movl $0x3, -0x2c(%rbp)
jmp 0xa00f6
cmpl $0x3, -0x2c(%rbp)
jne 0xa00f4
movl $0x0, -0x34(%rbp)
jmp 0xa00f6
jmp 0xa0102
movq $0x0, -0x8(%rbp)
jmp 0xa0134
leaq -0x7a1df(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x4230
movq %rax, -0x7a1d8(%rbp)
jmp 0x9fc97
jmp 0x9fc5e
movq -0x18(%rbp), %rdi
callq 0x4250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x7a240, %rsp          # imm = 0x7A240
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)