// File: /workspace/github_cpp_makefile_star2_O1/myudelson[P]hmm-scalable/HMMProblemEloSt.cpp
// Function: HMMProblemEloSt::init(task*)
void HMMProblemEloSt::init(struct task *task) {
//    printf("HMMProblemEloSt::init\n");
    // parent init
    HMMProblemSt::init(task);
    // local init
    // init elo parameters, trackers (values and counts)
    NCAT nG = task->nG;
    this->param_elo_n = task->elo_param_values_n;
    this->param_elo = init1D<NUMBER>(this->param_elo_n);
    for(NPAR i=0; i<this->param_elo_n; i++) {
        this->param_elo[i] = task->elo_param_values[i];
    }
    this->gradient_elo = initToValue1D<NUMBER>(this->param_elo_n, 0);
    this->elo_count_g = initToValue1D<NCAT>((NDAT)nG, 0);
    this->elo_track_g = initToValue1D<NUMBER>((NDAT)nG, 0); // init on logit scale
    this->elo_track_t = initToValue1D<NUMBER>((NDAT)task->N, 0); // init on logit scale
    // init elo sensitivity function
//    NUMBER (HMMProblemEloSt::*sensitivity)(NDAT) = &HMMProblemEloSt::sensitivity_K;
    switch(this->task->elo_type)
    {
        case ELO_DIRECT_K: {
            this->sensitivity = &HMMProblemEloSt::sensitivity_K;
            break;
        }
        case ELO_UNS_REL_1_B: {
            this->sensitivity = &HMMProblemEloSt::sensitivity_U1b;
            break;
        }
        case ELO_UNS_REL_1_EXPB_0_01: {
            this->sensitivity = &HMMProblemEloSt::sensitivity_U1bexp0_01;
            break;
        }
        case ELO_O2Z_IN_B: {
            this->sensitivity = &HMMProblemEloSt::sensitivity_O2Z_IN_B;
            break;
        }
        default:
            fprintf(stderr,"Elo type specified (%d) is not supported.\n",this->task->elo_type);
            exit(1);
            break;
    }

    // init elo gradient function
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0xac98
movslq 0x904(%r14), %r15
movsbq 0x30(%r14), %r12
movb %r12b, 0xf0(%rbx)
movl $0x8, %esi
movq %r12, %rdi
callq 0x2110
movzbl %r12b, %r13d
movq %rax, 0xe0(%rbx)
testq %r12, %r12
jle 0x10792
movq 0x28(%r14), %rcx
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
cmpq %rdx, %r13
jne 0x10780
movl $0x8, %esi
movq %r12, %rdi
callq 0x2110
movq %rax, %rbp
testb %r12b, %r12b
jle 0x107b8
shll $0x3, %r13d
movq %rbp, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x2100
movq %rbp, 0xe8(%rbx)
movl $0x4, %esi
movq %r15, %rdi
callq 0x2110
movq %rax, %r12
testl %r15d, %r15d
jle 0x107e6
leaq (,%r15,4), %rdx
movq %r12, %rdi
xorl %esi, %esi
callq 0x2100
movq %r12, 0x100(%rbx)
movl $0x8, %esi
movq %r15, %rdi
callq 0x2110
movq %rax, %r12
testl %r15d, %r15d
jle 0x10813
shlq $0x3, %r15
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2100
movq %r12, 0xf8(%rbx)
movslq 0x8f8(%r14), %r14
movl $0x8, %esi
movq %r14, %rdi
callq 0x2110
movq %rax, %r15
testq %r14, %r14
jle 0x10847
shlq $0x3, %r14
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x2100
movq %r15, 0x108(%rbx)
movq 0x68(%rbx), %rax
movzbl 0x20(%rax), %eax
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
ja 0x108b1
leaq 0x1c1b(%rip), %rax      # 0x12480
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x45(%rip), %rax        # 0x108ba
jmp 0x10890
leaq 0x92(%rip), %rax        # 0x10910
jmp 0x10890
leaq 0x103(%rip), %rax       # 0x1098a
jmp 0x10890
leaq 0x36(%rip), %rax        # 0x108c6
movq %rax, 0xd0(%rbx)
movq $0x0, 0xd8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl %al, %edi
callq 0x2c3c
nop