// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/savecode.c
// Function: generate_test_code_knnreg
void generate_test_code_knnreg(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, int nearcount, Instanceptr m)
{
 /*!Last Changed 13.06.2006*/
 char st[MAXLENGTH];
 int size = data_size(m);
 code_function_header(testcodefile, "knnreg", 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_constant_integer(testcodefile, language, "regno", d->classdefno);
 code_2d_array_constant_instance(testcodefile, language, d, "m", size, d->featurecount, m);
 code_variable_start(testcodefile, language);
 code_add_variable(testcodefile, language, INTEGER_VARIABLE, 2, "i", "j");
 code_add_variable(testcodefile, language, REAL_VARIABLE, 4, "sum", "m_ij", "x_j", "regvalue");
 code_add_array_variable(testcodefile, language, 3, REAL_VARIABLE, "distances", nearcount, INTEGER_VARIABLE, "indexes", nearcount, REAL_VARIABLE, "testdataconverted", d->featurecount);
 code_start(testcodefile, language);
	code_normalize(testcodefile, language, d);
 code_array_initialize(testcodefile, language, "distances", nearcount, "10000.0");
 code_array_initialize(testcodefile, language, "indexes", nearcount, "-1");
 code_sort_according_to_distances(testcodefile, language, d, size, nearcount);
 code_set_variable(testcodefile, language, "sum", "0.0");
 code_for(testcodefile, language, "i", 0, nearcount - 1, 1);     
 code_array_index_variable(st, language, "indexes", "i");  
 code_set_variable(testcodefile, language, "j", st); 
 code_2d_array_index_variable(st, language, "m", "j", "regno");
 code_set_variable(testcodefile, language, "regvalue", st);
 code_set_variable(testcodefile, language, "sum", "sum + regvalue");
 code_endfor(testcodefile, language, "i");
 sprintf(st, "sum / %d", nearcount);
 code_function_return_string(testcodefile, "knnreg", language, st);   
 code_function_end(testcodefile, language);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x7a188, %rsp          # imm = 0x7A188
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x449f0
movl %eax, -0x7a154(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x1bc(%rax), %edx
movl -0x14(%rbp), %ecx
leaq 0x37f49(%rip), %rsi     # 0xed1fe
callq 0xaf1e0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xaf9c0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movl 0x1bc(%rax), %r8d
leaq 0x2ddb7(%rip), %rcx     # 0xe309a
leaq 0x32cc8e(%rip), %r9     # 0x3e1f78
callq 0xb14a0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rax
movl 0x1bc(%rax), %r8d
leaq 0x2dd98(%rip), %rcx     # 0xe30a4
leaq 0x32cc95(%rip), %r9     # 0x3e1fa8
callq 0xb14a0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x1407128(%rax), %ecx
leaq 0x37ed5(%rip), %rdx     # 0xed205
callq 0xaf920
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x7a154(%rbp), %r8d
movq -0x20(%rbp), %rax
movl 0x1bc(%rax), %r9d
movq -0x30(%rbp), %rax
leaq 0x3746b(%rip), %rcx     # 0xec7c8
movq %rax, (%rsp)
callq 0xb1b30
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xb00e0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
xorl %edx, %edx
movl $0x2, %ecx
leaq 0x37fa2(%rip), %r8      # 0xed329
leaq 0x37c96(%rip), %r9      # 0xed024
movb $0x0, %al
callq 0xafe40
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl $0x1, %edx
movl $0x4, %ecx
leaq 0x37f70(%rip), %r8      # 0xed31d
leaq 0x37b52(%rip), %r9      # 0xecf06
leaq 0x37c7d(%rip), %r10     # 0xed038
leaq 0x37e4f(%rip), %rax     # 0xed211
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0xafe40
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x24(%rbp), %r9d
movl -0x24(%rbp), %r11d
movq -0x20(%rbp), %rax
movl 0x1bc(%rax), %eax
movl $0x3, %edx
movl $0x1, %ecx
leaq 0x37b39(%rip), %r8      # 0xecf35
xorl %r10d, %r10d
leaq 0x37b3f(%rip), %rbx     # 0xecf45
leaq 0x37ae7(%rip), %r10     # 0xecef4
movl $0x0, (%rsp)
movq %rbx, 0x8(%rsp)
movl %r11d, 0x10(%rsp)
movl $0x1, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movl %eax, 0x28(%rsp)
movb $0x0, %al
callq 0xafab0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xaf2c0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0xb3a50
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x24(%rbp), %ecx
leaq 0x37ad2(%rip), %rdx     # 0xecf35
leaq 0x37e17(%rip), %r8      # 0xed281
callq 0xb1e60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x24(%rbp), %ecx
leaq 0x37ac5(%rip), %rdx     # 0xecf45
leaq 0x33d81(%rip), %r8      # 0xe9208
callq 0xb1e60
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x7a154(%rbp), %ecx
movl -0x24(%rbp), %r8d
callq 0xb2100
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x37e69(%rip), %rdx     # 0xed31d
leaq 0x37dca(%rip), %rcx     # 0xed285
callq 0xafa00
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x24(%rbp), %r8d
subl $0x1, %r8d
leaq 0x37e53(%rip), %rdx     # 0xed329
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xb10b0
leaq -0x7a150(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x37a51(%rip), %rdx     # 0xecf45
leaq 0x37e2e(%rip), %rcx     # 0xed329
callq 0xb04c0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x7a150(%rbp), %rcx
leaq 0x37b0f(%rip), %rdx     # 0xed024
callq 0xafa00
leaq -0x7a150(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x3729d(%rip), %rdx     # 0xec7c8
leaq 0x37af2(%rip), %rcx     # 0xed024
leaq 0x37ccc(%rip), %r8      # 0xed205
callq 0xb0560
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x7a150(%rbp), %rcx
leaq 0x37cbe(%rip), %rdx     # 0xed211
callq 0xafa00
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x37db7(%rip), %rdx     # 0xed31d
leaq 0x37c9e(%rip), %rcx     # 0xed20b
callq 0xafa00
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq 0x37da9(%rip), %rdx     # 0xed329
callq 0xb13f0
leaq -0x7a150(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq 0x37c84(%rip), %rsi     # 0xed21a
movb $0x0, %al
callq 0x4170
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq -0x7a150(%rbp), %rcx
leaq 0x37c4c(%rip), %rsi     # 0xed1fe
callq 0xb01f0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xb03a0
addq $0x7a188, %rsp          # imm = 0x7A188
popq %rbx
popq %rbp
retq
nopl (%rax)