// File: /workspace/github_c_makefile_star2_O3/olcaytaner[P]Isell/savecode.c
// Function: code_kernel_function
void code_kernel_function(FILE* testcodefile, PROGRAMMING_LANGUAGE_TYPE language, Datasetptr d, Svm_parameter param)
{
 /*!Last Changed 25.06.2006*/
	char st[MAXLENGTH];
 code_set_variable(testcodefile, language, "sum", "0.0");
	code_for(testcodefile, language, "j", 0, d->multifeaturecount - 2, 1);
 code_array_index_variable(st, language, "testdataconverted", "j");  				             
	code_set_variable(testcodefile, language, "x_j", st);
 code_2d_array_index_variable(st, language, "sv", "i", "j");  
	code_set_variable(testcodefile, language, "sv_ij", st);
	switch (param.kernel_type){
	  case KLINEAR :
			case KPOLY   :
			case KSIGMOID:code_set_variable(testcodefile, language, "sum", "sum + x_j * sv_ij");
				             break;
			case KRBF    :code_set_variable(testcodefile, language, "sum", "sum + (x_j - sv_ij) * (x_j - sv_ij)");
				             break;
   case KPREDEFINED:break;
	};	
	code_endfor(testcodefile, language, "j");
	switch (param.kernel_type){
			case KPOLY   :code_set_variable(testcodefile, language, "sum", "pow(gamma * sum + coef0, degree)");
				             break;
			case KSIGMOID:code_set_variable(testcodefile, language, "sum", "tanh(gamma * sum + coef0)");
				             break;
			case KRBF    :code_set_variable(testcodefile, language, "sum", "exp(-gamma * sum)");
				             break;
   default      :break;
	};	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x7a120, %rsp          # imm = 0x7A120
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
leaq 0x2ff13(%rip), %rdx     # 0xb0cad
leaq 0x2fe74(%rip), %rcx     # 0xb0c15
callq 0x7d316
movl 0x1c0(%r15), %r8d
addl $-0x2, %r8d
leaq 0x2fbfc(%rip), %rdx     # 0xb09b4
movq %r14, %rdi
movl %ebx, %esi
xorl %ecx, %ecx
movl $0x1, %r9d
callq 0x7e3dc
movl %ebx, %r12d
cmpl $0x5, %ebx
ja 0x80df5
leaq 0x52fa7(%rip), %rax     # 0xd3d80
movq (%rax,%r12,8), %rsi
leaq 0x2faa0(%rip), %rdx     # 0xb0884
leaq 0x2fbc9(%rip), %rcx     # 0xb09b4
movq %rsp, %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x7a150(%rsp), %r15
leaq 0x2fbc4(%rip), %rdx     # 0xb09c8
movq %rsp, %rcx
movq %r14, %rdi
movl %ebx, %esi
callq 0x7d316
cmpl $0x5, %ebx
ja 0x80e40
leaq 0x52ed3(%rip), %rax     # 0xd3cf0
movq (%rax,%r12,8), %rsi
leaq 0x2ff19(%rip), %rdx     # 0xb0d41
leaq 0x2fe8a(%rip), %rcx     # 0xb0cb9
leaq 0x2fb7e(%rip), %r8      # 0xb09b4
movq %rsp, %rdi
xorl %eax, %eax
callq 0x41b0
leaq 0x2fbe5(%rip), %rdx     # 0xb0a2c
movq %rsp, %rcx
movq %r14, %rdi
movl %ebx, %esi
callq 0x7d316
movl 0x4(%r15), %ebp
cmpl $0x2, %ebp
jb 0x80e64
je 0x80e9f
cmpl $0x3, %ebp
jne 0x80e7c
leaq 0x2fe42(%rip), %rdx     # 0xb0cad
leaq 0x2fbae(%rip), %rcx     # 0xb0a20
movq %r14, %rdi
movl %ebx, %esi
callq 0x7d316
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e686
decl %ebp
cmpl $0x2, %ebp
ja 0x80ed9
movl %ebp, %eax
leaq 0x2f256(%rip), %rdx     # 0xb00ec
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
jmp 0x80ec8
leaq 0x2fe07(%rip), %rdx     # 0xb0cad
leaq 0x2fb85(%rip), %rcx     # 0xb0a32
movq %r14, %rdi
movl %ebx, %esi
callq 0x7d316
movq %r14, %rdi
movl %ebx, %esi
callq 0x7e686
leaq 0x2fbc9(%rip), %rcx     # 0xb0a91
leaq 0x2fdde(%rip), %rdx     # 0xb0cad
movq %r14, %rdi
movl %ebx, %esi
callq 0x7d316
addq $0x7a120, %rsp          # imm = 0x7A120
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq