// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x1bc(%rax), %edx
movl -0xc(%rbp), %ecx
leaq 0x38cfb(%rip), %rsi     # 0xed17a
callq 0xaf1e0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xaf9c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movl 0x1bc(%rax), %r8d
leaq 0x2ebed(%rip), %rcx     # 0xe309a
leaq 0x32dac4(%rip), %r9     # 0x3e1f78
callq 0xb14a0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movl 0x1bc(%rax), %r8d
leaq 0x2ebce(%rip), %rcx     # 0xe30a4
leaq 0x32dacb(%rip), %r9     # 0x3e1fa8
callq 0xb14a0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x18(%rbp), %rax
movl 0x10(%rax), %r8d
movq -0x18(%rbp), %rax
movl 0x1bc(%rax), %r9d
movq -0x20(%rbp), %rax
leaq 0x382bd(%rip), %rcx     # 0xec7c8
movq %rax, (%rsp)
callq 0xb1b30
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb00e0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
xorl %edx, %edx
movl $0x3, %ecx
leaq 0x38df4(%rip), %r8      # 0xed329
leaq 0x38ae8(%rip), %r9      # 0xed024
leaq 0x38c43(%rip), %rax     # 0xed186
movq %rax, (%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl $0x1, %edx
movl $0x4, %ecx
leaq 0x38db7(%rip), %r8      # 0xed31d
leaq 0x38acb(%rip), %r9      # 0xed038
leaq 0x38992(%rip), %r10     # 0xecf06
leaq 0x38c14(%rip), %rax     # 0xed18f
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x1bc(%rax), %r9d
movl $0x1, %ecx
leaq 0x3894b(%rip), %r8      # 0xecef4
movl %ecx, %edx
movb $0x0, %al
callq 0xafab0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xaf2c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0xb3a50
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x38bb3(%rip), %rdx     # 0xed18f
leaq 0x38c9e(%rip), %rcx     # 0xed281
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %r8d
subl $0x1, %r8d
leaq 0x38d27(%rip), %rdx     # 0xed329
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xb10b0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0xb1ef0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x31493(%rip), %rdx     # 0xe5ac0
leaq 0x38ce9(%rip), %rcx     # 0xed31d
leaq 0x38b54(%rip), %r8      # 0xed18f
leaq 0x38b44(%rip), %r9      # 0xed186
callq 0xb33c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x38cd4(%rip), %rdx     # 0xed329
callq 0xb13f0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0x38b12(%rip), %rsi     # 0xed17a
leaq 0x38b17(%rip), %rcx     # 0xed186
callq 0xb01f0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb03a0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)