// File: myudelson[P]hmm-scalable/InputUtilSt.cpp
// Function: InputUtilSt::readBin(char const*, task*)
bool InputUtilSt::readBin(const char *fn, struct task *task) {
    char c, v/*version*/;
    NDAT i;
    NDAT nread;
    FILE *fid = fopen(fn,"rb");
    
    // version
    nread = (NDAT)fread (&v, sizeof(char), (size_t)1, fid);
    if(nread != 1) {
        fprintf(stderr,"Error reading version data from %s\n",fn);
        return false;
    }
    if( v > bin_input_file_verstion) { // we will handle earlier versions
        fprintf(stderr,"Wrong version of the data file. Expected %d, actual %d\n",(int)bin_input_file_verstion, (int)v);
        return false;
    }
    
    // N
    nread = (NDAT)fread (&i, sizeof(NDAT), (size_t)1, fid);
    if(nread != 1) {
        fprintf(stderr,"Error reading number of rows from %s\n",fn);
        return false;
    }
    task->N = (NDAT)i;
    
    // Nst
    nread = (NDAT)fread (&i, sizeof(NDAT), (size_t)1, fid);
    if(nread != 1) {
        fprintf(stderr,"Error reading number of rows (stacked) from %s\n",fn);
        return false;
    }
    task->Nst = (NDAT)i;
    
    // N_null
    nread = (NDAT)fread (&i, sizeof(NDAT), (size_t)1, fid);
    if(nread != 1) {
        fprintf(stderr,"Error reading number of rows with null skills from %s\n",fn);
        return false;
    }
    task->N_null = (NDAT)i;
    
    // nO
    nread = (NDAT)fread (&i, sizeof(NDAT), (size_t)1, fid);
    if(nread != 1) {
        fprintf(stderr,"Error reading number of observations from %s\n",fn);
        return false;
    }
    task->nO = (NPAR)i;
    
    // nG
    nread = (NDAT)fread (&i, sizeof(NDAT), (size_t)1, fid);
    if(nread != 1) {
        fprintf(stderr,"Error reading number of groups (students) from %s\n",fn);
        return false;
    }
    task->nG = (NCAT)i;
    
    // nI
    nread = (NDAT)fread (&i, sizeof(NDAT), (size_t)1, fid);
    if(nread != 1) {
        fprintf(stderr,"Error reading number of items from %s\n",fn);
        return false;
    }
    task->nI = (NCAT)i;
    
    // nK
    nread = (NDAT)fread (&i, sizeof(NDAT), (size_t)1, fid);
    if(nread != 1) {
        fprintf(stderr,"Error reading number of skills from %s\n",fn);
        return false;
    }
    task->nK = (NCAT)i;
    
    // nZ
    nread = (NDAT)fread (&i, sizeof(NDAT), (size_t)1, fid);
    if(nread != 1) {
        fprintf(stderr,"Error reading number of slices from %s\n",fn);
        return false;
    }
    task->nZ = (NPAR)i;
    if(task->nZ<1) {
        fprintf(stderr,"Number of slices should be at least 1\n");
        return true;
    }
    
    // multiskill
    nread = (NDAT)fread (&c, sizeof(char), (size_t)1, fid);
    if(nread != 1) {
        fprintf(stderr,"Error reading multiskill flag from %s\n",fn);
        return false;
    }
    task->multiskill = (NPAR)c;
    
    
    // dat_obs
//    StripedArray<NPAR> *striped_dat_obs = new StripedArray<NPAR>(fid, task->N);
//    task->dat_obs = striped_dat_obs->toArray();
    task->dat_obs = StripedArray<NPAR>::fromFileToArray(fid, task->N);
    task->dat_obs_stacked = init1D<NPAR>(task->Nst);
    task->dat_predict = initToValue2D<NUMBER>(task->N, task->nO, 0);
//    delete striped_dat_obs;

    
//    if(v==1) { // older NCAT of unsigned short
//        StripedArray<short> *dat_group_legacy = NULL;
//        StripedArray<short> *dat_skill_legacy = NULL;
//        StripedArray<short*> *dat_multiskill_legacy = NULL;
//        dat_group_legacy = new StripedArray<short>(fid, task->N);
//        for(t=0; t<task->N; t++)
//            task->dat_group[t] = (NCAT)dat_group_legacy->get(t);
//        if(task->multiskill == 0) {
//            dat_skill_legacy = new StripedArray<short>(fid, task->N);
//            for(t=0; t<task->N; t++)
//                task->dat_skill[t] = (NCAT)dat_skill_legacy->get(t);
//            delete dat_skill_legacy;
//        } else {
//            task->dat_multiskill = new StripedArray<NCAT*>(task->N,true);
//            nread = readMultiSkill(fid, param, v);
//            delete dat_multiskill_legacy;
//        }
//        delete dat_group_legacy;
//    } else {
        // dat_group
//        StripedArray<NCAT> *striped_dat_group = new StripedArray<NCAT>(fid, task->N);
//        task->dat_group = striped_dat_group->toArray();
//        delete striped_dat_group;
        task->dat_group = StripedArray<NCAT>::fromFileToArray(fid, task->N);
//    }
    
    // dat_item
//    StripedArray<NCAT> *striped_dat_item = new StripedArray<NCAT>(fid, task->N);
//    task->dat_item = striped_dat_item->toArray();
//    delete striped_dat_item;
    task->dat_item = StripedArray<NCAT>::fromFileToArray(fid, task->N);
    
    // dat_skill
    if(task->multiskill == 0) {
//        StripedArray<NCAT> *striped_dat_skill = new StripedArray<NCAT>(fid, task->N);
//        task->dat_skill = striped_dat_skill->toArray();
//        delete striped_dat_skill;
        task->dat_skill = StripedArray<NCAT>::fromFileToArray(fid, task->N);
    } else {
//            task->dat_multiskill = new StripedArray< NCAT* >(task->N,true);
//            nread = readMultiSkill(fid, param, v);
//        StripedArray<NCAT> *striped_dat_skill_stacked = new StripedArray<NCAT>(fid, task->Nst);
//        task->dat_skill_stacked = striped_dat_skill_stacked->toArray();
//        StripedArray<NCAT> *striped_dat_skill_rcount = new StripedArray<NCAT>(fid, task->N);
//        task->dat_skill_rcount = striped_dat_skill_rcount->toArray();
//        StripedArray<NCAT> *striped_dat_skill_rix = new StripedArray<NCAT>(fid, task->N);
//        task->dat_skill_rix = striped_dat_skill_rix->toArray();
//        delete striped_dat_skill_stacked;
//        delete striped_dat_skill_rcount;
//        delete striped_dat_skill_rix;
        task->dat_skill_stacked = StripedArray<NCAT>::fromFileToArray(fid, task->Nst);
        task->dat_skill_rcount = StripedArray<NCAT>::fromFileToArray(fid, task->N);
        task->dat_skill_rix = StripedArray<NCAT>::fromFileToArray(fid, task->N);
    }
    // dat_slices, only of nZ > 1
    if(task->nZ > 1) {
        NDAT szZ = (task->multiskill == 0)?task->N:task->Nst;
//        StripedArray<NPAR> *striped_dat_slice = new StripedArray<NPAR>(fid, szZ);
//        task->dat_slice = striped_dat_slice->toArray();
//        delete striped_dat_slice;
        task->dat_slice = StripedArray<NPAR>::fromFileToArray(fid, szZ);
    }
        
    string str;
    task->map_group_fwd = new map<string,NCAT>();
    task->map_group_bwd = new map<NCAT,string>();
    task->map_skill_fwd = new map<string,NCAT>();
    task->map_skill_bwd = new map<NCAT,string>();
    task->map_step_fwd = new map<string,NCAT>();
    task->map_step_bwd = new map<NCAT,string>();
    // voc_group
    for(NCAT g=0; g<task->nG; g++) {
        str = readString(fid);
        task->map_group_fwd->insert(pair<string,NCAT>(str, g));
        task->map_group_bwd->insert(pair<NCAT,string>(g, str));
    }
    
    // voc_skill
    for(NCAT k=0; k<task->nK; k++) {
        str = readString(fid);
        task->map_skill_fwd->insert(pair<string,NCAT>(str, k));
        task->map_skill_bwd->insert(pair<NCAT,string>(k, str));
    }
    
    // voc_item
    for(NCAT i=0; i<task->nI; i++) {
        str = readString(fid);
        task->map_step_fwd->insert(pair<string,NCAT>(str, i));
        task->map_step_bwd->insert(pair<NCAT,string>(i, str));
    }
    
    // build dat_obs_stacked
    NDAT co = 0;
    if(task->multiskill!=0) {
        for(NDAT t=0;t<task->N;t++) {
            for(NDAT tt=0; tt<task->dat_skill_rcount[t]; tt++) {
                task->dat_obs_stacked[c] = task->dat_obs[t];
                co++;
            }
        }
    } else {
        memcpy( task->dat_obs_stacked, task->dat_obs , sizeof(NPAR)*(size_t)task->N );
    }

    //
    // create connectivities: skill-skill, student-skill
    //
    createConnectivities(task);

    fclose(fid);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xe52c(%rip), %rsi      # 0x1c02a
callq 0x3310
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
leaq -0x1a(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x33e0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0xdb4a
movq 0x144ac(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe4f3(%rip), %rsi      # 0x1c02d
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movsbl -0x1a(%rbp), %eax
cmpl $0x3, %eax
jle 0xdb7d
movq 0x1447e(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movsbl -0x1a(%rbp), %ecx
leaq 0xe4e9(%rip), %rsi      # 0x1c051
movl $0x3, %edx
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x33e0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0xdbc2
movq 0x14434(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe4d7(%rip), %rsi      # 0x1c089
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8f8(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x33e0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0xdc14
movq 0x143e2(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe4ab(%rip), %rsi      # 0x1c0af
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8fc(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x33e0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0xdc66
movq 0x14390(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe489(%rip), %rsi      # 0x1c0df
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x914(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x33e0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0xdcb8
movq 0x1433e(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe46e(%rip), %rsi      # 0x1c116
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movl -0x20(%rbp), %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x901(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x33e0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0xdd0c
movq 0x142ea(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe448(%rip), %rsi      # 0x1c144
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x904(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x33e0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0xdd5e
movq 0x14298(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe429(%rip), %rsi      # 0x1c177
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x90c(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x33e0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0xddb0
movq 0x14246(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe3fe(%rip), %rsi      # 0x1c19e
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x908(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x33e0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0xde02
movq 0x141f4(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe3d4(%rip), %rsi      # 0x1c1c6
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movl -0x20(%rbp), %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x910(%rax)
movq -0x18(%rbp), %rax
movsbl 0x910(%rax), %eax
cmpl $0x1, %eax
jge 0xde42
movq 0x141b0(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
leaq 0xe3bc(%rip), %rsi      # 0x1c1ee
movb $0x0, %al
callq 0x33c0
movb $0x1, -0x1(%rbp)
jmp 0xe797
movq -0x30(%rbp), %rcx
leaq -0x19(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x33e0
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0xde85
movq 0x14171(%rip), %rax     # 0x21fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0xe3a0(%rip), %rsi      # 0x1c215
movb $0x0, %al
callq 0x33c0
movb $0x0, -0x1(%rbp)
jmp 0xe797
movb -0x19(%rbp), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x920(%rax)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8f8(%rax), %esi
callq 0xf650
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x880(%rax)
movq -0x18(%rbp), %rax
movl 0x8fc(%rax), %edi
callq 0xf360
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x888(%rax)
movq -0x18(%rbp), %rax
movl 0x8f8(%rax), %edi
movq -0x18(%rbp), %rax
movsbl 0x901(%rax), %esi
xorps %xmm0, %xmm0
callq 0xf390
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8c8(%rax)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8f8(%rax), %esi
callq 0xf6d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x890(%rax)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8f8(%rax), %esi
callq 0xf6d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8b8(%rax)
movq -0x18(%rbp), %rax
movsbl 0x920(%rax), %eax
cmpl $0x0, %eax
jne 0xdf70
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8f8(%rax), %esi
callq 0xf6d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x898(%rax)
jmp 0xdfd3
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8fc(%rax), %esi
callq 0xf6d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8a0(%rax)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8f8(%rax), %esi
callq 0xf6d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8a8(%rax)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x8f8(%rax), %esi
callq 0xf6d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8b0(%rax)
movq -0x18(%rbp), %rax
movsbl 0x910(%rax), %eax
cmpl $0x1, %eax
jle 0xe038
movq -0x18(%rbp), %rax
movsbl 0x920(%rax), %eax
cmpl $0x0, %eax
jne 0xe005
movq -0x18(%rbp), %rax
movl 0x8f8(%rax), %eax
movl %eax, -0x238(%rbp)
jmp 0xe015
movq -0x18(%rbp), %rax
movl 0x8fc(%rax), %eax
movl %eax, -0x238(%rbp)
movl -0x238(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0xf650
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8c0(%rax)
leaq -0x58(%rbp), %rdi
callq 0x33b0
movl $0x30, %edi
callq 0x3270
movq %rax, -0x240(%rbp)
jmp 0xe054
movq -0x240(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x4430
movq -0x240(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x928(%rax)
movl $0x30, %edi
callq 0x3270
movq %rax, -0x248(%rbp)
jmp 0xe093
movq -0x248(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x4470
movq -0x248(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x930(%rax)
movl $0x30, %edi
callq 0x3270
movq %rax, -0x250(%rbp)
jmp 0xe0d2
movq -0x250(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x4430
movq -0x250(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x948(%rax)
movl $0x30, %edi
callq 0x3270
movq %rax, -0x258(%rbp)
jmp 0xe111
movq -0x258(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x4470
movq -0x258(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x950(%rax)
movl $0x30, %edi
callq 0x3270
movq %rax, -0x260(%rbp)
jmp 0xe150
movq -0x260(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x4430
movq -0x260(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x938(%rax)
movl $0x30, %edi
callq 0x3270
movq %rax, -0x268(%rbp)
jmp 0xe18f
movq -0x268(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x3140
movq -0x268(%rbp), %rdi
callq 0x4470
movq -0x268(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x940(%rax)
movl $0x0, -0x68(%rbp)
movl -0x68(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x904(%rcx), %eax
jge 0xe352
movq -0x30(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0xb950
jmp 0xe1ec
leaq -0x58(%rbp), %rdi
movq %rdi, -0x278(%rbp)
leaq -0x88(%rbp), %rsi
movq %rsi, -0x280(%rbp)
callq 0x3340
movq -0x280(%rbp), %rdi
callq 0x3160
movq -0x278(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x928(%rax), %rax
movq %rax, -0x270(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0x68(%rbp), %rdx
callq 0xefa0
jmp 0xe241
movq -0x270(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xef60
movb %dl, -0x289(%rbp)
movq %rax, -0x288(%rbp)
jmp 0xe263
movb -0x289(%rbp), %al
movq -0x288(%rbp), %rcx
movq %rcx, -0xc0(%rbp)
movb %al, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xefe0
movq -0x18(%rbp), %rax
movq 0x930(%rax), %rax
movq %rax, -0x298(%rbp)
leaq -0xe8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0xf040
jmp 0xe2b1
movq -0x298(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0xf000
movb %dl, -0x2a1(%rbp)
movq %rax, -0x2a0(%rbp)
jmp 0xe2d3
movb -0x2a1(%rbp), %al
movq -0x2a0(%rbp), %rcx
movq %rcx, -0xf8(%rbp)
movb %al, -0xf0(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xf080
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0xe1c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xe78c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0xefe0
jmp 0xe78c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0xf080
jmp 0xe78c
movl $0x0, -0xfc(%rbp)
movl -0xfc(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x908(%rcx), %eax
jge 0xe4e5
movq -0x30(%rbp), %rsi
leaq -0x120(%rbp), %rdi
callq 0xb950
jmp 0xe384
leaq -0x58(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
leaq -0x120(%rbp), %rsi
movq %rsi, -0x2c0(%rbp)
callq 0x3340
movq -0x2c0(%rbp), %rdi
callq 0x3160
movq -0x2b8(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x948(%rax), %rax
movq %rax, -0x2b0(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0xfc(%rbp), %rdx
callq 0xefa0
jmp 0xe3dc
movq -0x2b0(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0xef60
movb %dl, -0x2c9(%rbp)
movq %rax, -0x2c8(%rbp)
jmp 0xe3fe
movb -0x2c9(%rbp), %al
movq -0x2c8(%rbp), %rcx
movq %rcx, -0x158(%rbp)
movb %al, -0x150(%rbp)
leaq -0x148(%rbp), %rdi
callq 0xefe0
movq -0x18(%rbp), %rax
movq 0x950(%rax), %rax
movq %rax, -0x2d8(%rbp)
leaq -0x180(%rbp), %rdi
leaq -0xfc(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0xf040
jmp 0xe44f
movq -0x2d8(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0xf000
movb %dl, -0x2e1(%rbp)
movq %rax, -0x2e0(%rbp)
jmp 0xe471
movb -0x2e1(%rbp), %al
movq -0x2e0(%rbp), %rcx
movq %rcx, -0x190(%rbp)
movb %al, -0x188(%rbp)
leaq -0x180(%rbp), %rdi
callq 0xf080
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0xe35c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x148(%rbp), %rdi
callq 0xefe0
jmp 0xe78c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x180(%rbp), %rdi
callq 0xf080
jmp 0xe78c
movl $0x0, -0x194(%rbp)
movl -0x194(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x90c(%rcx), %eax
jge 0xe678
movq -0x30(%rbp), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0xb950
jmp 0xe517
leaq -0x58(%rbp), %rdi
movq %rdi, -0x2f8(%rbp)
leaq -0x1b8(%rbp), %rsi
movq %rsi, -0x300(%rbp)
callq 0x3340
movq -0x300(%rbp), %rdi
callq 0x3160
movq -0x2f8(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x938(%rax), %rax
movq %rax, -0x2f0(%rbp)
leaq -0x1e0(%rbp), %rdi
leaq -0x194(%rbp), %rdx
callq 0xefa0
jmp 0xe56f
movq -0x2f0(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xef60
movb %dl, -0x309(%rbp)
movq %rax, -0x308(%rbp)
jmp 0xe591
movb -0x309(%rbp), %al
movq -0x308(%rbp), %rcx
movq %rcx, -0x1f0(%rbp)
movb %al, -0x1e8(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0xefe0
movq -0x18(%rbp), %rax
movq 0x940(%rax), %rax
movq %rax, -0x318(%rbp)
leaq -0x218(%rbp), %rdi
leaq -0x194(%rbp), %rsi
leaq -0x58(%rbp), %rdx
callq 0xf040
jmp 0xe5e2
movq -0x318(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0xf000
movb %dl, -0x321(%rbp)
movq %rax, -0x320(%rbp)
jmp 0xe604
movb -0x321(%rbp), %al
movq -0x320(%rbp), %rcx
movq %rcx, -0x228(%rbp)
movb %al, -0x220(%rbp)
leaq -0x218(%rbp), %rdi
callq 0xf080
movl -0x194(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x194(%rbp)
jmp 0xe4ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0xefe0
jmp 0xe78c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x218(%rbp), %rdi
callq 0xf080
jmp 0xe78c
movl $0x0, -0x22c(%rbp)
movq -0x18(%rbp), %rax
movsbl 0x920(%rax), %eax
cmpl $0x0, %eax
je 0xe73d
movl $0x0, -0x230(%rbp)
movl -0x230(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8f8(%rcx), %eax
jge 0xe73b
movl $0x0, -0x234(%rbp)
movl -0x234(%rbp), %eax
movq -0x18(%rbp), %rcx
movq 0x8a8(%rcx), %rcx
movslq -0x230(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xe725
movq -0x18(%rbp), %rax
movq 0x880(%rax), %rax
movslq -0x230(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movq 0x888(%rax), %rax
movsbq -0x19(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x22c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x22c(%rbp)
movl -0x234(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x234(%rbp)
jmp 0xe6c0
jmp 0xe727
movl -0x230(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x230(%rbp)
jmp 0xe6a0
jmp 0xe767
movq -0x18(%rbp), %rax
movq 0x888(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x880(%rax), %rsi
movq -0x18(%rbp), %rax
movslq 0x8f8(%rax), %rdx
shlq $0x0, %rdx
callq 0x3220
movq -0x18(%rbp), %rdi
callq 0xd700
jmp 0xe772
movq -0x30(%rbp), %rdi
callq 0x3260
jmp 0xe77d
movb $0x1, -0x1(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x3160
jmp 0xe797
leaq -0x58(%rbp), %rdi
callq 0x3160
jmp 0xe7a5
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x3490
nop