// File: /workspace/github_c_makefile_star2_O1/olcaytaner[P]Isell/process.c
// Function: test_model
void test_model(char* modelfilename, char* testfilename)
{
 /*!Last Changed 20.12.2005*/
 void** model;
 void* parameters;
 FILE* posfile;
 Instanceptr means = NULL, variances = NULL;
 int i, k, modelcount, algorithm, runstart, **partition, *classes, *classcounts;
 totalrun = 0;
 model = load_model(modelfilename, &modelcount, &algorithm, &means, &variances);
 mustrealize = must_realize(algorithm);
 mustnormalize = must_normalize(algorithm);
 if (must_realize(algorithm))
   exchange_classdefno(current_dataset);
 if (!model)
   return;
 if (get_parameter_o("printposterior"))
  {
   posfile = fopen(get_parameter_s("posteriorfilename"), "w");
   if (!posfile)
     return;
  }
 parameters = prepare_supervised_algorithm_parameters(algorithm);
 if (isinteger(testfilename) && get_parameter_i("foldcount") > 1)
  {
   runstart = atoi(testfilename);
   get_prior_information();
   mysrand(runstart);
   partition = safemalloc(get_parameter_i("runcount") * sizeof(int *), "test_model", 12);
   classes = read_train_and_test_lines(&classcounts);
   if (get_parameter_f("testpercentage") > 0)
     read_data_from_lines(testlines, testlinecount, &separateddata);
   for (i = 0; i < get_parameter_i("runcount"); i++)
     partition[i] = stratified_partition(classes, trainlinecount, current_dataset->classno, classcounts);
   for (i = 0; i < get_parameter_i("runcount"); i++)
     for (k = 0; k < get_parameter_i("runtofold"); k++)
      {
       get_fold(k, partition[i]);
       test_single(model[totalrun], parameters, algorithm, posfile, means, variances);
      }
   free_2d((void**)partition, get_parameter_i("runcount"));
   if (current_dataset->classno > 0)
    {
     safe_free(classes);
     safe_free(classcounts);
    }
   if (get_parameter_f("testpercentage") > 0)
    {
     deallocate(separateddata);
     separateddata = NULL;
    }
   free_train_and_test_lines();
  }
 else
  {
   for (i = 0; i < modelcount; i++)
    {
     read_from_data_file(current_dataset, testfilename, &testdata); 
     test_single(model[i], parameters, algorithm, posfile, means, variances);
    }
  }
 for (i = 0; i < modelcount; i++)
  {
   free_model_of_supervised_algorithm(algorithm, model[i], current_dataset);
   if (must_normalize(algorithm))
    {
     safe_free(means[i].values);
     safe_free(variances[i].values);
    }
  }
 if (must_normalize(algorithm))
  {
   safe_free(means);
   safe_free(variances);
  }
 safe_free(model);
 free_supervised_algorithm_parameters(algorithm, parameters);
 if (get_parameter_o("printposterior"))
   fclose(posfile);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
xorl %eax, %eax
leaq 0x20(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x18(%rsp), %r8
movq %rax, (%r8)
movl $0x0, 0x34e9bc(%rip)    # 0x3af020
leaq 0x8(%rsp), %rsi
leaq 0x64(%rsp), %rbx
movq %rbx, %rdx
callq 0x5ebf4
movq %rax, 0x10(%rsp)
movl (%rbx), %ebp
movl %ebp, %edi
callq 0x4488
movl %eax, 0x34e91a(%rip)    # 0x3aefa4
movl %ebp, %edi
callq 0x44c0
movl %eax, 0x2d47d9(%rip)    # 0x334e70
movl %ebp, %edi
callq 0x4488
testl %eax, %eax
je 0x606ae
movq 0x721c7(%rip), %rdi     # 0xd2870
callq 0x12cfc
cmpq $0x0, 0x10(%rsp)
je 0x60a30
leaq 0x482db(%rip), %rdi     # 0xa899c
callq 0x536e7
testl %eax, %eax
je 0x606f2
leaq 0x483db(%rip), %rdi     # 0xa8aac
callq 0x5356b
leaq 0x481c4(%rip), %rsi     # 0xa88a1
movq %rax, %rdi
callq 0x40f0
movq %rax, %rbx
testq %rax, %rax
jne 0x606f2
jmp 0x60a30
movl %ebp, %edi
callq 0x5b37
movq %rax, %r12
movq %r14, %rdi
callq 0x3992c
testl %eax, %eax
movq %rbx, 0x30(%rsp)
movq %r12, 0x28(%rsp)
je 0x60931
leaq 0x4b3ff(%rip), %rdi     # 0xabb1c
callq 0x5341c
cmpl $0x2, %eax
jl 0x60931
movl %ebp, 0xc(%rsp)
movq %r14, %rdi
callq 0x4200
movl %eax, %ebp
callq 0x5cde7
movl %ebp, %edi
callq 0x39f5b
leaq 0x47501(%rip), %rdi     # 0xa7c4d
callq 0x5341c
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0x4835f(%rip), %rsi     # 0xa8abe
movl $0xc, %edx
callq 0x390f5
movq %rax, %r13
leaq 0x40(%rsp), %rdi
callq 0x5d87f
movq %rax, %r12
leaq 0x48303(%rip), %rdi     # 0xa8a83
callq 0x534b6
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x607a8
movq 0x720c2(%rip), %rdi     # 0xd2858
movl 0x71d70(%rip), %esi     # 0xd250c
leaq 0x2d46a5(%rip), %rdx    # 0x334e48
callq 0x5dad7
leaq 0x4749e(%rip), %rdi     # 0xa7c4d
callq 0x5341c
testl %eax, %eax
jle 0x607f8
movq 0x40(%rsp), %r14
xorl %ebx, %ebx
leaq 0x47487(%rip), %r15     # 0xa7c4d
movl 0x71d44(%rip), %esi     # 0xd2510
movq 0x7209d(%rip), %rax     # 0xd2870
movl 0x10(%rax), %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x2f14d
movq %rax, (%r13,%rbx,8)
incq %rbx
movq %r15, %rdi
callq 0x5341c
cltq
cmpq %rax, %rbx
jl 0x607c6
movq %r13, 0x38(%rsp)
movq %r12, 0x48(%rsp)
leaq 0x47444(%rip), %rdi     # 0xa7c4d
callq 0x5341c
testl %eax, %eax
jle 0x608bb
movq 0x20(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x50(%rsp)
xorl %r13d, %r13d
leaq 0x48295(%rip), %rax     # 0xa8ac9
movq 0x28(%rsp), %r15
movq 0x38(%rsp), %rbx
movq 0x58(%rsp), %rbp
movq 0x50(%rsp), %r14
movq %rax, %rdi
callq 0x5341c
testl %eax, %eax
jle 0x6089e
xorl %r12d, %r12d
movq (%rbx,%r13,8), %rsi
movl %r12d, %edi
callq 0x5d07d
movslq 0x34e7b6(%rip), %rax    # 0x3af020
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movq %r15, %rsi
movl 0xc(%rsp), %edx
movq 0x30(%rsp), %rcx
movq %rbp, %r8
movq %r14, %r9
callq 0x603f8
incl %r12d
leaq 0x48235(%rip), %rdi     # 0xa8ac9
callq 0x5341c
cmpl %eax, %r12d
jl 0x60857
incq %r13
leaq 0x473a5(%rip), %rdi     # 0xa7c4d
callq 0x5341c
cltq
cmpq %rax, %r13
leaq 0x48210(%rip), %rax     # 0xa8ac9
jl 0x60848
leaq 0x4738b(%rip), %rdi     # 0xa7c4d
callq 0x5341c
movq 0x38(%rsp), %rdi
movl %eax, %esi
callq 0x3915f
movq 0x71f96(%rip), %rax     # 0xd2870
cmpl $0x0, 0x10(%rax)
jle 0x608f4
movq 0x48(%rsp), %rdi
callq 0x39194
movq 0x40(%rsp), %rdi
callq 0x39194
leaq 0x48188(%rip), %rdi     # 0xa8a83
callq 0x534b6
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl 0xc(%rsp), %ebp
jbe 0x60925
movq 0x2d4533(%rip), %rdi    # 0x334e48
callq 0x2f616
movq $0x0, 0x2d4523(%rip) # 0x334e48
callq 0x60317
movq 0x10(%rsp), %r13
jmp 0x6098b
cmpl $0x0, 0x8(%rsp)
movq 0x10(%rsp), %r13
jle 0x6098b
movq %r14, %r12
movq 0x20(%rsp), %r14
movq 0x18(%rsp), %r15
xorl %ebx, %ebx
movq 0x71f1d(%rip), %rdi     # 0xd2870
movq %r12, %rsi
leaq 0x2d44db(%rip), %rdx    # 0x334e38
callq 0x5c147
movq (%r13,%rbx,8), %rdi
movq 0x28(%rsp), %rsi
movl %ebp, %edx
movq 0x30(%rsp), %rcx
movq %r14, %r8
movq %r15, %r9
callq 0x603f8
incq %rbx
movslq 0x8(%rsp), %rax
cmpq %rax, %rbx
jl 0x6094c
cmpl $0x0, 0x8(%rsp)
jle 0x609e3
movq 0x20(%rsp), %rbx
movq 0x18(%rsp), %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movq (%r13,%r12,8), %rsi
movq 0x71ec2(%rip), %rdx     # 0xd2870
movl %ebp, %edi
callq 0x4d52
movl %ebp, %edi
callq 0x44c0
testl %eax, %eax
je 0x609d2
movq (%rbx,%r15), %rdi
callq 0x39194
movq (%r14,%r15), %rdi
callq 0x39194
incq %r12
movslq 0x8(%rsp), %rax
addq $0x30, %r15
cmpq %rax, %r12
jl 0x609a2
movl %ebp, %edi
callq 0x44c0
testl %eax, %eax
je 0x60a02
movq 0x20(%rsp), %rdi
callq 0x39194
movq 0x18(%rsp), %rdi
callq 0x39194
movq %r13, %rdi
callq 0x39194
movl %ebp, %edi
movq 0x28(%rsp), %rsi
callq 0x4d19
leaq 0x47f7f(%rip), %rdi     # 0xa899c
callq 0x536e7
testl %eax, %eax
movq 0x30(%rsp), %rdi
je 0x60a30
callq 0x42a0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq