// File: /workspace/github_c_makefile_star2_O2/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 $0x58, %rsp
movq %rsi, %r15
leaq 0x30(%rsp), %rcx
andq $0x0, (%rcx)
leaq 0x28(%rsp), %r8
andq $0x0, (%r8)
andl $0x0, 0x350bd7(%rip)    # 0x3aa020
leaq 0x14(%rsp), %rsi
leaq 0x54(%rsp), %rbx
movq %rbx, %rdx
callq 0x57a58
movq %rax, 0x8(%rsp)
movl (%rbx), %ebx
movl %ebx, %edi
callq 0x448a
movl %eax, 0x350b35(%rip)    # 0x3a9fa4
movl %ebx, %edi
callq 0x44cb
movl %eax, 0x2d69f4(%rip)    # 0x32fe70
movl %ebx, 0x4(%rsp)
movl %ebx, %edi
callq 0x448a
testl %eax, %eax
je 0x59497
movq 0x743de(%rip), %rdi     # 0xcd870
callq 0x11d5c
cmpq $0x0, 0x8(%rsp)
je 0x597ab
leaq 0x424e2(%rip), %rdi     # 0x9b98c
callq 0x4cff1
testl %eax, %eax
je 0x594dd
leaq 0x425e2(%rip), %rdi     # 0x9ba9c
callq 0x4ce84
leaq 0x423cb(%rip), %rsi     # 0x9b891
movq %rax, %rdi
callq 0x40f0
movq %rax, 0x18(%rsp)
testq %rax, %rax
jne 0x594dd
jmp 0x597ab
movl 0x4(%rsp), %edi
callq 0x5a9c
movq %rax, 0x20(%rsp)
movq %r15, %rdi
callq 0x356ca
testl %eax, %eax
je 0x595c8
leaq 0x4560a(%rip), %rdi     # 0x9eb0c
callq 0x4cd35
cmpl $0x2, %eax
jl 0x595c8
movq %r15, %rdi
callq 0x4200
movl %eax, %ebp
callq 0x55d99
movl %ebp, %edi
callq 0x35ca7
leaq 0x41700(%rip), %rdi     # 0x9ac2d
callq 0x4cd35
movslq %eax, %rdi
shlq $0x3, %rdi
leaq 0x4256e(%rip), %rsi     # 0x9baae
pushq $0xc
popq %rdx
callq 0x34f59
movq %rax, %r15
leaq 0x48(%rsp), %rdi
callq 0x567cb
movq %rax, %r12
leaq 0x42514(%rip), %rdi     # 0x9ba73
callq 0x4cdcf
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x59587
movq 0x742e3(%rip), %rdi     # 0xcd858
movl 0x73f91(%rip), %esi     # 0xcd50c
leaq 0x2d68c6(%rip), %rdx    # 0x32fe48
callq 0x56a16
movq 0x48(%rsp), %r13
xorl %ebx, %ebx
leaq 0x41698(%rip), %r14     # 0x9ac2d
movq %r14, %rdi
callq 0x4cd35
cltq
cmpq %rax, %rbx
jge 0x59622
movl 0x73f66(%rip), %esi     # 0xcd510
movq 0x742bf(%rip), %rax     # 0xcd870
movl 0x10(%rax), %edx
movq %r12, %rdi
movq %r13, %rcx
callq 0x2ba93
movq %rax, (%r15,%rbx,8)
incq %rbx
jmp 0x59595
movq 0x30(%rsp), %rbp
movq 0x28(%rsp), %r13
xorl %ebx, %ebx
leaq 0x2d685d(%rip), %r14    # 0x32fe38
movslq 0x14(%rsp), %rax
cmpq %rax, %rbx
jge 0x59707
movq 0x74280(%rip), %rdi     # 0xcd870
movq %r15, %rsi
movq %r14, %rdx
callq 0x550f7
movq 0x8(%rsp), %rax
movq (%rax,%rbx,8), %rdi
movq 0x20(%rsp), %rsi
movl 0x4(%rsp), %edx
movq 0x18(%rsp), %rcx
movq %rbp, %r8
movq %r13, %r9
callq 0x591ea
incq %rbx
jmp 0x595db
movq %r13, 0x38(%rsp)
movq %r12, 0x40(%rsp)
movq 0x30(%rsp), %rbp
movq 0x28(%rsp), %r13
xorl %ebx, %ebx
leaq 0x4247a(%rip), %r14     # 0x9bab9
leaq 0x415e7(%rip), %rdi     # 0x9ac2d
callq 0x4cd35
cltq
cmpq %rax, %rbx
jge 0x596a1
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x4cd35
cmpl %eax, %r12d
jge 0x5969c
movq (%r15,%rbx,8), %rsi
movl %r12d, %edi
callq 0x56001
movslq 0x3509ab(%rip), %rax    # 0x3aa020
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movq 0x20(%rsp), %rsi
movl 0x4(%rsp), %edx
movq 0x18(%rsp), %rcx
movq %rbp, %r8
movq %r13, %r9
callq 0x591ea
incl %r12d
jmp 0x59655
incq %rbx
jmp 0x5963f
leaq 0x41585(%rip), %rdi     # 0x9ac2d
callq 0x4cd35
movq %r15, %rdi
movl %eax, %esi
callq 0x34fc3
movq 0x741b2(%rip), %rax     # 0xcd870
cmpl $0x0, 0x10(%rax)
jle 0x596d8
movq 0x40(%rsp), %rdi
callq 0x34ff7
movq 0x38(%rsp), %rdi
callq 0x34ff7
leaq 0x42394(%rip), %rdi     # 0x9ba73
callq 0x4cdcf
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x59702
movq 0x2d6753(%rip), %rdi    # 0x32fe48
callq 0x2c010
andq $0x0, 0x2d6746(%rip)    # 0x32fe48
callq 0x59120
xorl %ebx, %ebx
xorl %r14d, %r14d
movl 0x4(%rsp), %r15d
movslq 0x14(%rsp), %rax
cmpq %rax, %r14
jge 0x5975c
movq 0x8(%rsp), %rax
movq (%rax,%r14,8), %rsi
movq 0x74145(%rip), %rdx     # 0xcd870
movl %r15d, %edi
callq 0x4d2f
movl %r15d, %edi
callq 0x44cb
testl %eax, %eax
je 0x59753
movq (%rbp,%rbx), %rdi
callq 0x34ff7
movq (%r13,%rbx), %rdi
callq 0x34ff7
incq %r14
addq $0x30, %rbx
jmp 0x59711
movl 0x4(%rsp), %edi
callq 0x44cb
testl %eax, %eax
je 0x59779
movq %rbp, %rdi
callq 0x34ff7
movq %r13, %rdi
callq 0x34ff7
movq 0x8(%rsp), %rdi
callq 0x34ff7
movl 0x4(%rsp), %edi
movq 0x20(%rsp), %rsi
callq 0x4cf6
leaq 0x421f4(%rip), %rdi     # 0x9b98c
callq 0x4cff1
testl %eax, %eax
je 0x597ab
movq 0x18(%rsp), %rdi
callq 0x42a0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq