// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/graphdata.c
// Function: initial_graph_from_data
bayesiangraphptr initial_graph_from_data(char *graph_name, char *train_file, char *cv_file, char *test_file)
{
/*!Last Changed 09.03.2001*/
 FILE *myfile;
 int i, k = file_length(train_file);
 char *st;
 char tmp[10];
 char st1[3];
 char myline[READLINELENGTH];
 bayesiangraphptr mygraph;
 if (k == 0)
   return NULL;
 mygraph = create_graph(graph_name);
 st1[0] = ' ';
 st1[1] = '\n';
 st1[2] = '\0';
 myfile = fopen(train_file, "r");
 if (!myfile)
   return NULL;
 fgets(myline, READLINELENGTH, myfile);
 st = strtok(myline, st1);
 i = 0;
 while (st)
  {
   i++;
   sprintf(tmp, "Feature%d", i);
   add_one_node(mygraph, tmp);
   st = strtok(NULL, st1);
  }
 fseek(myfile, 0, SEEK_SET);
 while (fgets(myline, READLINELENGTH, myfile))
  {
   st = strtok(myline, st1);
   i = 0;
   while (st)
    {
     k = listindex(st, mygraph->nodes[i].values, mygraph->nodes[i].value_count);
     if (k == -1)
       add_one_value(&mygraph->nodes[i], st);
     i++;
     st = strtok(NULL, st1);
    }
  }
 fclose(myfile);
 load_data(mygraph, &train, train_file);
 load_data(mygraph, &cv, cv_file);
 load_data(mygraph, &test, test_file);
 return mygraph;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x7a180, %rsp          # imm = 0x7A180
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x50f90
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jne 0x36ffa
movq $0x0, -0x8(%rbp)
jmp 0x371eb
movq -0x10(%rbp), %rdi
callq 0x70f80
movq %rax, -0x7a178(%rbp)
movb $0x20, -0x4d(%rbp)
movb $0xa, -0x4c(%rbp)
movb $0x0, -0x4b(%rbp)
movq -0x18(%rbp), %rdi
leaq 0xb1185(%rip), %rsi     # 0xe81a6
callq 0x40c0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x3703e
movq $0x0, -0x8(%rbp)
jmp 0x371eb
leaq -0x7a170(%rbp), %rdi
movq -0x30(%rbp), %rdx
movl $0x7a120, %esi          # imm = 0x7A120
callq 0x40f0
leaq -0x7a170(%rbp), %rdi
leaq -0x4d(%rbp), %rsi
callq 0x4230
movq %rax, -0x40(%rbp)
movl $0x0, -0x34(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x370b6
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
leaq -0x4a(%rbp), %rdi
movl -0x34(%rbp), %edx
leaq 0xadc88(%rip), %rsi     # 0xe4d14
movb $0x0, %al
callq 0x4170
movq -0x7a178(%rbp), %rdi
leaq -0x4a(%rbp), %rsi
callq 0x70530
leaq -0x4d(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x4230
movq %rax, -0x40(%rbp)
jmp 0x3706e
movq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x4080
leaq -0x7a170(%rbp), %rdi
movq -0x30(%rbp), %rdx
movl $0x7a120, %esi          # imm = 0x7A120
callq 0x40f0
cmpq $0x0, %rax
je 0x37192
leaq -0x7a170(%rbp), %rdi
leaq -0x4d(%rbp), %rsi
callq 0x4230
movq %rax, -0x40(%rbp)
movl $0x0, -0x34(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x3718d
movq -0x40(%rbp), %rdi
movq -0x7a178(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
movq -0x7a178(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x10(%rax), %edx
callq 0x54910
movl %eax, -0x38(%rbp)
cmpl $-0x1, -0x38(%rbp)
jne 0x3716e
movq -0x7a178(%rbp), %rax
movq 0x8(%rax), %rdi
movslq -0x34(%rbp), %rax
imulq $0x48, %rax, %rax
addq %rax, %rdi
movq -0x40(%rbp), %rsi
callq 0x70d80
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
leaq -0x4d(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x4230
movq %rax, -0x40(%rbp)
jmp 0x370ff
jmp 0x370c5
movq -0x30(%rbp), %rdi
callq 0x4250
movq -0x7a178(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xce2db(%rip), %rsi     # 0x105488
callq 0x369c0
movq -0x7a178(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0xce2d4(%rip), %rsi     # 0x105498
callq 0x369c0
movq -0x7a178(%rbp), %rdi
movq -0x28(%rbp), %rdx
leaq 0xce2cd(%rip), %rsi     # 0x1054a8
callq 0x369c0
movq -0x7a178(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x7a180, %rsp          # imm = 0x7A180
popq %rbp
retq
nopl (%rax,%rax)