// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/savecode.c
// Function: generate_test_code_gaussian
void generate_test_code_gaussian(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Model_gaussianptr m)
{
 /*!Last Changed 05.06.2006*/
 char st[MAXLENGTH];
 code_function_header(testcodefile, "gaussian", 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, "priors", d->classno, m->priors, REAL_TYPE);
 code_1d_array_constant(testcodefile, language, "v", d->classno, m->variance, REAL_TYPE);
 code_2d_array_constant_instance(testcodefile, language, d, "m", d->classno, d->multifeaturecount - 1, m->mean);
 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, "sum", "maxposterior", "x_j", "m_ij", "v_i", "p_i", "posterior");
 code_add_array_variable(testcodefile, language, 1, REAL_VARIABLE, "testdataconverted", d->multifeaturecount);
 code_start(testcodefile, language);  
	code_realize(testcodefile, language, d, YES);
 code_set_variable(testcodefile, language, "maxposterior", "0.0");
 code_for(testcodefile, language, "i", 0, d->classno - 1, 1);
 code_set_variable(testcodefile, language, "sum", "0.0");
 code_array_index_variable(st, language, "v", "i");
 code_set_variable(testcodefile, language, "v_i", st);
 code_array_index_variable(st, language, "priors", "i");
 code_set_variable(testcodefile, language, "p_i", st);
 code_for(testcodefile, language, "j", 0, d->multifeaturecount - 2, 1);
 code_array_index_variable(st, language, "testdataconverted", "j");
 code_set_variable(testcodefile, language, "x_j", st);
 code_2d_array_index_variable(st, language, "m", "i", "j");
 code_set_variable(testcodefile, language, "m_ij", st);
 code_set_variable(testcodefile, language, "sum", "sum + (x_j - m_ij) * (x_j - m_ij)");
 code_endfor(testcodefile, language, "j");
 code_set_variable(testcodefile, language, "posterior", "(p_i / (v_i * sqrt(2 * 3.1415926))) * exp(-sum / (2 * v_i * v_i))");
 code_compare_and_set_bound(testcodefile, language, ">", "posterior", "maxposterior", "maxindex"); 
 code_endfor(testcodefile, language, "i");
 code_function_return_string(testcodefile, "gaussian", language, "maxindex");
 code_function_end(testcodefile, language);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x7a170, %rsp          # imm = 0x7A170
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x1bc(%rax), %edx
movl -0x1c(%rbp), %ecx
leaq 0x3116a(%rip), %rsi     # 0xe51af
callq 0xaf1e0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xaf9c0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rax
movl 0x1c0(%rax), %r8d
subl $0x1, %r8d
leaq 0x2f023(%rip), %rcx     # 0xe309a
leaq 0x32defa(%rip), %r9     # 0x3e1f78
callq 0xb14a0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rax
movl 0x1c0(%rax), %r8d
subl $0x1, %r8d
leaq 0x2f000(%rip), %rcx     # 0xe30a4
leaq 0x32defd(%rip), %r9     # 0x3e1fa8
callq 0xb14a0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x30(%rbp), %rax
movq 0x10(%rax), %r8
leaq 0x39046(%rip), %rdx     # 0xed113
movl $0x1, %r9d
callq 0xb15d0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r8
leaq 0x3a455(%rip), %rdx     # 0xee54a
movl $0x1, %r9d
callq 0xb15d0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rax
movl 0x10(%rax), %r8d
movq -0x28(%rbp), %rax
movl 0x1c0(%rax), %r9d
subl $0x1, %r9d
movq -0x30(%rbp), %rax
movq (%rax), %rax
leaq 0x38698(%rip), %rcx     # 0xec7c8
movq %rax, (%rsp)
callq 0xb1b30
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xb00e0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
xorl %edx, %edx
movl $0x5, %ecx
leaq 0x391cf(%rip), %r8      # 0xed329
leaq 0x38ec3(%rip), %r9      # 0xed024
leaq 0x38fb2(%rip), %r11     # 0xed11a
leaq 0x39283(%rip), %r10     # 0xed3f2
leaq 0x30872(%rip), %rax     # 0xe49e8
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl $0x1, %edx
movl $0x6, %ecx
leaq 0x3917a(%rip), %r8      # 0xed31d
leaq 0x38f79(%rip), %r9      # 0xed123
leaq 0x38e87(%rip), %r14     # 0xed038
leaq 0x38d4e(%rip), %rbx     # 0xecf06
leaq 0x38f71(%rip), %r11     # 0xed130
leaq 0x38f6e(%rip), %r10     # 0xed134
leaq 0x34154(%rip), %rax     # 0xe8321
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x1c0(%rax), %r9d
movl $0x1, %ecx
leaq 0x38cea(%rip), %r8      # 0xecef4
movl %ecx, %edx
movb $0x0, %al
callq 0xafab0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xaf2c0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rdx
movl $0x1, %ecx
callq 0xb3590
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x38ee1(%rip), %rdx     # 0xed123
leaq 0x3903c(%rip), %rcx     # 0xed285
callq 0xafa00
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x10(%rax), %r8d
subl $0x1, %r8d
leaq 0x390c1(%rip), %rdx     # 0xed329
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xb10b0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x3909a(%rip), %rdx     # 0xed31d
leaq 0x38ffb(%rip), %rcx     # 0xed285
callq 0xafa00
leaq -0x7a150(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x3a2aa(%rip), %rdx     # 0xee54a
leaq 0x39082(%rip), %rcx     # 0xed329
callq 0xb04c0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq -0x7a150(%rbp), %rcx
leaq 0x38e6f(%rip), %rdx     # 0xed130
callq 0xafa00
leaq -0x7a150(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x38e3c(%rip), %rdx     # 0xed113
leaq 0x3904b(%rip), %rcx     # 0xed329
callq 0xb04c0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq -0x7a150(%rbp), %rcx
leaq 0x38e3c(%rip), %rdx     # 0xed134
callq 0xafa00
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x1c0(%rax), %r8d
subl $0x2, %r8d
leaq 0x38d0a(%rip), %rdx     # 0xed024
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xb10b0
leaq -0x7a150(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x38bbc(%rip), %rdx     # 0xecef4
leaq 0x38ce5(%rip), %rcx     # 0xed024
callq 0xb04c0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq -0x7a150(%rbp), %rcx
leaq 0x38cdf(%rip), %rdx     # 0xed038
callq 0xafa00
leaq -0x7a150(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x38459(%rip), %rdx     # 0xec7c8
leaq 0x38fb3(%rip), %rcx     # 0xed329
leaq 0x38ca7(%rip), %r8      # 0xed024
callq 0xb0560
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq -0x7a150(%rbp), %rcx
leaq 0x38b6f(%rip), %rdx     # 0xecf06
callq 0xafa00
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x38f73(%rip), %rdx     # 0xed31d
leaq 0x38b62(%rip), %rcx     # 0xecf13
callq 0xafa00
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x38c60(%rip), %rdx     # 0xed024
callq 0xb13f0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x33f4a(%rip), %rdx     # 0xe8321
leaq 0x38d5a(%rip), %rcx     # 0xed138
callq 0xafa00
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x393ed(%rip), %rdx     # 0xed7de
leaq 0x33f29(%rip), %rcx     # 0xe8321
leaq 0x38d24(%rip), %r8      # 0xed123
leaq 0x38d14(%rip), %r9      # 0xed11a
callq 0xb33c0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
leaq 0x38f10(%rip), %rdx     # 0xed329
callq 0xb13f0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %edx
leaq 0x30d83(%rip), %rsi     # 0xe51af
leaq 0x38ce7(%rip), %rcx     # 0xed11a
callq 0xb01f0
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xb03a0
addq $0x7a170, %rsp          # imm = 0x7A170
popq %rbx
popq %r14
popq %rbp
retq