// File: /workspace/github_c_makefile_star2_O1/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, 0xf(%rsp)
movl $0x0, 0x75aa4(%rip)     # 0xd22ac
leaq 0x4c092(%rip), %rsi     # 0xa88a1
movq %rdx, %rdi
callq 0x40f0
testq %rax, %rax
je 0x5cb39
movq %rax, %rbp
leaq 0x4c097(%rip), %rdi     # 0xa88c1
movl $0xb, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x42c0
movq 0x7603d(%rip), %rsi     # 0xd2880
leaq 0x360(%rsp), %rdi
callq 0x4270
movq 0x76021(%rip), %r15     # 0xd2878
testq %r15, %r15
sete %r13b
je 0x5cafc
movq %r15, %rdi
leaq 0x18(%rsp), %rsi
callq 0x5c7af
movq 0x76008(%rip), %rdi     # 0xd2880
callq 0x39194
movq 0x75ffc(%rip), %rdi     # 0xd2880
movq %r14, %rsi
callq 0x3a404
movq %rax, 0x75fed(%rip)     # 0xd2880
movq %r15, %rdi
callq 0x16285
movq %rax, %r12
movq %rax, %rdi
leaq 0x4bff9(%rip), %rsi     # 0xa88a1
callq 0x40f0
testq %rax, %rax
jne 0x5c8ce
leaq 0x46ce9(%rip), %rdi     # 0xa35a2
movq %rbx, %rsi
xorl %eax, %eax
callq 0x4030
testb $0x1, %r13b
je 0x5c864
jmp 0x5cafa
movq %rax, %rbp
movq %r15, 0x75f98(%rip)     # 0xd2870
movsbl 0xf(%rsp), %esi
movq 0x18(%rsp), %r13
movq %rax, %rdi
movq %r15, %rdx
movq %r13, %rcx
callq 0x2fbad
movq %rbp, %rdi
callq 0x42a0
movq %r12, %rdi
callq 0x39194
movq %r13, %rdi
callq 0x2f616
movslq 0x1407128(%r15), %r13
movl 0x1bc(%r15), %eax
decl %eax
cmpl %eax, %r13d
je 0x5c9aa
imulq $0x340, %r13, %r12      # imm = 0x340
leaq (%r15,%r12), %rsi
addq $0x30f08, %rsi          # imm = 0x30F08
movl $0x340, %edx            # imm = 0x340
leaq 0x20(%rsp), %rdi
callq 0x4310
movl 0x1bc(%r15), %eax
decl %eax
cmpl %eax, %r13d
jge 0x5c988
addq %r15, %r12
addq $0x31248, %r12          # imm = 0x31248
leaq -0x340(%r12), %rdi
incq %r13
movl $0x340, %edx            # imm = 0x340
movq %r12, %rsi
callq 0x4310
movslq 0x1bc(%r15), %rax
decq %rax
addq $0x340, %r12            # imm = 0x340
cmpq %rax, %r13
jl 0x5c95a
leaq 0x30f08(%r15), %rcx
cltq
imulq $0x340, %rax, %rdi      # imm = 0x340
addq %rcx, %rdi
movl $0x340, %edx            # imm = 0x340
leaq 0x20(%rsp), %rsi
callq 0x4310
leaq 0x1a8(%r15), %rdi
movq %rdi, 0x10(%rsp)
leaq 0xf(%rsp), %rsi
callq 0x3959a
movq %r15, %rdi
callq 0x1621f
movq %rax, %r12
leaq 0x7a480(%rsp), %r13
movq %r13, %rdi
leaq 0x46f04(%rip), %rsi     # 0xa38e1
movq %rax, %rdx
xorl %eax, %eax
callq 0x41b0
movq %r12, %rdi
callq 0x39194
movq %r13, %rdi
callq 0x4100
movq %rbp, %rdi
movq %r15, %rsi
callq 0x165fa
movq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0x3959a
movslq 0x1bc(%r15), %r12
leaq -0x1(%r12), %r13
cmpl %r13d, 0x1407128(%r15)
je 0x5cab5
imulq $0x340, %r13, %rax      # imm = 0x340
leaq (%r15,%rax), %rsi
addq $0x30f08, %rsi          # imm = 0x30F08
movl $0x340, %edx            # imm = 0x340
leaq 0x20(%rsp), %rdi
callq 0x4310
leal -0x1(%r12), %ecx
movl 0x1407128(%r15), %eax
cmpl %eax, %ecx
jle 0x5ca93
imulq $0x340, %r12, %rax      # imm = 0x340
leaq (%r15,%rax), %rdi
addq $0x30bc8, %rdi          # imm = 0x30BC8
leaq -0x340(%rdi), %r12
movl $0x340, %edx            # imm = 0x340
movq %r12, %rsi
callq 0x4310
decq %r13
movslq 0x1407128(%r15), %rax
movq %r12, %rdi
cmpq %rax, %r13
jg 0x5ca6d
leaq 0x30f08(%r15), %rcx
cltq
imulq $0x340, %rax, %rdi      # imm = 0x340
addq %rcx, %rdi
movl $0x340, %edx            # imm = 0x340
leaq 0x20(%rsp), %rsi
callq 0x4310
movq 0x8(%r15), %rsi
leaq 0x4be0d(%rip), %rdi     # 0xa88cd
xorl %eax, %eax
callq 0x4030
movq 0x1407270(%r15), %r15
movq 0x75dab(%rip), %rdi     # 0xd2880
callq 0x39194
movq 0x75d9f(%rip), %rdi     # 0xd2880
leaq 0x360(%rsp), %rsi
callq 0x3a404
movq %rax, 0x75d8b(%rip)     # 0xd2880
jmp 0x5c857
xorl %ebp, %ebp
leaq 0x4bde3(%rip), %rdi     # 0xa88e6
movl $0xc, %esi
movl $0x1, %edx
movq %rbp, %rcx
callq 0x42c0
movq %rbp, %rdi
callq 0x42a0
movl $0x1, 0x75785(%rip)     # 0xd22ac
addq $0xf45a8, %rsp          # imm = 0xF45A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x46a62(%rip), %rdi     # 0xa35a2
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