// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/process.c
// Function: convert_datasets
void convert_datasets(char separator, char* newdatadirectory, char* newinifile)
{
 /*!Last Changed 02.01.2006*/
 /*!Last Changed 02.11.2005*/
 Datasetptr d;
 Feature tmp;
 char tmpdir[READLINELENGTH], *fname, *dname, tmpcommand[READLINELENGTH];
 int i;
 FILE* outfile;
 Instanceptr data;
 convert_missing_values = NO;
 outfile = fopen(newinifile, "w");
 if (!outfile)
  {
   printf(m1248, newinifile);
   return;
  }
 fprintf(outfile, "<datasets>\n");
 strcpy(tmpdir, datadir);
 d = Datasets;
 while (d)
  {
   read_from_train_file(d, &data);
   safe_free(datadir);
   datadir = strcopy(datadir, newdatadirectory);
   fname = dataset_file_name(d);
   outfile = fopen(fname, "w");
   if (!outfile)
    {
     printf(m1248, newinifile);
     continue;
    }
   current_dataset = d;
   print_instance_list(outfile, separator, d, data);
   fclose(outfile);
   safe_free(fname);
   deallocate(data);
   if (d->classdefno != d->featurecount - 1)
    {
     tmp = d->features[d->classdefno];
     for (i = d->classdefno; i < d->featurecount - 1; i++)
       d->features[i] = d->features[i + 1];
     d->features[d->featurecount - 1] = tmp;
    }
   swap_char(&(d->separator), &separator);
   dname = dataset_directory_name(d);
   sprintf(tmpcommand, "mkdir %s", dname);
   safe_free(dname);
   system(tmpcommand);
   save_definitions_of_dataset_as_xml(outfile, d);
   swap_char(&(d->separator), &separator);
   if (d->classdefno != d->featurecount - 1)
    {
     tmp = d->features[d->featurecount - 1];
     for (i = d->featurecount - 1; i > d->classdefno; i--)
       d->features[i] = d->features[i - 1];
     d->features[d->classdefno] = tmp;
    }
   printf(m1225, d->name);
   d = d->next;
   safe_free(datadir);
   datadir = strcopy(datadir, tmpdir);
  }
 fprintf(outfile, "</datasets>\n");
 fclose(outfile);
 convert_missing_values = YES;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf45a8, %rsp          # imm = 0xF45A8
movq %rdx, %rbx
movq %rsi, %r14
movb %dil, 0x7(%rsp)
andl $0x0, 0x77adc(%rip)     # 0xcd2ac
leaq 0x460ba(%rip), %rsi     # 0x9b891
movq %rdx, %rdi
callq 0x40f0
testq %rax, %rax
je 0x55afc
movq %rax, %r13
leaq 0x460bf(%rip), %rdi     # 0x9b8b1
pushq $0xb
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
callq 0x42c0
movq 0x78079(%rip), %rsi     # 0xcd880
leaq 0x360(%rsp), %rdi
callq 0x4270
movq 0x7805d(%rip), %r12     # 0xcd878
testq %r12, %r12
je 0x55ac3
movq %r12, %rdi
leaq 0x18(%rsp), %rsi
callq 0x5577a
movq 0x78048(%rip), %rdi     # 0xcd880
callq 0x34ff7
movq 0x7803c(%rip), %rdi     # 0xcd880
movq %r14, %rsi
callq 0x3604c
movq %rax, 0x7802d(%rip)     # 0xcd880
movq %r12, %rdi
callq 0x14f75
movq %rax, %rbp
movq %rax, %rdi
leaq 0x46029(%rip), %rsi     # 0x9b891
callq 0x40f0
testq %rax, %rax
jne 0x55885
leaq 0x40d0d(%rip), %rdi     # 0x96586
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4030
jmp 0x5581b
movq %rax, %r15
movq %r14, 0x10(%rsp)
movq %r12, 0x77fdc(%rip)     # 0xcd870
movsbl 0x7(%rsp), %esi
movq 0x18(%rsp), %r13
movq %rax, %rdi
movq %r12, %rdx
movq %r13, %rcx
callq 0x2c563
movq %r15, %rdi
callq 0x42a0
movq %rbp, %rdi
callq 0x34ff7
movq %r13, %rdi
callq 0x2c010
movslq 0x1407128(%r12), %rbp
movl 0x1bc(%r12), %r14d
leal -0x1(%r14), %eax
cmpl %eax, %ebp
je 0x55969
leaq 0x30f08(%r12), %rax
movq %rax, 0x8(%rsp)
imulq $0x340, %rbp, %r13      # imm = 0x340
leaq (%r12,%r13), %rsi
addq $0x30f08, %rsi          # imm = 0x30F08
movl $0x340, %edx            # imm = 0x340
leaq 0x20(%rsp), %rdi
callq 0x4310
addq %r12, %r13
addq $0x31248, %r13          # imm = 0x31248
decl %r14d
movslq %r14d, %rax
cmpq %rax, %rbp
jge 0x5594b
leaq -0x340(%r13), %rdi
incq %rbp
movl $0x340, %edx            # imm = 0x340
movq %r13, %rsi
callq 0x4310
movl 0x1bc(%r12), %r14d
addq $0x340, %r13            # imm = 0x340
jmp 0x55918
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x8(%rsp), %rdi
addq %rax, %rdi
movl $0x340, %edx            # imm = 0x340
leaq 0x20(%rsp), %rsi
callq 0x4310
leaq 0x1a8(%r12), %r13
movq %r13, %rdi
leaq 0x7(%rsp), %rsi
callq 0x35376
movq %r12, %rdi
callq 0x14f11
movq %rax, %rbp
leaq 0x7a480(%rsp), %r14
movq %r14, %rdi
leaq 0x40f2a(%rip), %rsi     # 0x968c5
movq %rax, %rdx
xorl %eax, %eax
callq 0x41b0
movq %rbp, %rdi
callq 0x34ff7
movq %r14, %rdi
callq 0x4100
movq %r15, %rdi
movq %r12, %rsi
callq 0x152a2
movq %r13, %rdi
leaq 0x7(%rsp), %rsi
callq 0x35376
movl 0x1407128(%r12), %r14d
movslq 0x1bc(%r12), %rbp
leaq -0x1(%rbp), %r13
cmpl %r13d, %r14d
je 0x55a74
leaq 0x30f08(%r12), %rax
movq %rax, 0x8(%rsp)
imulq $0x340, %r13, %rax      # imm = 0x340
leaq (%r12,%rax), %rsi
addq $0x30f08, %rsi          # imm = 0x30F08
movl $0x340, %edx            # imm = 0x340
leaq 0x20(%rsp), %rdi
callq 0x4310
imulq $0x340, %rbp, %rax      # imm = 0x340
leaq (%r12,%rax), %rdi
addq $0x30bc8, %rdi          # imm = 0x30BC8
movslq %r14d, %rax
cmpq %rax, %r13
jle 0x55a56
leaq -0x340(%rdi), %rbp
movl $0x340, %edx            # imm = 0x340
movq %rbp, %rsi
callq 0x4310
movl 0x1407128(%r12), %r14d
decq %r13
movq %rbp, %rdi
jmp 0x55a2a
imulq $0x340, %rax, %rax      # imm = 0x340
movq 0x8(%rsp), %rdi
addq %rax, %rdi
movl $0x340, %edx            # imm = 0x340
leaq 0x20(%rsp), %rsi
callq 0x4310
movq 0x8(%r12), %rsi
leaq 0x45e3d(%rip), %rdi     # 0x9b8bd
xorl %eax, %eax
callq 0x4030
movq 0x1407270(%r12), %r12
movq 0x77dea(%rip), %rdi     # 0xcd880
callq 0x34ff7
movq 0x77dde(%rip), %rdi     # 0xcd880
leaq 0x360(%rsp), %rsi
callq 0x3604c
movq %rax, 0x77dca(%rip)     # 0xcd880
movq %r15, %r13
movq 0x10(%rsp), %r14
jmp 0x5581b
leaq 0x45e0c(%rip), %rdi     # 0x9b8d6
pushq $0xc
popq %rsi
pushq $0x1
popq %rdx
movq %r13, %rcx
callq 0x42c0
movq %r13, %rdi
callq 0x42a0
movl $0x1, 0x777c2(%rip)     # 0xcd2ac
addq $0xf45a8, %rsp          # imm = 0xF45A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x40a83(%rip), %rdi     # 0x96586
movq %rbx, %rsi
xorl %eax, %eax
addq $0xf45a8, %rsp          # imm = 0xF45A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4030