// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/savecode.c
// Function: generate_test_code_mlpgenericreg
void generate_test_code_mlpgenericreg(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Mlpnetworkptr m)
{
 /*!Last Changed 24.06.2006*/
 int i;
 char st[MAXLENGTH], st2[MAXLENGTH], st3[MAXLENGTH];
 code_function_header(testcodefile, "mlpgenericreg", d->featurecount, language);
 code_constant_start(testcodefile, language);
	code_1d_array_constant_instance(testcodefile, language, d, "mean", d->multifeaturecount - 1, &mean);
	code_1d_array_constant_instance(testcodefile, language, d, "variance", d->multifeaturecount - 1, &variance);
 for (i = 0; i < m->P.layernum; i++)
  {
   sprintf(st, "weights%d", i);
   code_2d_array_constant(testcodefile, language, st, m->weights[i].row, m->weights[i].col, m->weights[i].values); 
  } 
 sprintf(st, "weights%d", m->P.layernum);
 code_1d_array_constant(testcodefile, language, st, m->weights[i].col, m->weights[i].values[0], REAL_TYPE); 
 code_variable_start(testcodefile, language);
 for (i = 0; i < m->P.layernum; i++)
  {
   sprintf(st, "hidden%d", i);
   code_add_array_variable(testcodefile, language, 1, REAL_VARIABLE, st, m->weights[i].row);
  }
 code_add_variable(testcodefile, language, REAL_VARIABLE, 6, "sum", "weights_ij", "weights_j", "x_j", "sigmoid", "output");
 code_add_variable(testcodefile, language, INTEGER_VARIABLE, 4, "i", "j", "k", "a");
 code_add_array_variable(testcodefile, language, 1, REAL_VARIABLE, "testdataconverted", d->multifeaturecount);
 code_start(testcodefile, language);
	code_realize(testcodefile, language, d, YES);
 for (i = 0; i < m->P.layernum; i++)
  {
   sprintf(st, "weights%d", i);
   sprintf(st2, "hidden%d", i);
   sprintf(st3, "hidden%d", i - 1);
   if (i == 0)
     code_forward_propagation(testcodefile, language, m->weights[i].row, m->weights[i].col, st, "testdataconverted", st2, YES);
   else
     code_forward_propagation(testcodefile, language, m->weights[i].row, m->weights[i].col, st, st3, st2, YES);
  }
 if (m->P.layernum == 0)
   code_forward_propagation_regression_output(testcodefile, language, m->weights[m->P.layernum].col, "weights0", "testdataconverted", "output");
 else
  {
   sprintf(st, "weights%d", m->P.layernum);
   sprintf(st2, "hidden%d", m->P.layernum - 1);
   code_forward_propagation_regression_output(testcodefile, language, m->weights[m->P.layernum].col, st, st2, "output");
  }
 code_function_return_string(testcodefile, "mlpgenericreg", language, "output");   
 code_function_end(testcodefile, language);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x16e378, %rsp         # imm = 0x16E378
movq %rcx, %r15
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movl 0x1bc(%rdx), %edx
leaq 0x29b04(%rip), %rsi     # 0xafab6
movl %ebp, %ecx
callq 0x7ce21
cmpl $0x2, %ebp
jne 0x85fd7
leaq 0x2a2d8(%rip), %rdi     # 0xb029d
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movl 0x1c0(%r14), %r8d
decl %r8d
leaq 0x2b8a3(%rip), %rcx     # 0xb188b
leaq 0x32bfb9(%rip), %r9     # 0x3b1fa8
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x7e724
movl 0x1c0(%r14), %r8d
decl %r8d
leaq 0x20417(%rip), %rcx     # 0xa6424
leaq 0x32bfc4(%rip), %r9     # 0x3b1fd8
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, (%rsp)
movq %r14, %rdx
callq 0x7e724
movl 0x5c(%r15), %edx
testl %edx, %edx
jle 0x8608e
movl %ebp, %r12d
movl $0x8, %ebp
leaq 0x10(%rsp), %r14
xorl %r13d, %r13d
movq 0x8(%rsp), %rbx
movq %r14, %rdi
leaq 0x2accb(%rip), %rsi     # 0xb0d1c
movl %r13d, %edx
xorl %eax, %eax
callq 0x41b0
movq (%r15), %rax
movl -0x8(%rax,%rbp), %ecx
movl -0x4(%rax,%rbp), %r8d
movq (%rax,%rbp), %r9
movq %rbx, %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x7ea43
incq %r13
movslq 0x5c(%r15), %rdx
addq $0x10, %rbp
cmpq %rdx, %r13
jl 0x86047
movl %r12d, %ebp
jmp 0x86091
xorl %r13d, %r13d
leaq 0x2ac84(%rip), %rsi     # 0xb0d1c
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41b0
movq (%r15), %rax
shlq $0x4, %r13
movl 0x4(%rax,%r13), %ecx
movq 0x8(%rax,%r13), %rax
movq (%rax), %r8
movq 0x8(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
movl $0x1, %r9d
callq 0x7e7f5
movl %ebp, %r12d
cmpl $0x2, %ebp
jne 0x860f4
leaq 0x2a21e(%rip), %rdi     # 0xb0300
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
cmpl $0x0, 0x5c(%r15)
movq %r14, %rbx
jle 0x8614d
leaq 0x10(%rsp), %r14
xorl %ebp, %ebp
xorl %r13d, %r13d
movq %r14, %rdi
leaq 0x2ac14(%rip), %rsi     # 0xb0d26
movl %r13d, %edx
xorl %eax, %eax
callq 0x41b0
movq (%r15), %rax
movl (%rax,%rbp), %r9d
movq %rbx, %rdi
movl %r12d, %esi
movl $0x1, %edx
movl $0x1, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x7d384
incq %r13
movslq 0x5c(%r15), %rax
addq $0x10, %rbp
cmpq %rax, %r13
jl 0x86108
leaq 0x24b7c(%rip), %r10     # 0xaacd0
leaq 0x24b29(%rip), %r11     # 0xaac84
leaq 0x2a866(%rip), %r13     # 0xb09c8
leaq 0x2a843(%rip), %r14     # 0xb09ac
leaq 0x2ab3d(%rip), %r8      # 0xb0cad
leaq 0x2a7ff(%rip), %r9      # 0xb0976
movq %rbx, %rdi
movl %r12d, %esi
movl $0x1, %edx
movl $0x6, %ecx
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %r13
pushq %r14
callq 0x7d617
addq $0x20, %rsp
leaq 0x21cff(%rip), %r10     # 0xa7ea0
leaq 0x2abda(%rip), %r11     # 0xb0d82
leaq 0x2ab0a(%rip), %r8      # 0xb0cb9
leaq 0x2a7fe(%rip), %r9      # 0xb09b4
movq %rbx, %rdi
movl %r12d, %esi
xorl %edx, %edx
movl $0x4, %ecx
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x7d617
addq $0x10, %rsp
movq (%rsp), %r14
movl 0x1c0(%r14), %r9d
leaq 0x2a6a0(%rip), %r8      # 0xb0884
movq %rbx, %rdi
movl %r12d, %esi
movl $0x1, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7d384
cmpl $0x2, %r12d
movl %r12d, %ebp
movq %rbx, %r12
jne 0x86220
leaq 0x29f02(%rip), %rdi     # 0xb0110
movl $0x6, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x42c0
incl 0x32bfc2(%rip)          # 0x3b21e8
movq %r12, %rdi
movl %ebp, %esi
movq %r14, %rdx
movl $0x1, %ecx
callq 0x8050d
movl 0x5c(%r15), %edx
testl %edx, %edx
jle 0x862f6
movl $0x4, %r13d
movl %ebp, (%rsp)
xorl %ebx, %ebx
leaq 0x10(%rsp), %rdi
leaq 0x2aac1(%rip), %rsi     # 0xb0d1c
movl %ebx, %edx
xorl %eax, %eax
callq 0x41b0
movq %r15, %r12
leaq 0x7a130(%rsp), %r15
movq %r15, %rdi
leaq 0x2aaad(%rip), %rbp     # 0xb0d26
movq %rbp, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x41b0
movq %rbx, %rdx
subq $0x1, %rdx
leaq 0xf4250(%rsp), %rdi
movq %rdi, %r14
leaq 0x2a5e6(%rip), %rax     # 0xb0884
cmovbq %rax, %r14
movq %rbp, %rsi
xorl %eax, %eax
callq 0x41b0
movq (%r12), %rax
movl -0x4(%rax,%r13), %edx
movl (%rax,%r13), %ecx
movq 0x8(%rsp), %rdi
movl (%rsp), %esi
leaq 0x10(%rsp), %r8
movq %r14, %r9
pushq $0x1
pushq %r15
movq %r12, %r15
callq 0x80069
addq $0x10, %rsp
incq %rbx
movslq 0x5c(%r12), %rdx
addq $0x10, %r13
cmpq %rdx, %rbx
jl 0x8624f
movl (%rsp), %ebp
movq 0x8(%rsp), %r12
testl %edx, %edx
je 0x86352
leaq 0x2aa1b(%rip), %rsi     # 0xb0d1c
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41b0
movl 0x5c(%r15), %edx
decl %edx
leaq 0x2aa09(%rip), %rsi     # 0xb0d26
leaq 0x7a130(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x41b0
movq (%r15), %rax
movslq 0x5c(%r15), %rcx
shlq $0x4, %rcx
movl 0x4(%rax,%rcx), %edx
leaq 0x2498b(%rip), %r9      # 0xaacd0
movq %r12, %rdi
movl %ebp, %esi
movq %rbx, %rcx
movq %r14, %r8
jmp 0x86372
movq (%r15), %rax
movl 0x4(%rax), %edx
leaq 0x2a9d0(%rip), %rcx     # 0xb0d2f
leaq 0x2a51e(%rip), %r8      # 0xb0884
leaq 0x24963(%rip), %r9      # 0xaacd0
movq %r12, %rdi
movl %ebp, %esi
callq 0x8021f
leaq 0x29738(%rip), %rsi     # 0xafab6
leaq 0x2494b(%rip), %rcx     # 0xaacd0
movq %r12, %rdi
movl %ebp, %edx
callq 0x7d912
movq %r12, %rdi
movl %ebp, %esi
callq 0x7db1b
addq $0x16e378, %rsp         # imm = 0x16E378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq