// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/savecode.c
// Function: generate_test_code_ldaclass
void generate_test_code_ldaclass(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Model_ldaclassptr m)
{
 /*!Last Changed 16.06.2006*/
 char st[MAXLENGTH];
 int i;
 code_function_header(testcodefile, "ldaclass", 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);
 code_1d_array_constant(testcodefile, language, "w0", d->classno, m->w0, REAL_TYPE);
 code_2d_array_start(testcodefile, language, "w", d->classno, m->newfeaturecount - 1);
 for (i = 0; i < d->classno; i++)
   code_constant_subarray(testcodefile, language, m->newfeaturecount - 1, m->w[i].values[0], i);
 code_2d_array_end(testcodefile, language);  
 code_2d_array_constant(testcodefile, language, "eigenvectors", m->eigenvectors.row, m->eigenvectors.col, m->eigenvectors.values);
 code_variable_start(testcodefile, language);
 code_add_variable(testcodefile, language, INTEGER_VARIABLE, 5, "i", "j", "maxindex", "k", "a");
 code_add_variable(testcodefile, language, REAL_VARIABLE, 6, "w_ij", "eigenvectors_ij", "x_i", "x_j", "sum", "maxvalue");
 code_add_array_variable(testcodefile, language, 2, REAL_VARIABLE, "testdatareduced", m->newfeaturecount - 1, REAL_VARIABLE, "testdataconverted", d->multifeaturecount);
 code_start(testcodefile, language);
	code_realize(testcodefile, language, d, YES);
 code_dimension_reduce(testcodefile, language, d, m->newfeaturecount - 1);    
 code_set_variable(testcodefile, language, "maxvalue", "-10000.0"); 
 code_for(testcodefile, language, "i", 0, d->classno - 1, 1);     
 code_array_index_variable(st, language, "w0", "i");  
 code_set_variable(testcodefile, language, "sum", st); 
 code_for(testcodefile, language, "j", 0, m->newfeaturecount - 2, 1);     
 code_2d_array_index_variable(st, language, "w", "i", "j");
 code_set_variable(testcodefile, language, "w_ij", st);
 code_array_index_variable(st, language, "testdatareduced", "j");  
 code_set_variable(testcodefile, language, "x_j", st); 
 code_set_variable(testcodefile, language, "sum", "sum + w_ij * x_j"); 
 code_endfor(testcodefile, language, "j");
 code_compare_and_set_bound(testcodefile, language, ">", "sum", "maxvalue", "maxindex"); 
 code_endfor(testcodefile, language, "i");
 code_function_return_string(testcodefile, "ldaclass", language, "maxindex");   
 code_function_end(testcodefile, language);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x7a178, %rsp          # imm = 0x7A178
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 0x3067b(%rip), %rsi     # 0xe68ee
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 0x2cdf5(%rip), %rcx     # 0xe309a
leaq 0x32bccc(%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 0x2cdd2(%rip), %rcx     # 0xe30a4
leaq 0x32bccf(%rip), %r9     # 0x3e1fa8
callq 0xb14a0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x28(%rbp), %rax
movq 0x8(%rax), %r8
leaq 0x36f74(%rip), %rdx     # 0xed26f
movl $0x1, %r9d
callq 0xb15d0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x28(%rbp), %rax
movl (%rax), %r8d
subl $0x1, %r8d
leaq 0x31e98(%rip), %rdx     # 0xe81be
callq 0xb1940
movl $0x0, -0x7a154(%rbp)
movl -0x7a154(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jge 0xb638e
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl (%rax), %edx
subl $0x1, %edx
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x7a154(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq (%rax), %rcx
movl -0x7a154(%rbp), %r8d
callq 0xaf4c0
movl -0x7a154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7a154(%rbp)
jmp 0xb6335
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xb1a10
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x28(%rbp), %rax
movl 0x1c(%rax), %r8d
movq -0x28(%rbp), %rax
movq 0x20(%rax), %r9
leaq 0x36bef(%rip), %rdx     # 0xecfae
callq 0xb18c0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xb00e0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %edx, %edx
movl $0x5, %ecx
leaq 0x36f44(%rip), %r8      # 0xed329
leaq 0x36c38(%rip), %r9      # 0xed024
leaq 0x36d27(%rip), %r11     # 0xed11a
leaq 0x36ff8(%rip), %r10     # 0xed3f2
leaq 0x2e5e7(%rip), %rax     # 0xe49e8
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl $0x1, %edx
movl $0x6, %ecx
leaq 0x36e44(%rip), %r8      # 0xed272
leaq 0x36b86(%rip), %r9      # 0xecfbb
leaq 0x36d6f(%rip), %rbx     # 0xed1ab
leaq 0x36bf5(%rip), %r11     # 0xed038
leaq 0x36ed3(%rip), %r10     # 0xed31d
leaq 0x36e26(%rip), %rax     # 0xed277
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
movq -0x28(%rbp), %rax
movl (%rax), %r9d
subl $0x1, %r9d
movq -0x20(%rbp), %rax
movl 0x1c0(%rax), %eax
movl $0x2, %edx
movl $0x1, %ecx
leaq 0x36b06(%rip), %r8      # 0xecf9e
leaq 0x36a55(%rip), %r10     # 0xecef4
movl $0x1, (%rsp)
movq %r10, 0x8(%rsp)
movl %eax, 0x10(%rsp)
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
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rax
movl (%rax), %ecx
subl $0x1, %ecx
callq 0xb2f30
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x36d79(%rip), %rdx     # 0xed277
leaq 0x36d7b(%rip), %rcx     # 0xed280
callq 0xafa00
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x10(%rax), %r8d
subl $0x1, %r8d
leaq 0x36e05(%rip), %rdx     # 0xed329
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xb10b0
leaq -0x7a150(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x36d2d(%rip), %rdx     # 0xed26f
leaq 0x36de0(%rip), %rcx     # 0xed329
callq 0xb04c0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x7a150(%rbp), %rcx
leaq 0x36dba(%rip), %rdx     # 0xed31d
callq 0xafa00
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl (%rax), %r8d
subl $0x2, %r8d
leaq 0x36aa3(%rip), %rdx     # 0xed024
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xb10b0
leaq -0x7a150(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x31c1f(%rip), %rdx     # 0xe81be
leaq 0x36d83(%rip), %rcx     # 0xed329
leaq 0x36a77(%rip), %r8      # 0xed024
callq 0xb0560
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x7a150(%rbp), %rcx
leaq 0x36cab(%rip), %rdx     # 0xed272
callq 0xafa00
leaq -0x7a150(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x369c1(%rip), %rdx     # 0xecf9e
leaq 0x36a40(%rip), %rcx     # 0xed024
callq 0xb04c0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x7a150(%rbp), %rcx
leaq 0x36a3a(%rip), %rdx     # 0xed038
callq 0xafa00
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x36d0c(%rip), %rdx     # 0xed31d
leaq 0x36c71(%rip), %rcx     # 0xed289
callq 0xafa00
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x369f9(%rip), %rdx     # 0xed024
callq 0xb13f0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x371a0(%rip), %rdx     # 0xed7de
leaq 0x36cd8(%rip), %rcx     # 0xed31d
leaq 0x36c2b(%rip), %r8      # 0xed277
leaq 0x36ac7(%rip), %r9      # 0xed11a
callq 0xb33c0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x36cc3(%rip), %rdx     # 0xed329
callq 0xb13f0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq 0x30275(%rip), %rsi     # 0xe68ee
leaq 0x36a9a(%rip), %rcx     # 0xed11a
callq 0xb01f0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xb03a0
addq $0x7a178, %rsp          # imm = 0x7A178
popq %rbx
popq %rbp
retq
nopl (%rax,%rax)