// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7a130, %rsp          # imm = 0x7A130
movq %rcx, %r12
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
movl 0x1bc(%rdx), %edx
leaq 0x27564(%rip), %rsi     # 0xa6df6
movl %ebx, %ecx
callq 0x7b551
cmpl $0x2, %ebx
jne 0x7f8b7
leaq 0x2d960(%rip), %rdi     # 0xad205
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
movl 0x1c0(%r15), %ecx
decl %ecx
movq 0x10(%r12), %rax
movq (%rax), %r8
leaq 0x28fd2(%rip), %rdx     # 0xa88a1
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %r9d
callq 0x7ceb8
movsd (%r12), %xmm0
leaq 0x2e1c1(%rip), %rdx     # 0xadaad
movq %r14, %rdi
movl %ebx, %esi
callq 0x7b9ed
cmpl $0x2, %ebx
jne 0x7f9a7
leaq 0x2d962(%rip), %rdi     # 0xad268
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
leaq 0x2e302(%rip), %r8      # 0xadc21
leaq 0x2dff6(%rip), %r9      # 0xad91c
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x2, %ecx
xorl %eax, %eax
callq 0x7bd1c
leaq 0x2e2d5(%rip), %rax     # 0xadc15
movq %rax, (%rsp)
leaq 0x2e148(%rip), %r8      # 0xada93
leaq 0x2e151(%rip), %r9      # 0xadaa3
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7bd1c
movl 0x1c0(%r15), %r9d
leaq 0x2de76(%rip), %r8      # 0xad7ec
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7bab4
leaq 0x2d6e5(%rip), %rdi     # 0xad078
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
jmp 0x7fa1b
leaq 0x2e273(%rip), %r8      # 0xadc21
leaq 0x2df67(%rip), %r9      # 0xad91c
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x2, %ecx
xorl %eax, %eax
callq 0x7bd1c
leaq 0x2e246(%rip), %rax     # 0xadc15
movq %rax, (%rsp)
leaq 0x2e0b9(%rip), %r8      # 0xada93
leaq 0x2e0c2(%rip), %r9      # 0xadaa3
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7bd1c
movl 0x1c0(%r15), %r9d
leaq 0x2dde7(%rip), %r8      # 0xad7ec
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7bab4
incl 0x32f7c7(%rip)          # 0x3af1e8
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x7e795
leaq 0x2e1de(%rip), %r12     # 0xadc15
leaq 0x2e13f(%rip), %rcx     # 0xadb7d
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x7ba46
movl 0x1c0(%r15), %r8d
addl $-0x2, %r8d
leaq 0x2e1c4(%rip), %r15     # 0xadc21
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x7ca9f
leaq 0x2dd73(%rip), %rdx     # 0xad7ec
leaq 0x10(%rsp), %r13
movq %r13, %rdi
movl %ebx, %esi
movq %r15, %rcx
callq 0x7c24c
leaq 0x2e011(%rip), %rdx     # 0xadaa3
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rcx
callq 0x7ba46
leaq 0x28dfb(%rip), %rdx     # 0xa88a1
movq %r13, %rdi
movl %ebx, %esi
movq %r15, %rcx
callq 0x7c24c
leaq 0x2dfd9(%rip), %rdx     # 0xada93
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rcx
callq 0x7ba46
leaq 0x2dfc9(%rip), %rcx     # 0xada97
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x7ba46
movq %r14, %rdi
movl %ebx, %esi
callq 0x7cd49
leaq 0x2dfbb(%rip), %rcx     # 0xadaa7
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x7ba46
leaq 0x272f6(%rip), %rsi     # 0xa6df6
movq %r14, %rdi
movl %ebx, %edx
movq %r12, %rcx
callq 0x7bffb
movq %r14, %rdi
movl %ebx, %esi
callq 0x7c1ca
addq $0x7a130, %rsp          # imm = 0x7A130
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq