// File: /workspace/github_c_makefile_star2_O2/olcaytaner[P]Isell/process.c
// Function: save_model
void save_model(FILE* modelfile, int algorithm, void* model, void* parameters)
{
 /*!Last Changed 05.08.2007 added QDACLASS algorithm*/
 /*!Last Changed 02.04.2007 added HMM algorithm*/
 /*!Last Changed 19.12.2005*/
 Svmtree_parameterptr psvmtree;
 Kforest_parameterptr pkf;
 if (get_algorithm_type(algorithm) == REGRESSION && get_parameter_o("normalizeoutput"))
   save_output_mean_and_variance(modelfile, outputmean, outputvariance);
 if (must_normalize(algorithm))
   save_mean_and_variance(modelfile, current_dataset, mean, variance, must_realize(algorithm));
 switch (algorithm)
  {
   case SELECTMAX    :save_model_selectmax(modelfile, current_dataset, (Model_selectmaxptr) model);
                      break;
   case ONEFEATURE   :save_model_onefeature(modelfile, current_dataset, (Model_onefeatureptr) model);
                      break;
   case SELECTAVERAGE:save_model_selectaverage(modelfile, current_dataset, (double*) model);
                      break;
   case GAUSSIAN     :save_model_gaussian(modelfile, current_dataset, (Model_gaussianptr) model);
                      break;
   case NEARESTMEAN  :save_model_nearestmean(modelfile, current_dataset, (Instanceptr) model);
                      break;
   case LINEARREG    :save_model_linearreg(modelfile, current_dataset, (Model_linearregressionptr) model);
                      break;
   case QUANTIZEREG  :save_model_quantizereg(modelfile, current_dataset, (Model_quantizeregptr) model);
                      break;
   case KNN          :
   case KNNREG       :save_model_knn(modelfile, current_dataset, (Instanceptr) model);
                      break;
   case GPROCESSREG  :save_model_gprocessreg(modelfile, current_dataset, (Model_gprocessregressionptr) model);
                      break;
   case C45          :
   case LDT          :save_model_c45(modelfile, current_dataset, (Decisionnodeptr) model, 0);
                      break;
   case SOFTTREE     :save_model_softtree(modelfile, current_dataset, (Decisionnodeptr) model, 0);
                      break;
   case SVMTREE      :psvmtree = (Svmtree_parameterptr) parameters;
                      if (psvmtree->multiclasstype == ONE_VS_ONE)
                        save_model_svmtree(modelfile, current_dataset, (Decisionnodeptr*) model, current_dataset->classno * (current_dataset->classno - 1) / 2);
                      else
                        save_model_svmtree(modelfile, current_dataset, (Decisionnodeptr*) model, current_dataset->classno);
                      break;
   case RANDOMFOREST :pkf = (Kforest_parameterptr) parameters;
                      save_model_randomforest(modelfile, current_dataset, (Decisionnodeptr*) model, pkf->forestsize);
                      break;
   case SVMREGTREE   :
   case REGTREE      :
   case SOFTREGTREE  :save_model_regtree(modelfile, current_dataset, (Regressionnodeptr) model, 0);
                      break;
   case REGRULE      :save_model_regrule(modelfile, current_dataset, (Regressionrulesetptr) model);
                      break;
   case RISE         :save_model_rise(modelfile, current_dataset, (Model_riseptr) model);
                      break;
   case IREP         :
   case IREP2        :
   case RIPPER       :
   case C45RULES     :
   case MULTIRIPPER  :
   case REXRIPPER    :
   case CN2          :
   case LERILS       :
   case PART         :save_model_ripper(modelfile, current_dataset, (Rulesetptr) model);
                      break;
   case DIVS         :save_model_divs(modelfile, current_dataset, (Model_divsptr) model);
                      break;
   case NAIVEBAYES   :save_model_naivebayes(modelfile, current_dataset, (Model_naivebayesptr) model);
                      break;
   case QDACLASS     :save_model_qdaclass(modelfile, current_dataset, (Model_qdaclassptr) model);
                      break;
   case LDACLASS     :save_model_ldaclass(modelfile, current_dataset, (Model_ldaclassptr) model);
                      break;
   case LOGISTIC     :save_model_logistic(modelfile, current_dataset, (double**) model);
                      break;
   case RBF          :
   case RBFREG       :save_model_rbf(modelfile, current_dataset, (Rbfnetworkptr) model);
                      break;
   case MLPGENERIC   :
   case MLPGENERICREG:
   case DNC          :
   case DNCREG       :save_model_mlpgeneric(modelfile, current_dataset, (Mlpnetworkptr) model);
                      break;
   case MULTILDT     :
   case CART         :save_model_multildt(modelfile, current_dataset, (Decisionnodeptr) model, 0);
                      break;
   case NBTREE       :save_model_nodeboundedtree(modelfile, current_dataset, (Decisionnodeptr) model, 0);
                      break;
   case SVM          :
   case SVMREG       :save_model_svm(modelfile, current_dataset, (Svm_modelptr) model);
                      break;
   case HMM          :save_model_hmm(modelfile, current_dataset, (Hmmptr*) model);
                      break;
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rcx, %r15
movq %rdx, %rbx
movl %esi, %r12d
movq %rdi, %r14
movl %esi, %edi
callq 0x445c
cmpl $0x1, %eax
jne 0x5804c
leaq 0x42bcc(%rip), %rdi     # 0x9abf7
callq 0x4cff1
testl %eax, %eax
je 0x5804c
movsd 0x351fd4(%rip), %xmm0   # 0x3aa010
movsd 0x351fd4(%rip), %xmm1   # 0x3aa018
movq %r14, %rdi
callq 0x7a95b
movl %r12d, %edi
callq 0x44cb
testl %eax, %eax
je 0x580bb
movq 0x75811(%rip), %r13     # 0xcd870
movl %r12d, %edi
callq 0x448a
movups 0x351f8a(%rip), %xmm0   # 0x3a9ff8
movups %xmm0, 0x50(%rsp)
movups 0x351f6e(%rip), %xmm0   # 0x3a9fe8
movups %xmm0, 0x40(%rsp)
movups 0x351f52(%rip), %xmm0   # 0x3a9fd8
movups %xmm0, 0x30(%rsp)
movups 0x351f36(%rip), %xmm0   # 0x3a9fc8
movups %xmm0, 0x20(%rsp)
movups 0x351f1a(%rip), %xmm0   # 0x3a9fb8
movups %xmm0, 0x10(%rsp)
movups 0x351efe(%rip), %xmm0   # 0x3a9fa8
movups %xmm0, (%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x7a9ca
leal -0x3e8(%r12), %eax
cmpl $0x22, %eax
ja 0x580f7
leaq 0x42e8d(%rip), %rcx     # 0x9af5c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x75791(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b59e
addl $0xfffff830, %r12d      # imm = 0xFFFFF830
cmpl $0xe, %r12d
ja 0x583b1
leaq 0x42ed9(%rip), %rax     # 0x9afe8
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x75751(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b97a
movq 0x75730(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7ae50
movq 0x75711(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7aebe
movq 0x756f0(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7ac03
movq 0x756cf(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7aaa2
movq 0x756b0(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7adfb
movq 0x75691(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b2fc
movq 0x75672(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b1ea
movq 0x75653(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b139
movq 0x75634(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b280
movq 0x75615(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7afcb
movq 0x755f4(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7aa46
movq 0x755d5(%rip), %rsi     # 0xcd870
movl (%r15), %ecx
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7ade3
cmpl $0x0, 0x10(%r15)
movq 0x755ae(%rip), %rsi     # 0xcd870
movl 0x10(%rsi), %ecx
je 0x58479
movq %r14, %rdi
movq %rbx, %rdx
jmp 0x5848d
movq 0x75593(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7aa13
movq 0x75574(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7ade8
movq 0x75555(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7aaea
movq 0x75534(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b100
movq 0x75515(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7bb20
movq 0x754f6(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b69b
movq 0x754d7(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b5f2
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x754aa(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b847
movq 0x7548b(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7bd9e
movq 0x7546c(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b783
movq 0x7544d(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7bdf9
movq 0x7542e(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b803
movq 0x7540f(%rip), %rsi     # 0xcd870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7b89b
leal -0x1(%rcx), %eax
imull %ecx, %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movq %r14, %rdi
movq %rbx, %rdx
movl %eax, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x7ada1