// File: /workspace/github_c_makefile_star2_O3/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 0x2f539(%rip), %rsi     # 0xb0b0a
movl %ebx, %ecx
callq 0x7ce21
cmpl $0x2, %ebx
jne 0x815f6
leaq 0x2ecb9(%rip), %rdi     # 0xb029d
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
movl 0x1bc(%r15), %r8d
leaq 0x30287(%rip), %rcx     # 0xb188b
leaq 0x33099d(%rip), %r9     # 0x3b1fa8
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7e724
movl 0x1bc(%r15), %r8d
leaq 0x24dfe(%rip), %rcx     # 0xa6424
leaq 0x3309ab(%rip), %r9     # 0x3b1fd8
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7e724
movl 0x10(%r15), %r8d
movl 0x1bc(%r15), %r9d
movq %r12, (%rsp)
leaq 0x2eb08(%rip), %rcx     # 0xb0158
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7ebcd
cmpl $0x2, %ebx
jne 0x81731
leaq 0x2ec93(%rip), %rdi     # 0xb0300
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
leaq 0x2f490(%rip), %rax     # 0xb0b16
movq %rax, (%rsp)
leaq 0x2f628(%rip), %r8      # 0xb0cb9
leaq 0x2f31c(%rip), %r9      # 0xb09b4
movq %r14, %rdi
movl $0x2, %esi
xorl %edx, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2f46a(%rip), %rax     # 0xb0b1f
movq %rax, 0x8(%rsp)
leaq 0x2f1d5(%rip), %rax     # 0xb0896
movq %rax, (%rsp)
leaq 0x2f5e1(%rip), %r8      # 0xb0cad
leaq 0x2f2f5(%rip), %r9      # 0xb09c8
movq %r14, %rdi
movl $0x2, %esi
movl $0x1, %edx
movl $0x4, %ecx
xorl %eax, %eax
callq 0x7d617
movl 0x1bc(%r15), %r9d
leaq 0x2f18a(%rip), %r8      # 0xb0884
movq %r14, %rdi
movl $0x2, %esi
movl $0x1, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7d384
leaq 0x2e9f6(%rip), %rdi     # 0xb0110
movl $0x6, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x42c0
jmp 0x817bc
leaq 0x2f3de(%rip), %rax     # 0xb0b16
movq %rax, (%rsp)
leaq 0x2f576(%rip), %r8      # 0xb0cb9
leaq 0x2f26a(%rip), %r9      # 0xb09b4
movq %r14, %rdi
movl %ebx, %esi
xorl %edx, %edx
movl $0x3, %ecx
xorl %eax, %eax
callq 0x7d617
leaq 0x2f3bb(%rip), %rax     # 0xb0b1f
movq %rax, 0x8(%rsp)
leaq 0x2f126(%rip), %rax     # 0xb0896
movq %rax, (%rsp)
leaq 0x2f532(%rip), %r8      # 0xb0cad
leaq 0x2f246(%rip), %r9      # 0xb09c8
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x4, %ecx
xorl %eax, %eax
callq 0x7d617
movl 0x1bc(%r15), %r9d
leaq 0x2f0de(%rip), %r8      # 0xb0884
movq %r14, %rdi
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
xorl %eax, %eax
callq 0x7d384
incl 0x330a26(%rip)          # 0x3b21e8
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x80ac7
leaq 0x2f349(%rip), %r12     # 0xb0b1f
leaq 0x2f434(%rip), %rcx     # 0xb0c11
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %rdx
callq 0x7d316
movl 0x10(%r15), %r8d
decl %r8d
leaq 0x2f4c1(%rip), %rdx     # 0xb0cb9
movq %r14, %rdi
movl %ebx, %esi
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x7e3dc
movq %r14, %rdi
movl %ebx, %esi
movq %r15, %rdx
callq 0x7eed1
leaq 0x27702(%rip), %rdx     # 0xa8f20
leaq 0x2f488(%rip), %rcx     # 0xb0cad
leaq 0x2f2ea(%rip), %r15     # 0xb0b16
movq %r14, %rdi
movl %ebx, %esi
movq %r12, %r8
movq %r15, %r9
callq 0x80365
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e686
leaq 0x2f2bd(%rip), %rsi     # 0xb0b0a
movq %r14, %rdi
movl %ebx, %edx
movq %r15, %rcx
callq 0x7d912
movq %r14, %rdi
movl %ebx, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x7db1b