// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/savenet.c
// Function: save_graph_hugin
void save_graph_hugin(bayesiangraphptr mygraph, char *file_name)
{
 /*!Last Changed 11.02.2001*/
 FILE *myfile;
 int i, j, k;
 myfile = fopen(file_name, "w");
	if (!myfile)
		 return;
 for (i = 0; i < mygraph->nodecount; i++)
  {
   fprintf(myfile, "node %s\n", mygraph->nodes[i].name);
   fprintf(myfile, "{ label = \"%s\";\n", mygraph->nodes[i].name);
   fprintf(myfile, "position = (%d %d);\n", mygraph->nodes[i].xpos, mygraph->nodes[i].ypos);
   fprintf(myfile, "states = (");
   for (j = 0; j < mygraph->nodes[i].value_count; j++)
     fprintf(myfile, "\"%s\" ", mygraph->nodes[i].values[j]);
   fprintf(myfile, ");\n}\n\n");
  }
 for (i = 0; i < mygraph->nodecount; i++)
  {
   fprintf(myfile, "potential (%s", mygraph->nodes[i].name);
   if (mygraph->nodes[i].parents > 0)
     fprintf(myfile, " |");
   for (j = 0; j < mygraph->nodes[i].parents; j++)
    {
     k = parent_index(mygraph, i, j);
     fprintf(myfile, "%s ", mygraph->nodes[k].name);
    }
   fprintf(myfile, ")\n{ data = \n");
   for (j = 0; j < mygraph->nodes[i].table_count; j++)
    {
     fprintf(myfile, "( ");
     for (k = 0; k < mygraph->nodes[i].value_count; k++)
       fprintf(myfile, "%4.f ", mygraph->nodes[i].table[j][k]);
     fprintf(myfile, ")\n");
    }
   fprintf(myfile, ";\n}\n\n");
  }
 fclose(myfile);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x2b6a3(%rip), %rsi     # 0xe81be
callq 0x40c0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xbcb30
jmp 0xbce32
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0xbcc65
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x30cea(%rip), %rsi     # 0xed852
movb $0x0, %al
callq 0x4280
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x30ccb(%rip), %rsi     # 0xed85b
movb $0x0, %al
callq 0x4280
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x40(%rax), %edx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movl 0x44(%rax), %ecx
leaq 0x30c9e(%rip), %rsi     # 0xed86c
movb $0x0, %al
callq 0x4280
movq -0x18(%rbp), %rdi
leaq 0x30ca1(%rip), %rsi     # 0xed881
movb $0x0, %al
callq 0x4280
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0xbcc45
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x30c59(%rip), %rsi     # 0xed88c
movb $0x0, %al
callq 0x4280
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xbcbee
movq -0x18(%rbp), %rdi
leaq 0x30c42(%rip), %rsi     # 0xed892
movb $0x0, %al
callq 0x4280
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xbcb37
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0xbce29
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x30bfc(%rip), %rsi     # 0xed899
movb $0x0, %al
callq 0x4280
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
cmpl $0x0, 0x20(%rax)
jle 0xbcccf
movq -0x18(%rbp), %rdi
leaq 0x30bdf(%rip), %rsi     # 0xed8a7
movb $0x0, %al
callq 0x4280
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x20(%rcx), %eax
jge 0xbcd36
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x704c0
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x30797(%rip), %rsi     # 0xed4bb
movb $0x0, %al
callq 0x4280
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xbccd6
movq -0x18(%rbp), %rdi
leaq 0x30b69(%rip), %rsi     # 0xed8aa
movb $0x0, %al
callq 0x4280
movl $0x0, -0x20(%rbp)
movslq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x28(%rcx), %rax
jge 0xbce09
movq -0x18(%rbp), %rdi
leaq 0x30b3c(%rip), %rsi     # 0xed8b7
movb $0x0, %al
callq 0x4280
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movslq -0x1c(%rbp), %rdx
imulq $0x48, %rdx, %rdx
addq %rdx, %rcx
cmpl 0x10(%rcx), %eax
jge 0xbcde9
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x1c(%rbp), %rcx
imulq $0x48, %rcx, %rcx
addq %rcx, %rax
movq 0x38(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x24(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x30ae3(%rip), %rsi     # 0xed8ba
movb $0x1, %al
callq 0x4280
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xbcd89
movq -0x18(%rbp), %rdi
leaq 0x306bc(%rip), %rsi     # 0xed4b0
movb $0x0, %al
callq 0x4280
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xbcd4f
movq -0x18(%rbp), %rdi
leaq 0x30a7f(%rip), %rsi     # 0xed893
movb $0x0, %al
callq 0x4280
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xbcc6c
movq -0x18(%rbp), %rdi
callq 0x4250
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)