// File: /workspace/github_c_makefile_star2_O3/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, %r15
xorl %eax, %eax
leaq 0x28(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x20(%rsp), %r8
movq %rax, (%r8)
movl $0x0, 0x3502e9(%rip)    # 0x3b2020
leaq 0x4(%rsp), %rsi
leaq 0x64(%rsp), %rbx
movq %rbx, %rdx
callq 0x602ee
movq %rax, %r14
movl (%rbx), %ebp
movl %ebp, %edi
callq 0x4488
movl %eax, 0x350249(%rip)    # 0x3b1fa4
movl %ebp, %edi
callq 0x44c0
movl %eax, 0x2d6108(%rip)    # 0x337e70
movl %ebp, %edi
callq 0x4488
testl %eax, %eax
je 0x61d7f
movq 0x73af6(%rip), %rdi     # 0xd5870
callq 0x12c28
testq %r14, %r14
je 0x62122
leaq 0x49cd9(%rip), %rdi     # 0xaba68
callq 0x54bec
testl %eax, %eax
je 0x61dc0
leaq 0x49dd9(%rip), %rdi     # 0xabb78
callq 0x54a6f
leaq 0x49bc2(%rip), %rsi     # 0xab96d
movq %rax, %rdi
callq 0x40f0
movq %rax, %r13
testq %rax, %rax
jne 0x61dc0
jmp 0x62122
movl %ebp, %edi
callq 0x5b37
movq %rax, 0x30(%rsp)
movq %r15, %rdi
callq 0x3a938
testl %eax, %eax
movq %r14, 0x18(%rsp)
je 0x62005
leaq 0x4ce00(%rip), %rdi     # 0xaebe8
callq 0x54920
cmpl $0x2, %eax
jl 0x62005
movl %ebp, 0x10(%rsp)
movq %r15, %rdi
callq 0x4200
movl %eax, %ebp
callq 0x5e2e1
movl %ebp, %edi
callq 0x3af63
leaq 0x48ee6(%rip), %rdi     # 0xaacfd
callq 0x54920
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0x49d60(%rip), %rsi     # 0xabb8a
movl $0xc, %edx
callq 0x3a0e1
movq %rax, %rbp
leaq 0x40(%rsp), %rdi
callq 0x5ed85
movq %rax, %r12
leaq 0x49d04(%rip), %rdi     # 0xabb4f
callq 0x549ba
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x61e73
movq 0x739f7(%rip), %rdi     # 0xd5858
movl 0x736a5(%rip), %esi     # 0xd550c
leaq 0x2d5fda(%rip), %rdx    # 0x337e48
callq 0x5efe0
movq %r13, 0x8(%rsp)
leaq 0x48e7e(%rip), %rdi     # 0xaacfd
callq 0x54920
testl %eax, %eax
jle 0x61ec8
movq 0x40(%rsp), %r14
xorl %ebx, %ebx
leaq 0x48e67(%rip), %r15     # 0xaacfd
movl 0x73674(%rip), %esi     # 0xd5510
movq 0x739cd(%rip), %rax     # 0xd5870
movl 0x10(%rax), %edx
movq %r12, %rdi
movq %r14, %rcx
callq 0x2f9b1
movq %rax, (%rbp,%rbx,8)
incq %rbx
movq %r15, %rdi
callq 0x54920
cltq
cmpq %rax, %rbx
jl 0x61e96
movq %rbp, 0x38(%rsp)
movq %r12, 0x48(%rsp)
leaq 0x48e24(%rip), %rdi     # 0xaacfd
callq 0x54920
testl %eax, %eax
jle 0x61f8b
movq 0x28(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x50(%rsp)
xorl %r13d, %r13d
leaq 0x49c91(%rip), %rax     # 0xabb95
movq 0x30(%rsp), %r15
movq 0x38(%rsp), %rbx
movq 0x58(%rsp), %rbp
movq 0x50(%rsp), %r14
movq %rax, %rdi
callq 0x54920
testl %eax, %eax
jle 0x61f6e
xorl %r12d, %r12d
movq (%rbx,%r13,8), %rsi
movl %r12d, %edi
callq 0x5e577
movslq 0x3500e6(%rip), %rax    # 0x3b2020
movq 0x18(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movq %r15, %rsi
movl 0x10(%rsp), %edx
movq 0x8(%rsp), %rcx
movq %rbp, %r8
movq %r14, %r9
callq 0x61acb
incl %r12d
leaq 0x49c31(%rip), %rdi     # 0xabb95
callq 0x54920
cmpl %eax, %r12d
jl 0x61f27
incq %r13
leaq 0x48d85(%rip), %rdi     # 0xaacfd
callq 0x54920
cltq
cmpq %rax, %r13
leaq 0x49c0c(%rip), %rax     # 0xabb95
jl 0x61f18
leaq 0x48d6b(%rip), %rdi     # 0xaacfd
callq 0x54920
movq 0x38(%rsp), %rdi
movl %eax, %esi
callq 0x3a14b
movq 0x738c6(%rip), %rax     # 0xd5870
cmpl $0x0, 0x10(%rax)
jle 0x61fc4
movq 0x48(%rsp), %rdi
callq 0x3a180
movq 0x40(%rsp), %rdi
callq 0x3a180
leaq 0x49b84(%rip), %rdi     # 0xabb4f
callq 0x549ba
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
movl 0x10(%rsp), %ebp
movq 0x8(%rsp), %r13
jbe 0x61ffa
movq 0x2d5e5e(%rip), %rdi    # 0x337e48
callq 0x2ff55
movq $0x0, 0x2d5e4e(%rip) # 0x337e48
callq 0x619ea
movl 0x4(%rsp), %eax
jmp 0x6207c
cmpl $0x0, 0x4(%rsp)
jle 0x620d5
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq 0x20(%rsp), %r15
xorl %ebx, %ebx
movq %r13, %r12
movq 0x18(%rsp), %r13
movl %ebp, %r14d
movq 0x30(%rsp), %rbp
movq 0x73833(%rip), %rdi     # 0xd5870
movq 0x8(%rsp), %rsi
leaq 0x2d5def(%rip), %rdx    # 0x337e38
callq 0x5d65b
movq (%r13,%rbx,8), %rdi
movq %rbp, %rsi
movl %r14d, %edx
movq %r12, %rcx
movq 0x10(%rsp), %r8
movq %r15, %r9
callq 0x61acb
incq %rbx
movslq 0x4(%rsp), %rax
cmpq %rax, %rbx
jl 0x62036
movq %r12, %r13
movl %r14d, %ebp
testl %eax, %eax
jle 0x620d5
movq 0x28(%rsp), %rbx
movq 0x20(%rsp), %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x18(%rsp), %rax
movq (%rax,%r12,8), %rsi
movq 0x737d0(%rip), %rdx     # 0xd5870
movl %ebp, %edi
callq 0x4d38
movl %ebp, %edi
callq 0x44c0
testl %eax, %eax
je 0x620c4
movq (%rbx,%r15), %rdi
callq 0x3a180
movq (%r14,%r15), %rdi
callq 0x3a180
incq %r12
movslq 0x4(%rsp), %rax
addq $0x30, %r15
cmpq %rax, %r12
jl 0x62090
movl %ebp, %edi
callq 0x44c0
testl %eax, %eax
je 0x620f4
movq 0x28(%rsp), %rdi
callq 0x3a180
movq 0x20(%rsp), %rdi
callq 0x3a180
movq 0x18(%rsp), %rdi
callq 0x3a180
movl %ebp, %edi
movq 0x30(%rsp), %rsi
callq 0x4cff
leaq 0x49957(%rip), %rdi     # 0xaba68
callq 0x54bec
testl %eax, %eax
je 0x62122
movq %r13, %rdi
callq 0x42a0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq