// File: /workspace/github_c_makefile_star2_O3/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 0x285cf(%rip), %rsi     # 0xa9e66
movl %ebx, %ecx
callq 0x7ce21
cmpl $0x2, %ebx
jne 0x8192b
leaq 0x2e9ef(%rip), %rdi     # 0xb029d
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
leaq 0x1c0(%r15), %r13
movl 0x1c0(%r15), %ecx
decl %ecx
movq 0x10(%r12), %rax
movq (%rax), %r8
leaq 0x2a08e(%rip), %rdx     # 0xab96d
movq %r14, %rdi
movl $0x2, %esi
movl $0x1, %r9d
callq 0x7e7f5
movsd (%r12), %xmm0
leaq 0x2e95b(%rip), %rsi     # 0xb025a
leaq 0x2f23f(%rip), %rdx     # 0xb0b45
movq %r14, %rdi
movb $0x1, %al
callq 0x42e0
leaq 0x2e9e9(%rip), %rdi     # 0xb0300
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
jmp 0x81990
leaq 0x1c0(%r15), %r13
movl 0x1c0(%r15), %ecx
decl %ecx
movq 0x10(%r12), %rax
movq (%rax), %r8
leaq 0x2a023(%rip), %rdx     # 0xab96d
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %r9d
callq 0x7e7f5
cmpl $0x5, %ebx
ja 0x81990
movl $0x3b, %eax
btl %ebx, %eax
jae 0x81990
movsd (%r12), %xmm0
movl %ebx, %eax
leaq 0x2e780(%rip), %rcx     # 0xb00f8
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
leaq 0x2f1bf(%rip), %rdx     # 0xb0b45
movq %r14, %rdi
movb $0x1, %al
callq 0x42e0
leaq 0x2f322(%rip), %r8      # 0xb0cb9
leaq 0x2f016(%rip), %r9      # 0xb09b4
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x2, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2f2f5(%rip), %rax     # 0xb0cad
movq %rax, (%rsp)
leaq 0x2f168(%rip), %r8      # 0xb0b2b
leaq 0x2f171(%rip), %r9      # 0xb0b3b
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7d617
movl (%r13), %r9d
leaq 0x2ee99(%rip), %r8      # 0xb0884
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7d384
cmpl $0x2, %ebx
jne 0x81a1f
leaq 0x2e703(%rip), %rdi     # 0xb0110
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
incl 0x3307c3(%rip)          # 0x3b21e8
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x8050d
leaq 0x2f272(%rip), %rdx     # 0xb0cad
leaq 0x2f1d3(%rip), %rcx     # 0xb0c15
movq %r14, %rdi
movl %ebx, %esi
callq 0x7d316
movl 0x1c0(%r15), %r8d
addl $-0x2, %r8d
leaq 0x2f25b(%rip), %rdx     # 0xb0cb9
movq %r14, %rdi
movl %ebx, %esi
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x7e3dc
leaq 0x52309(%rip), %r15     # 0xd3d80
cmpl $0x5, %ebx
ja 0x81a9c
movl %ebx, %eax
movq (%r15,%rax,8), %rsi
leaq 0x2edfb(%rip), %rdx     # 0xb0884
leaq 0x2f229(%rip), %rcx     # 0xb0cb9
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2f098(%rip), %rdx     # 0xb0b3b
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %esi
callq 0x7d316
cmpl $0x5, %ebx
ja 0x81ad7
movl %ebx, %eax
movq (%r15,%rax,8), %rsi
leaq 0x29ea9(%rip), %rdx     # 0xab96d
leaq 0x2f1ee(%rip), %rcx     # 0xb0cb9
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2f04d(%rip), %rdx     # 0xb0b2b
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
movl %ebx, %esi
callq 0x7d316
leaq 0x2f1b9(%rip), %r15     # 0xb0cad
leaq 0x2f034(%rip), %rcx     # 0xb0b2f
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7d316
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e686
leaq 0x2f026(%rip), %rcx     # 0xb0b3f
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7d316
leaq 0x28339(%rip), %rsi     # 0xa9e66
movq %r14, %rdi
movl %ebx, %edx
movq %r15, %rcx
callq 0x7d912
movq %r14, %rdi
movl %ebx, %esi
callq 0x7db1b
addq $0x7a130, %rsp          # imm = 0x7A130
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq