// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/process.c
// Function: export_all_two_class_problems
void export_all_two_class_problems(Datasetptr d, char* inifile)
{
/*!Last Changed 09.01.2009*/
 int i, j, k, p, classno = d->classno, tmpcount = d->datacount, tmpclasscounts[MAXCLASSES];
 char tmpname[READLINELENGTH];
 char tmpcommand[READLINELENGTH];
 char backupname[READLINELENGTH];
 char backupdirectory[READLINELENGTH];
 char backupclasses[MAXCLASSES][READLINELENGTH];
 char backupvalues[MAXCLASSES][READLINELENGTH];
 char* fname;
 char* dname;
 FILE* datafile;
 FILE* xmlfile;
 get_prior_information();
 read_train_lines();
 k = 0;
 strcpy(backupname, d->name);
 safe_free(d->name);
 strcpy(backupdirectory, d->directory);
 safe_free(d->directory);
 for (i = 0; i < classno; i++)
  {
   tmpclasscounts[i] = d->classcounts[i];
   strcpy(backupclasses[i], d->classes[i]);
   safe_free(d->classes[i]);
   strcpy(backupvalues[i], d->features[d->classdefno].strings[i]);
   safe_free(d->features[d->classdefno].strings[i]);
  }
 d->classno = 2;
 d->features[d->classdefno].valuecount = 2;
 xmlfile = fopen(inifile, "w");
 fprintf(xmlfile, "<datasets>\n");
 for (i = 0; i < classno; i++)
   for (j = i + 1; j < classno; j++)
    {
     k++;
     sprintf(tmpname, "%s%d", backupname, k);
     d->name = strcopy(d->name, tmpname);
     d->datacount = tmpclasscounts[i] + tmpclasscounts[j];
     d->classcounts[0] = tmpclasscounts[i];
     d->classcounts[1] = tmpclasscounts[j];
     sprintf(tmpname, "%s%d", backupdirectory, k);
     d->directory = strcopy(d->directory, tmpname);
     d->classes[0] = strcopy(d->classes[0], backupclasses[i]);
     d->classes[1] = strcopy(d->classes[1], backupclasses[j]);
     d->features[d->classdefno].strings[0] = strcopy(d->features[d->classdefno].strings[0], backupvalues[i]);
     d->features[d->classdefno].strings[1] = strcopy(d->features[d->classdefno].strings[1], backupvalues[j]);
     dname = dataset_directory_name(d);
     sprintf(tmpcommand, "mkdir %s", dname);
     safe_free(dname);
     system(tmpcommand);
     save_definitions_of_dataset_as_xml(xmlfile, d);
     fname = dataset_file_name(d);
     datafile = fopen(fname, "w");
     for (p = 0; p < trainlinecount; p++)
       if (prior_class_information[p] == i || prior_class_information[p] == j)
         fprintf(datafile, "%s", trainlines[p]);
     fclose(datafile);
     safe_free(fname);
     safe_free(d->name);
     safe_free(d->directory);
     safe_free(d->classes[0]);
     safe_free(d->classes[1]);
     safe_free(d->features[d->classdefno].strings[0]);
     safe_free(d->features[d->classdefno].strings[1]);
    }
 fprintf(xmlfile, "</datasets>\n");
 fclose(xmlfile);
 d->datacount = tmpcount;
 d->classno = classno;
 d->features[d->classdefno].valuecount = d->classno;
 d->name = strcopy(d->name, backupname);
 d->directory = strcopy(d->directory, backupdirectory);
 for (i = 0; i < classno; i++)
  {
   d->classcounts[i] = tmpclasscounts[i];
   d->classes[i] = strcopy(d->classes[i], backupclasses[i]);
   d->features[d->classdefno].strings[i] = strcopy(d->features[d->classdefno].strings[i], backupvalues[i]);
  }
 free_train_and_test_lines();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3197628, %rsp        # imm = 0x3197628
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
movl 0x10(%rdi), %ebp
movl 0x1407120(%rdi), %eax
movl %eax, 0x1c(%rsp)
callq 0x55d99
callq 0x5917b
movq 0x8(%rbx), %r15
leaq 0x7a240(%rsp), %rdi
movq %r15, %rsi
callq 0x4270
movq %r15, %rdi
callq 0x34ff7
movq 0x1407118(%rbx), %r15
leaq 0x120(%rsp), %rdi
movq %r15, %rsi
callq 0x4270
movq %r15, %rdi
callq 0x34ff7
leaq 0x30f08(%rbx), %rax
movq %rax, 0x10(%rsp)
xorl %r14d, %r14d
testl %ebp, %ebp
movl $0x0, %eax
movl %ebp, 0x4(%rsp)
cmovgl %ebp, %eax
movq %rax, 0x30(%rsp)
leaq (,%rax,4), %rax
movq %rax, 0x20(%rsp)
leaq 0x1e85a0(%rsp), %r15
leaq 0x19bfde0(%rsp), %r12
cmpq %r14, 0x20(%rsp)
je 0x56249
movl 0x1407140(%rbx,%r14), %eax
movl %eax, 0x50(%rsp,%r14)
leaq (%rbx,%r14,2), %r13
movq 0x18(%rbx,%r14,2), %rbp
movq %r12, %rdi
movq %rbp, %rsi
callq 0x4270
movq %rbp, %rdi
callq 0x34ff7
movslq 0x1407128(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x30f28(%rax,%r13), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x4270
movq %rbp, %rdi
callq 0x34ff7
addq $0x4, %r14
movl $0x7a120, %eax          # imm = 0x7A120
addq %rax, %r15
addq %rax, %r12
jmp 0x561df
pushq $0x2
popq %rax
movl %eax, 0x10(%rbx)
movslq 0x1407128(%rbx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movq 0x10(%rsp), %rdx
movl %eax, 0x18(%rdx,%rcx)
leaq 0x45624(%rip), %rsi     # 0x9b891
movq 0x8(%rsp), %rdi
callq 0x40f0
leaq 0x45633(%rip), %rdi     # 0x9b8b1
pushq $0xb
popq %rsi
pushq $0x1
popq %r12
movq %r12, %rdx
movq %rax, 0x28(%rsp)
movq %rax, %rcx
callq 0x42c0
xorl %ebp, %ebp
movl $0x0, 0x8(%rsp)
cmpq 0x30(%rsp), %rbp
je 0x5652c
imulq $0x7a120, %rbp, %rax    # imm = 0x7A120
leaq (%rsp,%rax), %rcx
addq $0x19bfde0, %rcx        # imm = 0x19BFDE0
movq %rcx, 0x48(%rsp)
addq %rsp, %rax
addq $0x1e85a0, %rax         # imm = 0x1E85A0
movq %rax, 0x40(%rsp)
movq %r12, 0x38(%rsp)
cmpl %r12d, 0x4(%rsp)
jle 0x5651c
movl 0x8(%rsp), %r15d
incl %r15d
leaq 0x16e480(%rsp), %r13
movq %r13, %rdi
leaq 0x45672(%rip), %r14     # 0x9b96b
movq %r14, %rsi
leaq 0x7a240(%rsp), %rdx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x41b0
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x3604c
movq %rax, 0x8(%rbx)
movl 0x50(%rsp,%rbp,4), %eax
movl 0x50(%rsp,%r12,4), %ecx
leal (%rcx,%rax), %edx
movl %edx, 0x1407120(%rbx)
movl %eax, 0x1407140(%rbx)
movl %ecx, 0x1407144(%rbx)
movq %r13, %rdi
movq %r14, %rsi
leaq 0x120(%rsp), %rdx
movl %r15d, 0x8(%rsp)
movl %r15d, %ecx
xorl %eax, %eax
callq 0x41b0
movq 0x1407118(%rbx), %rdi
movq %r13, %rsi
callq 0x3604c
movq %rax, 0x1407118(%rbx)
movq 0x18(%rbx), %rdi
movq 0x48(%rsp), %rsi
callq 0x3604c
movq %rax, 0x18(%rbx)
movq 0x20(%rbx), %rdi
imulq $0x7a120, %r12, %r14    # imm = 0x7A120
leaq (%rsp,%r14), %rsi
addq $0x19bfde0, %rsi        # imm = 0x19BFDE0
callq 0x3604c
movq %rax, 0x20(%rbx)
movslq 0x1407128(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x10(%rsp), %r15
movq 0x20(%r15,%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0x3604c
movslq 0x1407128(%rbx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movq %rax, 0x20(%r15,%rcx)
movq 0x28(%r15,%rcx), %rdi
leaq (%rsp,%r14), %rsi
addq $0x1e85a0, %rsi         # imm = 0x1E85A0
callq 0x3604c
movslq 0x1407128(%rbx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movq %rax, 0x28(%r15,%rcx)
movq %rbx, %rdi
callq 0x14f11
movq %rax, %r14
leaq 0xf4360(%rsp), %r15
movq %r15, %rdi
leaq 0x404ab(%rip), %rsi     # 0x968c5
movq %rax, %rdx
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdi
callq 0x34ff7
movq %r15, %rdi
callq 0x4100
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x152a2
movq %rbx, %rdi
callq 0x14f75
movq %rax, %r15
movq %rax, %rdi
leaq 0x4543b(%rip), %rsi     # 0x9b891
callq 0x40f0
movq %rax, %r14
movl 0x770ac(%rip), %eax     # 0xcd510
xorl %r13d, %r13d
movslq %eax, %rcx
cmpq %rcx, %r13
jge 0x564a8
movq 0x2d99e2(%rip), %rcx    # 0x32fe58
movl (%rcx,%r13,4), %ecx
cmpq %rcx, %rbp
setne %dl
cmpq %rcx, %r12
setne %cl
testb %cl, %dl
jne 0x564a3
movq 0x773cf(%rip), %rax     # 0xcd860
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
callq 0x41f0
movl 0x7706d(%rip), %eax     # 0xcd510
incq %r13
jmp 0x56467
movq %r14, %rdi
callq 0x42a0
movq %r15, %rdi
callq 0x34ff7
movq 0x8(%rbx), %rdi
callq 0x34ff7
movq 0x1407118(%rbx), %rdi
callq 0x34ff7
movq 0x18(%rbx), %rdi
callq 0x34ff7
movq 0x20(%rbx), %rdi
callq 0x34ff7
movslq 0x1407128(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x10(%rsp), %r14
movq 0x20(%r14,%rax), %rdi
callq 0x34ff7
movslq 0x1407128(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x28(%r14,%rax), %rdi
callq 0x34ff7
incq %r12
jmp 0x562d4
incq %rbp
movq 0x38(%rsp), %r12
incq %r12
jmp 0x5629f
leaq 0x453a3(%rip), %rdi     # 0x9b8d6
pushq $0xc
popq %rsi
pushq $0x1
popq %rdx
movq 0x28(%rsp), %r14
movq %r14, %rcx
callq 0x42c0
movq %r14, %rdi
callq 0x42a0
movl 0x1c(%rsp), %eax
movl %eax, 0x1407120(%rbx)
movl 0x4(%rsp), %ecx
movl %ecx, 0x10(%rbx)
movslq 0x1407128(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x10(%rsp), %rdx
movl %ecx, 0x18(%rdx,%rax)
movq 0x8(%rbx), %rdi
leaq 0x7a240(%rsp), %rsi
callq 0x3604c
movq %rax, 0x8(%rbx)
movq 0x1407118(%rbx), %rdi
leaq 0x120(%rsp), %rsi
callq 0x3604c
movq %rax, 0x1407118(%rbx)
leaq 0x1e85a0(%rsp), %r14
leaq 0x19bfde0(%rsp), %r15
xorl %r12d, %r12d
movl $0x7a120, %r13d         # imm = 0x7A120
cmpq %r12, 0x20(%rsp)
je 0x56629
movl 0x50(%rsp,%r12), %eax
movl %eax, 0x1407140(%rbx,%r12)
leaq (%rbx,%r12,2), %rbp
movq 0x18(%rbx,%r12,2), %rdi
movq %r15, %rsi
callq 0x3604c
movq %rax, 0x18(%rbx,%r12,2)
movslq 0x1407128(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x30f28(%rax,%rbp), %rdi
movq %r14, %rsi
callq 0x3604c
movslq 0x1407128(%rbx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movq %rax, 0x30f28(%rcx,%rbp)
addq $0x4, %r12
addq %r13, %r14
addq %r13, %r15
jmp 0x565bf
callq 0x59120
addq $0x3197628, %rsp        # imm = 0x3197628
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq