// File: /workspace/github_c_makefile_star2_O1/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 $0x16e378, %rsp         # imm = 0x16E378
movq %rcx, %r12
movl %esi, %ebx
movq %rdi, %r14
movq %rdx, %r15
movl 0x1bc(%rdx), %edx
leaq 0x272ba(%rip), %rsi     # 0xa6e0b
movl %ebx, %ecx
callq 0x7b551
cmpl $0x2, %ebx
jne 0x7fb76
leaq 0x2d6a1(%rip), %rdi     # 0xad205
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
movsd (%r12), %xmm0
leaq 0x2df2c(%rip), %rdx     # 0xadaaf
movq %r14, %rdi
movl %ebx, %esi
callq 0x7b9ed
movsd 0x8(%r12), %xmm0
leaq 0x2df32(%rip), %rdx     # 0xadacd
movq %r14, %rdi
movl %ebx, %esi
callq 0x7b9ed
cmpl $0x3, 0x1bc(%r15)
movl 0x40(%r12), %ecx
jl 0x7fcd4
movq 0x28(%r12), %r9
leaq 0x2def0(%rip), %rdx     # 0xadab4
movq %r14, %rdi
movl %ebx, %esi
movl %ecx, %r8d
callq 0x7d0d5
movl 0x30(%r12), %ecx
movl 0x34(%r12), %r8d
movq 0x38(%r12), %r9
leaq 0x2dcbf(%rip), %rdx     # 0xad8a6
movq %r14, %rdi
movl %ebx, %esi
callq 0x7d0d5
movsd 0x10(%r12), %xmm0
leaq 0x2debb(%rip), %rdx     # 0xadaba
movq %r14, %rdi
movl %ebx, %esi
callq 0x7b9ed
movsd 0x18(%r12), %xmm0
leaq 0x2dec9(%rip), %rdx     # 0xadae0
movq %r14, %rdi
movl %ebx, %esi
callq 0x7b9ed
cmpl $0x2, %ebx
jne 0x7fd4f
leaq 0x2d637(%rip), %rdi     # 0xad268
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
leaq 0x22d7f(%rip), %rax     # 0xa29c9
movq %rax, (%rsp)
leaq 0x2dfcc(%rip), %r8      # 0xadc21
leaq 0x23238(%rip), %r9      # 0xa2e94
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7bd1c
leaq 0x2dc3d(%rip), %r8      # 0xad8b3
leaq 0x2de26(%rip), %r9      # 0xadaa3
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x2, %ecx
xorl %eax, %eax
callq 0x7bd1c
leaq 0x2dbfc(%rip), %r8      # 0xad896
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x2, %r9d
xorl %eax, %eax
callq 0x7bab4
leaq 0x2d3bb(%rip), %rdi     # 0xad078
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
jmp 0x7fdc2
movq 0x20(%r12), %r8
leaq 0x2ddd4(%rip), %rdx     # 0xadab4
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %r9d
callq 0x7ceb8
cmpl $0x2, %ebx
movq %r15, 0x8(%rsp)
jne 0x7ffef
leaq 0x2d563(%rip), %rdi     # 0xad268
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
leaq 0x23176(%rip), %r8      # 0xa2e94
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7bd1c
leaq 0x2d340(%rip), %rdi     # 0xad078
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
jmp 0x80009
leaq 0x22c73(%rip), %rax     # 0xa29c9
movq %rax, (%rsp)
leaq 0x2dec0(%rip), %r8      # 0xadc21
leaq 0x2312c(%rip), %r9      # 0xa2e94
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7bd1c
leaq 0x2db31(%rip), %r8      # 0xad8b3
leaq 0x2dd1a(%rip), %r9      # 0xadaa3
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x2, %ecx
xorl %eax, %eax
callq 0x7bd1c
leaq 0x2daf0(%rip), %r8      # 0xad896
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
movl $0x2, %r9d
xorl %eax, %eax
callq 0x7bab4
incl 0x32f420(%rip)          # 0x3af1e8
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
movl $0x2, %ecx
callq 0x7e25d
leaq 0x2dab5(%rip), %rdx     # 0xad896
leaq 0x233c1(%rip), %rcx     # 0xa31a9
leaq 0x7a130(%rsp), %r12
movq %r12, %rdi
movl %ebx, %esi
callq 0x7c24c
leaq 0x2dcbe(%rip), %rsi     # 0xadabf
leaq 0xf4250(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x41b0
leaq 0x23077(%rip), %r13     # 0xa2e94
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x7ba46
leaq 0x260bc(%rip), %rsi     # 0xa5ef0
leaq 0x10(%rsp), %rbp
movl %ebx, %edi
movq %r13, %rdx
leaq 0x23364(%rip), %rcx     # 0xa31a9
movq %rbp, %r8
callq 0x7c601
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
callq 0x7c75c
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
leaq 0x23340(%rip), %rcx     # 0xa31a9
callq 0x7ba46
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c903
movl 0x1c0(%r15), %edx
decl %edx
leaq 0x2dcd5(%rip), %rsi     # 0xadb5d
movq %r12, %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2e23d(%rip), %rsi     # 0xae0d6
leaq 0x10(%rsp), %rbp
movl %ebx, %edi
movq %r13, %rdx
movq %r12, %rcx
movq %rbp, %r8
callq 0x7c601
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
callq 0x7c75c
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r12, %rcx
callq 0x7ba46
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c903
leaq 0x2da85(%rip), %rcx     # 0xad961
movq %r12, %rdi
movl %ebx, %esi
leaq 0x2d9ae(%rip), %rdx     # 0xad896
callq 0x7c24c
leaq 0x2dbde(%rip), %rsi     # 0xadad2
leaq 0xf4250(%rsp), %r13
movq %r13, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x41b0
leaq 0x22ab9(%rip), %rbp     # 0xa29c9
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x7ba46
leaq 0x10(%rsp), %r13
movl %ebx, %edi
leaq 0x25fc2(%rip), %rsi     # 0xa5ef0
movq %rbp, %rdx
leaq 0x23271(%rip), %r12     # 0xa31a9
movq %r12, %rcx
movq %r13, %r8
callq 0x7c601
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x7c75c
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x7ba46
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c903
movl 0x1c0(%r15), %edx
decl %edx
leaq 0x7a130(%rsp), %r12
movq %r12, %rdi
leaq 0x2dbd8(%rip), %rsi     # 0xadb5d
xorl %eax, %eax
callq 0x41b0
leaq 0x10(%rsp), %r15
movl %ebx, %edi
leaq 0x2e13c(%rip), %rsi     # 0xae0d6
movq %rbp, %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x7c601
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7c75c
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x7ba46
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c903
leaq 0x2dade(%rip), %rdx     # 0xadab4
movq %r12, %rdi
movl %ebx, %esi
leaq 0x22eb2(%rip), %rcx     # 0xa2e94
movq %rbp, %r8
callq 0x7c269
jmp 0x8011d
leaq 0x22e9e(%rip), %r8      # 0xa2e94
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7bd1c
incl 0x32f1d9(%rip)          # 0x3af1e8
leaq 0x2d7d6(%rip), %rdx     # 0xad7ec
leaq 0x2318c(%rip), %rbp     # 0xa31a9
leaq 0x7a130(%rsp), %r12
movq %r12, %rdi
movl %ebx, %esi
movq %rbp, %rcx
callq 0x7c24c
leaq 0x2da86(%rip), %rsi     # 0xadabf
leaq 0xf4250(%rsp), %r15
movq %r15, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x41b0
leaq 0x22e3f(%rip), %r13     # 0xa2e94
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x7ba46
leaq 0x25e84(%rip), %rsi     # 0xa5ef0
leaq 0x10(%rsp), %r15
movl %ebx, %edi
movq %r13, %rdx
movq %rbp, %rcx
movq %r15, %r8
callq 0x7c601
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7c75c
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x7ba46
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c903
movq 0x8(%rsp), %rax
movl 0x1c0(%rax), %edx
decl %edx
leaq 0x2daa1(%rip), %rsi     # 0xadb5d
movq %r12, %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2e009(%rip), %rsi     # 0xae0d6
leaq 0x10(%rsp), %r15
movl %ebx, %edi
movq %r13, %rdx
movq %r12, %rcx
movq %r15, %r8
callq 0x7c601
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7c75c
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r12, %rcx
callq 0x7ba46
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c903
leaq 0x2d9a4(%rip), %rdx     # 0xadab4
movq %r12, %rdi
movl %ebx, %esi
movq %r13, %rcx
callq 0x7c24c
leaq 0x26ce7(%rip), %rsi     # 0xa6e0b
leaq 0x7a130(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %edx
callq 0x7bffb
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c1ca
addq $0x16e378, %rsp         # imm = 0x16E378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq