// File: /workspace/github_c_makefile_star2_O2/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 $0xf4258, %rsp          # imm = 0xF4258
movq %rcx, %r12
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
movl 0x1bc(%rdx), %edx
leaq 0x2397d(%rip), %rsi     # 0x99da3
movl %ebx, %ecx
callq 0x72674
movq %r14, %rdi
movl %ebx, %esi
callq 0x72b0a
movsd (%r12), %xmm0
leaq 0x2a667(%rip), %rdx     # 0xa0aab
movq %r14, %rdi
movl %ebx, %esi
callq 0x72ad0
movsd 0x8(%r12), %xmm0
leaq 0x2a66d(%rip), %rdx     # 0xa0ac9
movq %r14, %rdi
movl %ebx, %esi
callq 0x72ad0
cmpl $0x3, 0x1bc(%r15)
movl 0x40(%r12), %ecx
jl 0x7672d
movq 0x28(%r12), %r9
leaq 0x2a62b(%rip), %rdx     # 0xa0ab0
movq %r14, %rdi
movl %ebx, %esi
movl %ecx, %r8d
callq 0x73ec6
movl 0x30(%r12), %ecx
movl 0x34(%r12), %r8d
movq 0x38(%r12), %r9
leaq 0x2a3fa(%rip), %rdx     # 0xa08a2
movq %r14, %rdi
movl %ebx, %esi
callq 0x73ec6
movsd 0x10(%r12), %xmm0
leaq 0x2a5f6(%rip), %rdx     # 0xa0ab6
movq %r14, %rdi
movl %ebx, %esi
callq 0x72ad0
movsd 0x18(%r12), %xmm0
leaq 0x2a604(%rip), %rdx     # 0xa0adc
movq %r14, %rdi
movl %ebx, %esi
callq 0x72ad0
movq %r14, %rdi
movl %ebx, %esi
callq 0x72fb3
leaq 0x1f4d6(%rip), %rax     # 0x959c9
movq %rax, (%rsp)
leaq 0x2a71f(%rip), %r8      # 0xa0c1d
leaq 0x1f997(%rip), %r9      # 0x95e9c
pushq $0x3
popq %rcx
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x72de1
leaq 0x2a392(%rip), %r8      # 0xa08af
leaq 0x2a57b(%rip), %r9      # 0xa0a9f
pushq $0x1
popq %rbp
pushq $0x2
popq %r12
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x72de1
leaq 0x2a34f(%rip), %r13     # 0xa0892
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %edx
movl %ebp, %ecx
movq %r13, %r8
movl %r12d, %r9d
xorl %eax, %eax
callq 0x72b76
movq %r14, %rdi
movl %ebx, %esi
callq 0x726d3
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
movl %r12d, %ecx
callq 0x74f01
leaq 0x1fc37(%rip), %rcx     # 0x961b1
leaq 0x7a130(%rsp), %r12
movq %r12, %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x7327f
leaq 0x2a525(%rip), %rsi     # 0xa0abb
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdi
movl %ebx, %esi
leaq 0x1f8e8(%rip), %rbp     # 0x95e9c
movq %rbp, %rdx
movq %r13, %rcx
callq 0x72b25
leaq 0x228ca(%rip), %rdx     # 0x98e90
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rcx
leaq 0x1fbdc(%rip), %r13     # 0x961b1
movq %r13, %r8
callq 0x736fc
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
callq 0x737fd
movl 0x1c0(%r15), %edx
decl %edx
leaq 0x2a552(%rip), %rsi     # 0xa0b59
movq %r12, %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2aaba(%rip), %rdx     # 0xa10d2
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rcx
movq %r12, %r8
callq 0x736fc
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
callq 0x737fd
leaq 0x2a314(%rip), %rcx     # 0xa095d
movq %r12, %rdi
movl %ebx, %esi
leaq 0x2a23d(%rip), %rdx     # 0xa0892
callq 0x7327f
leaq 0x2a46d(%rip), %rsi     # 0xa0ace
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdi
movl %ebx, %esi
leaq 0x1f34a(%rip), %rbp     # 0x959c9
movq %rbp, %rdx
movq %r13, %rcx
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
leaq 0x227fa(%rip), %rdx     # 0x98e90
movq %rbp, %rcx
leaq 0x1fb11(%rip), %r13     # 0x961b1
movq %r13, %r8
callq 0x736fc
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
callq 0x737fd
movl 0x1c0(%r15), %edx
decl %edx
movq %r12, %rdi
leaq 0x2a484(%rip), %rsi     # 0xa0b59
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdi
movl %ebx, %esi
leaq 0x2a9ea(%rip), %rdx     # 0xa10d2
movq %rbp, %rcx
movq %r12, %r8
callq 0x736fc
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
movq %r12, %rcx
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
callq 0x737fd
movq %r12, %rdi
movl %ebx, %esi
leaq 0x2a397(%rip), %rdx     # 0xa0ab0
leaq 0x1f77c(%rip), %rcx     # 0x95e9c
movq %rbp, %r8
callq 0x7329c
jmp 0x7685c
movq 0x20(%r12), %r8
leaq 0x2a377(%rip), %rdx     # 0xa0ab0
pushq $0x1
popq %rbp
movq %r14, %rdi
movl %ebx, %esi
movl %ebp, %r9d
callq 0x73cac
movq %r14, %rdi
movl %ebx, %esi
callq 0x72fb3
leaq 0x1f742(%rip), %r13     # 0x95e9c
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl %ebp, %ecx
movq %r13, %r8
xorl %eax, %eax
callq 0x72de1
movq %r14, %rdi
movl %ebx, %esi
callq 0x726d3
leaq 0x2a06a(%rip), %rdx     # 0xa07e8
leaq 0x1fa2c(%rip), %rcx     # 0x961b1
leaq 0x7a130(%rsp), %rbp
movq %rbp, %rdi
movl %ebx, %esi
callq 0x7327f
leaq 0x2a31d(%rip), %rsi     # 0xa0abb
movq %r15, %r12
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %r15, %rcx
callq 0x72b25
leaq 0x226c6(%rip), %rdx     # 0x98e90
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rcx
leaq 0x1f9d8(%rip), %r8      # 0x961b1
callq 0x736fc
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
leaq 0x1f9c4(%rip), %rcx     # 0x961b1
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
callq 0x737fd
movl 0x1c0(%r12), %edx
decl %edx
leaq 0x2a34c(%rip), %rsi     # 0xa0b59
movq %rbp, %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2a8b4(%rip), %rdx     # 0xa10d2
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rcx
movq %rbp, %r8
callq 0x736fc
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
callq 0x737fd
movq %rbp, %rdi
movl %ebx, %esi
leaq 0x2a25c(%rip), %rdx     # 0xa0ab0
movq %r13, %rcx
callq 0x7327f
leaq 0x23540(%rip), %rsi     # 0x99da3
leaq 0x7a130(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %edx
callq 0x7308c
movq %r14, %rdi
movl %ebx, %esi
callq 0x7320f
addq $0xf4258, %rsp          # imm = 0xF4258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq