// File: TooruAkagi[P]GCIS_Index/gcis_uni_build.cpp
// Function: main
int main(int argc, char *argv[]){
    int onhelp = 0;
    for(int i = 0;i<argc;i++){
    //printf("[%d : %s]",i,argv[i]);
    if('-'==argv[i][0]){ //符号
        if('i'==argv[i][1]){ //input
            int k = strlen(argv[i+1]);
            printf("<<%d,%d,%d>>",k,sizeof(argv[i+1]),sizeof(argv[i+1][0]));
            fname = (char*)malloc(k);
            for(int k2=0;k2<k;k2++){fname[k2]=argv[i+1][k2];}
        }
        if('o'==argv[i][1]){ //output
            int k = strlen(argv[i+1]);
            wname = (char*)malloc(k);
            for(int k2=0;k2<k;k2++){wname[k2]=argv[i+1][k2];}
        }
        if('h'==argv[i][1]){shelp();return 0;} //help
        i++;
        continue;
    }
  }
  if(fname==NULL){
    int k = strlen(defaultfname);
    fname = (char*)malloc(k);
    for(int k2=0;k2<k;k2++){fname[k2]=defaultfname[k2];}
  }
  if(wname==NULL){
    int k = strlen(defaultwname);
    wname = (char*)malloc(k);
    for(int k2=0;k2<k;k2++){wname[k2]=defaultwname[k2];}
  }
    FILE *fp;
    unsigned int *D;
    int *D_2;
    int i = 0;int round = 0;dcs[0] = 0;dc2s[0] = 0; 
    unsigned char chr;
    unsigned int a;
    fp = fopen(fname, "r");
    int flag = 0; //0:loops,1:dcs,2:dc2s,3:D,4:D_2,5:D3,6:NS
    int w = 1;
    while(flag<8){
        fscanf(fp,"%c",&chr);a = chr;
        fscanf(fp,"%c",&chr);a += chr*256;
        fscanf(fp,"%c",&chr);a += chr*65536;
        fscanf(fp,"%c",&chr);a += chr*65536*256;
        if(flag == 9){printf("\n[%d]:%u",flag,a);exit(1);}
        if(flag==7){NS[w]=a;w++;if(w==Sizelist[0]){flag++;printf("\n-finishing load index-\n");}}
        if(flag==6){Sizelist[0]=a;NS = (unsigned int*)malloc(4*Sizelist[0]);flag++;}
        if(flag==5){D_3[w]=a;w++;if(w==dc2s[loops]){flag++;w=0;}}
        if(flag==4){D_2[w]=a;w++;if(w==dc2s[loops]+1){flag++;w=0;}}
        if(flag==3){D[w]=a;w++;if(w==dcs[loops]){flag++;w=0;}}
        if(flag==2){dc2s[w]=a;if(w==loops){flag++;w=0;D_2 = (int*)malloc(4*dc2s[loops]+4);D_3 = (int*)malloc(4*dc2s[loops]+4);}else{w++;}}
        if(flag==1){dcs[w]=a;if(w==loops){flag++;w=1;D = (unsigned int*)malloc(4*dcs[loops]);}else{w++;}}
        if(flag==0){loops=a;flag++;}
        //fseek(fp,16,SEEK_CUR);

    }
    fclose(fp);
    for(int o = loops-1;o>=0;o--){exceptr[o]=-1;}
    Sizelist[1] = dc2s[loops];Sizelist[2] = dc2s[loops];
    for(int yj = 0;yj<dc2s[loops];yj++){
        if(D_3[yj]>255){Sizelist[1] = yj;break;}
    }
    for(int yj = Sizelist[1];yj<dc2s[loops];yj++){
        if(D_3[yj]>65535){Sizelist[2] = yj;break;}
    }
    D_3s = (unsigned char*)malloc(Sizelist[1]);
    D_3m = (unsigned short int*)malloc((Sizelist[2]-Sizelist[1])*2);
    for(int yj = 0;yj<Sizelist[1];yj++){D_3s[yj] = D_3[yj];}
    for(int yj = 0;yj<Sizelist[2]-Sizelist[1];yj++){D_3m[yj] = D_3[yj+Sizelist[1]];}
    //D_3をサイズごとに分割して保存している
    int roid;
    int totalsps = 0;
    int maxl = dc2s[loops];
    int *tx;
    tx = (int*)malloc((maxl+1)*4); //D_2の置き換え配列
    k = (bool*)malloc(Sizelist[7]); //最初に十分な領域を割り当てる.
    k3 = (bool*)malloc(Sizelist[8]);
    for(i=0;i<maxl;i++){
        //if(i==(maxl-5)){printf("[%d]まではOK(%d)",i,kad);} //Sizelist[7]を大きくするとセグフォしなくなります
        tx[i] = kad;
        roid=dmlen(i,D,D_2);
        diff(D,D_2[i],D_2[i+1]-D_2[i]);
        logg(roid,k); //1--反転なし:2--roid番目から文字が反転
        blogg(i,D,D_2,k);
    } //ガンマ符号
    tx[maxl] = kad;
    //printf("\n[D]配列サイズ : %d[%d bytes] / [D_2] = %d[%d bytes]\n",kad,kad/8,maxl,maxl*4);
    Sizelist[7] = kad;
    totalsps += kad/8; //符号化したD
    fano0(D,D_2,k3); //fの先頭の文字のコーディングをする．kadが消えるので，再生すること．
    //printf("[D1]:%d[%d bytes]\n",kad2,kad2/8);
    Sizelist[8] = kad2;
    totalsps += kad2/8; //符号化したD[先頭]
    free(D);
    for(i=0;i<=maxl;i++){D_2[i]=tx[i];} //作ったtxをD_2に差し替えるs
    free(tx);
    for(int o = 0;o<loops;o++){printf("\n%d[%d]",o,exceptr[o]);}
    int newn = kad2;
    //int t2=newn/lpurse;int t3=newn/spurse;
    Sizelist[3] = newn/lpurse + 1;Sizelist[4] =newn/spurse + 2;
    k3sub = (int*)malloc(Sizelist[3]*4);
    k3sub2 = (unsigned short int*)malloc(Sizelist[4]*2);
    
    totalsps += rsbuild(k3,k3sub,k3sub2,Sizelist[3]-1,newn);
    totalsps += Sizelist[0]*4 + dc2s[loops]*4; //NF && D
    d2under = (bool*)malloc((maxl+1)*6);
    d2top = (bool*)malloc(maxl+1+D_2[maxl]/64);
    printf("\n[[%d]]",maxl+1+D_2[maxl]/64);
    totalsps += fano(D_2,0,maxl+1,6,d2under,d2top);
    newn = kad2;
    //t2=newn/lpurse;t3=newn/spurse;
    Sizelist[5] = newn/lpurse + 1;Sizelist[6] =newn/spurse + 1;
    d2topsub = (int*)malloc(Sizelist[5]*4);
    d2topsub2 = (unsigned short int*)malloc(Sizelist[6]*2);
    totalsps += rsbuild(d2top,d2topsub,d2topsub2,Sizelist[5]-1,newn);
    printf("\nsps : %d byte(%d,%d)",totalsps,Sizelist[7],Sizelist[8]);
    write74();

    printf("codeindex is generated\n");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x2dfb
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %ecx
movl $0x2d, %eax
cmpl %ecx, %eax
jne 0x2deb
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %ecx
movl $0x69, %eax
cmpl %ecx, %eax
jne 0x2d32
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1090
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
leaq 0x1590(%rip), %rdi      # 0x425f
movl $0x8, %edx
movl $0x1, %ecx
movb $0x0, %al
callq 0x1030
movslq -0x1c(%rbp), %rdi
callq 0x1130
movq %rax, 0x34a8(%rip)      # 0x6198
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x2d30
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movb (%rax,%rcx), %dl
movq 0x347a(%rip), %rax      # 0x6198
movslq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x2cf7
jmp 0x2d32
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %ecx
movl $0x6f, %eax
cmpl %ecx, %eax
jne 0x2db6
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1090
movl %eax, -0x24(%rbp)
movslq -0x24(%rbp), %rdi
callq 0x1130
movq %rax, 0x342c(%rip)      # 0x61a0
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x2db4
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movb (%rax,%rcx), %dl
movq 0x33fe(%rip), %rax      # 0x61a0
movslq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x2d7b
jmp 0x2db6
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %ecx
movl $0x68, %eax
cmpl %ecx, %eax
jne 0x2de0
callq 0x2b90
movl $0x0, -0x4(%rbp)
jmp 0x382c
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2ded
jmp 0x2ded
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x2c67
cmpq $0x0, 0x3395(%rip)      # 0x6198
jne 0x2e5c
leaq 0x32e4(%rip), %rdi      # 0x60f0
callq 0x1090
movl %eax, -0x2c(%rbp)
movslq -0x2c(%rbp), %rdi
callq 0x1130
movq %rax, 0x3374(%rip)      # 0x6198
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x2e5a
movslq -0x30(%rbp), %rcx
leaq 0x32b2(%rip), %rax      # 0x60f0
movb (%rax,%rcx), %dl
movq 0x3350(%rip), %rax      # 0x6198
movslq -0x30(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2e2b
jmp 0x2e5c
cmpq $0x0, 0x333c(%rip)      # 0x61a0
jne 0x2ebd
leaq 0x3289(%rip), %rdi      # 0x60f6
callq 0x1090
movl %eax, -0x34(%rbp)
movslq -0x34(%rbp), %rdi
callq 0x1130
movq %rax, 0x331b(%rip)      # 0x61a0
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x2ebb
movslq -0x38(%rbp), %rcx
leaq 0x3257(%rip), %rax      # 0x60f6
movb (%rax,%rcx), %dl
movq 0x32f7(%rip), %rax      # 0x61a0
movslq -0x38(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2e8c
jmp 0x2ebd
movl $0x0, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movl $0x0, 0x32eb(%rip)      # 0x61c0
movl $0x0, 0x3331(%rip)      # 0x6210
movq 0x32b2(%rip), %rdi      # 0x6198
leaq 0x11b8(%rip), %rsi      # 0x40a5
callq 0x1100
movq %rax, -0x40(%rbp)
movl $0x0, -0x64(%rbp)
movl $0x1, -0x68(%rbp)
cmpl $0x8, -0x64(%rbp)
jge 0x320e
movq -0x40(%rbp), %rdi
leaq 0x1353(%rip), %rsi      # 0x426c
leaq -0x59(%rbp), %rdx
movb $0x0, %al
callq 0x11a0
movzbl -0x59(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x40(%rbp), %rdi
leaq 0x1336(%rip), %rsi      # 0x426c
leaq -0x59(%rbp), %rdx
movb $0x0, %al
callq 0x11a0
movzbl -0x59(%rbp), %eax
shll $0x8, %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x40(%rbp), %rdi
leaq 0x1313(%rip), %rsi      # 0x426c
leaq -0x59(%rbp), %rdx
movb $0x0, %al
callq 0x11a0
movzbl -0x59(%rbp), %eax
shll $0x10, %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x40(%rbp), %rdi
leaq 0x12f0(%rip), %rsi      # 0x426c
leaq -0x59(%rbp), %rdx
movb $0x0, %al
callq 0x11a0
movzbl -0x59(%rbp), %eax
shll $0x10, %eax
shll $0x8, %eax
addl -0x60(%rbp), %eax
movl %eax, -0x60(%rbp)
cmpl $0x9, -0x64(%rbp)
jne 0x2fbb
movl -0x64(%rbp), %esi
movl -0x60(%rbp), %edx
leaq 0x12c5(%rip), %rdi      # 0x426f
movb $0x0, %al
callq 0x1030
movl $0x1, %edi
callq 0x1120
cmpl $0x7, -0x64(%rbp)
jne 0x2fff
movl -0x60(%rbp), %edx
movq 0x338d(%rip), %rax      # 0x6358
movslq -0x68(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
cmpl 0x315c(%rip), %eax      # 0x6140
jne 0x2ffd
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
leaq 0x1282(%rip), %rdi      # 0x4278
movb $0x0, %al
callq 0x1030
jmp 0x2fff
cmpl $0x6, -0x64(%rbp)
jne 0x302f
movl -0x60(%rbp), %eax
movl %eax, 0x3132(%rip)      # 0x6140
movl 0x312c(%rip), %eax      # 0x6140
shll $0x2, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, 0x3332(%rip)      # 0x6358
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
cmpl $0x5, -0x64(%rbp)
jne 0x3077
movl -0x60(%rbp), %edx
movq 0x3349(%rip), %rax      # 0x6388
movslq -0x68(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movslq 0x30d3(%rip), %rdx      # 0x612c
leaq 0x31b0(%rip), %rcx      # 0x6210
cmpl (%rcx,%rdx,4), %eax
jne 0x3075
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl $0x0, -0x68(%rbp)
jmp 0x3077
cmpl $0x4, -0x64(%rbp)
jne 0x30c1
movl -0x60(%rbp), %edx
movq -0x50(%rbp), %rax
movslq -0x68(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movslq 0x308e(%rip), %rdx      # 0x612c
leaq 0x316b(%rip), %rcx      # 0x6210
movl (%rcx,%rdx,4), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x30bf
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl $0x0, -0x68(%rbp)
jmp 0x30c1
cmpl $0x3, -0x64(%rbp)
jne 0x3106
movl -0x60(%rbp), %edx
movq -0x48(%rbp), %rax
movslq -0x68(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movslq 0x3044(%rip), %rdx      # 0x612c
leaq 0x30d1(%rip), %rcx      # 0x61c0
cmpl (%rcx,%rdx,4), %eax
jne 0x3104
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl $0x0, -0x68(%rbp)
jmp 0x3106
cmpl $0x2, -0x64(%rbp)
jne 0x3192
movl -0x60(%rbp), %edx
movslq -0x68(%rbp), %rcx
leaq 0x30f2(%rip), %rax      # 0x6210
movl %edx, (%rax,%rcx,4)
movl -0x68(%rbp), %eax
cmpl 0x3002(%rip), %eax      # 0x612c
jne 0x3187
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl $0x0, -0x68(%rbp)
movslq 0x2fe9(%rip), %rcx      # 0x612c
leaq 0x30c6(%rip), %rax      # 0x6210
movl (%rax,%rcx,4), %eax
shll $0x2, %eax
addl $0x4, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, -0x50(%rbp)
movslq 0x2fc6(%rip), %rcx      # 0x612c
leaq 0x30a3(%rip), %rax      # 0x6210
movl (%rax,%rcx,4), %eax
shll $0x2, %eax
addl $0x4, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, 0x3203(%rip)      # 0x6388
jmp 0x3190
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x3192
cmpl $0x1, -0x64(%rbp)
jne 0x31f1
movl -0x60(%rbp), %edx
movslq -0x68(%rbp), %rcx
leaq 0x301a(%rip), %rax      # 0x61c0
movl %edx, (%rax,%rcx,4)
movl -0x68(%rbp), %eax
cmpl 0x2f7a(%rip), %eax      # 0x612c
jne 0x31e6
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl $0x1, -0x68(%rbp)
movslq 0x2f61(%rip), %rcx      # 0x612c
leaq 0x2fee(%rip), %rax      # 0x61c0
movl (%rax,%rcx,4), %eax
shll $0x2, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, -0x48(%rbp)
jmp 0x31ef
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x31f1
cmpl $0x0, -0x64(%rbp)
jne 0x3209
movl -0x60(%rbp), %eax
movl %eax, 0x2f2c(%rip)      # 0x612c
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x2f04
movq -0x40(%rbp), %rdi
callq 0x10e0
movl 0x2f0f(%rip), %eax      # 0x612c
subl $0x1, %eax
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x6c(%rbp)
jl 0x3246
movslq -0x6c(%rbp), %rcx
leaq 0x30cc(%rip), %rax      # 0x6300
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
movl -0x6c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x3223
movslq 0x2edf(%rip), %rcx      # 0x612c
leaq 0x2fbc(%rip), %rax      # 0x6210
movl (%rax,%rcx,4), %eax
movl %eax, 0x2ee7(%rip)      # 0x6144
movslq 0x2ec8(%rip), %rcx      # 0x612c
leaq 0x2fa5(%rip), %rax      # 0x6210
movl (%rax,%rcx,4), %eax
movl %eax, 0x2ed4(%rip)      # 0x6148
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
movslq 0x2ea7(%rip), %rdx      # 0x612c
leaq 0x2f84(%rip), %rcx      # 0x6210
cmpl (%rcx,%rdx,4), %eax
jge 0x32bd
movq 0x30f0(%rip), %rax      # 0x6388
movslq -0x70(%rbp), %rcx
cmpl $0xff, (%rax,%rcx,4)
jle 0x32b0
movl -0x70(%rbp), %eax
movl %eax, 0x2e96(%rip)      # 0x6144
jmp 0x32bd
jmp 0x32b2
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x327b
movl 0x2e81(%rip), %eax      # 0x6144
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %eax
movslq 0x2e5c(%rip), %rdx      # 0x612c
leaq 0x2f39(%rip), %rcx      # 0x6210
cmpl (%rcx,%rdx,4), %eax
jge 0x3308
movq 0x30a5(%rip), %rax      # 0x6388
movslq -0x74(%rbp), %rcx
cmpl $0xffff, (%rax,%rcx,4)  # imm = 0xFFFF
jle 0x32fb
movl -0x74(%rbp), %eax
movl %eax, 0x2e4f(%rip)      # 0x6148
jmp 0x3308
jmp 0x32fd
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x32c6
movslq 0x2e35(%rip), %rdi      # 0x6144
callq 0x1130
movq %rax, 0x3075(%rip)      # 0x6390
movl 0x2e27(%rip), %eax      # 0x6148
subl 0x2e1d(%rip), %eax      # 0x6144
shll %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, 0x3038(%rip)      # 0x6370
movl $0x0, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl 0x2dfc(%rip), %eax      # 0x6144
jge 0x3373
movq 0x3037(%rip), %rax      # 0x6388
movslq -0x78(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movb %al, %dl
movq 0x302f(%rip), %rax      # 0x6390
movslq -0x78(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
jmp 0x333f
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movl 0x2dc5(%rip), %ecx      # 0x6148
subl 0x2dbb(%rip), %ecx      # 0x6144
cmpl %ecx, %eax
jge 0x33c0
movq 0x2ff4(%rip), %rax      # 0x6388
movl -0x7c(%rbp), %ecx
addl 0x2da7(%rip), %ecx      # 0x6144
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movw %ax, %dx
movq 0x2fc3(%rip), %rax      # 0x6370
movslq -0x7c(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x337a
movl $0x0, -0x84(%rbp)
movslq 0x2d5b(%rip), %rcx      # 0x612c
leaq 0x2e38(%rip), %rax      # 0x6210
movl (%rax,%rcx,4), %eax
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %eax
addl $0x1, %eax
shll $0x2, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, -0x90(%rbp)
movslq 0x2d59(%rip), %rdi      # 0x615c
callq 0x1130
movq %rax, 0x2f89(%rip)      # 0x6398
movslq 0x2d4a(%rip), %rdi      # 0x6160
callq 0x1130
movq %rax, 0x2f7e(%rip)      # 0x63a0
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x88(%rbp), %eax
jge 0x34c2
movl 0x2d6e(%rip), %edx      # 0x61ac
movq -0x90(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x54(%rbp), %edi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0x1a50
movl %eax, -0x80(%rbp)
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %esi
movq -0x50(%rbp), %rax
movl -0x54(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x50(%rbp), %rax
movslq -0x54(%rbp), %rcx
subl (%rax,%rcx,4), %edx
callq 0x1680
movl -0x80(%rbp), %edi
movq 0x2f00(%rip), %rsi      # 0x6398
callq 0x1590
movl -0x54(%rbp), %edi
movq -0x48(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq 0x2ee9(%rip), %rcx      # 0x6398
callq 0x1610
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x3429
movl 0x2ce4(%rip), %edx      # 0x61ac
movq -0x90(%rbp), %rax
movslq -0x88(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl 0x2ccd(%rip), %eax      # 0x61ac
movl %eax, 0x2c77(%rip)      # 0x615c
movl 0x2cc1(%rip), %eax      # 0x61ac
movl $0x8, %ecx
cltd
idivl %ecx
addl -0x84(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq 0x2e92(%rip), %rdx      # 0x63a0
callq 0x1900
movl 0x2c97(%rip), %eax      # 0x61b0
movl %eax, 0x2c41(%rip)      # 0x6160
movl 0x2c8b(%rip), %eax      # 0x61b0
movl $0x8, %ecx
cltd
idivl %ecx
addl -0x84(%rbp), %eax
movl %eax, -0x84(%rbp)
movq -0x48(%rbp), %rdi
callq 0x1110
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x88(%rbp), %eax
jg 0x3578
movq -0x90(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x50(%rbp), %rax
movslq -0x54(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x3549
movq -0x90(%rbp), %rdi
callq 0x1110
movl $0x0, -0x94(%rbp)
movl -0x94(%rbp), %eax
cmpl 0x2b92(%rip), %eax      # 0x612c
jge 0x35d2
movl -0x94(%rbp), %esi
movslq -0x94(%rbp), %rcx
leaq 0x2d50(%rip), %rax      # 0x6300
movl (%rax,%rcx,4), %edx
leaq 0xcd7(%rip), %rdi       # 0x4291
movb $0x0, %al
callq 0x1030
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x358e
movl 0x2bd8(%rip), %eax      # 0x61b0
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
cltd
idivl 0x2b45(%rip)            # 0x6130
addl $0x1, %eax
movl %eax, 0x2b58(%rip)      # 0x614c
movl -0x98(%rbp), %eax
cltd
idivl 0x2b33(%rip)            # 0x6134
addl $0x2, %eax
movl %eax, 0x2b46(%rip)      # 0x6150
movl 0x2b3c(%rip), %eax      # 0x614c
shll $0x2, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, 0x2d5e(%rip)      # 0x6380
movl 0x2b28(%rip), %eax      # 0x6150
shll %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, 0x2d2f(%rip)      # 0x6368
movq 0x2d60(%rip), %rdi      # 0x63a0
movq 0x2d39(%rip), %rsi      # 0x6380
movq 0x2d1a(%rip), %rdx      # 0x6368
movl 0x2af8(%rip), %ecx      # 0x614c
subl $0x1, %ecx
movl -0x98(%rbp), %r8d
callq 0x23b0
addl -0x84(%rbp), %eax
movl %eax, -0x84(%rbp)
movl 0x2acb(%rip), %eax      # 0x6140
shll $0x2, %eax
movslq 0x2aad(%rip), %rdx      # 0x612c
leaq 0x2b8a(%rip), %rcx      # 0x6210
movl (%rcx,%rdx,4), %ecx
shll $0x2, %ecx
addl %ecx, %eax
addl -0x84(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x88(%rbp), %eax
addl $0x1, %eax
imull $0x6, %eax, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, 0x2cf3(%rip)      # 0x63a8
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movq -0x50(%rbp), %rax
movslq -0x88(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl $0x40, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x9c(%rbp), %eax
addl %ecx, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, 0x2cbd(%rip)      # 0x63b0
movl -0x88(%rbp), %esi
addl $0x1, %esi
movq -0x50(%rbp), %rax
movslq -0x88(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl $0x40, %ecx
cltd
idivl %ecx
addl %eax, %esi
leaq 0xb7e(%rip), %rdi       # 0x4299
movb $0x0, %al
callq 0x1030
movq -0x50(%rbp), %rdi
movl -0x88(%rbp), %edx
addl $0x1, %edx
movq 0x2c72(%rip), %r8       # 0x63a8
movq 0x2c73(%rip), %r9       # 0x63b0
xorl %esi, %esi
movl $0x6, %ecx
callq 0x1810
addl -0x84(%rbp), %eax
movl %eax, -0x84(%rbp)
movl 0x2a55(%rip), %eax      # 0x61b0
movl %eax, -0x98(%rbp)
movl -0x98(%rbp), %eax
cltd
idivl 0x29c2(%rip)            # 0x6130
addl $0x1, %eax
movl %eax, 0x29dd(%rip)      # 0x6154
movl -0x98(%rbp), %eax
cltd
idivl 0x29b0(%rip)            # 0x6134
addl $0x1, %eax
movl %eax, 0x29cb(%rip)      # 0x6158
movl 0x29c1(%rip), %eax      # 0x6154
shll $0x2, %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, 0x2bd3(%rip)      # 0x6378
movl 0x29ad(%rip), %eax      # 0x6158
shll %eax
movslq %eax, %rdi
callq 0x1130
movq %rax, 0x2ba4(%rip)      # 0x6360
movq 0x2bed(%rip), %rdi      # 0x63b0
movq 0x2bae(%rip), %rsi      # 0x6378
movq 0x2b8f(%rip), %rdx      # 0x6360
movl 0x297d(%rip), %ecx      # 0x6154
subl $0x1, %ecx
movl -0x98(%rbp), %r8d
callq 0x23b0
addl -0x84(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %esi
movl 0x295e(%rip), %edx      # 0x615c
movl 0x295c(%rip), %ecx      # 0x6160
leaq 0xa96(%rip), %rdi       # 0x42a1
movb $0x0, %al
callq 0x1030
callq 0x2930
leaq 0xa99(%rip), %rdi       # 0x42b7
movb $0x0, %al
callq 0x1030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax,%rax)