// File: /workspace/github_c_makefile_star2_O1/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 0x74fd6(%rip), %rax     # 0xd2870
movslq 0x10(%rax), %rdi
testq %rdi, %rdi
jle 0x5d8bc
leaq 0x4b1e8(%rip), %rdx     # 0xa8a92
movl $0x4, %esi
movl $0x5, %ecx
callq 0x39210
movq %rax, (%rbx)
movq 0x74fad(%rip), %rdi     # 0xd2870
callq 0x5ce9c
testl %eax, %eax
je 0x5dabf
movq %rbx, 0x18(%rsp)
leaq 0x4b1a7(%rip), %rdi     # 0xa8a83
callq 0x534b6
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5d913
movq 0x2d7566(%rip), %rdi    # 0x334e58
movq 0x74f77(%rip), %rcx     # 0xd2870
movl 0x1407120(%rcx), %esi
movl 0x10(%rcx), %edx
addq $0x1407140, %rcx        # imm = 0x1407140
callq 0x2f14d
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
leaq 0x20(%rsp), %r12
leaq 0x74f37(%rip), %r13     # 0xd2858
leaq 0x74be4(%rip), %rbx     # 0xd250c
xorl %r15d, %r15d
movq %r12, %rsi
callq 0x5cda0
testq %rax, %rax
je 0x5da91
movq %r12, %rdi
callq 0x39520
testl %eax, %eax
jne 0x5d92b
movq 0x74f21(%rip), %rax     # 0xd2870
cmpl $0x0, 0x10(%rax)
jle 0x5da18
movq %r13, %r14
movq 0x2d74f5(%rip), %rax    # 0x334e58
movl (%rax,%rbp,4), %eax
movslq %eax, %r13
leaq 0x4b113(%rip), %rdi     # 0xa8a83
callq 0x534b6
ucomisd 0x4538b(%rip), %xmm0    # 0xa2d08
jbe 0x5d9c9
movq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%rbp,4), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x4b0ea(%rip), %rdi     # 0xa8a83
callq 0x534b6
movq 0x74ecb(%rip), %rax     # 0xd2870
xorps %xmm1, %xmm1
cvtsi2sdl 0x1407140(%rax,%r13,4), %xmm1
mulsd %xmm0, %xmm1
ucomisd 0x8(%rsp), %xmm1
jbe 0x5d9c9
movq %r14, %r13
movq %r14, %rdi
jmp 0x5da6e
movq 0x18(%rsp), %rax
movq (%rax), %rax
incl (%rax,%r13,4)
movslq 0x74b34(%rip), %rdx     # 0xd2510
leaq 0x4(,%rdx,4), %rsi
incq %rdx
movq %r15, %rdi
callq 0x390c8
movq %rax, %r15
movslq 0x74b17(%rip), %rax     # 0xd2510
movl %r13d, (%r15,%rax,4)
leaq 0x74e5c(%rip), %rdi     # 0xd2860
leaq 0x74b05(%rip), %rsi     # 0xd2510
movq %r12, %rdx
callq 0x602cb
movq %r14, %r13
jmp 0x5da89
leaq 0x4b064(%rip), %rdi     # 0xa8a83
callq 0x534b6
ucomisd 0x452dc(%rip), %xmm0    # 0xa2d08
jbe 0x5da73
movq 0x10(%rsp), %rax
xorps %xmm0, %xmm0
cvtsi2sdl (%rax,%rbp,4), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x4b03b(%rip), %rdi     # 0xa8a83
callq 0x534b6
movq 0x74e1c(%rip), %rax     # 0xd2870
xorps %xmm1, %xmm1
cvtsi2sdl 0x1407120(%rax), %xmm1
mulsd %xmm0, %xmm1
ucomisd 0x8(%rsp), %xmm1
jbe 0x5da73
movq %r13, %rdi
movq %rbx, %rsi
jmp 0x5da81
leaq 0x74de6(%rip), %rdi     # 0xd2860
leaq 0x74a8f(%rip), %rsi     # 0xd2510
movq %r12, %rdx
callq 0x602cb
incq %rbp
jmp 0x5d92b
leaq 0x4afeb(%rip), %rdi     # 0xa8a83
callq 0x534b6
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x5dab1
movq 0x10(%rsp), %rdi
callq 0x39194
movq 0x74db8(%rip), %rdi     # 0xd2870
callq 0x5cf32
jmp 0x5dac2
xorl %r15d, %r15d
movq %r15, %rax
addq $0x7a148, %rsp          # imm = 0x7A148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq