// File: /workspace/github_cpp_makefile_star2_O3/TooruAkagi[P]GCIS_Index/gcis_uni_locate.cpp
// Function: main
int main(int argc, char *argv[]){
    for(int i = 0;i<argc;i++){
      if('-'==argv[i][0]){ //符号
        if('i'==argv[i][1]){ //input
            int k = strlen(argv[i+1]);
            inname = (char*)malloc(k);
            for(int k2=0;k2<k;k2++){inname[k2]=argv[i+1][k2];}
        }
        if('q'==argv[i][1]){ //input
            int k = strlen(argv[i+1]);
            qname = (char*)malloc(k);
            for(int k2=0;k2<k;k2++){qname[k2]=argv[i+1][k2];}
        }
        if('m'==argv[i][1]){ //mode
            runmode=0;
            for(int k = 0;k<strlen(argv[i+1]);k++){
                if(10 > argv[i+1][k]-'0' && argv[i+1][k]-'0'>=0){
                runmode *=10;
                runmode += argv[i+1][k] - '0';
                }
                else{break;}
            }
        }
        if('r'==argv[i][1]){ //mode
            querysuu=0;
            for(int k = 0;k<strlen(argv[i+1]);k++){
                if(10 > argv[i+1][k]-'0' && argv[i+1][k]-'0'>=0){
                querysuu *=10;
                querysuu += argv[i+1][k] - '0';
                }
                else{break;}
            }
        }
        if('l'==argv[i][1]){ //mode
            plength=0;
            for(int k = 0;k<strlen(argv[i+1]);k++){
                if(10 > argv[i+1][k]-'0' && argv[i+1][k]-'0'>=0){
                plength *=10;
                plength += argv[i+1][k] - '0';
                }
                else{break;}
            }
        }
        if('s'==argv[i][1]){ //mode
            qstart=0;
            for(int k = 0;k<strlen(argv[i+1]);k++){
                if(10 > argv[i+1][k]-'0' && argv[i+1][k]-'0'>=0){
                qstart *=10;
                qstart += argv[i+1][k] - '0';
                }
                else{break;}
            }
        }
        if('h'==argv[i][1]){shelp();return 0;} //help
        i++;continue;
      }
    }
    if(qname==NULL){shelp();return 0;} //
    if(inname==NULL){
      int k = strlen(defaultinname);
      inname = (char*)malloc(k);
      for(int k2=0;k2<k;k2++){inname[k2]=defaultinname[k2];}
    }
    if(runmode==-1){runmode=MMODE;}
    if(plength==-1){plength=MLONG;}
    if(querysuu==-1){querysuu=MREP;}
    if(qstart==-1){qstart=MSTART;}
    FILE *fp;
    dcs[0] = 0;dc2s[0] = 0;ccs[0] = 0;cc2s[0] = 0; 
    unsigned char chr;
    unsigned int a;
    fp = fopen(inname, "r");
    int flag = 0; //0:loops,1:dcs,2:dc2s,3:D,4:D_2,5:D3,6:NS
    int w = 0;
    while(flag<11){ //18種類の配列を，その様式ごとにindexファイルから拾う
        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==11 && w==0){
            //printf("\n[%d]:%u [%d,%d]",flag,a,dc2s[loops]-Sizelist[2],D_3[w]);
            //for(int yj=0;yj<loops;yj++){printf("(%d)",cc2s[yj]);}
            exit(1);
        }
        if(flag==10){NS[w]=a;w++;if(w==Sizelist[0]){flag++;w=0;}}
        if(flag==9){k3sub[w]=a;w++;if(w==Sizelist[3]){flag++;w=0;}}
        if(flag==8){d2topsub[w]=a;w++;if(w==Sizelist[5]){flag++;w=0;}}
        if(flag==7){D_3[w]=a;w++;if(w==dc2s[loops]-Sizelist[2]){flag++;w=0;}}
        if(flag==6){exceptr[w]=a;
            //printf("\nexceptr[%d] = %d",w,exceptr[w]);
            if(w==loops){
                flag++;w=0;
                if(dc2s[loops] == Sizelist[2]){flag++;} //D_3(4byte)がなかったら飛ばす
            }else{w++;}
        }
        if(flag==5){cc2s[w]=a;if(w==loops){flag++;w=0;}else{w++;}}
        if(flag==4){ccs[w]=a;if(w==loops){flag++;w=1;}else{w++;}}
        if(flag==3){dc2s[w]=a;
            //printf("\ndc2s[%d] = %d",w,a);
            if(w==loops){
                D_3 = (int*)malloc(4*(dc2s[loops] - Sizelist[2])); //D_3の配列サイズだけは後から決まる
                flag++;w=1;
            }
            else{w++;}
        }
        if(flag==2){dcs[w]=a;if(w==loops){flag++;w=1;}else{w++;}}
        if(flag==1){
            Sizelist[w]=a;
            if(w==10){
                flag++;w=1; //各種サイズを設定
                NS = (int*)malloc(4*Sizelist[0]);
                D_3s = (unsigned char*)malloc(Sizelist[1]);
                D_3m = (unsigned short int*)malloc(2*(Sizelist[2]-Sizelist[1]));
                d2topsub = (int*)malloc(4*Sizelist[5]);
                d2topsub2 = (unsigned short int*)malloc(2*Sizelist[6]);
                k3sub = (int*)malloc(4*Sizelist[3]);
                k3sub2 = (unsigned short int*)malloc(2*Sizelist[4]);
                k = (bool*)malloc(Sizelist[7]);
                k3 = (bool*)malloc(Sizelist[8]);
                d2under = (bool*)malloc(Sizelist[10]);
                d2top = (bool*)malloc(Sizelist[9]);
            }else{w++;}}
        if(flag==0){loops=a;flag++;}
    }
    //printf("\n-finishing 4byte part-\n");
    if(Sizelist[2]-Sizelist[1]==0){flag++;w=0;} //D_3mはないので，flagを一つ進める
    while(flag<14){ //2byteデータを読み込む
        fscanf(fp,"%c",&chr);a = chr;
        fscanf(fp,"%c",&chr);a += chr*256;
        //if(flag==13 && w == 1060){printf("//%d(%d)//",chr,Sizelist[4]);exit(3);}
        if(flag==13){k3sub2[w]=a;if(w+1==Sizelist[4]){flag++;w=0;}else{w++;}}
        if(flag==12){d2topsub2[w]=a;if(w+1==Sizelist[6]){flag++;w=0;}else{w++;}}
        if(flag==11){D_3m[w]=a;if(w+1==Sizelist[2]-Sizelist[1]){flag++;w=0;}else{w++;}}
    }
    d2topx = (unsigned char*)malloc(Sizelist[9]/8 + 1);
    k3x = (unsigned char*)malloc(Sizelist[8]/8 + 1);
    //printf("\n-finishing 2byte part-\n");
    while(flag<19){ //1byte式のデータ・bit列を読み込む
        fscanf(fp,"%c",&chr);a = chr;
        if(flag==16 && w>=0 && w<300){mote=1;}else{mote=0;}
        if(flag==18){
            d2topx[w/8]=a;
            if(bitload(d2top,a,w,Sizelist[9])==-1){flag++;w=0;}
            else{w+=8;}}
        if(flag==17){if(bitload(d2under,a,w,Sizelist[10])==-1){flag++;w=0;}else{w+=8;}}
        if(flag==16){
            k3x[w/8]=a;
            if(bitload(k3,a,w,Sizelist[8])==-1){flag++;w=0;}
            else{w+=8;}
        }
        if(flag==15){if(bitload(k,a,w,Sizelist[7])==-1){flag++;w=0;}else{w+=8;}}
        if(flag==14){D_3s[w]=a;if(w+1==Sizelist[1]){flag++;w=0;}else{w++;}}
    }
    fclose(fp);
    cc2s[loops]=Sizelist[8];ccs[loops]=Sizelist[8]-dc2s[loops];
    for(int i=0;i<256;i++){
        int ju = 128;
        int je = 0;
        for(int j=0;j<8;j++){
            if(i%(ju*2)>=ju){je++;}
            rankct[i][j] = je;
            ju = ju/2;
        }
    } //rankctの定義
    int popo = 5;
    int ujk = ccs[popo]; //ccs[popo+1]-ccs[popo]+2 ccs[popo+1]-ccs[popo]+2
    
    int ancl[querysuu][5];
    int anst[querysuu];
    double ancd[querysuu];
    int *m;
    int msize = 10000;
    m = (int*)malloc(4*msize);
    msize = queryload(m);
    double avt = 0;
    int jogaipar = 0;
    if(runmode==2){
        msize = qrmload(m,plength,0,anst);
        clock_t timesb = clock();
        patternmatching1(m,msize,loops);
        clock_t timee = clock();
        const double time = static_cast<double>(timee - timesb) / CLOCKS_PER_SEC * 1000.0;
        printf("\n[length of the pattern : %d] / ans:%d / core:%d : time %lf[ms]\n",msize,ans,coreans,time);
        printf("\nvain = %d",vain);
        if(CHECKFLAG==1){
            msize = qrmload(m,plength,0,anst);
            anscheck(msize,m);
        }
    }
    if(runmode==1 || runmode==3){
        double pertime = 0.00;
        if(runmode==3){srand((unsigned int)time(NULL));}
        for(int jo = 0;jo < querysuu;jo++){
            int ralen = plength;
            if(runmode==1){ralen = plength;}
            msize = qrmload(m,ralen,jo,anst);
            clock_t timesb = clock();
            patternmatching1(m,msize,loops);
            clock_t timee = clock();
            const double time = static_cast<double>(timee - timesb) / CLOCKS_PER_SEC * 1000.0;
            const double time2 = static_cast<double>(timessub - timesb) / CLOCKS_PER_SEC * 1000.0;
            printf("\n[length of the pattern : %d] / (%d) : time %lf[ms]\n",msize,ans,time);
            printf("\nvain = %d",vain);
            ancl[jo][0] = ans;
            ancl[jo][1] = coreans;coreans=0;
            ancl[jo][2] = ralen;
            ancl[jo][3] = transk;
            ancd[jo] = time;
            avt+=time;
            pertime += (time2*100)/time;
            if(CHECKFLAG==1){
                msize = qrmreload(m,ralen);
                anscheck(msize,m);
            }
            ans=0;
        }
        printf("avarage time : %lf[ms]",avt/querysuu);
        for(int jo=0;jo<querysuu;jo++){
            printf("\n(%d : P-length : %d from position %d[%d trans] / ans:%d / core:%d / time %lf[ms])",jo,ancl[jo][2],anst[jo],ancl[jo][3],ancl[jo][0],ancl[jo][1],ancd[jo]);
            }
        printf("\n[transformation time : %.3f %]\n",pertime/querysuu);
    }
    if(runmode==4){
        for(int jo = 0;jo < querysuu;jo++){
            msize = qrmloadset(m,jo);
            //if(jswt==1){printf("\n除外");jogaipar++;jo--;continue;}
            if(DEBUGFLAG==1){
                printf("\n検索文字列:[");
                for(int rek = 0;rek<msize;rek++){printf("%c",m[rek]);}
                printf("]\n");
            }
            clock_t timesb = clock();
            patternmatching1(m,msize,loops);
            clock_t timee = clock();
            const double time = static_cast<double>(timee - timesb) / CLOCKS_PER_SEC * 1000.0;
            printf("\n[length of the pattern : %d] / (ans:%d / core:%d ) : time %lf[ms]\n",msize,ans,coreans,time);
            ancl[jo][0] = ans;ans=0;
            ancl[jo][1] = coreans;coreans=0;
            ancl[jo][2] = msize;
            ancl[jo][3] = transk;
            ancd[jo] = time;
            avt += time;
        }
        printf("avarage time : %lf[ms]",avt/querysuu);
        for(int jo=0;jo<querysuu;jo++){
            printf("\n(P-length : %d [%d trans] / ans:%d / core:%d / time %lf[ms])",ancl[jo][2],ancl[jo][3],ancl[jo][0],ancl[jo][1],ancd[jo]);
            }
    }
    if(runmode==0){
        msize = queryload(m);
        clock_t timesb = clock();
        patternmatching1(m,msize,loops);
        clock_t timee = clock();
        const double time = static_cast<double>(timee - timesb) / CLOCKS_PER_SEC * 1000.0;
        printf("\n[length of the pattern : %d] / (%d) : time %lf[ms]\n",msize,ans,time);
        printf("\nvain = %d",vain);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
testl %edi, %edi
jle 0x641a
movq %rsi, %rbx
xorl %ecx, %ecx
movl %edi, -0x58(%rbp)
movslq %ecx, %r14
movq (%rbx,%r14,8), %rax
cmpb $0x2d, (%rax)
jne 0x6410
movq %rcx, -0x48(%rbp)
cmpb $0x69, 0x1(%rax)
jne 0x621d
movq 0x8(%rbx,%r14,8), %rdi
callq 0x2080
movq %rax, %r15
movslq %r15d, %r12
movq %r12, %rdi
callq 0x21b0
movq %rax, 0x5003(%rip)      # 0xb1f8
testl %r12d, %r12d
jle 0x621d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %eax, %eax
movq 0x8(%rbx,%r14,8), %rcx
movb (%rcx,%rax), %cl
movq 0x4fe6(%rip), %rdx      # 0xb1f8
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r15
jne 0x6203
movq (%rbx,%r14,8), %rax
cmpb $0x71, 0x1(%rax)
jne 0x626e
movq 0x8(%rbx,%r14,8), %rdi
callq 0x2080
movq %rax, %r15
movslq %r15d, %r12
movq %r12, %rdi
callq 0x21b0
movq %rax, 0x4fba(%rip)      # 0xb200
testl %r12d, %r12d
jle 0x626e
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %eax, %eax
movq 0x8(%rbx,%r14,8), %rcx
movb (%rcx,%rax), %cl
movq 0x4f9d(%rip), %rdx      # 0xb200
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r15
jne 0x6254
movq (%rbx,%r14,8), %rax
movq %rax, -0x40(%rbp)
movb 0x1(%rax), %al
cmpb $0x6d, %al
jne 0x62db
movl $0x0, 0x4ec5(%rip)      # 0xb14c
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x62d4
xorl %r12d, %r12d
xorl %r13d, %r13d
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x62d4
addl %r13d, %r13d
leal (%r13,%r13,4), %eax
movl %eax, 0x4e9c(%rip)      # 0xb14c
movsbl (%r15,%r12), %ecx
leal (%rcx,%rax), %r13d
addl $-0x30, %r13d
movl %r13d, 0x4e88(%rip)     # 0xb14c
incq %r12
movq %r15, %rdi
callq 0x2080
cmpq %r12, %rax
ja 0x6298
movq -0x40(%rbp), %rax
movb 0x1(%rax), %al
cmpb $0x72, %al
jne 0x6336
movl $0x0, 0x4e6b(%rip)      # 0xb154
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x6336
xorl %r12d, %r12d
xorl %r13d, %r13d
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x6336
addl %r13d, %r13d
leal (%r13,%r13,4), %eax
movl %eax, 0x4e42(%rip)      # 0xb154
movsbl (%r15,%r12), %ecx
leal (%rcx,%rax), %r13d
addl $-0x30, %r13d
movl %r13d, 0x4e2e(%rip)     # 0xb154
incq %r12
movq %r15, %rdi
callq 0x2080
cmpq %r12, %rax
ja 0x62fa
movq -0x40(%rbp), %rax
movb 0x1(%rax), %al
cmpb $0x6c, %al
jne 0x639f
movl $0x0, 0x4e05(%rip)      # 0xb150
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x6398
xorl %r12d, %r12d
xorl %r13d, %r13d
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x6398
addl %r13d, %r13d
leal (%r13,%r13,4), %eax
movl %eax, 0x4ddc(%rip)      # 0xb150
movsbl (%r15,%r12), %ecx
leal (%rcx,%rax), %r13d
addl $-0x30, %r13d
movl %r13d, 0x4dc8(%rip)     # 0xb150
incq %r12
movq %r15, %rdi
callq 0x2080
cmpq %r12, %rax
ja 0x635c
movq -0x40(%rbp), %rax
movb 0x1(%rax), %al
cmpb $0x73, %al
jne 0x63f9
movl $0x0, 0x4dab(%rip)      # 0xb158
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x63f9
xorl %r14d, %r14d
xorl %r12d, %r12d
movb (%r15,%r14), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x63f9
addl %r12d, %r12d
leal (%r12,%r12,4), %eax
movl %eax, 0x4d83(%rip)      # 0xb158
movsbl (%r15,%r14), %ecx
leal (%rcx,%rax), %r12d
addl $-0x30, %r12d
movl %r12d, 0x4d6f(%rip)     # 0xb158
incq %r14
movq %r15, %rdi
callq 0x2080
cmpq %r14, %rax
ja 0x63be
movq -0x40(%rbp), %rax
cmpb $0x68, 0x1(%rax)
je 0x68ea
movq -0x48(%rbp), %rcx
incl %ecx
movl -0x58(%rbp), %edi
incl %ecx
cmpl %edi, %ecx
jl 0x61bc
cmpq $0x0, 0x4dde(%rip)      # 0xb200
je 0x68ea
cmpq $0x0, 0x4dc8(%rip)      # 0xb1f8
jne 0x6479
leaq 0x4d07(%rip), %rbx      # 0xb140
movq %rbx, %rdi
callq 0x2080
movq %rax, %r14
movslq %r14d, %r15
movq %r15, %rdi
callq 0x21b0
movq %rax, 0x4da2(%rip)      # 0xb1f8
testl %r15d, %r15d
jle 0x6479
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %eax, %eax
movb (%rax,%rbx), %cl
movq 0x4d8a(%rip), %rdx      # 0xb1f8
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r14
jne 0x6464
cmpl $-0x1, 0x4ccc(%rip)     # 0xb14c
jne 0x648c
movl $0x3, 0x4cc0(%rip)      # 0xb14c
cmpl $-0x1, 0x4cbd(%rip)     # 0xb150
jne 0x649f
movl $0x64, 0x4cb1(%rip)     # 0xb150
cmpl $-0x1, 0x4cae(%rip)     # 0xb154
jne 0x64b2
movl $0xa, 0x4ca2(%rip)      # 0xb154
cmpl $-0x1, 0x4c9f(%rip)     # 0xb158
jne 0x64c5
movl $0x0, 0x4c93(%rip)      # 0xb158
xorl %eax, %eax
movl %eax, 0x4dc3(%rip)      # 0xb290
movl %eax, 0x4e0d(%rip)      # 0xb2e0
movl %eax, 0x4e57(%rip)      # 0xb330
movl %eax, 0x4ea1(%rip)      # 0xb380
movq 0x4d12(%rip), %rdi      # 0xb1f8
leaq 0x1bae(%rip), %rsi      # 0x809b
callq 0x2180
movq %rax, -0x40(%rbp)
xorl %esi, %esi
movq $0x0, -0x38(%rbp)
movq -0x40(%rbp), %r13
movl %esi, -0x48(%rbp)
movq %r13, %rdi
leaq 0x1cea(%rip), %rbx      # 0x81fb
movq %rbx, %rsi
leaq -0x29(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x2240
movzbl -0x29(%rbp), %eax
movq %rax, -0x58(%rbp)
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2240
movzbl -0x29(%rbp), %r15d
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2240
movzbl -0x29(%rbp), %r12d
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2240
movl -0x48(%rbp), %esi
cmpl $0xa, %esi
ja 0x6504
shll $0x8, %r15d
addq -0x58(%rbp), %r15
shll $0x10, %r12d
orq %r15, %r12
movzbl -0x29(%rbp), %edi
shll $0x18, %edi
orq %r12, %rdi
movl %esi, %eax
leaq 0x1aba(%rip), %rcx      # 0x8048
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %edi, 0x4bef(%rip)      # 0xb18c
movl $0x1, %esi
jmp 0x6504
movq -0x38(%rbp), %rdx
movslq %edx, %rax
leaq 0x4d7b(%rip), %rcx      # 0xb330
movl %edi, (%rcx,%rax,4)
xorl %esi, %esi
cmpl 0x4bcc(%rip), %edx      # 0xb18c
leal 0x1(%rdx), %eax
sete %sil
movl $0x1, %ecx
cmovel %ecx, %eax
orl $0x4, %esi
jmp 0x671f
movq 0x4e72(%rip), %rax      # 0xb450
movq -0x38(%rbp), %rdx
movslq %edx, %rcx
movl %edi, (%rax,%rcx,4)
incl %edx
xorl %esi, %esi
cmpl 0x4bba(%rip), %edx      # 0xb1ac
sete %sil
movl $0x0, %eax
cmovel %eax, %edx
movq %rdx, -0x38(%rbp)
addl $0x9, %esi
jmp 0x6504
movq -0x38(%rbp), %rdx
movslq %edx, %rax
leaq 0x4c78(%rip), %rcx      # 0xb290
movl %edi, (%rcx,%rax,4)
xorl %esi, %esi
cmpl 0x4b69(%rip), %edx      # 0xb18c
leal 0x1(%rdx), %eax
sete %sil
movl $0x1, %ecx
cmovel %ecx, %eax
orl $0x2, %esi
jmp 0x671f
movq -0x38(%rbp), %rdx
movslq %edx, %rax
leaq 0x4c98(%rip), %rcx      # 0xb2e0
movl %edi, (%rcx,%rax,4)
cmpl 0x4b3b(%rip), %edx      # 0xb18c
jne 0x67cb
movslq 0x4b4a(%rip), %rax      # 0xb1a8
subq %rax, %rdi
shlq $0x2, %rdi
callq 0x21b0
movq %rax, 0x4de7(%rip)      # 0xb458
movl $0x1, %eax
movq %rax, -0x38(%rbp)
movl $0x4, %esi
jmp 0x6504
movq 0x4dcd(%rip), %rax      # 0xb458
movq -0x38(%rbp), %rdx
movslq %edx, %rcx
movl %edi, (%rax,%rcx,4)
incl %edx
movslq 0x4aee(%rip), %rax      # 0xb18c
leaq 0x4c3b(%rip), %rcx      # 0xb2e0
movl (%rcx,%rax,4), %eax
subl 0x4afa(%rip), %eax      # 0xb1a8
xorl %esi, %esi
cmpl %eax, %edx
sete %sil
movl $0x0, %eax
cmovel %eax, %edx
movq %rdx, -0x38(%rbp)
addl $0x7, %esi
jmp 0x6504
movq -0x38(%rbp), %rdx
movslq %edx, %rax
leaq 0x4ac8(%rip), %rcx      # 0xb1a0
movl %edi, (%rcx,%rax,4)
cmpl $0xa, %eax
je 0x67eb
incl %edx
movq %rdx, -0x38(%rbp)
movl $0x1, %esi
jmp 0x6504
movq -0x38(%rbp), %rdx
movslq %edx, %rax
leaq 0x4c7e(%rip), %rcx      # 0xb380
movl %edi, (%rcx,%rax,4)
xorl %esi, %esi
cmpl 0x4a7f(%rip), %edx      # 0xb18c
leal 0x1(%rdx), %eax
sete %sil
movl $0x0, %ecx
cmovel %ecx, %eax
addl $0x5, %esi
movq %rax, -0x38(%rbp)
jmp 0x6504
movq -0x38(%rbp), %rdx
movslq %edx, %rax
leaq 0x4c9a(%rip), %rcx      # 0xb3d0
movl %edi, (%rcx,%rax,4)
cmpl 0x4a4d(%rip), %edx      # 0xb18c
jne 0x67db
leaq 0x4b94(%rip), %rcx      # 0xb2e0
movl (%rcx,%rax,4), %eax
xorl %esi, %esi
cmpl 0x4a51(%rip), %eax      # 0xb1a8
sete %sil
addl $0x7, %esi
movq $0x0, -0x38(%rbp)
jmp 0x6504
movq 0x4cb6(%rip), %rax      # 0xb428
movq -0x38(%rbp), %rdx
movslq %edx, %rcx
movl %edi, (%rax,%rcx,4)
incl %edx
movl $0xa, %esi
movq %rdx, -0x38(%rbp)
cmpl 0x4a13(%rip), %edx      # 0xb1a0
jne 0x6504
jmp 0x68f4
movq 0x4ca9(%rip), %rax      # 0xb448
movq -0x38(%rbp), %rdx
movslq %edx, %rcx
movl %edi, (%rax,%rcx,4)
incl %edx
xorl %esi, %esi
cmpl 0x4a01(%rip), %edx      # 0xb1b4
sete %sil
movl $0x0, %eax
cmovel %eax, %edx
movq %rdx, -0x38(%rbp)
orl $0x8, %esi
jmp 0x6504
incl %edx
movq %rdx, -0x38(%rbp)
movl $0x3, %esi
jmp 0x6504
incl %edx
movq %rdx, -0x38(%rbp)
movl $0x6, %esi
jmp 0x6504
movslq 0x49ae(%rip), %rdi      # 0xb1a0
shlq $0x2, %rdi
callq 0x21b0
movq %rax, 0x4c26(%rip)      # 0xb428
movslq 0x499b(%rip), %r12      # 0xb1a4
movq %r12, %rdi
callq 0x21b0
movq %rax, 0x4c68(%rip)      # 0xb480
movslq 0x4989(%rip), %rdi      # 0xb1a8
subq %r12, %rdi
addq %rdi, %rdi
callq 0x21b0
movq %rax, 0x4c0f(%rip)      # 0xb440
movslq 0x497c(%rip), %rdi      # 0xb1b4
shlq $0x2, %rdi
callq 0x21b0
movq %rax, 0x4c00(%rip)      # 0xb448
movslq 0x4969(%rip), %rdi      # 0xb1b8
addq %rdi, %rdi
callq 0x21b0
movq %rax, 0x4bd2(%rip)      # 0xb430
movslq 0x4947(%rip), %rdi      # 0xb1ac
shlq $0x2, %rdi
callq 0x21b0
movq %rax, 0x4bdb(%rip)      # 0xb450
movslq 0x4934(%rip), %rdi      # 0xb1b0
addq %rdi, %rdi
callq 0x21b0
movq %rax, 0x4bad(%rip)      # 0xb438
movslq 0x492a(%rip), %rdi      # 0xb1bc
callq 0x21b0
movq %rax, 0x4bea(%rip)      # 0xb488
movslq 0x491b(%rip), %rdi      # 0xb1c0
callq 0x21b0
movq %rax, 0x4bdf(%rip)      # 0xb490
movslq 0x4910(%rip), %rdi      # 0xb1c8
callq 0x21b0
movq %rax, 0x4bd4(%rip)      # 0xb498
movslq 0x48f9(%rip), %rdi      # 0xb1c4
callq 0x21b0
movq %rax, 0x4bc9(%rip)      # 0xb4a0
movl $0x1, %eax
movq %rax, -0x38(%rbp)
movl $0x2, %esi
jmp 0x6504
callq 0x60da
jmp 0x71b4
movl 0x48ae(%rip), %eax      # 0xb1a8
xorl %r12d, %r12d
cmpl 0x48a1(%rip), %eax      # 0xb1a4
sete %r12b
addl $0xb, %r12d
leaq 0x18e9(%rip), %r14      # 0x81fb
leaq -0x29(%rbp), %r15
xorl %esi, %esi
movq -0x40(%rbp), %rbx
movq %rsi, -0x48(%rbp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2240
movzbl -0x29(%rbp), %r13d
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x2240
cmpl $0xb, %r12d
je 0x6988
cmpl $0xc, %r12d
je 0x69cc
cmpl $0xd, %r12d
jne 0x6920
movzbl -0x29(%rbp), %eax
shll $0x8, %eax
orl %r13d, %eax
movq 0x4ad0(%rip), %rcx      # 0xb438
movq -0x48(%rbp), %rsi
movslq %esi, %rdx
movw %ax, (%rcx,%rdx,2)
incl %esi
movl $0xd, %r12d
cmpl 0x482f(%rip), %esi      # 0xb1b0
jne 0x691c
jmp 0x6a08
movzbl -0x29(%rbp), %eax
shll $0x8, %eax
orl %r13d, %eax
movq 0x4aa7(%rip), %rcx      # 0xb440
movq -0x48(%rbp), %rsi
movslq %esi, %rsi
movw %ax, (%rcx,%rsi,2)
incl %esi
movl 0x47fc(%rip), %eax      # 0xb1a8
subl 0x47f2(%rip), %eax      # 0xb1a4
xorl %r12d, %r12d
cmpl %eax, %esi
sete %r12b
movl $0x0, %eax
cmovel %eax, %esi
addl $0xb, %r12d
jmp 0x691c
movzbl -0x29(%rbp), %eax
shll $0x8, %eax
orl %r13d, %eax
movq 0x4a53(%rip), %rcx      # 0xb430
movq -0x48(%rbp), %rsi
movslq %esi, %rdx
movw %ax, (%rcx,%rdx,2)
incl %esi
xorl %r12d, %r12d
cmpl 0x47c5(%rip), %esi      # 0xb1b8
sete %r12b
movl $0x0, %eax
cmovel %eax, %esi
orl $0xc, %r12d
jmp 0x691c
movl 0x47b6(%rip), %eax      # 0xb1c4
leal 0x7(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x3, %ecx
incl %ecx
movslq %ecx, %rdi
callq 0x21b0
movl 0x4797(%rip), %ecx      # 0xb1c0
leal 0x7(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
movq %rax, 0x4a78(%rip)      # 0xb4b0
sarl $0x3, %edx
incl %edx
movslq %edx, %rdi
callq 0x21b0
movq %rax, 0x4a5c(%rip)      # 0xb4a8
movl $0xe, %r13d
leaq 0x17a2(%rip), %rsi      # 0x81fb
leaq -0x29(%rbp), %rdx
xorl %r12d, %r12d
cmpl $0x10, %r13d
sete %al
cmpl $0x12c, %r12d           # imm = 0x12C
setb %cl
andb %al, %cl
movzbl %cl, %r14d
addl $-0xe, %r13d
movq -0x40(%rbp), %rdi
movq %rsi, %r15
xorl %eax, %eax
movq %rdx, %rbx
callq 0x2240
movq %rbx, %rdx
movq %r15, %rsi
movb -0x29(%rbp), %al
movl %r14d, 0x59d4(%rip)     # 0xc470
cmpl $0x4, %r13d
ja 0x6a7b
leaq 0x15cb(%rip), %rdi      # 0x8074
movslq (%rdi,%r13,4), %rcx
addq %rdi, %rcx
jmpq *%rcx
movq 0x49c7(%rip), %rcx      # 0xb480
movslq %r12d, %rdi
movb %al, (%rcx,%rdi)
incl %r12d
xorl %r13d, %r13d
cmpl 0x46d8(%rip), %r12d     # 0xb1a4
sete %r13b
movl $0x0, %eax
cmovel %eax, %r12d
orl $0xe, %r13d
jmp 0x6a60
movq 0x49ca(%rip), %rcx      # 0xb4b0
leal 0x7(%r12), %edx
testl %r12d, %r12d
cmovnsl %r12d, %edx
sarl $0x3, %edx
movslq %edx, %rdx
movb %al, (%rcx,%rdx)
movq 0x499e(%rip), %rdi      # 0xb4a0
movl 0x46bc(%rip), %ecx      # 0xb1c4
movzbl %al, %esi
movl %r12d, %edx
callq 0x5eb6
movq %rbx, %rdx
movq %r15, %rsi
addl $0x8, %r12d
movl $0x12, %r13d
cmpl $-0x1, %eax
jne 0x6a60
jmp 0x6c07
movq 0x4970(%rip), %rcx      # 0xb4a8
leal 0x7(%r12), %edx
testl %r12d, %r12d
cmovnsl %r12d, %edx
sarl $0x3, %edx
movslq %edx, %rdx
movb %al, (%rcx,%rdx)
movq 0x493c(%rip), %rdi      # 0xb490
movl 0x4666(%rip), %ecx      # 0xb1c0
movzbl %al, %esi
movl %r12d, %edx
callq 0x5eb6
movq %rbx, %rdx
movq %r15, %rsi
addl $0x8, %r12d
xorl %r13d, %r13d
cmpl $-0x1, %eax
sete %r13b
movl $0x0, %eax
cmovel %eax, %r12d
orl $0x10, %r13d
jmp 0x6a60
movq 0x4906(%rip), %rdi      # 0xb498
movl 0x4630(%rip), %ecx      # 0xb1c8
movzbl %al, %esi
movl %r12d, %edx
callq 0x5eb6
movq %rbx, %rdx
movq %r15, %rsi
addl $0x8, %r12d
xorl %r13d, %r13d
cmpl $-0x1, %eax
sete %r13b
movl $0x0, %eax
cmovel %eax, %r12d
addl $0x11, %r13d
jmp 0x6a60
movq 0x48b8(%rip), %rdi      # 0xb488
movl 0x45e6(%rip), %ecx      # 0xb1bc
movzbl %al, %esi
movl %r12d, %edx
callq 0x5eb6
movq %rbx, %rdx
movq %r15, %rsi
addl $0x8, %r12d
xorl %r13d, %r13d
cmpl $-0x1, %eax
sete %r13b
movl $0x0, %eax
cmovel %eax, %r12d
addl $0xf, %r13d
jmp 0x6a60
movq -0x40(%rbp), %rdi
callq 0x2140
movl 0x45aa(%rip), %eax      # 0xb1c0
movslq 0x456f(%rip), %rcx      # 0xb18c
leaq 0x475c(%rip), %rdx      # 0xb380
movl %eax, (%rdx,%rcx,4)
leaq 0x46b2(%rip), %rdx      # 0xb2e0
subl (%rdx,%rcx,4), %eax
leaq 0x46f8(%rip), %rdx      # 0xb330
movl %eax, (%rdx,%rcx,4)
leaq 0x583e(%rip), %rsi      # 0xc480
xorl %ecx, %ecx
movl $0x80, %r9d
xorl %edi, %edi
xorl %r8d, %r8d
leal (%r9,%r9), %r10d
movl %ecx, %eax
cltd
idivl %r10d
xorl %eax, %eax
cmpl %r9d, %edx
setge %al
addl %eax, %r8d
movl %r8d, (%rsi,%rdi,4)
movl %r9d, %eax
shrl $0x1f, %eax
addl %r9d, %eax
sarl %eax
incq %rdi
movl %eax, %r9d
cmpq $0x8, %rdi
jne 0x6c4f
incq %rcx
addq $0x20, %rsi
cmpq $0x100, %rcx            # imm = 0x100
jne 0x6c44
movq %rsp, %r13
movl 0x44bc(%rip), %eax      # 0xb154
movq %rsp, %r15
leaq (%rax,%rax,4), %rax
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movl 0x449d(%rip), %eax      # 0xb154
movq %rsp, %r14
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
subq %rcx, %r14
movq %r14, %rsp
movq %rsp, %r12
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movl $0x9c40, %edi           # imm = 0x9C40
callq 0x21b0
movq %rax, %rbx
movq %rax, %rdi
callq 0x5ccf
movl 0x4450(%rip), %eax      # 0xb14c
cmpl $0x2, %eax
movq %r15, -0x60(%rbp)
movq %r12, -0x68(%rbp)
jne 0x6d98
movl 0x443d(%rip), %esi      # 0xb150
movq %rbx, %rdi
xorl %edx, %edx
movq %r14, %rcx
callq 0x5d80
movl %eax, %r15d
callq 0x20c0
movq %rax, %r12
movl 0x445b(%rip), %edx      # 0xb18c
movq %rbx, %rdi
movl %r15d, %esi
callq 0x58f8
callq 0x20c0
subq %r12, %rax
movq -0x68(%rbp), %r12
cvtsi2sd %rax, %xmm0
divsd 0x12db(%rip), %xmm0     # 0x8030
mulsd 0x12db(%rip), %xmm0     # 0x8038
movl 0x46b5(%rip), %edx      # 0xb418
movl 0x46b3(%rip), %ecx      # 0xb41c
leaq 0x148e(%rip), %rdi      # 0x81fe
movl %r15d, %esi
movq -0x60(%rbp), %r15
movb $0x1, %al
callq 0x2030
movl 0x44a0(%rip), %esi      # 0xb224
leaq 0x14b4(%rip), %rdi      # 0x823f
xorl %eax, %eax
callq 0x2030
movl 0x43b4(%rip), %eax      # 0xb14c
cmpl $0x1, %eax
movq %r13, -0x70(%rbp)
movq %rbx, -0x50(%rbp)
je 0x6dc0
xorpd %xmm0, %xmm0
cmpl $0x3, %eax
jne 0x6fe0
xorl %edi, %edi
callq 0x2120
movl %eax, %edi
callq 0x2130
movl 0x438e(%rip), %eax      # 0xb154
testl %eax, %eax
jle 0x6f26
leaq 0xc(%r15), %rbx
xorps %xmm1, %xmm1
xorl %r13d, %r13d
xorpd %xmm0, %xmm0
movq %r14, -0x78(%rbp)
movq -0x50(%rbp), %r15
movsd %xmm1, -0x48(%rbp)
movsd %xmm0, -0x40(%rbp)
movl 0x435c(%rip), %esi      # 0xb150
movl %esi, -0x58(%rbp)
movq %r15, %rdi
movl %r13d, %edx
movq %r14, %rcx
callq 0x5d80
movl %eax, %r12d
callq 0x20c0
movq %rax, %r14
movl 0x4376(%rip), %edx      # 0xb18c
movq %r15, %rdi
movl %r12d, %esi
callq 0x58f8
callq 0x20c0
subq %r14, %rax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
movsd 0x11f7(%rip), %xmm4     # 0x8030
divsd %xmm4, %xmm2
movq 0x7b44(%rip), %rax      # 0xe988
subq %r14, %rax
movq -0x78(%rbp), %r14
xorps %xmm3, %xmm3
cvtsi2sd %rax, %xmm3
movsd 0x11dd(%rip), %xmm1     # 0x8038
mulsd %xmm1, %xmm2
movapd %xmm2, %xmm0
movsd %xmm2, -0x80(%rbp)
divsd %xmm4, %xmm3
mulsd %xmm1, %xmm3
movsd %xmm3, -0x38(%rbp)
movl 0x459d(%rip), %edx      # 0xb418
leaq 0x13c8(%rip), %rdi      # 0x824a
movl %r12d, %esi
movq -0x68(%rbp), %r12
movb $0x1, %al
callq 0x2030
movl 0x438e(%rip), %esi      # 0xb224
leaq 0x13a2(%rip), %rdi      # 0x823f
xorl %eax, %eax
callq 0x2030
movsd -0x48(%rbp), %xmm1
movsd -0x40(%rbp), %xmm0
movl 0x4564(%rip), %eax      # 0xb418
movl %eax, -0xc(%rbx)
movl 0x455f(%rip), %eax      # 0xb41c
movl %eax, -0x8(%rbx)
xorl %ecx, %ecx
movl %ecx, 0x4554(%rip)      # 0xb41c
movl -0x58(%rbp), %eax
movl %eax, -0x4(%rbx)
movl 0x45f4(%rip), %eax      # 0xb4c8
movl %eax, (%rbx)
movsd -0x80(%rbp), %xmm2
movsd %xmm2, (%r12,%r13,8)
addsd %xmm2, %xmm0
movsd -0x38(%rbp), %xmm3
mulsd 0x114e(%rip), %xmm3     # 0x8040
divsd %xmm2, %xmm3
addsd %xmm3, %xmm1
movl %ecx, 0x4518(%rip)      # 0xb418
incq %r13
movslq 0x424a(%rip), %rax      # 0xb154
addq $0x14, %rbx
cmpq %rax, %r13
jl 0x6de4
movsd %xmm1, -0x48(%rbp)
movq -0x60(%rbp), %r15
movq -0x50(%rbp), %rbx
jmp 0x6f33
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movsd %xmm1, -0x48(%rbp)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd %xmm0, -0x40(%rbp)
divsd %xmm1, %xmm0
leaq 0x1335(%rip), %rdi      # 0x827f
movb $0x1, %al
callq 0x2030
movl 0x41fd(%rip), %eax      # 0xb154
testl %eax, %eax
jle 0x6fb3
leaq 0xc(%r15), %rbx
xorl %r15d, %r15d
leaq 0x132d(%rip), %r13      # 0x8296
movl -0x4(%rbx), %edx
movl (%r14,%r15,4), %ecx
movl (%rbx), %r8d
movl -0xc(%rbx), %r9d
movl -0x8(%rbx), %r10d
movsd (%r12,%r15,8), %xmm0
subq $0x8, %rsp
movq %r13, %rdi
movl %r15d, %esi
movb $0x1, %al
pushq %r10
callq 0x2030
addq $0x10, %rsp
incq %r15
movslq 0x41b2(%rip), %rax      # 0xb154
addq $0x14, %rbx
cmpq %rax, %r15
jl 0x6f69
movq -0x60(%rbp), %r15
movq -0x50(%rbp), %rbx
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd -0x48(%rbp), %xmm0
divsd %xmm1, %xmm0
leaq 0x131f(%rip), %rdi      # 0x82e9
movb $0x1, %al
callq 0x2030
movl 0x4175(%rip), %eax      # 0xb14c
movq -0x70(%rbp), %r13
movsd -0x40(%rbp), %xmm0
cmpl $0x4, %eax
jne 0x713e
movl 0x4165(%rip), %eax      # 0xb154
testl %eax, %eax
jle 0x70d3
leaq 0xc(%r15), %rbx
xorl %r15d, %r15d
movq -0x50(%rbp), %r14
movsd %xmm0, -0x40(%rbp)
movq %r14, %rdi
movl %r15d, %esi
callq 0x5bd0
movl %eax, %r12d
callq 0x20c0
movq %rax, %r13
movl 0x4169(%rip), %edx      # 0xb18c
movq %r14, %rdi
movl %r12d, %esi
callq 0x58f8
callq 0x20c0
subq %r13, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0xfea(%rip), %xmm0      # 0x8030
mulsd 0xfea(%rip), %xmm0      # 0x8038
movsd %xmm0, -0x48(%rbp)
movl 0x43bf(%rip), %edx      # 0xb418
movl 0x43bd(%rip), %ecx      # 0xb41c
leaq 0x12a4(%rip), %rdi      # 0x830a
movl %r12d, %esi
movb $0x1, %al
callq 0x2030
movsd -0x40(%rbp), %xmm0
movl 0x439d(%rip), %eax      # 0xb418
movl %eax, -0xc(%rbx)
xorl %ecx, %ecx
movl %ecx, 0x4392(%rip)      # 0xb418
movl 0x4390(%rip), %eax      # 0xb41c
movl %eax, -0x8(%rbx)
movl %ecx, 0x4387(%rip)      # 0xb41c
movl %r12d, -0x4(%rbx)
movq -0x68(%rbp), %r12
movl 0x4425(%rip), %eax      # 0xb4c8
movl %eax, (%rbx)
movsd -0x48(%rbp), %xmm1
movsd %xmm1, (%r12,%r15,8)
addsd %xmm1, %xmm0
incq %r15
movslq 0x4096(%rip), %rax      # 0xb154
addq $0x14, %rbx
cmpq %rax, %r15
jl 0x7002
movq -0x70(%rbp), %r13
movq -0x60(%rbp), %r15
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
leaq 0x119a(%rip), %rdi      # 0x827f
movb $0x1, %al
callq 0x2030
cmpl $0x0, 0x4061(%rip)      # 0xb154
jle 0x7134
addq $0xc, %r15
xorl %ebx, %ebx
leaq 0x124c(%rip), %r14      # 0x834e
movl -0x4(%r15), %esi
movl (%r15), %edx
movl -0xc(%r15), %ecx
movl -0x8(%r15), %r8d
movsd (%r12,%rbx,8), %xmm0
movq %r14, %rdi
movb $0x1, %al
callq 0x2030
incq %rbx
movslq 0x4029(%rip), %rax      # 0xb154
addq $0x14, %r15
cmpq %rax, %rbx
jl 0x7102
movl 0x4012(%rip), %eax      # 0xb14c
movq -0x50(%rbp), %rbx
testl %eax, %eax
jne 0x71b1
movq %rbx, %rdi
callq 0x5ccf
movl %eax, %r14d
callq 0x20c0
movq %rax, %r15
movl 0x4031(%rip), %edx      # 0xb18c
movq %rbx, %rdi
movl %r14d, %esi
callq 0x58f8
callq 0x20c0
subq %r15, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0xeb2(%rip), %xmm0      # 0x8030
mulsd 0xeb2(%rip), %xmm0      # 0x8038
movl 0x428c(%rip), %edx      # 0xb418
leaq 0x10b7(%rip), %rdi      # 0x824a
movl %r14d, %esi
movb $0x1, %al
callq 0x2030
movl 0x4081(%rip), %esi      # 0xb224
leaq 0x1095(%rip), %rdi      # 0x823f
xorl %eax, %eax
callq 0x2030
movq %r13, %rsp
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop