// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/process.c
// Function: read_train_and_test_lines
int* read_train_and_test_lines(int** classcounts)
{
 /*!Last Changed 26.11.2005*/
 /*!Last Changed 30.10.2005*/
 char myline[READLINELENGTH];
 int* partition, i = 0, classno, *classes = NULL;
 if (current_dataset->classno > 0)
   *classcounts = safecalloc(current_dataset->classno, sizeof(int), "read_train_and_test_lines", 5);
 if (!open_dataset(current_dataset))
   return NULL;  
 if (get_parameter_f("testpercentage") > 0)
   partition = stratified_partition(prior_class_information, current_dataset->datacount, current_dataset->classno, current_dataset->classcounts);
 while (get_single_instance(current_dataset, myline))
  {
   if (is_line_comment(myline))
     continue;
   if (current_dataset->classno > 0)
    {
     classno = prior_class_information[i];
     if (get_parameter_f("testpercentage") > 0 && partition[i] < get_parameter_f("testpercentage") * current_dataset->classcounts[classno])
       add_single_data_line(&testlines, &testlinecount, myline);
     else
      {
       (*classcounts)[classno]++;
       classes = alloc(classes, (trainlinecount + 1) * sizeof(int), trainlinecount + 1);
       classes[trainlinecount] = classno;
       add_single_data_line(&trainlines, &trainlinecount, myline);
      }
    }
   else
    {
     if (get_parameter_f("testpercentage") > 0 && partition[i] < get_parameter_f("testpercentage") * current_dataset->datacount)
       add_single_data_line(&testlines, &testlinecount, myline);
     else
       add_single_data_line(&trainlines, &trainlinecount, myline);
    }
   i++;
  }
 if (get_parameter_f("testpercentage") > 0)
   safe_free(partition);
 close_dataset(current_dataset);
 return classes;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a148, %rsp          # imm = 0x7A148
movq %rdi, %rbx
movq 0x7708a(%rip), %rdi     # 0xcd870
movslq 0x10(%rdi), %rax
testq %rax, %rax
jle 0x5680e
leaq 0x4528c(%rip), %rdx     # 0x9ba82
pushq $0x4
popq %rsi
pushq $0x5
popq %rcx
movq %rax, %rdi
callq 0x35067
movq %rax, (%rbx)
movq 0x77062(%rip), %rdi     # 0xcd870
callq 0x55e4c
testl %eax, %eax
je 0x569fe
movq %rbx, 0x18(%rsp)
leaq 0x4524c(%rip), %rdi     # 0x9ba73
callq 0x4cdcf
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5685e
movq 0x2d961b(%rip), %rdi    # 0x32fe58
movq 0x7702c(%rip), %rcx     # 0xcd870
movl 0x1407120(%rcx), %esi
movl 0x10(%rcx), %edx
addq $0x1407140, %rcx        # imm = 0x1407140
callq 0x2ba93
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
leaq 0x20(%rsp), %r12
leaq 0x76fec(%rip), %r13     # 0xcd858
leaq 0x76c99(%rip), %rbx     # 0xcd50c
xorl %r15d, %r15d
movq %r12, %rsi
callq 0x55d59
testq %rax, %rax
je 0x569d0
movq %r12, %rdi
callq 0x352fc
testl %eax, %eax
jne 0x56876
movq 0x76fd6(%rip), %rax     # 0xcd870
cmpl $0x0, 0x10(%rax)
jle 0x5695d
movq %r13, %r14
movq 0x2d95aa(%rip), %rax    # 0x32fe58
movl (%rax,%rbp,4), %eax
movslq %eax, %r13
leaq 0x451b8(%rip), %rdi     # 0x9ba73
callq 0x4cdcf
ucomisd 0x3f450(%rip), %xmm0    # 0x95d18
jbe 0x5690e
movq 0x10(%rsp), %rax
cvtsi2sdl (%rax,%rbp,4), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x45192(%rip), %rdi     # 0x9ba73
callq 0x4cdcf
movq 0x76f83(%rip), %rax     # 0xcd870
cvtsi2sdl 0x1407140(%rax,%r13,4), %xmm1
mulsd %xmm0, %xmm1
ucomisd 0x8(%rsp), %xmm1
jbe 0x5690e
movq %r14, %r13
movq %r14, %rdi
jmp 0x569ad
movq 0x18(%rsp), %rax
movq (%rax), %rax
incl (%rax,%r13,4)
movslq 0x76bef(%rip), %rdx     # 0xcd510
leaq 0x4(,%rdx,4), %rsi
incq %rdx
movq %r15, %rdi
callq 0x34f30
movq %rax, %r15
movslq 0x76bd2(%rip), %rax     # 0xcd510
movl %r13d, (%r15,%rax,4)
leaq 0x76f17(%rip), %rdi     # 0xcd860
leaq 0x76bc0(%rip), %rsi     # 0xcd510
movq %r12, %rdx
callq 0x590d4
movq %r14, %r13
jmp 0x569c8
leaq 0x4510f(%rip), %rdi     # 0x9ba73
callq 0x4cdcf
ucomisd 0x3f3a7(%rip), %xmm0    # 0x95d18
jbe 0x569b2
movq 0x10(%rsp), %rax
cvtsi2sdl (%rax,%rbp,4), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x450e9(%rip), %rdi     # 0x9ba73
callq 0x4cdcf
movq 0x76eda(%rip), %rax     # 0xcd870
cvtsi2sdl 0x1407120(%rax), %xmm1
mulsd %xmm0, %xmm1
ucomisd 0x8(%rsp), %xmm1
jbe 0x569b2
movq %r13, %rdi
movq %rbx, %rsi
jmp 0x569c0
leaq 0x76ea7(%rip), %rdi     # 0xcd860
leaq 0x76b50(%rip), %rsi     # 0xcd510
movq %r12, %rdx
callq 0x590d4
incq %rbp
jmp 0x56876
leaq 0x4509c(%rip), %rdi     # 0x9ba73
callq 0x4cdcf
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x569f0
movq 0x10(%rsp), %rdi
callq 0x34ff7
movq 0x76e79(%rip), %rdi     # 0xcd870
callq 0x55ecf
jmp 0x56a01
xorl %r15d, %r15d
movq %r15, %rax
addq $0x7a148, %rsp          # imm = 0x7A148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq