// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/utils.cpp
// Function: set_param_defaults(param*)
void set_param_defaults(struct param *param) {
    param->item_complexity = NULL;
	// configurable - set
    param->tol                   = 0.01;
    param->tol_mode              = 'p';
	param->scaled                = 0;
    param->do_not_check_constraints = 0;
	param->sliced                = 0;
    param->duplicate_console     = 0;
	param->maxiter               = 200;
	param->quiet                 = 0;
	param->single_skill          = 0;
	param->structure			 = 1; // default is by skill
	param->solver				 = 2; // default is Gradient Descent
	param->solver_setting		 = -1; // -1 - not set
    param->metrics               = 0;
    param->metrics_target_obs    = 0;
    param->predictions           = 0;
    param->update_known          = 'r';
    param->update_unknown        = 't';
    param->binaryinput           = 0;
	param->Cw                     = Calloc(NUMBER, (size_t)1);
    param->Cw[0]                  = 0;
    param->Ccenters              = NULL;
    param->initfile[0]           = 0; // 1st bit is 0 - no file
    param->init_params           = Calloc(NUMBER, (size_t)5);
    param->init_params_n         = 5;
	param->init_params[0] = 0.5; // PI[0]
	param->init_params[1] = 1.0; // p(not forget)
	param->init_params[2] = 0.4; // p(learn)
	param->init_params[3] = 0.8; // p(not slip)
	param->init_params[4] = 0.2; // p(guess)
	param->param_lo				= Calloc(NUMBER, (size_t)10);
	param->param_lo[0] = 0; param->param_lo[1] = 0; param->param_lo[2] = 1; param->param_lo[3] = 0; param->param_lo[4] = 0;
	param->param_lo[5] = 0; param->param_lo[6] = 0; param->param_lo[7] = 0; param->param_lo[8] = 0; param->param_lo[9] = 0;
	param->param_hi				= Calloc(NUMBER, (size_t)10);
	param->param_hi[0] = 1.0; param->param_hi[1] = 1.0; param->param_hi[2] = 1.0; param->param_hi[3] = 0.0; param->param_hi[4] = 1.0;
	param->param_hi[5] = 1.0; param->param_hi[6] = 1.0; param->param_hi[7] = 0.3; param->param_hi[8] = 0.3; param->param_hi[9] = 1.0;
	param->cv_folds = 0;
	param->cv_strat = 'g'; // default group(student)-stratified
    param->cv_target_obs = 0; // 1st state to validate agains by default, cv_folds enables cross-validation
    param->cv_folds_file[0] = 0; // empty folds file
    param->cv_inout_flag = 'o'; // default rule, we're writing folds out
    param->multiskill = 0; // single skill per ovservation by default
    param->parallel = 0; // parallelization flag, no parallelization (0) by default
    // parse running settings
    param->init_reset = false; // init parameters specified
    param->lo_lims_specd = false; // parameter limits s`pecified
    param->hi_lims_specd = false; // parameter limits s`pecified
    param->stat_specd_gt2 = false; // number of states specified to be >2
    // vocabilaries
    param->map_group_fwd = NULL;
    param->map_group_bwd = NULL;
    param->map_step_fwd = NULL;
    param->map_step_bwd = NULL;
    param->map_skill_fwd = NULL;
    param->map_skill_bwd = NULL;
	// derived from data - set to 0
    param->N  = 0; //will be dynamically set in read_data_...()
    param->Nstacked  = 0; //will be dynamically set in read_data_...()
	param->nS = 2;
	param->nO = 0;
	param->nG = 0;
	param->nK = 0;
	param->nI = 0;
    param->nZ = 1;
    param->nELO = 1;
	// data
    param->all_data = NULL;
    param->nSeq = 0;
	param->k_numg = NULL;
	param->k_data = NULL;
	param->k_g_data = NULL;
	param->g_numk = NULL;
	param->g_data = NULL;
	param->g_k_data = NULL;
    param->N_null = 0;
    param->n_null_skill_group = 0;
    param->null_skills = NULL;
	// fitting specific - Armijo rule
	param->ArmijoC1            = 1e-4;
	param->ArmijoC2            = 0.9; // since we're not newton method
	param->ArmijoReduceFactor  = 2;//1/0.9;//
	param->ArmijoSeed          = 1.0; //1; - since we use smooth stepping 1 is the only thing we need
    param->ArmijoMinStep       = 0.001; //  0.000001~20steps, 0.001~10steps
    // coord descend
    param->first_iteration_qualify = 0;
    param->iterations_to_qualify   = 2;
    param->iterations_limit        = 200;
    // block fitting of some parameters
    param->block_fitting_type = 0; // no bocking of fitting - TODO, enable diff block types
    param->block_fitting[0] = 0; // no bocking fitting for PI
    param->block_fitting[1] = 0; // no bocking fitting for A
    param->block_fitting[2] = 0; // no bocking fitting for B
    param->per_kc_rmse_acc = false;
    // data
    param->dat_obs = NULL;
    param->dat_group = NULL;
    param->dat_skill = NULL;
    param->dat_skill_stacked = NULL;
    param->dat_skill_rcount = NULL;
    param->dat_skill_rix = NULL;
    param->dat_item = NULL;
//    param->dat_multiskill = NULL;
    param->dat_slice = NULL;
	param->tag1 = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
movq %r15, (%rdi)
movabsq $0x3f847ae147ae147b, %rax # imm = 0x3F847AE147AE147B
movq %rax, 0x28(%rdi)
movb $0x70, 0x30(%rdi)
movl %r15d, 0x31(%rdi)
movabsq $0x2010000000000c8, %rax # imm = 0x2010000000000C8
movq %rax, 0x38(%rdi)
movb $-0x1, 0x40(%rdi)
movl %r15d, 0x58(%rdi)
movb %r15b, 0x5c(%rdi)
movl %r15d, 0x60(%rdi)
movw $0x7472, 0x64(%rdi)     # imm = 0x7472
movl %r15d, 0x68(%rdi)
movl $0x1, %edi
movl $0x8, %esi
callq 0x4130
movq %rax, 0x48(%rbx)
movq %r15, (%rax)
movq %r15, 0x50(%rbx)
movb %r15b, 0x6c(%rbx)
movl $0x5, %edi
movl $0x8, %esi
callq 0x4130
movq %rax, 0x8(%rbx)
movb $0x5, 0x10(%rbx)
movabsq $0x3fe0000000000000, %rcx # imm = 0x3FE0000000000000
movq %rcx, (%rax)
movabsq $0x3ff0000000000000, %r12 # imm = 0x3FF0000000000000
movq %r12, 0x8(%rax)
movabsq $0x3fd999999999999a, %rcx # imm = 0x3FD999999999999A
movq %rcx, 0x10(%rax)
movabsq $0x3fe999999999999a, %rcx # imm = 0x3FE999999999999A
movq %rcx, 0x18(%rax)
movabsq $0x3fc999999999999a, %rcx # imm = 0x3FC999999999999A
movq %rcx, 0x20(%rax)
movl $0xa, %edi
movl $0x8, %esi
callq 0x4130
movq %rax, %r14
movq %rax, 0x18(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r12, 0x10(%rax)
movl $0xa, %edi
movl $0x8, %esi
callq 0x4130
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r14)
movups %xmm0, 0x28(%r14)
movups %xmm0, 0x38(%r14)
movq %r15, 0x48(%r14)
movq %rax, 0x20(%rbx)
movq %r12, (%rax)
movq %r12, 0x8(%rax)
movq %r12, 0x10(%rax)
movq %r15, 0x18(%rax)
movq %r12, 0x20(%rax)
movq %r12, 0x28(%rax)
movq %r12, 0x30(%rax)
movabsq $0x3fd3333333333333, %rcx # imm = 0x3FD3333333333333
movq %rcx, 0x38(%rax)
movq %rcx, 0x40(%rax)
movq %r12, 0x48(%rax)
movl $0x6700, 0x46c(%rbx)    # imm = 0x6700
movb $0x6f, 0x86f(%rbx)
movb %r15b, 0x41(%rbx)
movq %r15, 0x8b0(%rbx)
movb %r15b, 0x91c(%rbx)
movl %r15d, 0x918(%rbx)
movups %xmm0, 0x940(%rbx)
movups %xmm0, 0x930(%rbx)
movups %xmm0, 0x920(%rbx)
movw $0x2, 0x8b8(%rbx)
movq %r15, 0x8bc(%rbx)
movl %r15d, 0x8c4(%rbx)
movw $0x101, 0x8c8(%rbx)     # imm = 0x101
movups %xmm0, 0x908(%rbx)
movups %xmm0, 0x8fc(%rbx)
movups %xmm0, 0x8ec(%rbx)
movups %xmm0, 0x8dc(%rbx)
movups %xmm0, 0x8cc(%rbx)
movabsq $0x3f1a36e2eb1c432d, %rax # imm = 0x3F1A36E2EB1C432D
movq %rax, 0x950(%rbx)
movabsq $0x3feccccccccccccd, %rax # imm = 0x3FECCCCCCCCCCCCD
movq %rax, 0x958(%rbx)
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x960(%rbx)
movq %r12, 0x968(%rbx)
movabsq $0x3f50624dd2f1a9fc, %rax # imm = 0x3F50624DD2F1A9FC
movq %rax, 0x970(%rbx)
movw $0x200, 0x978(%rbx)     # imm = 0x200
movq $0xc8, 0x97c(%rbx)
movl %r15d, 0x9a0(%rbx)
movups %xmm0, 0x8a0(%rbx)
movups %xmm0, 0x890(%rbx)
movups %xmm0, 0x880(%rbx)
movups %xmm0, 0x870(%rbx)
movb %r15b, 0x984(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq