// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %rbx
subq $0x16e3a8, %rsp         # imm = 0x16E3A8
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x1bc(%rax), %edx
movl -0x14(%rbp), %ecx
leaq 0x33c17(%rip), %rsi     # 0xec1da
callq 0xaf1e0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xaf9c0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movl 0x1c0(%rax), %r8d
subl $0x1, %r8d
leaq 0x2aaa5(%rip), %rcx     # 0xe309a
leaq 0x32997c(%rip), %r9     # 0x3e1f78
callq 0xb14a0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movl 0x1c0(%rax), %r8d
subl $0x1, %r8d
leaq 0x2aa82(%rip), %rcx     # 0xe30a4
leaq 0x32997f(%rip), %r9     # 0x3e1fa8
callq 0xb14a0
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x5c(%rcx), %eax
jge 0xb86ba
leaq -0x7a150(%rbp), %rdi
movl -0x2c(%rbp), %edx
leaq 0x34d3a(%rip), %rsi     # 0xed38c
movb $0x0, %al
callq 0x4170
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x7a150(%rbp), %rdx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %r8
shlq $0x4, %r8
addq %r8, %rax
movl 0x4(%rax), %r8d
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %r9
shlq $0x4, %r9
addq %r9, %rax
movq 0x8(%rax), %r9
callq 0xb18c0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xb8635
leaq -0x7a150(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x5c(%rax), %edx
leaq 0x34cbd(%rip), %rsi     # 0xed38c
movb $0x0, %al
callq 0x4170
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x7a150(%rbp), %rdx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %r8
shlq $0x4, %r8
addq %r8, %rax
movq 0x8(%rax), %rax
movq (%rax), %r8
movl $0x1, %r9d
callq 0xb15d0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xb00e0
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x5c(%rcx), %eax
jge 0xb8790
leaq -0x7a150(%rbp), %rdi
movl -0x2c(%rbp), %edx
leaq 0x34c49(%rip), %rsi     # 0xed396
movb $0x0, %al
callq 0x4170
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x7a150(%rbp), %r8
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %r9d
movl $0x1, %ecx
movl %ecx, %edx
movb $0x0, %al
callq 0xafab0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xb8730
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl $0x1, %edx
movl $0x6, %ecx
leaq 0x34b75(%rip), %r8      # 0xed31d
leaq 0x34837(%rip), %r9      # 0xecfe6
leaq 0x34866(%rip), %rbx     # 0xed01c
leaq 0x3487b(%rip), %r11     # 0xed038
leaq 0x2ef20(%rip), %r10     # 0xe76e4
leaq 0x2ef65(%rip), %rax     # 0xe7730
movq %rbx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %edx, %edx
movl $0x4, %ecx
leaq 0x34b2f(%rip), %r8      # 0xed329
leaq 0x34823(%rip), %r9      # 0xed024
leaq 0x34bea(%rip), %r10     # 0xed3f2
leaq 0x2c1d9(%rip), %rax     # 0xe49e8
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x1c0(%rax), %r9d
movl $0x1, %ecx
leaq 0x346b7(%rip), %r8      # 0xecef4
movl %ecx, %edx
movb $0x0, %al
callq 0xafab0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xaf2c0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl $0x1, %ecx
callq 0xb3590
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x5c(%rcx), %eax
jge 0xb898d
leaq -0x7a150(%rbp), %rdi
movl -0x2c(%rbp), %edx
leaq 0x34afd(%rip), %rsi     # 0xed38c
movb $0x0, %al
callq 0x4170
leaq -0xf4270(%rbp), %rdi
movl -0x2c(%rbp), %edx
leaq 0x34aef(%rip), %rsi     # 0xed396
movb $0x0, %al
callq 0x4170
leaq -0x16e390(%rbp), %rdi
movl -0x2c(%rbp), %edx
subl $0x1, %edx
leaq 0x34ad4(%rip), %rsi     # 0xed396
movb $0x0, %al
callq 0x4170
cmpl $0x0, -0x2c(%rbp)
jne 0xb8927
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %edx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
leaq -0x7a150(%rbp), %r8
leaq -0xf4270(%rbp), %rax
leaq 0x345e0(%rip), %r9      # 0xecef4
movq %rax, (%rsp)
movl $0x1, 0x8(%rsp)
callq 0xb30b0
jmp 0xb897d
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %edx
movq -0x28(%rbp), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
leaq -0x7a150(%rbp), %r8
leaq -0x16e390(%rbp), %r9
leaq -0xf4270(%rbp), %rax
movq %rax, (%rsp)
movl $0x1, 0x8(%rsp)
callq 0xb30b0
jmp 0xb897f
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xb886e
movq -0x28(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
jne 0xb89d3
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movslq 0x5c(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %edx
leaq 0x349e1(%rip), %rcx     # 0xed39f
leaq 0x3452f(%rip), %r8      # 0xecef4
leaq 0x2ed64(%rip), %r9      # 0xe7730
callq 0xb3290
jmp 0xb8a48
leaq -0x7a150(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x5c(%rax), %edx
leaq 0x349a4(%rip), %rsi     # 0xed38c
movb $0x0, %al
callq 0x4170
leaq -0xf4270(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x5c(%rax), %edx
subl $0x1, %edx
leaq 0x3498f(%rip), %rsi     # 0xed396
movb $0x0, %al
callq 0x4170
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movslq 0x5c(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %edx
leaq -0x7a150(%rbp), %rcx
leaq -0xf4270(%rbp), %r8
leaq 0x2eced(%rip), %r9      # 0xe7730
callq 0xb3290
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq 0x33784(%rip), %rsi     # 0xec1da
leaq 0x2ecd3(%rip), %rcx     # 0xe7730
callq 0xb01f0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xb03a0
addq $0x16e3a8, %rsp         # imm = 0x16E3A8
popq %rbx
popq %rbp
retq
nopl (%rax,%rax)