// File: /workspace/github_c_makefile_star2_O3/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 0x76ad0(%rip), %rdi     # 0xd5870
movslq 0x10(%rdi), %rax
testq %rax, %rax
jle 0x5edcc
leaq 0x4cdae(%rip), %rdx     # 0xabb5e
movl $0x4, %esi
movq %rax, %rdi
movl $0x5, %ecx
callq 0x3a1fc
movq %rax, (%rbx)
movq 0x76aa4(%rip), %rdi     # 0xd5870
callq 0x5e396
testl %eax, %eax
je 0x5efc8
movq %rbx, 0x18(%rsp)
leaq 0x4cd6a(%rip), %rdi     # 0xabb4f
callq 0x549ba
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5ee1c
movq 0x2d905d(%rip), %rdi    # 0x337e58
movq 0x76a6e(%rip), %rcx     # 0xd5870
movl 0x1407120(%rcx), %esi
movl 0x10(%rcx), %edx
addq $0x1407140, %rcx        # imm = 0x1407140
callq 0x2f9b1
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
leaq 0x20(%rsp), %r12
leaq 0x76a2e(%rip), %r13     # 0xd5858
leaq 0x766db(%rip), %rbx     # 0xd550c
xorl %r15d, %r15d
movq %r12, %rsi
callq 0x5e29a
testq %rax, %rax
je 0x5ef9a
movq %r12, %rdi
callq 0x3a52c
testl %eax, %eax
jne 0x5ee34
movq 0x76a18(%rip), %rax     # 0xd5870
cmpl $0x0, 0x10(%rax)
jle 0x5ef21
movq %r13, %r14
movq 0x2d8fec(%rip), %rax    # 0x337e58
movl (%rax,%rbp,4), %eax
movslq %eax, %r13
leaq 0x4ccd6(%rip), %rdi     # 0xabb4f
callq 0x549ba
ucomisd 0x46e82(%rip), %xmm0    # 0xa5d08
jbe 0x5eed2
movq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%rbp,4), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x4ccad(%rip), %rdi     # 0xabb4f
callq 0x549ba
movq 0x769c2(%rip), %rax     # 0xd5870
xorps %xmm1, %xmm1
cvtsi2sdl 0x1407140(%rax,%r13,4), %xmm1
mulsd %xmm0, %xmm1
ucomisd 0x8(%rsp), %xmm1
jbe 0x5eed2
movq %r14, %r13
movq %r14, %rdi
jmp 0x5ef77
movq 0x18(%rsp), %rax
movq (%rax), %rax
incl (%rax,%r13,4)
movslq 0x7662b(%rip), %rdx     # 0xd5510
leaq 0x4(,%rdx,4), %rsi
incq %rdx
movq %r15, %rdi
callq 0x3a0b4
movq %rax, %r15
movslq 0x7660e(%rip), %rax     # 0xd5510
movl %r13d, (%r15,%rax,4)
leaq 0x76953(%rip), %rdi     # 0xd5860
leaq 0x765fc(%rip), %rsi     # 0xd5510
movq %r12, %rdx
callq 0x6199e
movq %r14, %r13
jmp 0x5ef92
leaq 0x4cc27(%rip), %rdi     # 0xabb4f
callq 0x549ba
ucomisd 0x46dd3(%rip), %xmm0    # 0xa5d08
jbe 0x5ef7c
movq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%rbp,4), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x4cbfe(%rip), %rdi     # 0xabb4f
callq 0x549ba
movq 0x76913(%rip), %rax     # 0xd5870
xorps %xmm1, %xmm1
cvtsi2sdl 0x1407120(%rax), %xmm1
mulsd %xmm0, %xmm1
ucomisd 0x8(%rsp), %xmm1
jbe 0x5ef7c
movq %r13, %rdi
movq %rbx, %rsi
jmp 0x5ef8a
leaq 0x768dd(%rip), %rdi     # 0xd5860
leaq 0x76586(%rip), %rsi     # 0xd5510
movq %r12, %rdx
callq 0x6199e
incq %rbp
jmp 0x5ee34
leaq 0x4cbae(%rip), %rdi     # 0xabb4f
callq 0x549ba
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5efba
movq 0x10(%rsp), %rdi
callq 0x3a180
movq 0x768af(%rip), %rdi     # 0xd5870
callq 0x5e42c
jmp 0x5efcb
xorl %r15d, %r15d
movq %r15, %rax
addq $0x7a148, %rsp          # imm = 0x7A148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq