// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/savecode.c
// Function: generate_test_code_quantizereg
void generate_test_code_quantizereg(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Model_quantizeregptr m)
{
 /*!Last Changed 12.06.2006*/
 char st[MAXLENGTH], st2[MAXLENGTH];
 code_function_header(testcodefile, "quantizereg", d->featurecount, language);
 code_constant_start(testcodefile, language); 
 code_constant_real(testcodefile, language, "minx", m->minx);
 code_constant_real(testcodefile, language, "binx", m->binx);
 if (d->featurecount > 2)
  {
   code_2d_array_constant(testcodefile, language, "means", m->partitioncount, m->partitioncount, m->meanstwo);
   code_2d_array_constant(testcodefile, language, "eigenvectors", m->eigenvectors.row, m->eigenvectors.col, m->eigenvectors.values);
   code_constant_real(testcodefile, language, "miny", m->miny);
   code_constant_real(testcodefile, language, "biny", m->biny);
   code_variable_start(testcodefile, language);
   code_add_variable(testcodefile, language, INTEGER_VARIABLE, 3, "i", "x", "y");
   code_add_variable(testcodefile, language, REAL_VARIABLE, 2, "eigenvectors_ij", "x_i");
   code_add_array_variable(testcodefile, language, 1, REAL_VARIABLE, "testdatareduced", 2);
   code_start(testcodefile, language);  
   code_dimension_reduce(testcodefile, language, d, 2);   
   code_array_index_variable(st, language, "testdatareduced", "0"); 
   sprintf(st2, "(%s - minx) / binx", st);
   code_set_variable(testcodefile, language, "x", st2);
   code_if(testcodefile, language, "<", "x", "0");
   code_set_variable(testcodefile, language, "x", "0");
   code_endif(testcodefile, language);
   sprintf(st, "%d", d->multifeaturecount - 1);
   code_if(testcodefile, language, ">", "x", st);
   code_set_variable(testcodefile, language, "x", st);   
   code_endif(testcodefile, language);
   code_array_index_variable(st, language, "testdatareduced", "1"); 
   sprintf(st2, "(%s - miny) / biny", st);
   code_set_variable(testcodefile, language, "y", st2);
   code_if(testcodefile, language, "<", "y", "0");
   code_set_variable(testcodefile, language, "y", "0");
   code_endif(testcodefile, language);
   sprintf(st, "%d", d->multifeaturecount - 1);
   code_if(testcodefile, language, ">", "y", st);
   code_set_variable(testcodefile, language, "y", st);   
   code_endif(testcodefile, language);
   code_2d_array_index_variable(st, language, "means", "x", "y");
  }
 else
  {
   code_1d_array_constant(testcodefile, language, "means", m->partitioncount, m->meansone, REAL_TYPE);
   code_variable_start(testcodefile, language);
   code_add_variable(testcodefile, language, INTEGER_VARIABLE, 1, "x");
   code_start(testcodefile, language);  
   code_array_index_variable(st, language, "testdataconverted", "0"); 
   sprintf(st2, "(%s - minx) / binx", st);
   code_set_variable(testcodefile, language, "x", st2);
   code_if(testcodefile, language, "<", "x", "0");
   code_set_variable(testcodefile, language, "x", "0");
   code_endif(testcodefile, language);
   sprintf(st, "%d", d->multifeaturecount - 1);
   code_if(testcodefile, language, ">", "x", st);
   code_set_variable(testcodefile, language, "x", st);   
   code_endif(testcodefile, language);   
   code_array_index_variable(st, language, "means", "x");
  }
 code_function_return_string(testcodefile, "quantizereg", language, st);   
 code_function_end(testcodefile, language);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x16e388, %rsp         # imm = 0x16E388
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %ebx
movq %rdi, %r14
movl 0x1bc(%rdx), %edx
leaq 0x282fd(%rip), %rsi     # 0xa9e7b
movl %ebx, %ecx
callq 0x7ce21
movl %ebx, %r15d
cmpl $0x2, %ebx
jne 0x81bb5
leaq 0x2e709(%rip), %rdi     # 0xb029d
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
movsd (%r12), %xmm0
leaq 0x2e6a7(%rip), %rsi     # 0xb025a
jmp 0x81be0
cmpl $0x5, %ebx
ja 0x81bf1
movsd (%r12), %xmm0
leaq 0x2e435(%rip), %rax     # 0xafffc
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x2e67d(%rip), %rsi     # 0xb0254
jmp 0x81be0
leaq 0x2e686(%rip), %rsi     # 0xb0266
leaq 0x2ef60(%rip), %rdx     # 0xb0b47
movq %r14, %rdi
movb $0x1, %al
callq 0x42e0
cmpl $0x5, %ebx
ja 0x81c19
movsd 0x8(%r12), %xmm0
leaq 0x5211c(%rip), %rax     # 0xd3d20
movq (%rax,%r15,8), %rsi
leaq 0x2ef56(%rip), %rdx     # 0xb0b65
movq %r14, %rdi
movb $0x1, %al
callq 0x42e0
cmpl $0x3, 0x1bc(%r13)
movl 0x40(%r12), %ecx
movq %r15, 0x10(%rsp)
movq %r13, 0x18(%rsp)
jl 0x81cc1
movq 0x28(%r12), %r9
leaq 0x2ef0a(%rip), %rdx     # 0xb0b4c
movq %r14, %rdi
movl %ebx, %esi
movl %ecx, %r8d
callq 0x7ea43
movl 0x30(%r12), %ecx
movl 0x34(%r12), %r8d
movq 0x38(%r12), %r9
leaq 0x2ecd9(%rip), %rdx     # 0xb093e
movq %r14, %rdi
movl %ebx, %esi
callq 0x7ea43
cmpl $0x5, %ebx
ja 0x81c97
movsd 0x10(%r12), %xmm0
leaq 0x5209e(%rip), %rax     # 0xd3d20
movq (%rax,%r15,8), %rsi
leaq 0x2eec5(%rip), %rdx     # 0xb0b52
movq %r14, %rdi
movb $0x1, %al
callq 0x42e0
cmpl $0x5, %ebx
ja 0x81f90
movsd 0x18(%r12), %xmm0
movl $0xb, %eax
btl %ebx, %eax
jae 0x81eb7
leaq 0x2e598(%rip), %rsi     # 0xb0254
jmp 0x81ecc
movq 0x20(%r12), %r8
leaq 0x2ee7f(%rip), %rdx     # 0xb0b4c
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %r9d
callq 0x7e7f5
cmpl $0x2, %ebx
jne 0x81d5a
leaq 0x2e617(%rip), %rdi     # 0xb0300
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
leaq 0x24192(%rip), %r8      # 0xa5e94
movq %r14, %rdi
movl $0x2, %esi
xorl %edx, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2e3f1(%rip), %rdi     # 0xb0110
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
incl 0x3304b1(%rip)          # 0x3b21e8
leaq 0x2e64d(%rip), %rsi     # 0xb038b
leaq 0x2eb3f(%rip), %rdx     # 0xb0884
leaq 0x2445d(%rip), %rcx     # 0xa61a9
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
callq 0x41b0
jmp 0x81d96
leaq 0x24133(%rip), %r8      # 0xa5e94
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7d617
incl 0x33046e(%rip)          # 0x3b21e8
cmpl $0x5, %ebx
ja 0x81d96
movl $0x3b, %eax
btl %ebx, %eax
jae 0x81d96
leaq 0x51f30(%rip), %rax     # 0xd3cc0
movq (%rax,%r15,8), %rsi
jmp 0x81d3e
leaq 0x2edba(%rip), %rsi     # 0xb0b57
leaq 0xf4260(%rsp), %r15
leaq 0x20(%rsp), %r12
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x41b0
leaq 0x240d6(%rip), %r13     # 0xa5e94
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x7d316
leaq 0x2714b(%rip), %rsi     # 0xa8f20
leaq 0x243cd(%rip), %r15     # 0xa61a9
leaq 0x7a140(%rsp), %rbp
movl %ebx, %edi
movq %r13, %rdx
movq %r15, %rcx
movq %rbp, %r8
callq 0x7df46
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
callq 0x7e093
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x7d316
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
movq 0x18(%rsp), %rax
movl 0x1c0(%rax), %edx
decl %edx
leaq 0x2edc6(%rip), %rsi     # 0xb0bf5
movq %r12, %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2f32e(%rip), %rsi     # 0xb116e
leaq 0x7a140(%rsp), %r15
movl %ebx, %edi
movq %r13, %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x7df46
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7e093
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r12, %rcx
callq 0x7d316
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
cmpl $0x5, %ebx
ja 0x822c6
leaq 0x51ef1(%rip), %rax     # 0xd3d80
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x2ecad(%rip), %rdx     # 0xb0b4c
leaq 0x23fee(%rip), %rcx     # 0xa5e94
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
callq 0x41b0
jmp 0x822c6
movl $0x14, %eax
btl %ebx, %eax
jae 0x81f78
leaq 0x2e38e(%rip), %rsi     # 0xb025a
leaq 0x2eca5(%rip), %rdx     # 0xb0b78
movq %r14, %rdi
movb $0x1, %al
callq 0x42e0
cmpl $0x2, %ebx
jne 0x81f00
leaq 0x2e417(%rip), %rdi     # 0xb0300
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
jmp 0x81f90
leaq 0x23ac2(%rip), %rax     # 0xa59c9
movq %rax, (%rsp)
leaq 0x2eda7(%rip), %r8      # 0xb0cb9
leaq 0x23f7b(%rip), %r9      # 0xa5e94
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2ea18(%rip), %r8      # 0xb094b
leaq 0x2ec01(%rip), %r9      # 0xb0b3b
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x2, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2e9d7(%rip), %r8      # 0xb092e
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x2, %r9d
xorl %eax, %eax
callq 0x7d384
jmp 0x82045
leaq 0x2e2e7(%rip), %rsi     # 0xb0266
leaq 0x2ebf2(%rip), %rdx     # 0xb0b78
movq %r14, %rdi
movb $0x1, %al
callq 0x42e0
leaq 0x23a32(%rip), %rax     # 0xa59c9
movq %rax, (%rsp)
leaq 0x2ed17(%rip), %r8      # 0xb0cb9
leaq 0x23eeb(%rip), %r9      # 0xa5e94
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2e988(%rip), %r8      # 0xb094b
leaq 0x2eb71(%rip), %r9      # 0xb0b3b
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x2, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2e947(%rip), %r8      # 0xb092e
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x2, %r9d
xorl %eax, %eax
callq 0x7d384
cmpl $0x2, %ebx
jne 0x82045
leaq 0x2e101(%rip), %rdi     # 0xb0110
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
incl 0x3301c1(%rip)          # 0x3b21e8
movq %r14, %rdi
movl $0x2, %esi
movq %r13, %rdx
movl $0x2, %ecx
callq 0x7feaa
leaq 0x2e348(%rip), %rsi     # 0xb038b
jmp 0x82077
incl 0x33019d(%rip)          # 0x3b21e8
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movl $0x2, %ecx
callq 0x7feaa
cmpl $0x5, %ebx
ja 0x82091
movl $0x3b, %eax
btl %ebx, %eax
jae 0x82091
leaq 0x51c4d(%rip), %rax     # 0xd3cc0
movq (%rax,%r15,8), %rsi
leaq 0x2e8b0(%rip), %rdx     # 0xb092e
leaq 0x24124(%rip), %rcx     # 0xa61a9
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2eabf(%rip), %rsi     # 0xb0b57
leaq 0xf4260(%rsp), %rbp
leaq 0x20(%rsp), %rdx
movq %rbp, %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x23dde(%rip), %r12     # 0xa5e94
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x7d316
leaq 0x26e53(%rip), %rsi     # 0xa8f20
leaq 0x240d5(%rip), %rbp     # 0xa61a9
leaq 0x7a140(%rsp), %r15
movl %ebx, %edi
movq %r12, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x7df46
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7e093
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x7d316
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
movl 0x1c0(%r13), %edx
decl %edx
leaq 0x2ead2(%rip), %rsi     # 0xb0bf5
leaq 0x20(%rsp), %r13
movq %r13, %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2f035(%rip), %rsi     # 0xb116e
leaq 0x7a140(%rsp), %r15
movl %ebx, %edi
movq %r12, %rdx
movq %r13, %rcx
movq %r15, %r8
callq 0x7df46
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7e093
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
movq %r13, %rcx
callq 0x7d316
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
cmpl $0x5, %ebx
ja 0x821a7
leaq 0x51bfc(%rip), %rax     # 0xd3d80
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x2e79a(%rip), %rdx     # 0xb092e
leaq 0x2e85e(%rip), %rcx     # 0xb09f9
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2e9bc(%rip), %rsi     # 0xb0b6a
leaq 0xf4260(%rsp), %r15
leaq 0x20(%rsp), %r12
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x41b0
leaq 0x237fa(%rip), %r13     # 0xa59c9
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x7d316
leaq 0x26d3a(%rip), %rsi     # 0xa8f20
leaq 0x23fbc(%rip), %r15     # 0xa61a9
leaq 0x7a140(%rsp), %rbp
movl %ebx, %edi
movq %r13, %rdx
movq %r15, %rcx
movq %rbp, %r8
callq 0x7df46
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
callq 0x7e093
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x7d316
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
movq 0x18(%rsp), %rax
movl 0x1c0(%rax), %edx
decl %edx
leaq 0x2e9b5(%rip), %rsi     # 0xb0bf5
movq %r12, %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2ef1d(%rip), %rsi     # 0xb116e
leaq 0x7a140(%rsp), %r15
movl %ebx, %edi
movq %r13, %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x7df46
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7e093
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r12, %rcx
callq 0x7d316
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e23a
cmpl $0x5, %ebx
ja 0x822c6
leaq 0x51a54(%rip), %rax     # 0xd3cf0
movq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x2e8a0(%rip), %rdx     # 0xb0b4c
leaq 0x23be1(%rip), %rcx     # 0xa5e94
leaq 0x2370f(%rip), %r8      # 0xa59c9
leaq 0x20(%rsp), %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x27bae(%rip), %rsi     # 0xa9e7b
leaq 0x20(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %edx
callq 0x7d912
movq %r14, %rdi
movl %ebx, %esi
callq 0x7db1b
addq $0x16e388, %rsp         # imm = 0x16E388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq