// File: /workspace/github_c_makefile_star2_O1/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 0x5f1fd
leaq 0x48a3b(%rip), %rdi     # 0xa7c17
callq 0x536e7
testl %eax, %eax
je 0x5f1fd
movsd 0x34fe23(%rip), %xmm0   # 0x3af010
movsd 0x34fe23(%rip), %xmm1   # 0x3af018
movq %r14, %rdi
callq 0x852d4
movl %r12d, %edi
callq 0x44c0
testl %eax, %eax
je 0x5f26c
movq 0x73660(%rip), %r13     # 0xd2870
movl %r12d, %edi
callq 0x4488
movups 0x34fdd9(%rip), %xmm0   # 0x3aeff8
movups %xmm0, 0x50(%rsp)
movups 0x34fdbd(%rip), %xmm0   # 0x3aefe8
movups %xmm0, 0x40(%rsp)
movups 0x34fda1(%rip), %xmm0   # 0x3aefd8
movups %xmm0, 0x30(%rsp)
movups 0x34fd85(%rip), %xmm0   # 0x3aefc8
movups %xmm0, 0x20(%rsp)
movups 0x34fd69(%rip), %xmm0   # 0x3aefb8
movups %xmm0, 0x10(%rsp)
movups 0x34fd4d(%rip), %xmm0   # 0x3aefa8
movups %xmm0, (%rsp)
movq %r14, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x85343
leal -0x3e8(%r12), %eax
cmpl $0x22, %eax
ja 0x5f2a8
leaq 0x48cec(%rip), %rcx     # 0xa7f6c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x735e0(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85f86
addl $0xfffff830, %r12d      # imm = 0xFFFFF830
cmpl $0xe, %r12d
ja 0x5f562
leaq 0x48d38(%rip), %rax     # 0xa7ff8
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x735a0(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x863b8
movq 0x7357f(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85805
movq 0x73560(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x8587d
movq 0x7353f(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x8556a
movq 0x7351e(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85420
movq 0x734ff(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x857b0
movq 0x734e0(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85cb2
movq 0x734c1(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85b8d
movq 0x734a2(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85acf
movq 0x73483(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85c2f
movq 0x73464(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85970
movq 0x73443(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x853bf
movq 0x73424(%rip), %rsi     # 0xd2870
movl (%r15), %ecx
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x8575e
cmpl $0x0, 0x10(%r15)
movq 0x733fd(%rip), %rsi     # 0xd2870
movl 0x10(%rsi), %ecx
je 0x5f62a
movq %r14, %rdi
movq %rbx, %rdx
jmp 0x5f63f
movq 0x733e2(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x8538c
movq 0x733c3(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x8579d
movq 0x733a4(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85468
movq 0x73383(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85a92
movq 0x73364(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x86540
movq 0x73345(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x86089
movq 0x73326(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x85fd9
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x732f9(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x86285
movq 0x732da(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x867ea
movq 0x732bb(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x861c1
movq 0x7329c(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x86842
movq 0x7327d(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x86241
movq 0x7325e(%rip), %rsi     # 0xd2870
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x862d9
leal -0x1(%rcx), %eax
imull %ecx, %eax
movl %eax, %ecx
shrl $0x1f, %ecx
addl %eax, %ecx
sarl %ecx
movq %r14, %rdi
movq %rbx, %rdx
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x8571f