// File: /workspace/github_c_makefile_star2_O1/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 0x2905b(%rip), %rsi     # 0xac9de
movl %ebp, %ecx
callq 0x7b551
cmpl $0x2, %ebp
jne 0x839a8
leaq 0x2986f(%rip), %rdi     # 0xad205
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movl 0x1c0(%r14), %r8d
decl %r8d
leaq 0x2ae42(%rip), %rcx     # 0xae7fb
leaq 0x32b5e8(%rip), %r9     # 0x3aefa8
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, %rdx
callq 0x7cde7
movl 0x1c0(%r14), %r8d
decl %r8d
leaq 0x1fa46(%rip), %rcx     # 0xa3424
leaq 0x32b5f3(%rip), %r9     # 0x3aefd8
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
movq %r14, (%rsp)
movq %r14, %rdx
callq 0x7cde7
movl 0x5c(%r15), %edx
testl %edx, %edx
jle 0x83a5f
movl %ebp, %r12d
movl $0x8, %ebp
leaq 0x10(%rsp), %r14
xorl %r13d, %r13d
movq 0x8(%rsp), %rbx
movq %r14, %rdi
leaq 0x2a262(%rip), %rsi     # 0xadc84
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 0x7d0d5
incq %r13
movslq 0x5c(%r15), %rdx
addq $0x10, %rbp
cmpq %rdx, %r13
jl 0x83a18
movl %r12d, %ebp
jmp 0x83a62
xorl %r13d, %r13d
leaq 0x2a21b(%rip), %rsi     # 0xadc84
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 0x7ceb8
movl %ebp, %r12d
cmpl $0x2, %ebp
jne 0x83ac5
leaq 0x297b5(%rip), %rdi     # 0xad268
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
cmpl $0x0, 0x5c(%r15)
movq %r14, %rbx
jle 0x83b1e
leaq 0x10(%rsp), %r14
xorl %ebp, %ebp
xorl %r13d, %r13d
movq %r14, %rdi
leaq 0x2a1ab(%rip), %rsi     # 0xadc8e
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 0x7bab4
incq %r13
movslq 0x5c(%r15), %rax
addq $0x10, %rbp
cmpq %rax, %r13
jl 0x83ad9
leaq 0x240fb(%rip), %r10     # 0xa7c20
leaq 0x240a8(%rip), %r11     # 0xa7bd4
leaq 0x29dfd(%rip), %r13     # 0xad930
leaq 0x29dda(%rip), %r14     # 0xad914
leaq 0x2a0d4(%rip), %r8      # 0xadc15
leaq 0x29d96(%rip), %r9      # 0xad8de
movq %rbx, %rdi
movl %r12d, %esi
movl $0x1, %edx
movl $0x6, %ecx
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %r13
pushq %r14
callq 0x7bd1c
addq $0x20, %rsp
leaq 0x212d6(%rip), %r10     # 0xa4e48
leaq 0x2a171(%rip), %r11     # 0xadcea
leaq 0x2a0a1(%rip), %r8      # 0xadc21
leaq 0x29d95(%rip), %r9      # 0xad91c
movq %rbx, %rdi
movl %r12d, %esi
xorl %edx, %edx
movl $0x4, %ecx
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x7bd1c
addq $0x10, %rsp
movq (%rsp), %r14
movl 0x1c0(%r14), %r9d
leaq 0x29c37(%rip), %r8      # 0xad7ec
movq %rbx, %rdi
movl %r12d, %esi
movl $0x1, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7bab4
cmpl $0x2, %r12d
movl %r12d, %ebp
movq %rbx, %r12
jne 0x83bf1
leaq 0x29499(%rip), %rdi     # 0xad078
movl $0x6, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x42c0
incl 0x32b5f1(%rip)          # 0x3af1e8
movq %r12, %rdi
movl %ebp, %esi
movq %r14, %rdx
movl $0x1, %ecx
callq 0x7e795
movl 0x5c(%r15), %edx
testl %edx, %edx
jle 0x83cc7
movl $0x4, %r13d
movl %ebp, (%rsp)
xorl %ebx, %ebx
leaq 0x10(%rsp), %rdi
leaq 0x2a058(%rip), %rsi     # 0xadc84
movl %ebx, %edx
xorl %eax, %eax
callq 0x41b0
movq %r15, %r12
leaq 0x7a130(%rsp), %r15
movq %r15, %rdi
leaq 0x2a044(%rip), %rbp     # 0xadc8e
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 0x29b7d(%rip), %rax     # 0xad7ec
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 0x7e398
addq $0x10, %rsp
incq %rbx
movslq 0x5c(%r12), %rdx
addq $0x10, %r13
cmpq %rdx, %rbx
jl 0x83c20
movl (%rsp), %ebp
movq 0x8(%rsp), %r12
testl %edx, %edx
je 0x83d23
leaq 0x29fb2(%rip), %rsi     # 0xadc84
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41b0
movl 0x5c(%r15), %edx
decl %edx
leaq 0x29fa0(%rip), %rsi     # 0xadc8e
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 0x23f0a(%rip), %r9      # 0xa7c20
movq %r12, %rdi
movl %ebp, %esi
movq %rbx, %rcx
movq %r14, %r8
jmp 0x83d43
movq (%r15), %rax
movl 0x4(%rax), %edx
leaq 0x29f67(%rip), %rcx     # 0xadc97
leaq 0x29ab5(%rip), %r8      # 0xad7ec
leaq 0x23ee2(%rip), %r9      # 0xa7c20
movq %r12, %rdi
movl %ebp, %esi
callq 0x7e50b
leaq 0x28c8f(%rip), %rsi     # 0xac9de
leaq 0x23eca(%rip), %rcx     # 0xa7c20
movq %r12, %rdi
movl %ebp, %edx
callq 0x7bffb
movq %r12, %rdi
movl %ebp, %esi
callq 0x7c1ca
addq $0x16e378, %rsp         # imm = 0x16E378
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq