// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/savecode.c
// Function: generate_test_code_linearreg
void generate_test_code_linearreg(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Model_linearregressionptr m)
{
 /*!Last Changed 01.20.2006 fixed for loop's ending value*/
 /*!Last Changed 12.06.2006*/
 char st[MAXLENGTH];
 code_function_header(testcodefile, "linearreg", d->featurecount, language);
 code_constant_start(testcodefile, language); 
 code_1d_array_constant(testcodefile, language, "w", d->multifeaturecount - 1, m->w.values[0], REAL_TYPE);
 code_constant_real(testcodefile, language, "b", m->b);
 code_variable_start(testcodefile, language);
 code_add_variable(testcodefile, language, INTEGER_VARIABLE, 2, "i", "j");
 code_add_variable(testcodefile, language, REAL_VARIABLE, 3, "w_i", "x_i", "sum");
 code_add_array_variable(testcodefile, language, 1, REAL_VARIABLE, "testdataconverted", d->multifeaturecount);
 code_start(testcodefile, language);  
	code_realize(testcodefile, language, d, NO);
 code_set_variable(testcodefile, language, "sum", "0.0"); 
 code_for(testcodefile, language, "i", 0, d->multifeaturecount - 2, 1);
 code_array_index_variable(st, language, "testdataconverted", "i"); 
 code_set_variable(testcodefile, language, "x_i", st);
 code_array_index_variable(st, language, "w", "i"); 
 code_set_variable(testcodefile, language, "w_i", st);
 code_set_variable(testcodefile, language, "sum", "sum + w_i * x_i");
 code_endfor(testcodefile, language, "i");
 code_set_variable(testcodefile, language, "sum", "sum + b");
 code_function_return_string(testcodefile, "linearreg", language, "sum");
 code_function_end(testcodefile, language);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a138, %rsp          # imm = 0x7A138
movq %rcx, %r12
movq %rdx, %rbp
movl %esi, %ebx
movq %rdi, %r14
movl 0x1bc(%rdx), %edx
leaq 0x23b59(%rip), %rsi     # 0x99d8e
movl %ebx, %ecx
callq 0x72674
movq %r14, %rdi
movl %ebx, %esi
callq 0x72b0a
movl 0x1c0(%rbp), %ecx
decl %ecx
movq 0x10(%r12), %rax
movq (%rax), %r8
leaq 0x25634(%rip), %rdx     # 0x9b891
pushq $0x1
popq %r15
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %r9d
callq 0x73cac
movsd (%r12), %xmm0
leaq 0x2a82e(%rip), %rdx     # 0xa0aa9
movq %r14, %rdi
movl %ebx, %esi
callq 0x72ad0
movq %r14, %rdi
movl %ebx, %esi
callq 0x72fb3
leaq 0x2a987(%rip), %r12     # 0xa0c1d
leaq 0x2a67b(%rip), %r9      # 0xa0918
pushq $0x2
popq %rcx
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movq %r12, %r8
xorl %eax, %eax
callq 0x72de1
leaq 0x2a959(%rip), %r13     # 0xa0c11
movq %r13, (%rsp)
leaq 0x2a7cc(%rip), %r8      # 0xa0a8f
leaq 0x2a7d5(%rip), %r9      # 0xa0a9f
pushq $0x3
popq %rcx
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
xorl %eax, %eax
callq 0x72de1
movl 0x1c0(%rbp), %r9d
leaq 0x2a4fe(%rip), %r8      # 0xa07e8
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x72b76
movq %r14, %rdi
movl %ebx, %esi
callq 0x726d3
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x753f5
leaq 0x2a85d(%rip), %rcx     # 0xa0b79
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x72b25
movl 0x1c0(%rbp), %r8d
addl $-0x2, %r8d
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
xorl %ecx, %ecx
movl %r15d, %r9d
callq 0x73938
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl %ebx, %esi
leaq 0x2a491(%rip), %rdx     # 0xa07e8
movq %r12, %rcx
callq 0x7327f
movq %r14, %rdi
movl %ebx, %esi
leaq 0x2a734(%rip), %rdx     # 0xa0a9f
movq %r15, %rcx
callq 0x72b25
movq %r15, %rdi
movl %ebx, %esi
leaq 0x25512(%rip), %rdx     # 0x9b891
movq %r12, %rcx
callq 0x7327f
movq %r14, %rdi
movl %ebx, %esi
leaq 0x2a6fc(%rip), %rdx     # 0xa0a8f
movq %r15, %rcx
callq 0x72b25
leaq 0x2a6f1(%rip), %rcx     # 0xa0a93
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x72b25
movq %r14, %rdi
movl %ebx, %esi
callq 0x73b72
leaq 0x2a6e3(%rip), %rcx     # 0xa0aa3
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rdx
callq 0x72b25
movq %r14, %rdi
leaq 0x239b7(%rip), %rsi     # 0x99d8e
movl %ebx, %edx
movq %r13, %rcx
callq 0x7308c
movq %r14, %rdi
movl %ebx, %esi
callq 0x7320f
addq $0x7a138, %rsp          # imm = 0x7A138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq