// File: /workspace/github_c_makefile_star2_O1/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
movslq 0x10(%rdi), %r14
movl 0x1407120(%rdi), %eax
movl %eax, 0x24(%rsp)
callq 0x5cde7
callq 0x6037e
movq 0x8(%rbx), %r15
leaq 0x7a240(%rsp), %rdi
movq %r15, %rsi
callq 0x4270
movq %r15, %rdi
callq 0x39194
movq 0x1407118(%rbx), %r15
leaq 0x120(%rsp), %rdi
movq %r15, %rsi
callq 0x4270
movq %r15, %rdi
callq 0x39194
movq %r14, 0x18(%rsp)
testq %r14, %r14
jle 0x5d2b8
movq 0x18(%rsp), %rax
leaq (,%rax,4), %rax
movq %rax, 0x10(%rsp)
leaq 0x1e85a0(%rsp), %r15
leaq 0x19bfde0(%rsp), %r12
xorl %r14d, %r14d
movl 0x1407140(%rbx,%r14), %eax
movl %eax, 0x50(%rsp,%r14)
leaq (%rbx,%r14,2), %rbp
movq 0x18(%rbx,%r14,2), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x4270
movq %r13, %rdi
callq 0x39194
movslq 0x1407128(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x30f28(%rax,%rbp), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x4270
movq %r13, %rdi
callq 0x39194
movl $0x7a120, %eax          # imm = 0x7A120
addq %rax, %r15
addq $0x4, %r14
addq %rax, %r12
cmpq %r14, 0x10(%rsp)
jne 0x5d250
movl $0x2, %eax
movl %eax, 0x10(%rbx)
leaq 0x30f08(%rbx), %r15
movslq 0x1407128(%rbx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movl %eax, 0x30f20(%rbx,%rcx)
leaq 0x4b5be(%rip), %rsi     # 0xa88a1
movq 0x8(%rsp), %rdi
callq 0x40f0
leaq 0x4b5cd(%rip), %rdi     # 0xa88c1
movl $0x1, %r13d
movl $0xb, %esi
movl $0x1, %edx
movq %rax, 0x28(%rsp)
movq %rax, %rcx
callq 0x42c0
movq 0x18(%rsp), %rbp
testl %ebp, %ebp
jle 0x5d5c7
xorl %r12d, %r12d
movl $0x0, 0x8(%rsp)
movq %r15, 0x10(%rsp)
leaq 0x1(%r12), %rax
movq %rax, 0x30(%rsp)
cmpq %rbp, %rax
movq %r13, 0x38(%rsp)
jae 0x5d5b1
imulq $0x7a120, %r12, %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)
movl 0x8(%rsp), %r15d
incl %r15d
leaq 0x16e480(%rsp), %rbp
movq %rbp, %rdi
leaq 0x4b5f6(%rip), %r14     # 0xa897b
movq %r14, %rsi
leaq 0x7a240(%rsp), %rdx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x41b0
movq 0x8(%rbx), %rdi
movq %rbp, %rsi
callq 0x3a404
movq %rax, 0x8(%rbx)
movl 0x50(%rsp,%r12,4), %eax
movl 0x50(%rsp,%r13,4), %ecx
leal (%rcx,%rax), %edx
movl %edx, 0x1407120(%rbx)
movl %eax, 0x1407140(%rbx)
movl %ecx, 0x1407144(%rbx)
movq %rbp, %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 %rbp, %rsi
callq 0x3a404
movq %rax, 0x1407118(%rbx)
movq 0x18(%rbx), %rdi
movq 0x48(%rsp), %rsi
callq 0x3a404
movq %rax, 0x18(%rbx)
movq 0x20(%rbx), %rdi
imulq $0x7a120, %r13, %r14    # imm = 0x7A120
leaq (%rsp,%r14), %rsi
addq $0x19bfde0, %rsi        # imm = 0x19BFDE0
callq 0x3a404
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 0x3a404
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 0x3a404
movslq 0x1407128(%rbx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movq %rax, 0x28(%r15,%rcx)
movq %rbx, %rdi
callq 0x1621f
movq %rax, %r14
leaq 0xf4360(%rsp), %r15
movq %r15, %rdi
leaq 0x4643a(%rip), %rsi     # 0xa38e1
movq %rax, %rdx
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdi
callq 0x39194
movq %r15, %rdi
callq 0x4100
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x165fa
movq %rbx, %rdi
callq 0x16285
movq %rax, %rbp
movq %rax, %rdi
leaq 0x4b3be(%rip), %rsi     # 0xa88a1
callq 0x40f0
movq %rax, %r14
cmpl $0x0, 0x7501e(%rip)     # 0xd2510
jle 0x5d534
xorl %r15d, %r15d
movq 0x2d795a(%rip), %rax    # 0x334e58
movl (%rax,%r15,4), %eax
cmpq %rax, %r12
setne %cl
cmpq %rax, %r13
setne %al
testb %al, %cl
jne 0x5d525
movq 0x75347(%rip), %rax     # 0xd2860
movq (%rax,%r15,8), %rdi
movq %r14, %rsi
callq 0x41f0
incq %r15
movslq 0x74fe1(%rip), %rax     # 0xd2510
cmpq %rax, %r15
jl 0x5d4f7
movq %r14, %rdi
callq 0x42a0
movq %rbp, %rdi
callq 0x39194
movq 0x8(%rbx), %rdi
callq 0x39194
movq 0x1407118(%rbx), %rdi
callq 0x39194
movq 0x18(%rbx), %rdi
callq 0x39194
movq 0x20(%rbx), %rdi
callq 0x39194
movslq 0x1407128(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x10(%rsp), %r15
movq 0x20(%r15,%rax), %rdi
callq 0x39194
movslq 0x1407128(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x28(%r15,%rax), %rdi
callq 0x39194
incq %r13
movq 0x18(%rsp), %rbp
cmpq %rbp, %r13
jne 0x5d36b
movq 0x38(%rsp), %r13
incq %r13
movq 0x30(%rsp), %r12
cmpq %rbp, %r12
jne 0x5d32e
leaq 0x4b318(%rip), %rdi     # 0xa88e6
movl $0xc, %esi
movl $0x1, %edx
movq 0x28(%rsp), %r14
movq %r14, %rcx
callq 0x42c0
movq %r14, %rdi
callq 0x42a0
movl 0x24(%rsp), %eax
movl %eax, 0x1407120(%rbx)
movl %ebp, 0x10(%rbx)
movslq 0x1407128(%rbx), %rax
imulq $0x340, %rax, %rax      # imm = 0x340
movl %ebp, 0x18(%r15,%rax)
movq 0x8(%rbx), %rdi
leaq 0x7a240(%rsp), %rsi
callq 0x3a404
movq %rax, 0x8(%rbx)
movq 0x1407118(%rbx), %rdi
leaq 0x120(%rsp), %rsi
callq 0x3a404
movq %rax, 0x1407118(%rbx)
testl %ebp, %ebp
jle 0x5d6cd
leaq 0x1e85a0(%rsp), %r14
leaq 0x19bfde0(%rsp), %r15
shlq $0x2, %rbp
xorl %r12d, %r12d
movl 0x50(%rsp,%r12), %eax
movl %eax, 0x1407140(%rbx,%r12)
movq %rbp, %r13
leaq (%rbx,%r12,2), %rbp
movq 0x18(%rbx,%r12,2), %rdi
movq %r15, %rsi
callq 0x3a404
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 0x3a404
movslq 0x1407128(%rbx), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
movq %rax, 0x30f28(%rcx,%rbp)
movq %r13, %rbp
movl $0x7a120, %eax          # imm = 0x7A120
addq %rax, %r14
addq %rax, %r15
addq $0x4, %r12
cmpq %r12, %r13
jne 0x5d65c
callq 0x60317
addq $0x3197628, %rsp        # imm = 0x3197628
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq