// File: /workspace/github_c_makefile_star2_O2/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 $0x16e388, %rsp         # imm = 0x16E388
movq %rcx, %r15
movq %rdx, %r14
movl %esi, %r12d
movq %rdi, %rbx
movl 0x1bc(%rdx), %edx
leaq 0x265a5(%rip), %rsi     # 0x9f9d6
movl %r12d, %ecx
callq 0x72674
movq %rbx, %rdi
movl %r12d, %esi
callq 0x72b0a
movl 0x1c0(%r14), %r8d
decl %r8d
leaq 0x28396(%rip), %rcx     # 0xa17eb
leaq 0x330b4c(%rip), %r9     # 0x3a9fa8
movq %rbx, %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x73bdf
movl 0x1c0(%r14), %r8d
decl %r8d
leaq 0x1cfa9(%rip), %rcx     # 0x96424
leaq 0x330b56(%rip), %r9     # 0x3a9fd8
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
movl %r12d, %esi
movq %r14, 0x18(%rsp)
movq %r14, %rdx
callq 0x73bdf
pushq $0x8
popq %rbp
leaq 0x277dc(%rip), %rbx     # 0xa0c80
leaq 0x20(%rsp), %r14
xorl %r13d, %r13d
movslq 0x5c(%r15), %rdx
cmpq %rdx, %r13
jge 0x794ee
movq %r14, %rdi
movq %rbx, %rsi
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 0x10(%rsp), %rdi
movl %r12d, %esi
movq %r14, %rdx
callq 0x73ec6
incq %r13
addq $0x10, %rbp
jmp 0x794ac
leaq 0x2778b(%rip), %rsi     # 0xa0c80
leaq 0x20(%rsp), %r13
movq %r13, %rdi
xorl %eax, %eax
callq 0x41b0
movq (%r15), %rax
movl -0x4(%rax,%rbp), %ecx
movq (%rax,%rbp), %rax
movq (%rax), %r8
pushq $0x1
popq %rbx
movq 0x10(%rsp), %r14
movq %r14, %rdi
movl %r12d, %esi
movq %r13, %rdx
movl %ebx, %r9d
callq 0x73cac
movq %r14, %rdi
movl %r12d, 0xc(%rsp)
movl %r12d, %esi
callq 0x72fb3
leaq 0x27748(%rip), %r14     # 0xa0c8a
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq 0x5c(%r15), %rax
cmpq %rax, %rbp
jge 0x79586
movq %r13, %rdi
movq %r14, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x41b0
movq (%r15), %rax
movl (%rax,%r12), %r9d
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
movl %ebx, %edx
movl %ebx, %ecx
movq %r13, %r8
xorl %eax, %eax
callq 0x72b76
incq %rbp
addq $0x10, %r12
jmp 0x79547
leaq 0x21673(%rip), %r10     # 0x9ac00
leaq 0x21620(%rip), %r11     # 0x9abb4
leaq 0x27391(%rip), %r14     # 0xa092c
leaq 0x2736e(%rip), %r12     # 0xa0910
leaq 0x27668(%rip), %r8      # 0xa0c11
leaq 0x2732a(%rip), %r9      # 0xa08da
pushq $0x1
popq %rbx
pushq $0x6
popq %rcx
movq 0x10(%rsp), %r13
movq %r13, %rdi
movl 0xc(%rsp), %ebp
movl %ebp, %esi
movl %ebx, %edx
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %r14
pushq %r12
callq 0x72de1
addq $0x20, %rsp
leaq 0x1e840(%rip), %r10     # 0x97e20
leaq 0x276ff(%rip), %r11     # 0xa0ce6
leaq 0x2762f(%rip), %r8      # 0xa0c1d
leaq 0x27323(%rip), %r9      # 0xa0918
pushq $0x4
popq %rcx
movq %r13, %rdi
movl %ebp, %esi
xorl %edx, %edx
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x72de1
popq %rax
popq %rcx
movq 0x18(%rsp), %r14
movl 0x1c0(%r14), %r9d
leaq 0x271c9(%rip), %r8      # 0xa07e8
movq %r13, %rdi
movl %ebp, %esi
movl %ebx, %edx
movl %ebx, %ecx
xorl %eax, %eax
callq 0x72b76
movq %r13, %rdi
movl %ebp, %esi
callq 0x726d3
movq %r13, %rdi
movl %ebp, %esi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x753f5
pushq $0x4
popq %r13
xorl %r14d, %r14d
movslq 0x5c(%r15), %rdx
cmpq %rdx, %r14
jge 0x796f3
leaq 0x20(%rsp), %rdi
leaq 0x27618(%rip), %rsi     # 0xa0c80
movl %r14d, %edx
xorl %eax, %eax
callq 0x41b0
movq %r15, %r12
leaq 0x7a140(%rsp), %r15
movq %r15, %rdi
leaq 0x27603(%rip), %rbp     # 0xa0c8a
movq %rbp, %rsi
movl %r14d, %edx
xorl %eax, %eax
callq 0x41b0
movq %r14, %rdx
subq $0x1, %rdx
leaq 0xf4260(%rsp), %rdi
movq %rdi, %rbx
leaq 0x2713b(%rip), %rax     # 0xa07e8
cmovbq %rax, %rbx
movq %rbp, %rsi
xorl %eax, %eax
callq 0x41b0
movq (%r12), %rax
movl -0x4(%rax,%r13), %edx
movl (%rax,%r13), %ecx
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
leaq 0x20(%rsp), %r8
movq %rbx, %r9
pushq $0x1
pushq %r15
movq %r12, %r15
callq 0x75037
popq %rax
popq %rcx
incq %r14
addq $0x10, %r13
jmp 0x7964f
testl %edx, %edx
je 0x79758
leaq 0x27582(%rip), %rsi     # 0xa0c80
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41b0
movl 0x5c(%r15), %edx
decl %edx
leaq 0x27570(%rip), %rsi     # 0xa0c8a
leaq 0x7a140(%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 0x214be(%rip), %r9      # 0x9ac00
movq 0x10(%rsp), %r15
movq %r15, %rdi
movl 0xc(%rsp), %ebp
movl %ebp, %esi
movq %rbx, %rcx
movq %r14, %r8
jmp 0x79781
movq (%r15), %rax
movl 0x4(%rax), %edx
leaq 0x2752e(%rip), %rcx     # 0xa0c93
leaq 0x2707c(%rip), %r8      # 0xa07e8
leaq 0x2148d(%rip), %r9      # 0x9ac00
movq 0x10(%rsp), %r15
movq %r15, %rdi
movl 0xc(%rsp), %ebp
movl %ebp, %esi
callq 0x751a3
leaq 0x26249(%rip), %rsi     # 0x9f9d6
leaq 0x2146c(%rip), %rcx     # 0x9ac00
movq %r15, %rdi
movl %ebp, %edx
callq 0x7308c
movq %r15, %rdi
movl %ebp, %esi
callq 0x7320f
addq $0x16e388, %rsp         # imm = 0x16E388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq