// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/readnet.c
// Function: read_network_xml
bayesiangraphptr read_network_xml(char *f_name)
{
/*!Last Changed 28.12.2000*/
 FILE *myfile;
 bayesiangraphptr result = NULL;
 char myline[READLINELENGTH];
 char *st;
 char st1[10];
 int anydata = 0, pos = -1, temp, childindex = -1, cond = -1, pcount = -1, pindex;
 int parents[MAXPARENT], parent_values[MAXPARENT];
 nodeptr current;
 st1[0] = ' ';
 st1[1] = '\n';
 st1[2] = '<';
 st1[3] = '>';
 st1[4] = ':';
 st1[5] = '"';
 st1[6] = '/';
 st1[7] = '=';
 st1[8] = '\t';
 st1[9] = '\0';
 if ((myfile = fopen(f_name,"r")) == NULL)
  {
   printf(m1308, f_name);
   return NULL;
  }
 while (fgets(myline, READLINELENGTH, myfile))
  {
   st = strtok(myline, st1);
   while (st)
    {
     switch (listindex(st, xml_words, 28)) 
      {
       case -1:switch (pos){
                 case -1:case  0:case  3:case  5:case  6:
                 case  8:case 10:case 12:case 13:case 14:
                 case 20:case 22:case 23:case 24:case 27:
                 case 28:case 29:case 31:case 33:case 35:
                 case 36:case 37:case 38:case 39:case 42:
                 case 43:case 44:
                 case 45:return NULL;
                 case  1:case  2:case  7:case 11:
                 case 19:anydata = 1;
                         break;
                 case  4:if (!result)
                           result = create_graph(st);
                         break;
                 case  9:if (strcmp(st,"0.2") != 0)
                           return NULL;
                         break;
                 case 15:current = add_one_node(result,st);
                         break;
                 case 16:
                 case 30:if (strcmp(st,"discrete") != 0)
                           return NULL;
                         break;
                 case 17:current->xpos = atoi(st);
                         break;
                 case 18:current->ypos = atoi(st);
                         break;
                 case 21:add_one_value(current, st);
                         break;
                 case 25:pindex = node_in(result, st);
                         if (pindex == -1)
                           return NULL;
                         break;
                 case 26:temp = node_in(result, st);
                         if (temp != -1)
                          {
                           add_parent_counts(result, &result->nodes[temp], pindex);
                           add_one_arc(result);
                           add_one_pointer(result, &result->nodes[temp], pindex);
                          }
                         else
                           return NULL;
                         break;
                 case 32:temp = node_in(result, st);
                         if (temp != -1)
                          {
                           current = &result->nodes[temp];
                           alloc_conditional_table(current);
                          }
                         else
                           return NULL;
                         break;
                 case 34:current->table[0][childindex] = (double) atof(st);
                         childindex++;
                         break;
                 case 40:temp = node_in(result, st);
                         if (temp != -1)
                          {
                           parents[cond] = temp;
                           cond++;
                          }
                         else
                           return NULL;
                         break;
                 case 41:if (pcount < current->parents)
                          {
                           parent_values[pcount] = listindex(st, result->nodes[parents[pcount]].values, result->nodes[parents[pcount]].value_count);
                           pcount++;
                           childindex = 0;
                          }
                         else
                          {
                           if (childindex == 0)
                             pindex = table_pos(*current, parent_values);
                           current->table[pindex][childindex] = (double) atof(st);
                           childindex++;
                          }
                         break;
               };
               break;
       case  0:if (pos == -1)/*ANALYSISNOTEBOOK basliyor*/
                 pos++;
               else
                 if (pos == 44)/*ANALYSISNOTEBOOK bitti*/
                   pos++;
                 else
                   return NULL;
               break;  
       case  1:if (in_list(pos, 5, 0, 3, 14, 31, 39))/*NAME*/
                 pos++;
               else
                 return NULL;
               break;
       case  2:
       case  3:if (((pos == 1) || (pos == 2)) && (anydata))/*ROOT,BNMODEL*/
                {
                 anydata = 0;
                 pos++;
                }
               else
                 if (pos == 43)/*BNMODEL bitti*/
                   pos++;
                 else
                   return NULL;
               break;
       case  4:if (in_list(pos, 2, 4, 11))/*STATICPROPERTIES*/
                 pos++;
               else
                 return NULL;
               break;
       case  5:
       case  7:
       case  8:if (in_list(pos, 3, 5, 7, 9))/*FORMAT,VERSION,CREATOR*/
                 pos++;
               else
                 return NULL;
               break;
       case  6:if (in_list(pos, 3, 6, 8, 10))/*VALUE*/
                {
                 anydata = 0;
                 pos++;
                }
               else
                 return NULL;
               break;
       case  9:if (pos == 12)/*VARIABLES basliyor*/
                 pos++;
               else
                 if (pos == 13)/*VARIABLES bitti*/
                   pos = 22;
                 else
                   return NULL;
               break;
       case 10:if (pos == 13)/*VAR basliyor*/
                 pos++;
               else
                 if (pos == 21)/*VAR bitti*/
                   pos = 13;
                 else
                   return NULL;
               break;
       case 11:if (pos == 15)/*TYPE*/
                 pos++;
               else
                 if (pos == 29)
                   pos++;
                 else
                   return NULL;
               break;
       case 12:if (pos == 16)/*XPOS*/
                 pos++;
               else
                 return NULL;
               break;
       case 13:if (pos == 17)/*YPOS*/
                 pos++;
               else
                 return NULL;
               break;
       case 14:if (in_list(pos, 2, 18, 19))/*DESCRIPTION*/
                 pos++;
               else
                 return NULL;
               break;
       case 15:if (pos == 20)/*STATENAME*/
                 pos++;
               else
                 if (pos == 21)
                   ;
                 else
                   return NULL;
               break;
       case 16:if (pos == 22)/*STRUCTURE basliyor*/
                 pos++;
               else
                 if (pos == 26)/*STRUCTURE bitti*/
                   pos++;
                 else
                   return NULL;
               break;
       case 17:if (pos == 23)/*ARC*/
                 pos++;
               else
                 if (pos == 26)
                   pos = 24;
                 else
                   return NULL;
               break;
       case 18:if (pos == 24)/*PARENT*/
                 pos++;
               else
                 return NULL;
               break;
       case 19:if (pos == 25)/*CHILD*/
                 pos++;
               else
                 return NULL;
               break;
       case 20:if (pos == 27)/*DISTRIBUTIONS basliyor*/
                 pos++;
               else
                 if (pos == 37)/*DISTRIBUTIONS bitti*/
                   pos = 43;
                 else
                   return NULL;
               break;
       case 21:if (in_list(pos, 2, 28, 37))/*DIST basliyor*/
                 pos = 29;
               else
                 if (pos == 36)/*DIST bitti*/
                   pos++;
                 else
                   return NULL;
               break;
       case 22:if (pos == 30)/*PRIVATE*/
                 pos++;
               else
                 return NULL;
               break;
       case 23:if (pos == 32)/*DPIS basliyor*/
                 pos++;
               else
                 if (in_list(pos, 2, 35, 42))/*DPIS bitti*/
                   pos = 36;
                 else
                   return NULL;
               break;
       case 24:if (in_list(pos, 2, 33, 42))/*DPI basliyor*/
                {
                 pos = 34;
                 childindex = 0;
                }
               else
                 if (in_list(pos, 2, 34, 41)) /*DPI bitti*/
                   pos++;
                 else
                   return NULL;
               break;
       case 25:if (pos == 30)/*CONDSET*/
                {
                 pos = 38;
                 cond = 0;
                }
               else
                 if (pos == 40)
                   pos = 30;
                 else
                   return NULL;
               break;
       case 26:if (pos == 38)/*CONDELEM*/
                 pos++;
               else
                 if (pos == 40)
                   pos = 39;
                 else
                   return NULL;
               break;
       case 27:if ((pos == 34) && (cond > 0))/*INDEXES*/
                {
                 pcount = 0;
                 pos = 41;
                }
               else
                 return NULL;
               break;
     }
     st = strtok(NULL, st1);
    }
  }
 fclose(myfile);
 return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a258, %rsp          # imm = 0x7A258
movq %rdi, %r15
movabsq $0x3d2f223a3e3c0a20, %rax # imm = 0x3D2F223A3E3C0A20
movq %rax, 0x80(%rsp)
movw $0x9, 0x88(%rsp)
leaq 0x3a3f6(%rip), %rsi     # 0xab95b
callq 0x40f0
testq %rax, %rax
je 0x71c6e
leaq 0x130(%rsp), %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq %rax, 0x78(%rsp)
movq %rax, %rdx
callq 0x4120
xorl %ebx, %ebx
testq %rax, %rax
je 0x71c95
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0x50(%rsp)
leaq 0x130(%rsp), %r15
leaq 0x80(%rsp), %r12
leaq 0x63d77(%rip), %r13     # 0xd5330
leaq 0x3e254(%rip), %r14     # 0xaf814
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, 0x70(%rsp) # imm = 0xFFFFFFFF
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq $0x0, 0x58(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x4280
testq %rax, %rax
je 0x71c49
movq %rax, %r15
movq %r15, %rdi
movq %r13, %rsi
movl $0x1c, %edx
callq 0x3b355
incl %eax
cmpl $0x1c, %eax
ja 0x71989
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
movl %ebp, %edi
movl $0x3, %esi
movl $0x5, %edx
movl $0x7, %ecx
movl $0x9, %r8d
jmp 0x7180c
leal -0x1(%rbp), %eax
cmpl $0x2, %eax
setb %al
testl %ebx, %ebx
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x71653
incl %ebp
xorl %ebx, %ebx
jmp 0x71989
cmpl $0x2b, %ebp
movl $0x2c, %ebp
je 0x71989
jmp 0x71c8a
cmpl $0xf, %ebp
je 0x7192a
cmpl $0x1d, %ebp
je 0x718e2
jmp 0x71c8a
movl %ebp, %edi
movl $0x2, %esi
movl $0x21, %edx
movl $0x2a, %ecx
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x71967
movl $0x22, %ebp
movl $0x0, 0x70(%rsp)
jmp 0x71989
movl %ebp, %edi
movl $0x2, %esi
movl $0x12, %edx
movl $0x13, %ecx
jmp 0x71978
cmpl $0x20, %ebp
jne 0x71904
movl $0x21, %ebp
jmp 0x71989
cmpl $0xc, %ebp
je 0x7182a
cmpl $0xd, %ebp
jne 0x71c8a
movl $0x16, %ebp
jmp 0x71989
cmpl $0x10, %ebp
movl $0x11, %ebp
je 0x71989
jmp 0x71c8a
movl %ebp, %edi
movl $0x2, %esi
movl $0x4, %edx
movl $0xb, %ecx
jmp 0x71978
cmpl $0x16, %ebp
je 0x71931
cmpl $0x1a, %ebp
jne 0x71c8a
movl $0x1b, %ebp
jmp 0x71989
cmpl $0x19, %ebp
movl $0x1a, %ebp
je 0x71989
jmp 0x71c8a
cmpl $0x1b, %ebp
je 0x71938
cmpl $0x25, %ebp
jne 0x71c8a
movl $0x2b, %ebp
jmp 0x71989
cmpl $0x17, %ebp
je 0x7193f
cmpl $0x1a, %ebp
movl $0x18, %ebp
je 0x71989
jmp 0x71c8a
movl $0x27, (%rsp)
movl %ebp, %edi
movl $0x5, %esi
xorl %edx, %edx
movl $0x3, %ecx
movl $0xe, %r8d
movl $0x1f, %r9d
xorl %eax, %eax
callq 0x3aa8c
jmp 0x7197f
leal 0x1(%rbp), %eax
cmpl $0x2e, %eax
ja 0x71989
leaq 0x3e0c4(%rip), %rcx     # 0xaf888
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %ebx
jmp 0x71989
cmpl $-0x1, %ebp
je 0x71946
cmpl $0x2c, %ebp
jne 0x71c8a
movl $0x2d, %ebp
jmp 0x71989
xorl %ebx, %ebx
movl %ebp, %edi
movl $0x3, %esi
movl $0x6, %edx
movl $0x8, %ecx
movl $0xa, %r8d
xorl %eax, %eax
callq 0x3aa8c
jmp 0x7197f
cmpl $0xd, %ebp
je 0x7194a
cmpl $0x15, %ebp
jne 0x71c8a
movl $0xd, %ebp
jmp 0x71989
movl %ebp, %edi
movl $0x2, %esi
movl $0x1c, %edx
movl $0x25, %ecx
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x719a4
movl $0x1d, %ebp
jmp 0x71989
cmpl $0x11, %ebp
movl $0x12, %ebp
je 0x71989
jmp 0x71c8a
cmpl $0x18, %ebp
movl $0x19, %ebp
je 0x71989
jmp 0x71c8a
andl $-0x2, %ebp
cmpl $0x14, %ebp
movl $0x15, %ebp
je 0x71989
jmp 0x71c8a
cmpl $0x1e, %ebp
movl $0x1f, %ebp
je 0x71989
jmp 0x71c8a
movq $0x0, 0x50(%rsp)
cmpl $0x22, %ebp
jne 0x71cb2
movl $0x29, %ebp
cmpl $0x0, 0x64(%rsp)
jg 0x71989
jmp 0x71cb2
cmpl $0x1e, %ebp
je 0x71951
cmpl $0x28, %ebp
jne 0x71c8a
movl $0x1e, %ebp
jmp 0x71989
cmpl $0x26, %ebp
je 0x71960
cmpl $0x28, %ebp
movl $0x27, %ebp
je 0x71989
jmp 0x71c8a
movl %ebp, %edi
movl $0x2, %esi
movl $0x23, %edx
movl $0x2a, %ecx
xorl %eax, %eax
callq 0x3aa8c
movl $0x24, %ebp
testl %eax, %eax
jne 0x71989
jmp 0x71c8a
movl $0x10, %ebp
jmp 0x71989
movl $0x17, %ebp
jmp 0x71989
movl $0x1c, %ebp
jmp 0x71989
movl $0x18, %ebp
jmp 0x71989
xorl %ebp, %ebp
jmp 0x71989
movl $0xe, %ebp
jmp 0x71989
movl $0x26, %ebp
movl $0x0, 0x64(%rsp)
jmp 0x71989
movl $0x27, %ebp
jmp 0x71989
movl %ebp, %edi
movl $0x2, %esi
movl $0x22, %edx
movl $0x29, %ecx
xorl %eax, %eax
callq 0x3aa8c
testl %eax, %eax
je 0x71c8a
incl %ebp
xorl %edi, %edi
movq %r12, %rsi
callq 0x4280
movq %rax, %r15
testq %rax, %rax
jne 0x715f5
jmp 0x71c49
cmpl $0x24, %ebp
movl $0x25, %ebp
je 0x71989
jmp 0x71c8a
leaq 0x38300(%rip), %rsi     # 0xa9cba
movq %r15, %rdi
callq 0x4260
jmp 0x71a98
movq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x4e464
cmpl $-0x1, %eax
je 0x71c8a
movl 0x64(%rsp), %edx
movslq %edx, %rcx
movl %eax, 0xe0(%rsp,%rcx,4)
incl %edx
movl %edx, 0x64(%rsp)
movl $0x28, %ebp
jmp 0x71989
movq 0x58(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4e464
cmpl $-0x1, %eax
je 0x71c8a
cltq
shlq $0x3, %rax
leaq (%rax,%rax,8), %r15
movq 0x8(%rbp), %rsi
addq %r15, %rsi
movq %rbp, %rdi
movl 0x60(%rsp), %edx
callq 0x4e964
movq %rbp, %rdi
callq 0x4e881
addq 0x8(%rbp), %r15
movq %rbp, %rdi
movq %r15, %rsi
movl 0x60(%rsp), %edx
callq 0x4e8d5
movl $0x1a, %ebp
jmp 0x71989
movq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0x4e9e4
movl $0x15, %ebp
jmp 0x71989
movq %r15, %rdi
callq 0x4200
movq 0x68(%rsp), %rcx
movl %eax, 0x44(%rcx)
movl $0x12, %ebp
jmp 0x71989
leaq 0x3dfe2(%rip), %rsi     # 0xafa6d
movq %r15, %rdi
callq 0x4260
movl $0x9, %ebp
testl %eax, %eax
je 0x71989
jmp 0x71c8a
movl $0x4, %ebp
cmpq $0x0, 0x58(%rsp)
jne 0x71989
movq %r15, %rdi
callq 0x4eade
movq %rax, 0x58(%rsp)
jmp 0x71989
movq 0x50(%rsp), %rbp
movq 0x68(%rsp), %rax
cmpl 0x20(%rax), %ebp
jge 0x71bee
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movslq %ebp, %rcx
movq %rcx, 0x70(%rsp)
movslq 0xe0(%rsp,%rcx,4), %rcx
leaq (%rcx,%rcx,8), %rcx
movq 0x8(%rax,%rcx,8), %rsi
movl 0x10(%rax,%rcx,8), %edx
movq %r15, %rdi
callq 0x3b355
movq 0x70(%rsp), %rcx
movl %eax, 0x90(%rsp,%rcx,4)
incl %ebp
movq %rbp, 0x50(%rsp)
movl $0x0, 0x70(%rsp)
jmp 0x71c3f
movq %r15, %rdi
callq 0x4130
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movl 0x70(%rsp), %edx
movslq %edx, %rcx
movsd %xmm0, (%rax,%rcx,8)
incl %edx
movl %edx, 0x70(%rsp)
movl $0x22, %ebp
jmp 0x71989
movq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x4e464
cmpl $-0x1, %eax
je 0x71c8a
movl %eax, 0x60(%rsp)
movl $0x19, %ebp
jmp 0x71989
movq 0x58(%rsp), %rdi
movq %r15, %rsi
callq 0x4e5de
movq %rax, 0x68(%rsp)
movl $0xf, %ebp
jmp 0x71989
movq %r15, %rdi
callq 0x4200
movq 0x68(%rsp), %rcx
movl %eax, 0x40(%rcx)
movl $0x11, %ebp
jmp 0x71989
movq 0x58(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4e464
cmpl $-0x1, %eax
je 0x71c8a
cltq
leaq (%rax,%rax,8), %rdi
shlq $0x3, %rdi
addq 0x8(%rbp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x4e9b8
movl $0x20, %ebp
jmp 0x71989
movl 0x70(%rsp), %ebp
testl %ebp, %ebp
jne 0x71c17
movl $0x9, %ecx
movq %rsp, %rdi
movq 0x68(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x90(%rsp), %rdi
callq 0x4e515
movl %eax, 0x60(%rsp)
movq %r15, %rdi
callq 0x4130
movq 0x68(%rsp), %rax
movq 0x38(%rax), %rax
movslq 0x60(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq %ebp, %rcx
movsd %xmm0, (%rax,%rcx,8)
incl %ebp
movl %ebp, 0x70(%rsp)
movl $0x29, %ebp
jmp 0x71989
leaq 0x130(%rsp), %r15
movq %r15, %rdi
movl $0x7a120, %esi          # imm = 0x7A120
movq 0x78(%rsp), %rdx
callq 0x4120
testq %rax, %rax
jne 0x715de
jmp 0x71c9e
leaq 0x3dde5(%rip), %rdi     # 0xafa5a
movq $0x0, 0x50(%rsp)
movq %r15, %rsi
xorl %eax, %eax
callq 0x4030
jmp 0x71cb2
movq $0x0, 0x50(%rsp)
jmp 0x71cb2
movq $0x0, 0x58(%rsp)
movq 0x78(%rsp), %rdi
callq 0x42a0
movq 0x58(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
addq $0x7a258, %rsp          # imm = 0x7A258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq