// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/savecode.c
// Function: generate_test_code_nearestmean
void generate_test_code_nearestmean(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Instanceptr m)
{
 /*!Last Changed 09.06.2006*/
 code_function_header(testcodefile, "nearestmean", d->featurecount, language);
 code_constant_start(testcodefile, language);
	code_1d_array_constant_instance(testcodefile, language, d, "mean", d->featurecount, &mean);
	code_1d_array_constant_instance(testcodefile, language, d, "variance", d->featurecount, &variance);
 code_2d_array_constant_instance(testcodefile, language, d, "m", d->classno, d->featurecount, m);
 code_variable_start(testcodefile, language);
 code_add_variable(testcodefile, language, INTEGER_VARIABLE, 3, "i", "j", "minindex");
 code_add_variable(testcodefile, language, REAL_VARIABLE, 4, "sum", "x_j", "m_ij", "mindistance");
 code_add_array_variable(testcodefile, language, 1, REAL_VARIABLE, "testdataconverted", d->featurecount);
 code_start(testcodefile, language);  
 code_normalize(testcodefile, language, d);
 code_set_variable(testcodefile, language, "mindistance", "10000.0"); 
 code_for(testcodefile, language, "i", 0, d->classno - 1, 1);
 code_calculate_distance(testcodefile, language, d);
 code_compare_and_set_bound(testcodefile, language, "<", "sum", "mindistance", "minindex"); 
 code_endfor(testcodefile, language, "i");
 code_function_return_string(testcodefile, "nearestmean", language, "minindex");
 code_function_end(testcodefile, language);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r15
movq %rdx, %r12
movl %esi, %ebx
movq %rdi, %r14
movl 0x1bc(%rdx), %edx
leaq 0x2aa1e(%rip), %rsi     # 0xa0a6e
movl %ebx, %ecx
callq 0x72674
movq %r14, %rdi
movl %ebx, %esi
callq 0x72b0a
movl 0x1bc(%r12), %r8d
leaq 0x2b77b(%rip), %rcx     # 0xa17eb
leaq 0x333f31(%rip), %r9     # 0x3a9fa8
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x73bdf
movl 0x1bc(%r12), %r8d
leaq 0x20391(%rip), %rcx     # 0x96424
leaq 0x333f3e(%rip), %r9     # 0x3a9fd8
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x73bdf
movl 0x10(%r12), %r8d
movl 0x1bc(%r12), %r9d
movq %r15, (%rsp)
leaq 0x29ffd(%rip), %rcx     # 0xa00bc
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x74003
movq %r14, %rdi
movl %ebx, %esi
callq 0x72fb3
leaq 0x2a99d(%rip), %rax     # 0xa0a7a
movq %rax, (%rsp)
leaq 0x2ab35(%rip), %r8      # 0xa0c1d
leaq 0x2a829(%rip), %r9      # 0xa0918
pushq $0x3
popq %rcx
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x72de1
leaq 0x2a97c(%rip), %rbp     # 0xa0a83
movq %rbp, 0x8(%rsp)
leaq 0x2a6e7(%rip), %rax     # 0xa07fa
movq %rax, (%rsp)
leaq 0x2aaf3(%rip), %r13     # 0xa0c11
leaq 0x2a807(%rip), %r9      # 0xa092c
pushq $0x1
popq %r15
pushq $0x4
popq %rcx
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
movq %r13, %r8
xorl %eax, %eax
callq 0x72de1
movl 0x1bc(%r12), %r9d
leaq 0x2a69b(%rip), %r8      # 0xa07e8
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x72b76
movq %r14, %rdi
movl %ebx, %esi
callq 0x726d3
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x75838
leaq 0x2a9f8(%rip), %rcx     # 0xa0b75
movq %r14, %rdi
movl %ebx, %esi
movq %rbp, %rdx
callq 0x72b25
movl 0x10(%r12), %r8d
decl %r8d
movq %r14, %rdi
movl %ebx, %esi
leaq 0x2aa7f(%rip), %rdx     # 0xa0c1d
xorl %ecx, %ecx
movl %r15d, %r9d
callq 0x73938
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x74269
leaq 0x22cd4(%rip), %rdx     # 0x98e90
movq %r14, %rdi
movl %ebx, %esi
movq %r13, %rcx
movq %rbp, %r8
leaq 0x2a8ac(%rip), %r15     # 0xa0a7a
movq %r15, %r9
callq 0x752a9
movq %r14, %rdi
movl %ebx, %esi
callq 0x73b72
movq %r14, %rdi
leaq 0x2a884(%rip), %rsi     # 0xa0a6e
movl %ebx, %edx
movq %r15, %rcx
callq 0x7308c
movq %r14, %rdi
movl %ebx, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7320f