// File: myudelson[P]hmm-scalable/InputUtil.cpp
// Function: InputUtil::readBin(char const*, param*)
bool InputUtil::readBin(const char *fn, struct param * param) {
    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;
    }
    param->N = (NDAT)i;
    
    // Nstacked
    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;
    }
    param->Nstacked = (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;
    }
    param->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;
    }
    param->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;
    }
    param->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;
    }
    param->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;
    }
    param->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;
    }
    param->nZ = (NPAR)i;
    if(param->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;
    }
    param->multiskill = (NPAR)c;
    
    
    // dat_obs
    StripedArray<NPAR> *striped_dat_obs = new StripedArray<NPAR>(fid, param->N);
    param->dat_obs = striped_dat_obs->toArray();
    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, param->N);
//        for(t=0; t<param->N; t++)
//            param->dat_group[t] = (NCAT)dat_group_legacy->get(t);
//        if(param->multiskill == 0) {
//            dat_skill_legacy = new StripedArray<short>(fid, param->N);
//            for(t=0; t<param->N; t++)
//                param->dat_skill[t] = (NCAT)dat_skill_legacy->get(t);
//            delete dat_skill_legacy;
//        } else {
//            param->dat_multiskill = new StripedArray<NCAT*>(param->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, param->N);
        param->dat_group = striped_dat_group->toArray();
        delete striped_dat_group;
//    }
    
    // dat_item
    StripedArray<NCAT> *striped_dat_item = new StripedArray<NCAT>(fid, param->N);
    param->dat_item = striped_dat_item->toArray();
    delete striped_dat_item;
    
    // dat_skill
    if(param->multiskill == 0) {
        StripedArray<NCAT> *striped_dat_skill = new StripedArray<NCAT>(fid, param->N);
        param->dat_skill = striped_dat_skill->toArray();
        delete striped_dat_skill;
    } else {
//            param->dat_multiskill = new StripedArray< NCAT* >(param->N,true);
//            nread = readMultiSkill(fid, param, v);
        StripedArray<NCAT> *striped_dat_skill_stacked = new StripedArray<NCAT>(fid, param->Nstacked);
        param->dat_skill_stacked = striped_dat_skill_stacked->toArray();
        StripedArray<NCAT> *striped_dat_skill_rcount = new StripedArray<NCAT>(fid, param->N);
        param->dat_skill_rcount = striped_dat_skill_rcount->toArray();
        StripedArray<NCAT> *striped_dat_skill_rix = new StripedArray<NCAT>(fid, param->N);
        param->dat_skill_rix = striped_dat_skill_rix->toArray();
        delete striped_dat_skill_stacked;
        delete striped_dat_skill_rcount;
        delete striped_dat_skill_rix;
    }
    // dat_slices, only of nZ > 1
    if(param->nZ > 1) {
        NDAT szZ = (param->multiskill == 0)?param->N:param->Nstacked;
        StripedArray<NPAR> *striped_dat_slice = new StripedArray<NPAR>(fid, szZ);
        param->dat_slice = striped_dat_slice->toArray();
        delete striped_dat_slice;
    }
        
    string str;
    param->map_group_fwd = new map<string,NCAT>();
    param->map_group_bwd = new map<NCAT,string>();
    param->map_skill_fwd = new map<string,NCAT>();
    param->map_skill_bwd = new map<NCAT,string>();
    param->map_step_fwd = new map<string,NCAT>();
    param->map_step_bwd = new map<NCAT,string>();
    // voc_group
    for(NCAT g=0; g<param->nG; g++) {
        str = readString(fid);
        param->map_group_fwd->insert(pair<string,NCAT>(str, g));
        param->map_group_bwd->insert(pair<NCAT,string>(g, str));
    }
    
    // voc_skill
    for(NCAT k=0; k<param->nK; k++) {
        str = readString(fid);
        param->map_skill_fwd->insert(pair<string,NCAT>(str, k));
        param->map_skill_bwd->insert(pair<NCAT,string>(k, str));
    }
    
    // voc_item
    for(NCAT i=0; i<param->nI; i++) {
        str = readString(fid);
        param->map_step_fwd->insert(pair<string,NCAT>(str, i));
        param->map_step_bwd->insert(pair<NCAT,string>(i, str));
    }
    
    fclose(fid);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3f0, %rsp            # imm = 0x3F0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x3b2f0(%rip), %rsi     # 0x5012e
callq 0x5370
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
leaq -0x1a(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x5470
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0x14e8a
movq 0x4616c(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3b2b7(%rip), %rsi     # 0x50131
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movsbl -0x1a(%rbp), %eax
cmpl $0x3, %eax
jle 0x14ebd
movq 0x4613e(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movsbl -0x1a(%rbp), %ecx
leaq 0x3b2ad(%rip), %rsi     # 0x50155
movl $0x3, %edx
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5470
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0x14f02
movq 0x460f4(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3b29b(%rip), %rsi     # 0x5018d
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8b0(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5470
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0x14f54
movq 0x460a2(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3b26f(%rip), %rsi     # 0x501b3
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8b4(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5470
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0x14fa6
movq 0x46050(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3b24d(%rip), %rsi     # 0x501e3
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8cc(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5470
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0x14ff8
movq 0x45ffe(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3b232(%rip), %rsi     # 0x5021a
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movl -0x20(%rbp), %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x8b9(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5470
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0x1504c
movq 0x45faa(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3b20c(%rip), %rsi     # 0x50248
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8bc(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5470
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0x1509e
movq 0x45f58(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3b1ed(%rip), %rsi     # 0x5027b
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8c4(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5470
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0x150f0
movq 0x45f06(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3b1c2(%rip), %rsi     # 0x502a2
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movl -0x20(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8c0(%rax)
movq -0x30(%rbp), %rcx
leaq -0x20(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5470
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0x15142
movq 0x45eb4(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3b198(%rip), %rsi     # 0x502ca
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movl -0x20(%rbp), %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, 0x8c8(%rax)
movq -0x18(%rbp), %rax
movsbl 0x8c8(%rax), %eax
cmpl $0x1, %eax
jge 0x15182
movq 0x45e70(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
leaq 0x3b180(%rip), %rsi     # 0x502f2
movb $0x0, %al
callq 0x5440
movb $0x1, -0x1(%rbp)
jmp 0x15dbc
movq -0x30(%rbp), %rcx
leaq -0x19(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x5470
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
je 0x151c5
movq 0x45e31(%rip), %rax     # 0x5afd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x3b164(%rip), %rsi     # 0x50319
movb $0x0, %al
callq 0x5440
movb $0x0, -0x1(%rbp)
jmp 0x15dbc
movb -0x19(%rbp), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x918(%rax)
movl $0x18, %edi
callq 0x52d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x278(%rbp)
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8b0(%rax), %edx
callq 0x16dd0
jmp 0x151fe
movq -0x278(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x16b90
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x870(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x280(%rbp)
cmpq $0x0, %rax
je 0x1524e
movq -0x280(%rbp), %rdi
callq 0x16c50
movq -0x280(%rbp), %rdi
movl $0x18, %esi
callq 0x52e0
movl $0x18, %edi
callq 0x52d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x288(%rbp)
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8b0(%rax), %edx
callq 0x16f10
jmp 0x1527a
movq -0x288(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x16cb0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x878(%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x290(%rbp)
cmpq $0x0, %rax
je 0x152ca
movq -0x290(%rbp), %rdi
callq 0x16d70
movq -0x290(%rbp), %rdi
movl $0x18, %esi
callq 0x52e0
movl $0x18, %edi
callq 0x52d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x298(%rbp)
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8b0(%rax), %edx
callq 0x16f10
jmp 0x152f6
movq -0x298(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x16cb0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8a0(%rax)
movq -0x58(%rbp), %rax
movq %rax, -0x2a0(%rbp)
cmpq $0x0, %rax
je 0x15346
movq -0x2a0(%rbp), %rdi
callq 0x16d70
movq -0x2a0(%rbp), %rdi
movl $0x18, %esi
callq 0x52e0
movq -0x18(%rbp), %rax
movsbl 0x918(%rax), %eax
cmpl $0x0, %eax
jne 0x15463
movl $0x18, %edi
callq 0x52d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2a8(%rbp)
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8b0(%rax), %edx
callq 0x16f10
jmp 0x15386
movq -0x2a8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x16cb0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x880(%rax)
movq -0x60(%rbp), %rax
movq %rax, -0x2b0(%rbp)
cmpq $0x0, %rax
je 0x153d6
movq -0x2b0(%rbp), %rdi
callq 0x16d70
movq -0x2b0(%rbp), %rdi
movl $0x18, %esi
callq 0x52e0
jmp 0x1563f
movq -0x278(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x18, %esi
callq 0x52e0
jmp 0x15dca
movq -0x288(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x18, %esi
callq 0x52e0
jmp 0x15dca
movq -0x298(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x18, %esi
callq 0x52e0
jmp 0x15dca
movq -0x2a8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x18, %esi
callq 0x52e0
jmp 0x15dca
movl $0x18, %edi
callq 0x52d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2b8(%rbp)
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8b4(%rax), %edx
callq 0x16f10
jmp 0x1548f
movq -0x2b8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x16cb0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x888(%rax)
movl $0x18, %edi
callq 0x52d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2c0(%rbp)
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8b0(%rax), %edx
callq 0x16f10
jmp 0x154dd
movq -0x2c0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0x16cb0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x890(%rax)
movl $0x18, %edi
callq 0x52d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2c8(%rbp)
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8b0(%rax), %edx
callq 0x16f10
jmp 0x1552b
movq -0x2c8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0x16cb0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x898(%rax)
movq -0x68(%rbp), %rax
movq %rax, -0x2d0(%rbp)
cmpq $0x0, %rax
je 0x1557b
movq -0x2d0(%rbp), %rdi
callq 0x16d70
movq -0x2d0(%rbp), %rdi
movl $0x18, %esi
callq 0x52e0
movq -0x70(%rbp), %rax
movq %rax, -0x2d8(%rbp)
cmpq $0x0, %rax
je 0x155a9
movq -0x2d8(%rbp), %rdi
callq 0x16d70
movq -0x2d8(%rbp), %rdi
movl $0x18, %esi
callq 0x52e0
movq -0x78(%rbp), %rax
movq %rax, -0x2e0(%rbp)
cmpq $0x0, %rax
je 0x155d7
movq -0x2e0(%rbp), %rdi
callq 0x16d70
movq -0x2e0(%rbp), %rdi
movl $0x18, %esi
callq 0x52e0
jmp 0x1563f
movq -0x2b8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x18, %esi
callq 0x52e0
jmp 0x15dca
movq -0x2c0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x18, %esi
callq 0x52e0
jmp 0x15dca
movq -0x2c8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x18, %esi
callq 0x52e0
jmp 0x15dca
movq -0x18(%rbp), %rax
movsbl 0x8c8(%rax), %eax
cmpl $0x1, %eax
jle 0x15730
movq -0x18(%rbp), %rax
movsbl 0x918(%rax), %eax
cmpl $0x0, %eax
jne 0x15675
movq -0x18(%rbp), %rax
movl 0x8b0(%rax), %eax
movl %eax, -0x2e4(%rbp)
jmp 0x15685
movq -0x18(%rbp), %rax
movl 0x8b4(%rax), %eax
movl %eax, -0x2e4(%rbp)
movl -0x2e4(%rbp), %eax
movl %eax, -0x7c(%rbp)
movl $0x18, %edi
callq 0x52d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2f0(%rbp)
movq -0x30(%rbp), %rsi
movl -0x7c(%rbp), %edx
callq 0x16dd0
jmp 0x156b3
movq -0x2f0(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rdi
callq 0x16b90
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8a8(%rax)
movq -0x88(%rbp), %rax
movq %rax, -0x2f8(%rbp)
cmpq $0x0, %rax
je 0x1570c
movq -0x2f8(%rbp), %rdi
callq 0x16c50
movq -0x2f8(%rbp), %rdi
movl $0x18, %esi
callq 0x52e0
jmp 0x15730
movq -0x2f0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x18, %esi
callq 0x52e0
jmp 0x15dca
leaq -0xa8(%rbp), %rdi
callq 0x5420
movl $0x30, %edi
callq 0x52d0
movq %rax, -0x300(%rbp)
jmp 0x1574f
movq -0x300(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x6850
movq -0x300(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x920(%rax)
movl $0x30, %edi
callq 0x52d0
movq %rax, -0x308(%rbp)
jmp 0x1578e
movq -0x308(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x6890
movq -0x308(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x928(%rax)
movl $0x30, %edi
callq 0x52d0
movq %rax, -0x310(%rbp)
jmp 0x157cd
movq -0x310(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x6850
movq -0x310(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x940(%rax)
movl $0x30, %edi
callq 0x52d0
movq %rax, -0x318(%rbp)
jmp 0x1580c
movq -0x318(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x6890
movq -0x318(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x948(%rax)
movl $0x30, %edi
callq 0x52d0
movq %rax, -0x320(%rbp)
jmp 0x1584b
movq -0x320(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
callq 0x6850
movq -0x320(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x930(%rax)
movl $0x30, %edi
callq 0x52d0
movq %rax, -0x328(%rbp)
jmp 0x1588a
movq -0x328(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x5150
movq -0x328(%rbp), %rdi
callq 0x6890
movq -0x328(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x938(%rax)
movl $0x0, -0xac(%rbp)
movl -0xac(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8bc(%rcx), %eax
jge 0x15a65
movq -0x30(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x131d0
jmp 0x158ed
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x338(%rbp)
leaq -0xd0(%rbp), %rsi
movq %rsi, -0x340(%rbp)
callq 0x53a0
movq -0x340(%rbp), %rdi
callq 0x5170
movq -0x338(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x920(%rax), %rax
movq %rax, -0x330(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0xac(%rbp), %rdx
callq 0x16890
jmp 0x15948
movq -0x330(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x16850
movb %dl, -0x349(%rbp)
movq %rax, -0x348(%rbp)
jmp 0x1596a
movb -0x349(%rbp), %al
movq -0x348(%rbp), %rcx
movq %rcx, -0x108(%rbp)
movb %al, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x168d0
movq -0x18(%rbp), %rax
movq 0x928(%rax), %rax
movq %rax, -0x358(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0xac(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x16930
jmp 0x159be
movq -0x358(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x168f0
movb %dl, -0x361(%rbp)
movq %rax, -0x360(%rbp)
jmp 0x159e0
movb -0x361(%rbp), %al
movq -0x360(%rbp), %rcx
movq %rcx, -0x140(%rbp)
movb %al, -0x138(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x16970
movl -0xac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0x158c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x15dae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x168d0
jmp 0x15dae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x16970
jmp 0x15dae
movl $0x0, -0x144(%rbp)
movl -0x144(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8c0(%rcx), %eax
jge 0x15bfe
movq -0x30(%rbp), %rsi
leaq -0x168(%rbp), %rdi
callq 0x131d0
jmp 0x15a97
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x378(%rbp)
leaq -0x168(%rbp), %rsi
movq %rsi, -0x380(%rbp)
callq 0x53a0
movq -0x380(%rbp), %rdi
callq 0x5170
movq -0x378(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x940(%rax), %rax
movq %rax, -0x370(%rbp)
leaq -0x190(%rbp), %rdi
leaq -0x144(%rbp), %rdx
callq 0x16890
jmp 0x15af2
movq -0x370(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x16850
movb %dl, -0x389(%rbp)
movq %rax, -0x388(%rbp)
jmp 0x15b14
movb -0x389(%rbp), %al
movq -0x388(%rbp), %rcx
movq %rcx, -0x1a0(%rbp)
movb %al, -0x198(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x168d0
movq -0x18(%rbp), %rax
movq 0x948(%rax), %rax
movq %rax, -0x398(%rbp)
leaq -0x1c8(%rbp), %rdi
leaq -0x144(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x16930
jmp 0x15b68
movq -0x398(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x168f0
movb %dl, -0x3a1(%rbp)
movq %rax, -0x3a0(%rbp)
jmp 0x15b8a
movb -0x3a1(%rbp), %al
movq -0x3a0(%rbp), %rcx
movq %rcx, -0x1d8(%rbp)
movb %al, -0x1d0(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x16970
movl -0x144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x144(%rbp)
jmp 0x15a6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x168d0
jmp 0x15dae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x16970
jmp 0x15dae
movl $0x0, -0x1dc(%rbp)
movl -0x1dc(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8c4(%rcx), %eax
jge 0x15d91
movq -0x30(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0x131d0
jmp 0x15c30
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
leaq -0x200(%rbp), %rsi
movq %rsi, -0x3c0(%rbp)
callq 0x53a0
movq -0x3c0(%rbp), %rdi
callq 0x5170
movq -0x3b8(%rbp), %rsi
movq -0x18(%rbp), %rax
movq 0x930(%rax), %rax
movq %rax, -0x3b0(%rbp)
leaq -0x228(%rbp), %rdi
leaq -0x1dc(%rbp), %rdx
callq 0x16890
jmp 0x15c8b
movq -0x3b0(%rbp), %rdi
leaq -0x228(%rbp), %rsi
callq 0x16850
movb %dl, -0x3c9(%rbp)
movq %rax, -0x3c8(%rbp)
jmp 0x15cad
movb -0x3c9(%rbp), %al
movq -0x3c8(%rbp), %rcx
movq %rcx, -0x238(%rbp)
movb %al, -0x230(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x168d0
movq -0x18(%rbp), %rax
movq 0x938(%rax), %rax
movq %rax, -0x3d8(%rbp)
leaq -0x260(%rbp), %rdi
leaq -0x1dc(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x16930
jmp 0x15d01
movq -0x3d8(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x168f0
movb %dl, -0x3e1(%rbp)
movq %rax, -0x3e0(%rbp)
jmp 0x15d23
movb -0x3e1(%rbp), %al
movq -0x3e0(%rbp), %rcx
movq %rcx, -0x270(%rbp)
movb %al, -0x268(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x16970
movl -0x1dc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1dc(%rbp)
jmp 0x15c08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x168d0
jmp 0x15dae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x16970
jmp 0x15dae
movq -0x30(%rbp), %rdi
callq 0x52c0
jmp 0x15d9c
movb $0x1, -0x1(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x5170
jmp 0x15dbc
leaq -0xa8(%rbp), %rdi
callq 0x5170
jmp 0x15dca
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x3f0, %rsp            # imm = 0x3F0
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5540
nopw %cs:(%rax,%rax)