// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/savecode.c
// Function: code_realize
void code_realize(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, int normalize)
{
 /*!Last Changed 01.20.2006 fixed for loop's ending value*/
 /*!Last Changed 24.06.2006*/
 int *symbolic, *numeric, scount, ncount, i, *cases;
 char st[MAXLENGTH], st2[MAXLENGTH], st3[MAXLENGTH], st4[MAXLENGTH], st5[MAXLENGTH];
 code_array_index_variable(st4, language, "mean", "a");  
 code_array_index_variable(st5, language, "variance", "a");  
	cases = safemalloc(sizeof(int), "code_realize", 5);
 symbolic = symbolic_features(d, &scount);
 numeric = numeric_features(d, &ncount);
 code_set_variable(testcodefile, language, "j", "0");
	if (normalize)
   code_set_variable(testcodefile, language, "a", "0");
 code_for(testcodefile, language, "i", 0, d->featurecount - 1, 1);   
 code_switch(testcodefile, language, "i");
	if (ncount > 0)
	 {
  	code_case(testcodefile, language, numeric, ncount);
   code_array_index_variable(st, language, "testdataconverted", "j");  
   code_array_index_variable(st2, language, "testdata", "i");  
	  if (normalize)
			 {
	  	 sprintf(st3, "(%s - %s) / sqrt(%s)", st2, st4, st5);
     code_set_variable(testcodefile, language, st, st3);
     code_set_variable(testcodefile, language, "a", "a + 1");
			 }
	  else
     code_set_variable(testcodefile, language, st, st2);
   code_set_variable(testcodefile, language, "j", "j + 1");
	  code_endcase(testcodefile, language);
	 }
 for (i = 0; i < scount; i++)
	 {
		 cases[0] = symbolic[i];
  	code_case(testcodefile, language, cases, 1);
			code_for(testcodefile, language, "k", 0, d->features[i].valuecount, 1);
			code_if(testcodefile, language, "==", st2, "k");
			if (normalize)
			 {
  		 sprintf(st3, "(1.0 - %s) / sqrt(%s)", st4, st5);
     code_set_variable(testcodefile, language, st, st3);
			 }
			else
     code_set_variable(testcodefile, language, st, "1.0");
			code_else(testcodefile, language);
			if (normalize)
			 {
  		 sprintf(st3, "-%s / sqrt(%s)", st4, st5);
     code_set_variable(testcodefile, language, st, st3);
			 }
			else
     code_set_variable(testcodefile, language, st, "0.0");
			code_endif(testcodefile, language);
   if (normalize)
     code_set_variable(testcodefile, language, "a", "a + 1");
			code_set_variable(testcodefile, language, "j", "j + 1");
			code_endfor(testcodefile, language, "k");
			code_endcase(testcodefile, language);
	 }
	cases[0] = d->classdefno;
	code_case(testcodefile, language, cases, 1);
	sprintf(st3, "%d", d->multifeaturecount - 1);
 code_array_index_variable(st, language, "testdataconverted", st3);  
 code_set_variable(testcodefile, language, st, st2);
	if (normalize)
   code_set_variable(testcodefile, language, "a", "a + 1");
 code_endcase(testcodefile, language);
	code_endswitch(testcodefile, language);
 code_endfor(testcodefile, language, "i");
	safe_free(symbolic);
	safe_free(numeric);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2625f0, %rsp         # imm = 0x2625F0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
leaq -0x1e84d0(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x2fae0(%rip), %rdx     # 0xe309a
leaq 0x31427(%rip), %rcx     # 0xe49e8
callq 0xb04c0
leaq -0x2625f0(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x2facd(%rip), %rdx     # 0xe30a4
leaq 0x3140a(%rip), %rcx     # 0xe49e8
callq 0xb04c0
movl $0x4, %edi
leaq 0x39a54(%rip), %rsi     # 0xed043
movl $0x5, %edx
callq 0x52d70
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x1dcd0
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x1de20
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x399f7(%rip), %rdx     # 0xed024
leaq 0x39c53(%rip), %rcx     # 0xed287
callq 0xafa00
cmpl $0x0, -0x1c(%rbp)
je 0xb3659
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x3139b(%rip), %rdx     # 0xe49e8
leaq 0x39c33(%rip), %rcx     # 0xed287
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
movl 0x1bc(%rax), %r8d
subl $0x1, %r8d
leaq 0x39cb3(%rip), %rdx     # 0xed329
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xb10b0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x39c98(%rip), %rdx     # 0xed329
callq 0xb0930
cmpl $0x0, -0x38(%rbp)
jle 0xb3793
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x30(%rbp), %rdx
movl -0x38(%rbp), %ecx
callq 0xb06d0
leaq -0x7a170(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x39830(%rip), %rdx     # 0xecef4
leaq 0x39959(%rip), %rcx     # 0xed024
callq 0xb04c0
leaq -0xf4290(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x3988d(%rip), %rdx     # 0xecf6e
leaq 0x39c41(%rip), %rcx     # 0xed329
callq 0xb04c0
cmpl $0x0, -0x1c(%rbp)
je 0xb3753
leaq -0x16e3b0(%rbp), %rdi
leaq -0xf4290(%rbp), %rdx
leaq -0x1e84d0(%rbp), %rcx
leaq -0x2625f0(%rbp), %r8
leaq 0x3993a(%rip), %rsi     # 0xed050
movb $0x0, %al
callq 0x4170
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a170(%rbp), %rdx
leaq -0x16e3b0(%rbp), %rcx
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x312a3(%rip), %rdx     # 0xe49e8
leaq 0x39919(%rip), %rcx     # 0xed065
callq 0xafa00
jmp 0xb376d
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a170(%rbp), %rdx
leaq -0xf4290(%rbp), %rcx
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x398a9(%rip), %rdx     # 0xed024
leaq 0x397bd(%rip), %rcx     # 0xecf3f
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb08e0
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0xb3961
movq -0x28(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x48(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x48(%rbp), %rdx
movl $0x1, %ecx
callq 0xb06d0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rax
addq $0x30f08, %rax          # imm = 0x30F08
movslq -0x3c(%rbp), %rcx
imulq $0x340, %rcx, %rcx      # imm = 0x340
addq %rcx, %rax
movl 0x18(%rax), %r8d
leaq 0x39bfc(%rip), %rdx     # 0xed3f2
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0xb10b0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0xf4290(%rbp), %rcx
leaq 0x322b0(%rip), %rdx     # 0xe5ac8
leaq 0x39bd3(%rip), %r8      # 0xed3f2
callq 0xb0d00
cmpl $0x0, -0x1c(%rbp)
je 0xb3869
leaq -0x16e3b0(%rbp), %rdi
leaq -0x1e84d0(%rbp), %rdx
leaq -0x2625f0(%rbp), %rcx
leaq 0x39825(%rip), %rsi     # 0xed06b
movb $0x0, %al
callq 0x4170
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a170(%rbp), %rdx
leaq -0x16e3b0(%rbp), %rcx
callq 0xafa00
jmp 0xb3883
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a170(%rbp), %rdx
leaq 0x31826(%rip), %rcx     # 0xe50a4
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb0e70
cmpl $0x0, -0x1c(%rbp)
je 0xb38d4
leaq -0x16e3b0(%rbp), %rdi
leaq -0x1e84d0(%rbp), %rdx
leaq -0x2625f0(%rbp), %rcx
leaq 0x397d0(%rip), %rsi     # 0xed081
movb $0x0, %al
callq 0x4170
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a170(%rbp), %rdx
leaq -0x16e3b0(%rbp), %rcx
callq 0xafa00
jmp 0xb38ee
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a170(%rbp), %rdx
leaq 0x3999c(%rip), %rcx     # 0xed285
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb0ec0
cmpl $0x0, -0x1c(%rbp)
je 0xb391a
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x310da(%rip), %rdx     # 0xe49e8
leaq 0x39750(%rip), %rcx     # 0xed065
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x396fc(%rip), %rdx     # 0xed024
leaq 0x39610(%rip), %rcx     # 0xecf3f
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x39ab0(%rip), %rdx     # 0xed3f2
callq 0xb13f0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb08e0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xb379a
movq -0x18(%rbp), %rax
movl 0x1407128(%rax), %ecx
movq -0x48(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x48(%rbp), %rdx
movl $0x1, %ecx
callq 0xb06d0
leaq -0x16e3b0(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x1c0(%rax), %edx
subl $0x1, %edx
leaq 0x398c4(%rip), %rsi     # 0xed265
movb $0x0, %al
callq 0x4170
leaq -0x7a170(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x16e3b0(%rbp), %rcx
leaq 0x39534(%rip), %rdx     # 0xecef4
callq 0xb04c0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x7a170(%rbp), %rdx
leaq -0xf4290(%rbp), %rcx
callq 0xafa00
cmpl $0x0, -0x1c(%rbp)
je 0xb39ff
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x30ff5(%rip), %rdx     # 0xe49e8
leaq 0x3966b(%rip), %rcx     # 0xed065
callq 0xafa00
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb08e0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0xb09e0
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq 0x39904(%rip), %rdx     # 0xed329
callq 0xb13f0
movq -0x28(%rbp), %rdi
callq 0x52e80
movq -0x30(%rbp), %rdi
callq 0x52e80
addq $0x2625f0, %rsp         # imm = 0x2625F0
popq %rbp
retq
nopw %cs:(%rax,%rax)