// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
movl 0x1bc(%rdx), %edx
leaq 0x2e49d(%rip), %rsi     # 0xada72
movl %ebx, %ecx
callq 0x7b551
cmpl $0x2, %ebx
jne 0x7f5fa
leaq 0x2dc1d(%rip), %rdi     # 0xad205
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
movl 0x1bc(%r15), %r8d
leaq 0x2f1f3(%rip), %rcx     # 0xae7fb
leaq 0x32f999(%rip), %r9     # 0x3aefa8
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7cde7
movl 0x1bc(%r15), %r8d
leaq 0x23dfa(%rip), %rcx     # 0xa3424
leaq 0x32f9a7(%rip), %r9     # 0x3aefd8
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7cde7
movl 0x10(%r15), %r8d
movl 0x1bc(%r15), %r9d
movq %r12, (%rsp)
leaq 0x2da6c(%rip), %rcx     # 0xad0c0
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7d214
cmpl $0x2, %ebx
jne 0x7f72c
leaq 0x2dbf7(%rip), %rdi     # 0xad268
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
leaq 0x2e3f4(%rip), %rax     # 0xada7e
movq %rax, (%rsp)
leaq 0x2e58c(%rip), %r8      # 0xadc21
leaq 0x2e280(%rip), %r9      # 0xad91c
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7bd1c
leaq 0x2e3d1(%rip), %rax     # 0xada87
movq %rax, 0x8(%rsp)
leaq 0x2e13c(%rip), %rax     # 0xad7fe
movq %rax, (%rsp)
leaq 0x2e548(%rip), %r8      # 0xadc15
leaq 0x2e25c(%rip), %r9      # 0xad930
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x4, %ecx
xorl %eax, %eax
callq 0x7bd1c
movl 0x1bc(%r15), %r9d
leaq 0x2e0f4(%rip), %r8      # 0xad7ec
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7bab4
leaq 0x2d963(%rip), %rdi     # 0xad078
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
jmp 0x7f7b7
leaq 0x2e34b(%rip), %rax     # 0xada7e
movq %rax, (%rsp)
leaq 0x2e4e3(%rip), %r8      # 0xadc21
leaq 0x2e1d7(%rip), %r9      # 0xad91c
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7bd1c
leaq 0x2e328(%rip), %rax     # 0xada87
movq %rax, 0x8(%rsp)
leaq 0x2e093(%rip), %rax     # 0xad7fe
movq %rax, (%rsp)
leaq 0x2e49f(%rip), %r8      # 0xadc15
leaq 0x2e1b3(%rip), %r9      # 0xad930
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x4, %ecx
xorl %eax, %eax
callq 0x7bd1c
movl 0x1bc(%r15), %r9d
leaq 0x2e04b(%rip), %r8      # 0xad7ec
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7bab4
incl 0x32fa2b(%rip)          # 0x3af1e8
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7ec45
leaq 0x2e2b6(%rip), %r12     # 0xada87
leaq 0x2e3a1(%rip), %rcx     # 0xadb79
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x7ba46
movl 0x10(%r15), %r8d
decl %r8d
leaq 0x2e42e(%rip), %rdx     # 0xadc21
movq %r14, %rdi
movl %ebx, %esi
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x7ca9f
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7d478
leaq 0x266d7(%rip), %rdx     # 0xa5ef0
leaq 0x2e3f5(%rip), %rcx     # 0xadc15
leaq 0x2e257(%rip), %r15     # 0xada7e
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %r8
movq %r15, %r9
callq 0x7e616
movq %r14, %rdi
movl %ebx, %esi
callq 0x7cd49
leaq 0x2e22a(%rip), %rsi     # 0xada72
movq %r14, %rdi
movl %ebx, %edx
movq %r15, %rcx
callq 0x7bffb
movq %r14, %rdi
movl %ebx, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x7c1ca