// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x7a150, %rsp          # imm = 0x7A150
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x1bc(%rax), %edx
movl -0xc(%rbp), %ecx
leaq 0x322ec(%rip), %rsi     # 0xe69ae
callq 0xaf1e0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xaf9c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x1c0(%rax), %ecx
subl $0x1, %ecx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq (%rax), %r8
leaq 0x33ac5(%rip), %rdx     # 0xe81be
movl $0x1, %r9d
callq 0xb15d0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movsd (%rax), %xmm0
leaq 0x38a9b(%rip), %rdx     # 0xed1b5
callq 0xaf870
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb00e0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
xorl %edx, %edx
movl $0x2, %ecx
leaq 0x38be9(%rip), %r8      # 0xed329
leaq 0x388dd(%rip), %r9      # 0xed024
movb $0x0, %al
callq 0xafe40
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x1, %edx
movl $0x3, %ecx
leaq 0x38a35(%rip), %r8      # 0xed19b
leaq 0x38a3e(%rip), %r9      # 0xed1ab
leaq 0x38ba9(%rip), %rax     # 0xed31d
movq %rax, (%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x1c0(%rax), %r9d
movl $0x1, %ecx
leaq 0x38757(%rip), %r8      # 0xecef4
movl %ecx, %edx
movb $0x0, %al
callq 0xafab0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xaf2c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
xorl %ecx, %ecx
callq 0xb3590
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x38b4b(%rip), %rdx     # 0xed31d
leaq 0x38aac(%rip), %rcx     # 0xed285
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x1c0(%rax), %r8d
subl $0x2, %r8d
leaq 0x38b2e(%rip), %rdx     # 0xed329
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xb10b0
leaq -0x7a140(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x386db(%rip), %rdx     # 0xecef4
leaq 0x38b09(%rip), %rcx     # 0xed329
callq 0xb04c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a140(%rbp), %rcx
leaq 0x38971(%rip), %rdx     # 0xed1ab
callq 0xafa00
leaq -0x7a140(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x3396e(%rip), %rdx     # 0xe81be
leaq 0x38ad2(%rip), %rcx     # 0xed329
callq 0xb04c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a140(%rbp), %rcx
leaq 0x3892a(%rip), %rdx     # 0xed19b
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x38a99(%rip), %rdx     # 0xed31d
leaq 0x38914(%rip), %rcx     # 0xed19f
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x38a8b(%rip), %rdx     # 0xed329
callq 0xb13f0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x38a6c(%rip), %rdx     # 0xed31d
leaq 0x388f7(%rip), %rcx     # 0xed1af
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0x320e3(%rip), %rsi     # 0xe69ae
leaq 0x38a4b(%rip), %rcx     # 0xed31d
callq 0xb01f0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb03a0
addq $0x7a150, %rsp          # imm = 0x7A150
popq %rbp
retq
nopl (%rax)