// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/savecode.c
// Function: generate_test_code_mlpgeneric
void generate_test_code_mlpgeneric(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Mlpnetworkptr m)
{
 /*!Last Changed 16.06.2006*/
 int i;
 char st[MAXLENGTH], st2[MAXLENGTH], st3[MAXLENGTH];
 code_function_header(testcodefile, "mlpgeneric", 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); 
  } 
 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_array_variable(testcodefile, language, 2, REAL_VARIABLE, "output", d->classno, REAL_VARIABLE, "testdataconverted", d->multifeaturecount);
 code_add_variable(testcodefile, language, REAL_VARIABLE, 5, "sum", "weights_ij", "x_j", "sigmoid", "maxvalue");
 code_add_variable(testcodefile, language, INTEGER_VARIABLE, 5, "i", "j", "maxindex", "k", "a");
 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(testcodefile, language, m->weights[m->P.layernum].row, m->weights[m->P.layernum].col, "weights0", "testdataconverted", "output", NO);
 else
  {
   sprintf(st, "weights%d", m->P.layernum);
   sprintf(st2, "hidden%d", m->P.layernum - 1);
   code_forward_propagation(testcodefile, language, m->weights[m->P.layernum].row, m->weights[m->P.layernum].col, st, st2, "output", NO);
  }
 code_find_bound_of_list(testcodefile, language, "output", d->classno, "-10000.0", "maxvalue", "maxindex", ">");
 code_function_return_string(testcodefile, "logistic", language, "maxindex");   
 code_function_end(testcodefile, language);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x16e3b0, %rsp         # imm = 0x16E3B0
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 0x2e811(%rip), %rsi     # 0xe6893
callq 0xaf1e0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xaf9c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movl 0x1c0(%rax), %r8d
subl $0x1, %r8d
leaq 0x2afe6(%rip), %rcx     # 0xe309a
leaq 0x329ebd(%rip), %r9     # 0x3e1f78
callq 0xb14a0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movl 0x1c0(%rax), %r8d
subl $0x1, %r8d
leaq 0x2afc3(%rip), %rcx     # 0xe30a4
leaq 0x329ec0(%rip), %r9     # 0x3e1fa8
callq 0xb14a0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x5c(%rcx), %eax
jg 0xb8179
leaq -0x7a150(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq 0x3527b(%rip), %rsi     # 0xed38c
movb $0x0, %al
callq 0x4170
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a150(%rbp), %rdx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %r8
shlq $0x4, %r8
addq %r8, %rax
movl 0x4(%rax), %r8d
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %r9
shlq $0x4, %r9
addq %r9, %rax
movq 0x8(%rax), %r9
callq 0xb18c0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xb80f4
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb00e0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x5c(%rcx), %eax
jge 0xb81ec
leaq -0x7a150(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq 0x351ed(%rip), %rsi     # 0xed396
movb $0x0, %al
callq 0x4170
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a150(%rbp), %r8
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %r9d
movl $0x1, %ecx
movl %ecx, %edx
movb $0x0, %al
callq 0xafab0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xb818c
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %r9d
movq -0x18(%rbp), %rax
movl 0x1c0(%rax), %eax
movl $0x2, %edx
movl $0x1, %ecx
leaq 0x2f51a(%rip), %r8      # 0xe7730
leaq 0x34cd7(%rip), %r10     # 0xecef4
movl $0x1, (%rsp)
movq %r10, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0xafab0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x1, %edx
movl $0x5, %ecx
leaq 0x350d1(%rip), %r8      # 0xed31d
leaq 0x34d93(%rip), %r9      # 0xecfe6
leaq 0x34dde(%rip), %r11     # 0xed038
leaq 0x2f483(%rip), %r10     # 0xe76e4
leaq 0x3500f(%rip), %rax     # 0xed277
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
xorl %edx, %edx
movl $0x5, %ecx
leaq 0x35097(%rip), %r8      # 0xed329
leaq 0x34d8b(%rip), %r9      # 0xed024
leaq 0x34e7a(%rip), %r11     # 0xed11a
leaq 0x3514b(%rip), %r10     # 0xed3f2
leaq 0x2c73a(%rip), %rax     # 0xe49e8
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xaf2c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movl $0x1, %ecx
callq 0xb3590
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x5c(%rcx), %eax
jge 0xb840a
leaq -0x7a150(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq 0x35080(%rip), %rsi     # 0xed38c
movb $0x0, %al
callq 0x4170
leaq -0xf4270(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq 0x35072(%rip), %rsi     # 0xed396
movb $0x0, %al
callq 0x4170
leaq -0x16e390(%rbp), %rdi
movl -0x24(%rbp), %edx
subl $0x1, %edx
leaq 0x35057(%rip), %rsi     # 0xed396
movb $0x0, %al
callq 0x4170
cmpl $0x0, -0x24(%rbp)
jne 0xb83a4
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %edx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
leaq -0x7a150(%rbp), %r8
leaq -0xf4270(%rbp), %rax
leaq 0x34b63(%rip), %r9      # 0xecef4
movq %rax, (%rsp)
movl $0x1, 0x8(%rsp)
callq 0xb30b0
jmp 0xb83fa
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %edx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x24(%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 0xb83fc
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xb82eb
movq -0x20(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
jne 0xb847a
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x5c(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %edx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x5c(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
leaq 0x34f4c(%rip), %r8      # 0xed39f
leaq 0x34a9a(%rip), %r9      # 0xecef4
leaq 0x2f2cf(%rip), %rax     # 0xe7730
xorl %r10d, %r10d
movq %rax, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0xb30b0
jmp 0xb8516
leaq -0x7a150(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x5c(%rax), %edx
leaq 0x34efd(%rip), %rsi     # 0xed38c
movb $0x0, %al
callq 0x4170
leaq -0xf4270(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x5c(%rax), %edx
subl $0x1, %edx
leaq 0x34ee8(%rip), %rsi     # 0xed396
movb $0x0, %al
callq 0x4170
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x5c(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %edx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x5c(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
leaq -0x7a150(%rbp), %r8
leaq -0xf4270(%rbp), %r9
leaq 0x2f22e(%rip), %rax     # 0xe7730
xorl %r10d, %r10d
movq %rax, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0xb30b0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x2f205(%rip), %rdx     # 0xe7730
leaq 0x34d4e(%rip), %r8      # 0xed280
leaq 0x34d3e(%rip), %r9      # 0xed277
leaq 0x34bda(%rip), %r10     # 0xed11a
leaq 0x35297(%rip), %rax     # 0xed7de
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0xb3440
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0x2a70a(%rip), %rsi     # 0xe2c6d
leaq 0x34bb0(%rip), %rcx     # 0xed11a
callq 0xb01f0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb03a0
addq $0x16e3b0, %rsp         # imm = 0x16E3B0
popq %rbp
retq
nopw %cs:(%rax,%rax)