// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rsi, %rbx
xorl %eax, %eax
movl %edi, -0x48(%rbp)
cmpl %edi, %eax
jge 0x5edc
movslq %eax, %r12
movq (%rbx,%r12,8), %r13
cmpb $0x2d, (%r13)
jne 0x5ed5
movl %eax, -0x40(%rbp)
movb 0x1(%r13), %al
cmpb $0x69, %al
jne 0x5d13
movq 0x8(%rbx,%r12,8), %rdi
callq 0x20a0
movslq %eax, %r15
movq %r15, %rdi
callq 0x21d0
movq %rax, 0x4527(%rip)      # 0xa208
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
xorl %eax, %eax
cmpq %rax, %r15
je 0x5d0b
movq 0x8(%rbx,%r12,8), %rcx
movb (%rcx,%rax), %cl
movq 0x4505(%rip), %rdx      # 0xa208
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x5cef
movq (%rbx,%r12,8), %r13
movb 0x1(%r13), %al
cmpb $0x71, %al
jne 0x5d65
movq 0x8(%rbx,%r12,8), %rdi
callq 0x20a0
movslq %eax, %r15
movq %r15, %rdi
callq 0x21d0
movq %rax, 0x44dd(%rip)      # 0xa210
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
xorl %eax, %eax
cmpq %rax, %r15
je 0x5d5d
movq 0x8(%rbx,%r12,8), %rcx
movb (%rcx,%rax), %cl
movq 0x44bb(%rip), %rdx      # 0xa210
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x5d41
movq (%rbx,%r12,8), %r13
movb 0x1(%r13), %al
cmpb $0x6d, %al
movq %r13, -0x38(%rbp)
jne 0x5dc1
andl $0x0, 0x43e8(%rip)      # 0xa15c
movq 0x8(%rbx,%r12,8), %r15
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x20a0
cmpq %r13, %rax
jbe 0x5db9
movb (%r15,%r13), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x5db9
imull $0xa, %r14d, %eax
movl %eax, 0x43bc(%rip)      # 0xa15c
movsbl (%r15,%r13), %ecx
leal (%rax,%rcx), %r14d
addl $-0x30, %r14d
movl %r14d, 0x43a8(%rip)     # 0xa15c
incq %r13
jmp 0x5d7f
movq -0x38(%rbp), %r13
movb 0x1(%r13), %al
cmpb $0x72, %al
jne 0x5e19
andl $0x0, 0x4398(%rip)      # 0xa164
movq 0x8(%rbx,%r12,8), %r15
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x20a0
cmpq %r13, %rax
jbe 0x5e11
movb (%r15,%r13), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x5e11
imull $0xa, %r14d, %eax
movl %eax, 0x436c(%rip)      # 0xa164
movsbl (%r15,%r13), %ecx
leal (%rax,%rcx), %r14d
addl $-0x30, %r14d
movl %r14d, 0x4358(%rip)     # 0xa164
incq %r13
jmp 0x5dd7
movq -0x38(%rbp), %r13
movb 0x1(%r13), %al
cmpb $0x6c, %al
jne 0x5e71
andl $0x0, 0x433c(%rip)      # 0xa160
movq 0x8(%rbx,%r12,8), %r15
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x20a0
cmpq %r13, %rax
jbe 0x5e69
movb (%r15,%r13), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x5e69
imull $0xa, %r14d, %eax
movl %eax, 0x4310(%rip)      # 0xa160
movsbl (%r15,%r13), %ecx
leal (%rax,%rcx), %r14d
addl $-0x30, %r14d
movl %r14d, 0x42fc(%rip)     # 0xa160
incq %r13
jmp 0x5e2f
movq -0x38(%rbp), %r13
movb 0x1(%r13), %al
cmpb $0x73, %al
jne 0x5ec5
andl $0x0, 0x42ec(%rip)      # 0xa168
movq 0x8(%rbx,%r12,8), %r15
xorl %r12d, %r12d
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x20a0
cmpq %r12, %rax
jbe 0x5ec1
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x5ec1
imull $0xa, %r14d, %eax
movl %eax, 0x42c0(%rip)      # 0xa168
movsbl (%r15,%r12), %ecx
leal (%rax,%rcx), %r14d
addl $-0x30, %r14d
movl %r14d, 0x42ac(%rip)     # 0xa168
incq %r12
jmp 0x5e87
movb 0x1(%r13), %al
cmpb $0x68, %al
je 0x6371
movl -0x40(%rbp), %eax
incl %eax
movl -0x48(%rbp), %edi
incl %eax
jmp 0x5ca0
cmpq $0x0, 0x432c(%rip)      # 0xa210
je 0x6371
cmpq $0x0, 0x4316(%rip)      # 0xa208
je 0x6bdf
cmpl $-0x1, 0x425d(%rip)     # 0xa15c
jne 0x5f0b
movl $0x3, 0x4251(%rip)      # 0xa15c
cmpl $-0x1, 0x424e(%rip)     # 0xa160
jne 0x5f1e
movl $0x64, 0x4242(%rip)     # 0xa160
cmpl $-0x1, 0x423f(%rip)     # 0xa164
jne 0x5f31
movl $0xa, 0x4233(%rip)      # 0xa164
cmpl $-0x1, 0x4230(%rip)     # 0xa168
jne 0x5f41
andl $0x0, 0x4227(%rip)      # 0xa168
andl $0x0, 0x4358(%rip)      # 0xa2a0
andl $0x0, 0x43a1(%rip)      # 0xa2f0
andl $0x0, 0x43ea(%rip)      # 0xa340
andl $0x0, 0x4433(%rip)      # 0xa390
movq 0x42a4(%rip), %rdi      # 0xa208
leaq 0x1130(%rip), %rsi      # 0x709b
callq 0x21a0
movq %rax, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
xorl %r14d, %r14d
cmpl $0xa, %r14d
ja 0x637b
movq %r14, -0x48(%rbp)
movq -0x40(%rbp), %r14
movq %r14, %rdi
leaq 0x1260(%rip), %r15      # 0x71fb
movq %r15, %rsi
leaq -0x29(%rbp), %r13
movq %r13, %rdx
xorl %eax, %eax
callq 0x2260
movzbl -0x29(%rbp), %eax
movq %rax, -0x50(%rbp)
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x2260
movzbl -0x29(%rbp), %r12d
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x2260
movzbl -0x29(%rbp), %ebx
movq %r14, %rdi
movq -0x48(%rbp), %r14
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x2260
cmpl $0xa, %r14d
ja 0x5f7f
shll $0x8, %r12d
addq -0x50(%rbp), %r12
shll $0x10, %ebx
orq %r12, %rbx
movzbl -0x29(%rbp), %edi
shll $0x18, %edi
orq %rbx, %rdi
movl %r14d, %eax
leaq 0x1043(%rip), %rdx      # 0x705c
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
movslq -0x38(%rbp), %rax
jmpq *%rcx
movl %edi, 0x4170(%rip)      # 0xa19c
jmp 0x6165
leaq 0x4308(%rip), %rcx      # 0xa340
movl %edi, (%rcx,%rax,4)
xorl %r14d, %r14d
movq -0x38(%rbp), %rax
cmpl 0x4154(%rip), %eax      # 0xa19c
leal 0x1(%rax), %eax
sete %r14b
pushq $0x1
popq %rcx
cmovel %ecx, %eax
orl $0x4, %r14d
jmp 0x619a
movq 0x43fb(%rip), %rcx      # 0xa460
movl %edi, (%rcx,%rax,4)
movq -0x38(%rbp), %rcx
incl %ecx
xorl %r14d, %r14d
cmpl 0x4145(%rip), %ecx      # 0xa1bc
sete %r14b
movl $0x0, %eax
cmovel %eax, %ecx
movq %rcx, -0x38(%rbp)
addl $0x9, %r14d
jmp 0x5f7f
leaq 0x4209(%rip), %rcx      # 0xa2a0
movl %edi, (%rcx,%rax,4)
xorl %r14d, %r14d
movq -0x38(%rbp), %rax
cmpl 0x40f5(%rip), %eax      # 0xa19c
leal 0x1(%rax), %eax
sete %r14b
pushq $0x1
popq %rcx
cmovel %ecx, %eax
orl $0x2, %r14d
jmp 0x619a
leaq 0x422c(%rip), %rcx      # 0xa2f0
movl %edi, (%rcx,%rax,4)
movq -0x38(%rbp), %rax
cmpl 0x40cb(%rip), %eax      # 0xa19c
jne 0x6249
movslq 0x40da(%rip), %rax      # 0xa1b8
subq %rax, %rdi
shlq $0x2, %rdi
callq 0x21d0
movq %rax, 0x4377(%rip)      # 0xa468
pushq $0x1
popq %rax
movq %rax, -0x38(%rbp)
pushq $0x4
popq %rax
movl %eax, %r14d
jmp 0x5f7f
movq 0x435e(%rip), %rcx      # 0xa468
movl %edi, (%rcx,%rax,4)
movq -0x38(%rbp), %rdx
incl %edx
movslq 0x4082(%rip), %rax      # 0xa19c
leaq 0x41cf(%rip), %rcx      # 0xa2f0
movl (%rcx,%rax,4), %eax
subl 0x408e(%rip), %eax      # 0xa1b8
xorl %r14d, %r14d
cmpl %eax, %edx
sete %r14b
movl $0x0, %eax
cmovel %eax, %edx
movq %rdx, -0x38(%rbp)
addl $0x7, %r14d
jmp 0x5f7f
leaq 0x4061(%rip), %rcx      # 0xa1b0
movl %edi, (%rcx,%rax,4)
cmpl $0xa, %eax
je 0x6273
movq -0x38(%rbp), %rax
incl %eax
movq %rax, -0x38(%rbp)
pushq $0x1
popq %rax
movl %eax, %r14d
jmp 0x5f7f
leaq 0x4219(%rip), %rcx      # 0xa390
movl %edi, (%rcx,%rax,4)
xorl %r14d, %r14d
movq -0x38(%rbp), %rax
cmpl 0x4015(%rip), %eax      # 0xa19c
leal 0x1(%rax), %eax
sete %r14b
movl $0x0, %ecx
cmovel %ecx, %eax
addl $0x5, %r14d
movq %rax, -0x38(%rbp)
jmp 0x5f7f
leaq 0x4236(%rip), %rcx      # 0xa3e0
movl %edi, (%rcx,%rax,4)
movq -0x38(%rbp), %rcx
cmpl 0x3fe5(%rip), %ecx      # 0xa19c
jne 0x625e
leaq 0x412c(%rip), %rcx      # 0xa2f0
movl (%rcx,%rax,4), %eax
xorl %r14d, %r14d
cmpl 0x3fe8(%rip), %eax      # 0xa1b8
sete %r14b
addl $0x7, %r14d
movq $0x0, -0x38(%rbp)
jmp 0x5f7f
movq 0x424c(%rip), %rcx      # 0xa438
movl %edi, (%rcx,%rax,4)
movq -0x38(%rbp), %rcx
incl %ecx
xorl %r14d, %r14d
cmpl 0x3fb2(%rip), %ecx      # 0xa1b0
sete %r14b
movl $0x0, %eax
cmovel %eax, %ecx
movq %rcx, -0x38(%rbp)
orl $0xa, %r14d
jmp 0x5f7f
movq 0x423a(%rip), %rcx      # 0xa458
movl %edi, (%rcx,%rax,4)
movq -0x38(%rbp), %rcx
incl %ecx
xorl %r14d, %r14d
cmpl 0x3f94(%rip), %ecx      # 0xa1c4
sete %r14b
movl $0x0, %eax
cmovel %eax, %ecx
movq %rcx, -0x38(%rbp)
orl $0x8, %r14d
jmp 0x5f7f
movq -0x38(%rbp), %rax
incl %eax
movq %rax, -0x38(%rbp)
pushq $0x3
popq %rax
movl %eax, %r14d
jmp 0x5f7f
movq -0x38(%rbp), %rax
incl %eax
movq %rax, -0x38(%rbp)
pushq $0x6
popq %rax
movl %eax, %r14d
jmp 0x5f7f
movslq 0x3f36(%rip), %rdi      # 0xa1b0
shlq $0x2, %rdi
callq 0x21d0
movq %rax, 0x41ae(%rip)      # 0xa438
movslq 0x3f23(%rip), %r14      # 0xa1b4
movq %r14, %rdi
callq 0x21d0
movq %rax, 0x41f0(%rip)      # 0xa490
movslq 0x3f11(%rip), %rdi      # 0xa1b8
subq %r14, %rdi
addq %rdi, %rdi
callq 0x21d0
movq %rax, 0x4197(%rip)      # 0xa450
movslq 0x3f04(%rip), %rdi      # 0xa1c4
shlq $0x2, %rdi
callq 0x21d0
movq %rax, 0x4188(%rip)      # 0xa458
movslq 0x3ef1(%rip), %rdi      # 0xa1c8
addq %rdi, %rdi
callq 0x21d0
movq %rax, 0x415a(%rip)      # 0xa440
movslq 0x3ecf(%rip), %rdi      # 0xa1bc
shlq $0x2, %rdi
callq 0x21d0
movq %rax, 0x4163(%rip)      # 0xa460
movslq 0x3ebc(%rip), %rdi      # 0xa1c0
addq %rdi, %rdi
callq 0x21d0
movq %rax, 0x4135(%rip)      # 0xa448
movslq 0x3eb2(%rip), %rdi      # 0xa1cc
callq 0x21d0
movq %rax, 0x4172(%rip)      # 0xa498
movslq 0x3ea3(%rip), %rdi      # 0xa1d0
callq 0x21d0
movq %rax, 0x4167(%rip)      # 0xa4a0
movslq 0x3e98(%rip), %rdi      # 0xa1d8
callq 0x21d0
movq %rax, 0x415c(%rip)      # 0xa4a8
movslq 0x3e81(%rip), %rdi      # 0xa1d4
callq 0x21d0
movq %rax, 0x4151(%rip)      # 0xa4b0
pushq $0x1
popq %rax
movq %rax, -0x38(%rbp)
pushq $0x2
popq %rax
movl %eax, %r14d
jmp 0x5f7f
callq 0x5bc9
jmp 0x6bce
movl 0x3e37(%rip), %eax      # 0xa1b8
xorl %edx, %edx
xorl %ecx, %ecx
cmpl 0x3e29(%rip), %eax      # 0xa1b4
movq -0x38(%rbp), %rax
cmovel %edx, %eax
movq %rax, -0x38(%rbp)
sete %cl
addl %ecx, %r14d
leaq -0x29(%rbp), %r12
movq -0x40(%rbp), %rbx
cmpl $0xd, %r14d
jg 0x6495
movq %rbx, %rdi
leaq 0xe43(%rip), %r13       # 0x71fb
movq %r13, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2260
movzbl -0x29(%rbp), %r15d
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2260
movslq -0x38(%rbp), %rax
cmpl $0xb, %r14d
je 0x6422
cmpl $0xc, %r14d
je 0x645c
cmpl $0xd, %r14d
jne 0x63a4
movzbl -0x29(%rbp), %ecx
shll $0x8, %ecx
orl %r15d, %ecx
movq 0x4047(%rip), %rdx      # 0xa448
movw %cx, (%rdx,%rax,2)
incl %eax
xorl %r14d, %r14d
cmpl 0x3db0(%rip), %eax      # 0xa1c0
sete %r14b
movl $0x0, %ecx
cmovel %ecx, %eax
addl $0xd, %r14d
jmp 0x648c
movzbl -0x29(%rbp), %ecx
shll $0x8, %ecx
orl %r15d, %ecx
movq 0x401d(%rip), %rdx      # 0xa450
movw %cx, (%rdx,%rax,2)
movl 0x3d7b(%rip), %ecx      # 0xa1b8
subl 0x3d71(%rip), %ecx      # 0xa1b4
incl %eax
xorl %r14d, %r14d
cmpl %ecx, %eax
sete %r14b
movl $0x0, %ecx
cmovel %ecx, %eax
addl $0xb, %r14d
jmp 0x648c
movzbl -0x29(%rbp), %ecx
shll $0x8, %ecx
orl %r15d, %ecx
movq 0x3fd3(%rip), %rdx      # 0xa440
movw %cx, (%rdx,%rax,2)
incl %eax
xorl %r14d, %r14d
cmpl 0x3d4c(%rip), %eax      # 0xa1c8
sete %r14b
movl $0x0, %ecx
cmovel %ecx, %eax
orl $0xc, %r14d
movq %rax, -0x38(%rbp)
jmp 0x63a4
movl 0x3d39(%rip), %eax      # 0xa1d4
pushq $0x8
popq %rbx
cltd
idivl %ebx
incl %eax
movslq %eax, %rdi
callq 0x21d0
movq %rax, 0x400e(%rip)      # 0xa4c0
movl 0x3d18(%rip), %eax      # 0xa1d0
cltd
idivl %ebx
incl %eax
movslq %eax, %rdi
callq 0x21d0
movq %rax, 0x3fec(%rip)      # 0xa4b8
leaq -0x29(%rbp), %r12
leaq 0xb71(%rip), %r13       # 0x7048
cmpl $0x10, %r14d
sete %al
cmpl $0x12c, -0x38(%rbp)     # imm = 0x12C
setb %cl
andb %al, %cl
movzbl %cl, %r15d
leal -0xe(%r14), %ebx
cmpl $0x12, %r14d
jg 0x6676
movq -0x40(%rbp), %rdi
leaq 0xcf4(%rip), %rsi       # 0x71fb
movq %r12, %rdx
xorl %eax, %eax
callq 0x2260
movb -0x29(%rbp), %cl
movl %r15d, 0x4f65(%rip)     # 0xb480
cmpl $0x4, %ebx
ja 0x64f2
movslq (%r13,%rbx,4), %rax
addq %r13, %rax
movzbl %cl, %esi
jmpq *%rax
movq 0x3f5c(%rip), %rax      # 0xa490
movq -0x38(%rbp), %rsi
movslq %esi, %rdx
movb %cl, (%rax,%rdx)
incl %esi
xorl %r14d, %r14d
cmpl 0x3c6b(%rip), %esi      # 0xa1b4
sete %r14b
movl $0x0, %eax
cmovel %eax, %esi
movq %rsi, -0x38(%rbp)
orl $0xe, %r14d
jmp 0x64d7
movq 0x3f57(%rip), %rdi      # 0xa4c0
movq -0x38(%rbp), %rbx
movl %ebx, %eax
cltd
pushq $0x8
popq %r8
idivl %r8d
cltq
movb %cl, (%rdi,%rax)
movq 0x3f2d(%rip), %rdi      # 0xa4b0
movl 0x3c4b(%rip), %ecx      # 0xa1d4
movl %ebx, %edx
callq 0x59b2
addl $0x8, %ebx
xorl %r14d, %r14d
cmpl $-0x1, %eax
sete %r14b
movl $0x0, %eax
cmovel %eax, %ebx
movq %rbx, -0x38(%rbp)
orl $0x12, %r14d
jmp 0x64d7
movq 0x3eff(%rip), %rdi      # 0xa4b8
movq -0x38(%rbp), %rbx
movl %ebx, %eax
cltd
pushq $0x8
popq %r8
idivl %r8d
cltq
movb %cl, (%rdi,%rax)
movq 0x3ecd(%rip), %rdi      # 0xa4a0
movl 0x3bf7(%rip), %ecx      # 0xa1d0
movl %ebx, %edx
callq 0x59b2
addl $0x8, %ebx
xorl %r14d, %r14d
cmpl $-0x1, %eax
sete %r14b
movl $0x0, %eax
cmovel %eax, %ebx
movq %rbx, -0x38(%rbp)
orl $0x10, %r14d
jmp 0x64d7
movq 0x3e9f(%rip), %rdi      # 0xa4a8
movl 0x3bc9(%rip), %ecx      # 0xa1d8
movq -0x38(%rbp), %rbx
movl %ebx, %edx
callq 0x59b2
addl $0x8, %ebx
xorl %r14d, %r14d
cmpl $-0x1, %eax
sete %r14b
movl $0x0, %eax
cmovel %eax, %ebx
movq %rbx, -0x38(%rbp)
addl $0x11, %r14d
jmp 0x64d7
movq 0x3e55(%rip), %rdi      # 0xa498
movl 0x3b83(%rip), %ecx      # 0xa1cc
movq -0x38(%rbp), %rbx
movl %ebx, %edx
callq 0x59b2
addl $0x8, %ebx
xorl %r14d, %r14d
cmpl $-0x1, %eax
sete %r14b
movl $0x0, %eax
cmovel %eax, %ebx
movq %rbx, -0x38(%rbp)
addl $0xf, %r14d
jmp 0x64d7
movq -0x40(%rbp), %rdi
callq 0x2160
movl 0x3b4b(%rip), %eax      # 0xa1d0
movslq 0x3b10(%rip), %rcx      # 0xa19c
leaq 0x3cfd(%rip), %rdx      # 0xa390
movl %eax, (%rdx,%rcx,4)
leaq 0x3c53(%rip), %rdx      # 0xa2f0
subl (%rdx,%rcx,4), %eax
leaq 0x3c99(%rip), %rdx      # 0xa340
movl %eax, (%rdx,%rcx,4)
leaq 0x4ddf(%rip), %rdi      # 0xb490
xorl %ecx, %ecx
pushq $0x2
popq %r8
cmpq $0x100, %rcx            # imm = 0x100
je 0x66ff
movl $0x80, %esi
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpq $0x8, %r9
je 0x66f6
leal (%rsi,%rsi), %r11d
movl %ecx, %eax
cltd
idivl %r11d
xorl %eax, %eax
cmpl %esi, %edx
setge %al
addl %eax, %r10d
movl %r10d, (%rdi,%r9,4)
movl %esi, %eax
cltd
idivl %r8d
incq %r9
movl %eax, %esi
jmp 0x66cb
incq %rcx
addq $0x20, %rdi
jmp 0x66b7
movq %rsp, -0x70(%rbp)
movl 0x3a5b(%rip), %eax      # 0xa164
movq %rsp, %r13
imulq $0x14, %rax, %rax
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
movl 0x3a40(%rip), %eax      # 0xa164
movq %rsp, %r14
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
subq %rcx, %r14
movq %r14, %rsp
movq %rsp, %rcx
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, -0x40(%rbp)
movq %rcx, %rsp
movl $0x9c40, %edi           # imm = 0x9C40
callq 0x21d0
movq %rax, -0x58(%rbp)
movq %rax, %rdi
callq 0x57c3
movl 0x39ee(%rip), %eax      # 0xa15c
cmpl $0x2, %eax
jne 0x67fe
movl 0x39e3(%rip), %esi      # 0xa160
movq -0x58(%rbp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
movq %r14, %rcx
callq 0x587f
movl %eax, %r15d
callq 0x20e0
movq %rax, %r12
movl 0x39fd(%rip), %edx      # 0xa19c
movq %rbx, %rdi
movl %r15d, %esi
callq 0x540c
callq 0x20e0
subq %r12, %rax
cvtsi2sd %rax, %xmm0
divsd 0x871(%rip), %xmm0      # 0x7030
mulsd 0x871(%rip), %xmm0      # 0x7038
movl 0x3c5b(%rip), %edx      # 0xa428
movl 0x3c59(%rip), %ecx      # 0xa42c
leaq 0xa24(%rip), %rdi       # 0x71fe
movl %r15d, %esi
movb $0x1, %al
callq 0x2030
movl 0x3a4a(%rip), %esi      # 0xa234
leaq 0xa4e(%rip), %rdi       # 0x723f
xorl %eax, %eax
callq 0x2030
movl 0x395e(%rip), %eax      # 0xa15c
cmpl $0x1, %eax
movq %r13, -0x68(%rbp)
je 0x6822
xorpd %xmm0, %xmm0
cmpl $0x3, %eax
jne 0x6a08
xorl %edi, %edi
callq 0x2140
movl %eax, %edi
callq 0x2150
leaq 0xc(%r13), %rbx
xorpd %xmm0, %xmm0
xorl %ecx, %ecx
xorps %xmm1, %xmm1
movsd %xmm1, -0x50(%rbp)
movq -0x58(%rbp), %r15
movslq 0x3925(%rip), %rax      # 0xa164
cmpq %rax, %rcx
movsd %xmm0, -0x38(%rbp)
jge 0x6974
movl 0x390d(%rip), %esi      # 0xa160
movl %esi, -0x5c(%rbp)
movq %r15, %rdi
movq %rcx, -0x48(%rbp)
movq -0x48(%rbp), %rdx
movq %r14, %rcx
callq 0x587f
movl %eax, %r12d
callq 0x20e0
movq %r14, %r13
movq %rax, %r14
movl 0x391f(%rip), %edx      # 0xa19c
movq %r15, %rdi
movl %r12d, %esi
callq 0x540c
callq 0x20e0
subq %r14, %rax
cvtsi2sd %rax, %xmm3
movsd 0x793(%rip), %xmm0      # 0x7030
divsd %xmm0, %xmm3
movq 0x70f0(%rip), %rax      # 0xd998
subq %r14, %rax
movq %r13, %r14
cvtsi2sd %rax, %xmm2
movsd 0x77d(%rip), %xmm1      # 0x7038
mulsd %xmm1, %xmm3
movsd %xmm3, -0x78(%rbp)
divsd %xmm0, %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, -0x80(%rbp)
movl 0x3b51(%rip), %edx      # 0xa428
leaq 0x96c(%rip), %rdi       # 0x724a
movl %r12d, %esi
movapd %xmm3, %xmm0
movb $0x1, %al
callq 0x2030
movl 0x3942(%rip), %esi      # 0xa234
leaq 0x946(%rip), %rdi       # 0x723f
xorl %eax, %eax
callq 0x2030
movq -0x48(%rbp), %rcx
movsd -0x38(%rbp), %xmm0
movl 0x3b19(%rip), %eax      # 0xa428
movl %eax, -0xc(%rbx)
movl 0x3b14(%rip), %eax      # 0xa42c
movl %eax, -0x8(%rbx)
andl $0x0, 0x3b0a(%rip)      # 0xa42c
movl -0x5c(%rbp), %eax
movl %eax, -0x4(%rbx)
movl 0x3baa(%rip), %eax      # 0xa4d8
movl %eax, (%rbx)
movq -0x40(%rbp), %rax
movsd -0x78(%rbp), %xmm1
movsd %xmm1, (%rax,%rcx,8)
addsd %xmm1, %xmm0
movsd -0x80(%rbp), %xmm2
mulsd 0x6f1(%rip), %xmm2      # 0x7040
andl $0x0, 0x3ad2(%rip)      # 0xa428
divsd %xmm1, %xmm2
movsd -0x50(%rbp), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, -0x50(%rbp)
incq %rcx
addq $0x14, %rbx
jmp 0x6838
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
leaq 0x8fc(%rip), %rdi       # 0x727f
movb $0x1, %al
callq 0x2030
movq -0x68(%rbp), %r13
leaq 0xc(%r13), %rbx
xorl %r15d, %r15d
leaq 0x8fa(%rip), %r12       # 0x7296
movslq 0x37c1(%rip), %rax      # 0xa164
cmpq %rax, %r15
jge 0x69e2
movl -0x4(%rbx), %edx
movl (%r14,%r15,4), %ecx
movl (%rbx), %r8d
movl -0xc(%rbx), %r9d
movl -0x8(%rbx), %r10d
movq -0x40(%rbp), %rax
movsd (%rax,%r15,8), %xmm0
subq $0x8, %rsp
movq %r12, %rdi
movl %r15d, %esi
movb $0x1, %al
pushq %r10
callq 0x2030
popq %rcx
popq %rdx
incq %r15
addq $0x14, %rbx
jmp 0x699c
cvtsi2sd %eax, %xmm1
movsd -0x50(%rbp), %xmm0
divsd %xmm1, %xmm0
leaq 0x8f3(%rip), %rdi       # 0x72e9
movb $0x1, %al
callq 0x2030
movl 0x3759(%rip), %eax      # 0xa15c
movsd -0x38(%rbp), %xmm0
cmpl $0x4, %eax
jne 0x6b56
movsd %xmm0, -0x38(%rbp)
leaq 0xc(%r13), %rbx
xorl %r14d, %r14d
movq -0x58(%rbp), %r15
movslq 0x373c(%rip), %rax      # 0xa164
cmpq %rax, %r14
jge 0x6af0
movq %r15, %rdi
movl %r14d, %esi
callq 0x56ca
movl %eax, %r12d
callq 0x20e0
movq %rax, %r13
movl 0x374f(%rip), %edx      # 0xa19c
movq %r15, %rdi
movl %r12d, %esi
callq 0x540c
callq 0x20e0
subq %r13, %rax
movq -0x68(%rbp), %r13
cvtsi2sd %rax, %xmm0
divsd 0x5bf(%rip), %xmm0      # 0x7030
mulsd 0x5bf(%rip), %xmm0      # 0x7038
movsd %xmm0, -0x48(%rbp)
movl 0x39a4(%rip), %edx      # 0xa428
movl 0x39a2(%rip), %ecx      # 0xa42c
leaq 0x879(%rip), %rdi       # 0x730a
movl %r12d, %esi
movb $0x1, %al
callq 0x2030
movl 0x3987(%rip), %eax      # 0xa428
movl %eax, -0xc(%rbx)
andl $0x0, 0x397d(%rip)      # 0xa428
movl 0x397b(%rip), %eax      # 0xa42c
andl $0x0, 0x3974(%rip)      # 0xa42c
movl %eax, -0x8(%rbx)
movl %r12d, -0x4(%rbx)
movl 0x3a13(%rip), %eax      # 0xa4d8
movl %eax, (%rbx)
movq -0x40(%rbp), %rax
movsd -0x48(%rbp), %xmm1
movsd %xmm1, (%rax,%r14,8)
movsd -0x38(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
incq %r14
addq $0x14, %rbx
jmp 0x6a21
cvtsi2sd %eax, %xmm1
movsd -0x38(%rbp), %xmm0
divsd %xmm1, %xmm0
leaq 0x77b(%rip), %rdi       # 0x727f
movb $0x1, %al
callq 0x2030
addq $0xc, %r13
xorl %ebx, %ebx
leaq 0x836(%rip), %r14       # 0x734e
movslq 0x3645(%rip), %rax      # 0xa164
cmpq %rax, %rbx
jge 0x6b50
movl -0x4(%r13), %esi
movl (%r13), %edx
movl -0xc(%r13), %ecx
movl -0x8(%r13), %r8d
movq -0x40(%rbp), %rax
movsd (%rax,%rbx,8), %xmm0
movq %r14, %rdi
movb $0x1, %al
callq 0x2030
incq %rbx
addq $0x14, %r13
jmp 0x6b18
movl 0x3606(%rip), %eax      # 0xa15c
testl %eax, %eax
jne 0x6bca
movq -0x58(%rbp), %rbx
movq %rbx, %rdi
callq 0x57c3
movl %eax, %r14d
callq 0x20e0
movq %rax, %r15
movl 0x3625(%rip), %edx      # 0xa19c
movq %rbx, %rdi
movl %r14d, %esi
callq 0x540c
callq 0x20e0
subq %r15, %rax
cvtsi2sd %rax, %xmm0
divsd 0x499(%rip), %xmm0      # 0x7030
mulsd 0x499(%rip), %xmm0      # 0x7038
movl 0x3883(%rip), %edx      # 0xa428
leaq 0x69e(%rip), %rdi       # 0x724a
movl %r14d, %esi
movb $0x1, %al
callq 0x2030
movl 0x3678(%rip), %esi      # 0xa234
leaq 0x67c(%rip), %rdi       # 0x723f
xorl %eax, %eax
callq 0x2030
movq -0x70(%rbp), %rsp
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x356a(%rip), %rbx      # 0xa150
movq %rbx, %rdi
callq 0x20a0
movslq %eax, %r14
movq %r14, %rdi
callq 0x21d0
movq %rax, 0x3608(%rip)      # 0xa208
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
cmpq %rax, %r14
je 0x5ef8
movb (%rax,%rbx), %cl
movq 0x35ec(%rip), %rdx      # 0xa208
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x6c09