// File: /workspace/github_cpp_makefile_star2_O1/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
setg %dl
jle 0x64d0
movq %rsi, %rbx
xorl %ecx, %ecx
movl %edi, -0x44(%rbp)
movslq %ecx, %r14
movq (%rbx,%r14,8), %rax
cmpb $0x2d, (%rax)
jne 0x64b2
movb %dl, -0x70(%rbp)
movq %rcx, -0x40(%rbp)
cmpb $0x69, 0x1(%rax)
jne 0x62c7
movq 0x8(%rbx,%r14,8), %rdi
callq 0x2080
movq %rax, %r15
movslq %r15d, %r12
movq %r12, %rdi
callq 0x21b0
movq %rax, 0x4f59(%rip)      # 0xb1f8
testl %r12d, %r12d
jle 0x62c7
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %eax, %eax
movq 0x8(%rbx,%r14,8), %rcx
movb (%rcx,%rax), %cl
movq 0x4f3c(%rip), %rdx      # 0xb1f8
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r15
jne 0x62ad
movq (%rbx,%r14,8), %rax
cmpb $0x71, 0x1(%rax)
jne 0x6318
movq 0x8(%rbx,%r14,8), %rdi
callq 0x2080
movq %rax, %r15
movslq %r15d, %r12
movq %r12, %rdi
callq 0x21b0
movq %rax, 0x4f10(%rip)      # 0xb200
testl %r12d, %r12d
jle 0x6318
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %eax, %eax
movq 0x8(%rbx,%r14,8), %rcx
movb (%rcx,%rax), %cl
movq 0x4ef3(%rip), %rdx      # 0xb200
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r15
jne 0x62fe
movq (%rbx,%r14,8), %rax
movq %rax, -0x38(%rbp)
cmpb $0x6d, 0x1(%rax)
jne 0x637d
movl $0x0, 0x4e1c(%rip)      # 0xb14c
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x637d
xorl %r12d, %r12d
xorl %r13d, %r13d
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x637d
addl %r13d, %r13d
leal (%r13,%r13,4), %eax
movl %eax, 0x4df3(%rip)      # 0xb14c
movsbl (%r15,%r12), %ecx
leal (%rcx,%rax), %r13d
addl $-0x30, %r13d
movl %r13d, 0x4ddf(%rip)     # 0xb14c
incq %r12
movq %r15, %rdi
callq 0x2080
cmpq %r12, %rax
ja 0x6341
movq -0x38(%rbp), %rax
cmpb $0x72, 0x1(%rax)
jne 0x63de
movl $0x0, 0x4dc3(%rip)      # 0xb154
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x63de
xorl %r12d, %r12d
xorl %r13d, %r13d
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x63de
addl %r13d, %r13d
leal (%r13,%r13,4), %eax
movl %eax, 0x4d9a(%rip)      # 0xb154
movsbl (%r15,%r12), %ecx
leal (%rcx,%rax), %r13d
addl $-0x30, %r13d
movl %r13d, 0x4d86(%rip)     # 0xb154
incq %r12
movq %r15, %rdi
callq 0x2080
cmpq %r12, %rax
ja 0x63a2
movq -0x38(%rbp), %rax
cmpb $0x6c, 0x1(%rax)
jne 0x643f
movl $0x0, 0x4d5e(%rip)      # 0xb150
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x643f
xorl %r12d, %r12d
xorl %r13d, %r13d
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x643f
addl %r13d, %r13d
leal (%r13,%r13,4), %eax
movl %eax, 0x4d35(%rip)      # 0xb150
movsbl (%r15,%r12), %ecx
leal (%rcx,%rax), %r13d
addl $-0x30, %r13d
movl %r13d, 0x4d21(%rip)     # 0xb150
incq %r12
movq %r15, %rdi
callq 0x2080
cmpq %r12, %rax
ja 0x6403
movq -0x38(%rbp), %rax
cmpb $0x73, 0x1(%rax)
jne 0x649f
movl $0x0, 0x4d05(%rip)      # 0xb158
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x649f
xorl %r14d, %r14d
xorl %r12d, %r12d
movb (%r15,%r14), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x649f
addl %r12d, %r12d
leal (%r12,%r12,4), %eax
movl %eax, 0x4cdd(%rip)      # 0xb158
movsbl (%r15,%r14), %ecx
leal (%rcx,%rax), %r12d
addl $-0x30, %r12d
movl %r12d, 0x4cc9(%rip)     # 0xb158
incq %r14
movq %r15, %rdi
callq 0x2080
cmpq %r14, %rax
ja 0x6464
movq -0x38(%rbp), %rax
cmpb $0x68, 0x1(%rax)
je 0x64c1
movq -0x40(%rbp), %rcx
incl %ecx
movl -0x44(%rbp), %edi
incl %ecx
cmpl %edi, %ecx
setl %dl
jl 0x6263
jmp 0x64d0
callq 0x617e
testb $0x1, -0x70(%rbp)
jne 0x71fa
cmpq $0x0, 0x4d28(%rip)      # 0xb200
je 0x6f69
cmpq $0x0, 0x4d12(%rip)      # 0xb1f8
jne 0x652f
leaq 0x4c51(%rip), %rbx      # 0xb140
movq %rbx, %rdi
callq 0x2080
movq %rax, %r14
movslq %r14d, %r15
movq %r15, %rdi
callq 0x21b0
movq %rax, 0x4cec(%rip)      # 0xb1f8
testl %r15d, %r15d
jle 0x652f
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %eax, %eax
movb (%rax,%rbx), %cl
movq 0x4cd4(%rip), %rdx      # 0xb1f8
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r14
jne 0x651a
cmpl $-0x1, 0x4c16(%rip)     # 0xb14c
jne 0x6542
movl $0x3, 0x4c0a(%rip)      # 0xb14c
cmpl $-0x1, 0x4c07(%rip)     # 0xb150
jne 0x6555
movl $0x64, 0x4bfb(%rip)     # 0xb150
cmpl $-0x1, 0x4bf8(%rip)     # 0xb154
jne 0x6568
movl $0xa, 0x4bec(%rip)      # 0xb154
cmpl $-0x1, 0x4be9(%rip)     # 0xb158
jne 0x657b
movl $0x0, 0x4bdd(%rip)      # 0xb158
xorl %eax, %eax
movl %eax, 0x4d0d(%rip)      # 0xb290
movl %eax, 0x4d57(%rip)      # 0xb2e0
movl %eax, 0x4da1(%rip)      # 0xb330
movl %eax, 0x4deb(%rip)      # 0xb380
movq 0x4c5c(%rip), %rdi      # 0xb1f8
leaq 0x1ac8(%rip), %rsi      # 0x806b
callq 0x2180
movq %rax, -0x40(%rbp)
xorl %r15d, %r15d
xorl %ebx, %ebx
movq %rbx, -0x38(%rbp)
movq -0x40(%rbp), %r14
movq %r14, %rdi
leaq 0x1c08(%rip), %rbx      # 0x81cb
movq %rbx, %rsi
leaq -0x29(%rbp), %r12
movq %r12, %rdx
xorl %eax, %eax
callq 0x2240
movzbl -0x29(%rbp), %r13d
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2240
movzbl -0x29(%rbp), %r12d
shll $0x8, %r12d
orl %r13d, %r12d
movq %r14, %rdi
movq %rbx, %rsi
movq %rbx, %r13
leaq -0x29(%rbp), %rdx
xorl %eax, %eax
callq 0x2240
movzbl -0x29(%rbp), %ebx
shll $0x10, %ebx
orl %r12d, %ebx
movq %r14, %rdi
movq %r13, %rsi
leaq -0x29(%rbp), %rdx
xorl %eax, %eax
callq 0x2240
movzbl -0x29(%rbp), %r13d
shll $0x18, %r13d
orl %ebx, %r13d
cmpl $0xa, %r15d
jne 0x6669
movq 0x4deb(%rip), %rcx      # 0xb428
movslq -0x38(%rbp), %rax
movl %r13d, (%rcx,%rax,4)
incl %eax
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpl 0x4b4e(%rip), %eax      # 0xb1a0
sete %cl
je 0x6659
movl %eax, %ebx
movb %cl, %r15b
orl $0xa, %r15d
leaq 0x4c79(%rip), %rdx      # 0xb2e0
jmp 0x6674
leaq 0x4c70(%rip), %rdx      # 0xb2e0
movq -0x38(%rbp), %rbx
cmpl $0x9, %r15d
jne 0x66a3
movq 0x4dcf(%rip), %rcx      # 0xb450
movslq %ebx, %rax
movl %r13d, (%rcx,%rax,4)
incl %eax
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpl 0x4b17(%rip), %eax      # 0xb1ac
sete %cl
je 0x669c
movl %eax, %ebx
movb %cl, %r15b
addl $0x9, %r15d
cmpl $0x8, %r15d
jne 0x66d2
movq 0x4d98(%rip), %rcx      # 0xb448
movslq %ebx, %rax
movl %r13d, (%rcx,%rax,4)
incl %eax
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpl 0x4af0(%rip), %eax      # 0xb1b4
sete %cl
je 0x66cb
movl %eax, %ebx
movb %cl, %r15b
orl $0x8, %r15d
cmpl $0x7, %r15d
jne 0x670d
movq 0x4d79(%rip), %rcx      # 0xb458
movslq %ebx, %rax
movl %r13d, (%rcx,%rax,4)
incl %eax
movslq 0x4a9d(%rip), %rcx      # 0xb18c
movl (%rdx,%rcx,4), %ecx
subl 0x4ab0(%rip), %ecx      # 0xb1a8
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpl %ecx, %eax
sete %cl
je 0x6706
movl %eax, %ebx
movb %cl, %r15b
addl $0x7, %r15d
cmpl $0x6, %r15d
jne 0x674c
movslq %ebx, %rcx
leaq 0x4cb3(%rip), %rax      # 0xb3d0
movl %r13d, (%rax,%rcx,4)
movslq 0x4a64(%rip), %rax      # 0xb18c
cmpl %eax, %ecx
jne 0x6744
movl (%rdx,%rax,4), %eax
xorl %r15d, %r15d
cmpl 0x4a70(%rip), %eax      # 0xb1a8
sete %r15b
addl $0x7, %r15d
xorl %ebx, %ebx
jmp 0x674c
incl %ebx
movl $0x6, %r15d
cmpl $0x5, %r15d
jne 0x677d
movslq %ebx, %rax
leaq 0x4c24(%rip), %rcx      # 0xb380
movl %r13d, (%rcx,%rax,4)
xorl %eax, %eax
xorl %r15d, %r15d
cmpl 0x4a21(%rip), %ebx      # 0xb18c
sete %cl
je 0x6774
incl %ebx
movl %ebx, %eax
movb %cl, %r15b
addl $0x5, %r15d
movl %eax, %ebx
cmpl $0x4, %r15d
jne 0x67b1
movslq %ebx, %rax
leaq 0x4ba3(%rip), %rcx      # 0xb330
movl %r13d, (%rcx,%rax,4)
xorl %r15d, %r15d
movl $0x1, %eax
cmpl 0x49ed(%rip), %ebx      # 0xb18c
sete %cl
je 0x67a8
incl %ebx
movl %ebx, %eax
movb %cl, %r15b
orl $0x4, %r15d
movl %eax, %ebx
cmpl $0x3, %r15d
jne 0x67fc
movslq %ebx, %rcx
movl %r13d, (%rdx,%rcx,4)
movslq 0x49c7(%rip), %rax      # 0xb18c
cmpl %eax, %ecx
jne 0x67f4
movslq (%rdx,%rax,4), %rdi
movslq 0x49d4(%rip), %rax      # 0xb1a8
subq %rax, %rdi
shlq $0x2, %rdi
callq 0x21b0
movq %rax, 0x4c71(%rip)      # 0xb458
movl $0x4, %r15d
movl $0x1, %ebx
jmp 0x67fc
incl %ebx
movl $0x3, %r15d
cmpl $0x2, %r15d
jne 0x6830
movslq %ebx, %rax
leaq 0x4a84(%rip), %rcx      # 0xb290
movl %r13d, (%rcx,%rax,4)
xorl %r15d, %r15d
movl $0x1, %eax
cmpl 0x496e(%rip), %ebx      # 0xb18c
sete %cl
je 0x6827
incl %ebx
movl %ebx, %eax
movb %cl, %r15b
orl $0x2, %r15d
movl %eax, %ebx
cmpl $0x1, %r15d
jne 0x6951
movslq %ebx, %rax
leaq 0x495c(%rip), %rcx      # 0xb1a0
movl %r13d, (%rcx,%rax,4)
cmpl $0xa, %eax
je 0x685a
incl %ebx
movl $0x1, %r15d
jmp 0x6951
movslq 0x493f(%rip), %rdi      # 0xb1a0
shlq $0x2, %rdi
callq 0x21b0
movq %rax, 0x4bb7(%rip)      # 0xb428
movslq 0x492c(%rip), %r14      # 0xb1a4
movq %r14, %rdi
callq 0x21b0
movq %rax, 0x4bf9(%rip)      # 0xb480
movslq 0x491a(%rip), %rdi      # 0xb1a8
subq %r14, %rdi
addq %rdi, %rdi
callq 0x21b0
movq %rax, 0x4ba0(%rip)      # 0xb440
movslq 0x490d(%rip), %rdi      # 0xb1b4
shlq $0x2, %rdi
callq 0x21b0
movq %rax, 0x4b91(%rip)      # 0xb448
movslq 0x48fa(%rip), %rdi      # 0xb1b8
addq %rdi, %rdi
callq 0x21b0
movq %rax, 0x4b63(%rip)      # 0xb430
movslq 0x48d8(%rip), %rdi      # 0xb1ac
shlq $0x2, %rdi
callq 0x21b0
movq %rax, 0x4b6c(%rip)      # 0xb450
movslq 0x48c5(%rip), %rdi      # 0xb1b0
addq %rdi, %rdi
callq 0x21b0
movq %rax, 0x4b3e(%rip)      # 0xb438
movslq 0x48bb(%rip), %rdi      # 0xb1bc
callq 0x21b0
movq %rax, 0x4b7b(%rip)      # 0xb488
movslq 0x48ac(%rip), %rdi      # 0xb1c0
callq 0x21b0
movq %rax, 0x4b70(%rip)      # 0xb490
movslq 0x48a1(%rip), %rdi      # 0xb1c8
callq 0x21b0
movq %rax, 0x4b65(%rip)      # 0xb498
movslq 0x488a(%rip), %rdi      # 0xb1c4
callq 0x21b0
movq %rax, 0x4b5a(%rip)      # 0xb4a0
movl $0x2, %r15d
movl $0x1, %ebx
testl %r15d, %r15d
jne 0x6963
movl %r13d, 0x482f(%rip)     # 0xb18c
movl $0x1, %r15d
cmpl $0xb, %r15d
jl 0x65b1
movl 0x4835(%rip), %eax      # 0xb1a8
xorl %ecx, %ecx
xorl %edx, %edx
cmpl 0x4827(%rip), %eax      # 0xb1a4
sete %dl
cmovel %ecx, %ebx
addl %edx, %r15d
cmpl $0xd, %r15d
jg 0x6a76
movq -0x40(%rbp), %r14
movq %rbx, -0x38(%rbp)
movq %r14, %rdi
leaq 0x1829(%rip), %r12      # 0x81cb
movq %r12, %rsi
leaq -0x29(%rbp), %r13
movq %r13, %rdx
xorl %eax, %eax
callq 0x2240
movzbl -0x29(%rbp), %ebx
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x2240
movzbl -0x29(%rbp), %eax
shll $0x8, %eax
orl %ebx, %eax
cmpl $0xd, %r15d
jne 0x6a02
movq 0x4a5b(%rip), %rdx      # 0xb438
movslq -0x38(%rbp), %rcx
movw %ax, (%rdx,%rcx,2)
incl %ecx
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpl 0x47be(%rip), %ecx      # 0xb1b0
sete %dl
je 0x69f9
movl %ecx, %ebx
movb %dl, %r15b
addl $0xd, %r15d
jmp 0x6a06
movq -0x38(%rbp), %rbx
cmpl $0xc, %r15d
jne 0x6a35
movq 0x4a1d(%rip), %rdx      # 0xb430
movslq %ebx, %rcx
movw %ax, (%rdx,%rcx,2)
incl %ecx
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpl 0x4791(%rip), %ecx      # 0xb1b8
sete %dl
je 0x6a2e
movl %ecx, %ebx
movb %dl, %r15b
orl $0xc, %r15d
cmpl $0xb, %r15d
jne 0x6a6c
movq 0x49fe(%rip), %rdx      # 0xb440
movslq %ebx, %rcx
movw %ax, (%rdx,%rcx,2)
incl %ecx
movl 0x4757(%rip), %eax      # 0xb1a8
subl 0x474d(%rip), %eax      # 0xb1a4
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpl %eax, %ecx
sete %al
je 0x6a65
movl %ecx, %ebx
movb %al, %r15b
addl $0xb, %r15d
cmpl $0xe, %r15d
jl 0x6994
movl 0x4748(%rip), %eax      # 0xb1c4
leal 0x7(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
sarl $0x3, %ecx
incl %ecx
movslq %ecx, %rdi
callq 0x21b0
movl 0x4729(%rip), %ecx      # 0xb1c0
leal 0x7(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
movq %rax, 0x4a0a(%rip)      # 0xb4b0
sarl $0x3, %edx
incl %edx
movslq %edx, %rdi
callq 0x21b0
movq %rax, 0x49ee(%rip)      # 0xb4a8
cmpl $0x12, %r15d
ja 0x6c4b
leaq 0x1700(%rip), %r14      # 0x81cb
movq -0x40(%rbp), %rdi
movq %r14, %rsi
leaq -0x29(%rbp), %rdx
xorl %eax, %eax
callq 0x2240
movb -0x29(%rbp), %r12b
cmpl $0x10, %r15d
sete %al
cmpl $0x12c, %ebx            # imm = 0x12C
setb %cl
andb %al, %cl
movzbl %cl, %eax
movl %eax, 0x5974(%rip)      # 0xc470
movzbl %r12b, %r13d
cmpl $0x12, %r15d
jne 0x6b51
movq 0x49a3(%rip), %rax      # 0xb4b0
leal 0x7(%rbx), %ecx
testl %ebx, %ebx
cmovnsl %ebx, %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
movb %r13b, (%rax,%rcx)
movq 0x497a(%rip), %rdi      # 0xb4a0
movl 0x4698(%rip), %ecx      # 0xb1c4
movl %r13d, %esi
movl %ebx, %edx
callq 0x5f5a
xorl %ecx, %ecx
xorl %r15d, %r15d
cmpl $-0x1, %eax
sete %al
je 0x6b48
addl $0x8, %ebx
movl %ebx, %ecx
movb %al, %r15b
orl $0x12, %r15d
movl %ecx, %ebx
cmpl $0x11, %r15d
jne 0x6b89
movq 0x493a(%rip), %rdi      # 0xb498
movl 0x4664(%rip), %ecx      # 0xb1c8
movl %r13d, %esi
movl %ebx, %edx
callq 0x5f5a
xorl %ecx, %ecx
xorl %r15d, %r15d
cmpl $-0x1, %eax
sete %al
je 0x6b80
addl $0x8, %ebx
movl %ebx, %ecx
movb %al, %r15b
addl $0x11, %r15d
movl %ecx, %ebx
cmpl $0x10, %r15d
jne 0x6bda
movq 0x4912(%rip), %rax      # 0xb4a8
leal 0x7(%rbx), %ecx
testl %ebx, %ebx
cmovnsl %ebx, %ecx
sarl $0x3, %ecx
movslq %ecx, %rcx
movb %r13b, (%rax,%rcx)
movq 0x48e1(%rip), %rdi      # 0xb490
movl 0x460b(%rip), %ecx      # 0xb1c0
movl %r13d, %esi
movl %ebx, %edx
callq 0x5f5a
xorl %ecx, %ecx
xorl %r15d, %r15d
cmpl $-0x1, %eax
sete %al
je 0x6bd1
addl $0x8, %ebx
movl %ebx, %ecx
movb %al, %r15b
orl $0x10, %r15d
movl %ecx, %ebx
cmpl $0xf, %r15d
jne 0x6c12
movq 0x48a1(%rip), %rdi      # 0xb488
movl 0x45cf(%rip), %ecx      # 0xb1bc
movl %r13d, %esi
movl %ebx, %edx
callq 0x5f5a
xorl %ecx, %ecx
xorl %r15d, %r15d
cmpl $-0x1, %eax
sete %al
je 0x6c09
addl $0x8, %ebx
movl %ebx, %ecx
movb %al, %r15b
addl $0xf, %r15d
movl %ecx, %ebx
cmpl $0xe, %r15d
jne 0x6c41
movq 0x4861(%rip), %rcx      # 0xb480
movslq %ebx, %rax
movb %r12b, (%rcx,%rax)
incl %eax
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpl 0x4571(%rip), %eax      # 0xb1a4
sete %cl
je 0x6c3a
movl %eax, %ebx
movb %cl, %r15b
orl $0xe, %r15d
cmpl $0x13, %r15d
jl 0x6acb
movq -0x40(%rbp), %rdi
callq 0x2140
movl 0x4566(%rip), %eax      # 0xb1c0
movslq 0x452b(%rip), %rcx      # 0xb18c
leaq 0x4718(%rip), %rdx      # 0xb380
movl %eax, (%rdx,%rcx,4)
leaq 0x466e(%rip), %rdx      # 0xb2e0
subl (%rdx,%rcx,4), %eax
leaq 0x46b4(%rip), %rdx      # 0xb330
movl %eax, (%rdx,%rcx,4)
leaq 0x57fa(%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 0x6c93
incq %rcx
addq $0x20, %rsi
cmpq $0x100, %rcx            # imm = 0x100
jne 0x6c88
movq %rsp, %r13
movl 0x4478(%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 0x4459(%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 0x5d73
cmpl $0x2, 0x440b(%rip)      # 0xb14c
movq %r15, -0x50(%rbp)
movq %r12, -0x68(%rbp)
jne 0x6dd4
movl 0x43fb(%rip), %esi      # 0xb150
movq %rbx, %rdi
xorl %edx, %edx
movq %r14, %rcx
callq 0x5e24
movl %eax, %r15d
callq 0x20c0
movq %rax, %r12
movl 0x4419(%rip), %edx      # 0xb18c
movq %rbx, %rdi
movl %r15d, %esi
callq 0x5947
callq 0x20c0
subq %r12, %rax
movq -0x68(%rbp), %r12
cvtsi2sd %rax, %xmm0
divsd 0x12a9(%rip), %xmm0     # 0x8040
mulsd 0x12a9(%rip), %xmm0     # 0x8048
movl 0x4673(%rip), %edx      # 0xb418
movl 0x4671(%rip), %ecx      # 0xb41c
leaq 0x141c(%rip), %rdi      # 0x81ce
movl %r15d, %esi
movq -0x50(%rbp), %r15
movb $0x1, %al
callq 0x2030
movl 0x445e(%rip), %esi      # 0xb224
leaq 0x1442(%rip), %rdi      # 0x820f
xorl %eax, %eax
callq 0x2030
movl 0x4372(%rip), %eax      # 0xb14c
cmpl $0x1, %eax
movq %r13, -0x58(%rbp)
movq %rbx, -0x60(%rbp)
je 0x6e02
xorpd %xmm0, %xmm0
cmpl $0x3, %eax
jne 0x7023
xorl %edi, %edi
callq 0x2120
movl %eax, %edi
callq 0x2130
movl 0x434c(%rip), %eax      # 0xb154
testl %eax, %eax
jle 0x6f73
leaq 0xc(%r15), %rbx
xorpd %xmm1, %xmm1
xorl %r13d, %r13d
xorpd %xmm0, %xmm0
movq %r14, -0x78(%rbp)
movq -0x60(%rbp), %r15
movsd %xmm1, -0x40(%rbp)
movsd %xmm0, -0x38(%rbp)
movl 0x4319(%rip), %esi      # 0xb150
movl %esi, -0x44(%rbp)
movq %r15, %rdi
movl %r13d, %edx
movq %r14, %rcx
callq 0x5e24
movl %eax, %r12d
callq 0x20c0
movq %rax, %r14
movl 0x4333(%rip), %edx      # 0xb18c
movq %r15, %rdi
movl %r12d, %esi
callq 0x5947
callq 0x20c0
subq %r14, %rax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
movsd 0x11c4(%rip), %xmm4     # 0x8040
divsd %xmm4, %xmm2
movq 0x7b01(%rip), %rax      # 0xe988
subq %r14, %rax
movq -0x78(%rbp), %r14
xorps %xmm3, %xmm3
cvtsi2sd %rax, %xmm3
movsd 0x11aa(%rip), %xmm1     # 0x8048
mulsd %xmm1, %xmm2
movapd %xmm2, %xmm0
movsd %xmm2, -0x80(%rbp)
divsd %xmm4, %xmm3
mulsd %xmm1, %xmm3
movsd %xmm3, -0x70(%rbp)
movl 0x455a(%rip), %edx      # 0xb418
leaq 0x1355(%rip), %rdi      # 0x821a
movl %r12d, %esi
movq -0x68(%rbp), %r12
movb $0x1, %al
callq 0x2030
movl 0x434b(%rip), %esi      # 0xb224
leaq 0x132f(%rip), %rdi      # 0x820f
xorl %eax, %eax
callq 0x2030
movsd -0x40(%rbp), %xmm1
movsd -0x38(%rbp), %xmm0
movl 0x4521(%rip), %eax      # 0xb418
movl %eax, -0xc(%rbx)
movl 0x451c(%rip), %eax      # 0xb41c
movl %eax, -0x8(%rbx)
xorl %ecx, %ecx
movl %ecx, 0x4511(%rip)      # 0xb41c
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbx)
movl 0x45b1(%rip), %eax      # 0xb4c8
movl %eax, (%rbx)
movsd -0x80(%rbp), %xmm2
movsd %xmm2, (%r12,%r13,8)
addsd %xmm2, %xmm0
movsd -0x70(%rbp), %xmm3
mulsd 0x111b(%rip), %xmm3     # 0x8050
divsd %xmm2, %xmm3
addsd %xmm3, %xmm1
movl %ecx, 0x44d5(%rip)      # 0xb418
incq %r13
movslq 0x4207(%rip), %rax      # 0xb154
addq $0x14, %rbx
cmpq %rax, %r13
jl 0x6e27
movsd %xmm1, -0x40(%rbp)
movq -0x58(%rbp), %r13
movq -0x50(%rbp), %r15
jmp 0x6f80
callq 0x617e
jmp 0x71fa
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
movsd %xmm1, -0x40(%rbp)
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd %xmm0, -0x38(%rbp)
divsd %xmm1, %xmm0
leaq 0x12b8(%rip), %rdi      # 0x824f
movb $0x1, %al
callq 0x2030
movl 0x41b0(%rip), %eax      # 0xb154
testl %eax, %eax
jle 0x7000
leaq 0xc(%r15), %rbx
xorl %r15d, %r15d
leaq 0x12b0(%rip), %r13      # 0x8266
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 0x4165(%rip), %rax      # 0xb154
addq $0x14, %rbx
cmpq %rax, %r15
jl 0x6fb6
movq -0x50(%rbp), %r15
movq -0x58(%rbp), %r13
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd -0x40(%rbp), %xmm0
divsd %xmm1, %xmm0
leaq 0x12a2(%rip), %rdi      # 0x82b9
movb $0x1, %al
callq 0x2030
movsd -0x38(%rbp), %xmm0
cmpl $0x4, 0x4122(%rip)      # 0xb14c
jne 0x717b
movl 0x411e(%rip), %eax      # 0xb154
testl %eax, %eax
jle 0x711a
leaq 0xc(%r15), %rbx
xorl %r15d, %r15d
movq -0x60(%rbp), %r14
movsd %xmm0, -0x38(%rbp)
movq %r14, %rdi
movl %r15d, %esi
callq 0x5c74
movl %eax, %r12d
callq 0x20c0
movq %rax, %r13
movl 0x4122(%rip), %edx      # 0xb18c
movq %r14, %rdi
movl %r12d, %esi
callq 0x5947
callq 0x20c0
subq %r13, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0xfb3(%rip), %xmm0      # 0x8040
mulsd 0xfb3(%rip), %xmm0      # 0x8048
movsd %xmm0, -0x40(%rbp)
movl 0x4378(%rip), %edx      # 0xb418
movl 0x4376(%rip), %ecx      # 0xb41c
leaq 0x122d(%rip), %rdi      # 0x82da
movl %r12d, %esi
movb $0x1, %al
callq 0x2030
movsd -0x38(%rbp), %xmm0
movl 0x4356(%rip), %eax      # 0xb418
movl %eax, -0xc(%rbx)
xorl %ecx, %ecx
movl %ecx, 0x434b(%rip)      # 0xb418
movl 0x4349(%rip), %eax      # 0xb41c
movl %eax, -0x8(%rbx)
movl %ecx, 0x4340(%rip)      # 0xb41c
movl %r12d, -0x4(%rbx)
movq -0x68(%rbp), %r12
movl 0x43de(%rip), %eax      # 0xb4c8
movl %eax, (%rbx)
movsd -0x40(%rbp), %xmm1
movsd %xmm1, (%r12,%r15,8)
addsd %xmm1, %xmm0
incq %r15
movslq 0x404f(%rip), %rax      # 0xb154
addq $0x14, %rbx
cmpq %rax, %r15
jl 0x7049
movq -0x58(%rbp), %r13
movq -0x50(%rbp), %r15
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
leaq 0x1123(%rip), %rdi      # 0x824f
movb $0x1, %al
callq 0x2030
cmpl $0x0, 0x401a(%rip)      # 0xb154
jle 0x717b
addq $0xc, %r15
xorl %ebx, %ebx
leaq 0x11d5(%rip), %r14      # 0x831e
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 0x3fe2(%rip), %rax      # 0xb154
addq $0x14, %r15
cmpq %rax, %rbx
jl 0x7149
cmpl $0x0, 0x3fca(%rip)      # 0xb14c
jne 0x71f7
movq -0x60(%rbp), %rbx
movq %rbx, %rdi
callq 0x5d73
movl %eax, %r14d
callq 0x20c0
movq %rax, %r15
movl 0x3feb(%rip), %edx      # 0xb18c
movq %rbx, %rdi
movl %r14d, %esi
callq 0x5947
callq 0x20c0
subq %r15, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0xe7c(%rip), %xmm0      # 0x8040
mulsd 0xe7c(%rip), %xmm0      # 0x8048
movl 0x4246(%rip), %edx      # 0xb418
leaq 0x1041(%rip), %rdi      # 0x821a
movl %r14d, %esi
movb $0x1, %al
callq 0x2030
movl 0x403b(%rip), %esi      # 0xb224
leaq 0x101f(%rip), %rdi      # 0x820f
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