// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_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=2;}

    long long int sps = 0;
    long long int spsmax = 0;
    FILE *fp;
    
    unsigned int *D;
    int *D_2,*D_3;
    int i = 0;
    int msize = 10000;
    int pn = 0;
    int round = 0;
    
    m = (int*)malloc(4*msize);
    //msize = queryload(m);
    dcs[0] = 0;dc2s[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:D_3,6:NS
    int w = 1;int tm1;
    while(flag<8){
        fscanf(fp,"%c",&chr);a = chr;
        fscanf(fp,"%c",&chr);a += chr*256;
        fscanf(fp,"%c",&chr);a += chr*65536;
        fscanf(fp,"%c",&chr);a += chr*65536*256;
        //if(w<30){printf("\n[%d]:%u",flag,a);}
        if(flag==7){NS[w]=a;w++;if(w==tm1){flag++;printf("\n-finishing load index-\n");}}
        if(flag==6){tm1=a;NS = (int*)malloc(4*tm1);flag++;}
        if(flag==5){D_3[w]=a;w++;if(w==dc2s[loops]){flag++;w=0;}}
        if(flag==4){D_2[w]=a;w++;if(w==dc2s[loops]+1){flag++;w=0;}}
        if(flag==3){D[w]=a;w++;if(w==dcs[loops]){flag++;w=0;}}
        if(flag==2){dc2s[w]=a;if(w==loops){flag++;w=0;D_2 = (int*)malloc(4*dc2s[loops]+4);D_3 = (int*)malloc(4*dc2s[loops]+4);}else{w++;}}
        if(flag==1){dcs[w]=a;if(w==loops){flag++;w=1;D = (unsigned int*)malloc(4*dcs[loops]);}else{w++;}}
        if(flag==0){loops=a;flag++;}
        //fseek(fp,16,SEEK_CUR);

    }
    fclose(fp);
    int ancl[querysuu][5];
    int anst[querysuu];
    double ancd[querysuu];
    pn = tm1;
    NSsize = pn;
    round=loops;
    fround = round;
    double avt = 0;
    //int jogaipar = 0;
    if(runmode==2){
        msize = qrmload(plength,0,anst);
        clock_t timesb = clock();
        patternmatching2(D,D_2,D_3,msize); 
        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);
        if(CHECKFLAG==1){
            msize = qrmload(plength,0,anst);
            anscheck(msize);
        }
    }
    if(runmode==1 || runmode == 3){
        float avetransk = 0.00;
        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(ralen,jo,anst);
            if(DEBUGFLAG==1){
                printf("\n検索文字列:[");
                for(int rek = 0;rek<ralen;rek++){printf("%c",m[rek]);}
                printf("]\n");
            }
            clock_t timesb = clock();
            patternmatching2(D,D_2,D_3,msize);
            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] / (ans:%d / core:%d ) : time %lf[ms](%.3lf %)\n",msize,ans,coreans,time,(time2*100)/time);
            ancl[jo][0] = ans;
            ancl[jo][1] = coreans;
            ancl[jo][2] = ralen;
            ancl[jo][3] = transk;
            ancd[jo] = time;
            pertime += (time2*100)/time;
            avt += time;avetransk+=transk;
            if(CHECKFLAG==1){
                msize = qrmreload(ralen);
                anscheck(msize);
            }
        }
        for(int jo=0;jo<querysuu;jo++){
            printf("\n(P-length : %d from position %d[%d trans] / ans:%d / core:%d / time %lf[ms])",ancl[jo][2],anst[jo],ancl[jo][3],ancl[jo][0],ancl[jo][1],ancd[jo]);
            }
        printf("\navarage time : %lf[ms]\n avarage transform : %f times\n",avt/querysuu,avetransk/querysuu);
        printf("[transformation time : %.3f %]\n",pertime/querysuu);
    }
    if(runmode==4){
        for(int jo = 0;jo < querysuu;jo++){
            msize = qrmloadset(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();
            patternmatching2(D,D_2,D_3,msize);
            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;
            ancl[jo][1] = coreans;
            ancl[jo][2] = msize;
            ancl[jo][3] = transk;
            ancl[jo][4] = -1;
            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();
        clock_t timesb = clock();
        patternmatching2(D,D_2,D_3,msize);    
        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);
        
    }
    free(NS); 
    free(D); 
    free(D_2); 
    free(D_3); 
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
xorl %eax, %eax
movl %edi, -0x38(%rbp)
cmpl %edi, %eax
jge 0x4324
movslq %eax, %r12
movq (%rbx,%r12,8), %r13
cmpb $0x2d, (%r13)
jne 0x431d
movl %eax, -0x50(%rbp)
movb 0x1(%r13), %al
cmpb $0x69, %al
jne 0x415b
movq 0x8(%rbx,%r12,8), %rdi
callq 0x1070
movslq %eax, %r15
movq %r15, %rdi
callq 0x1160
movq %rax, 0x403f(%rip)      # 0x8168
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
xorl %eax, %eax
cmpq %rax, %r15
je 0x4153
movq 0x8(%rbx,%r12,8), %rcx
movb (%rcx,%rax), %cl
movq 0x401d(%rip), %rdx      # 0x8168
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x4137
movq (%rbx,%r12,8), %r13
movb 0x1(%r13), %al
cmpb $0x71, %al
jne 0x41ad
movq 0x8(%rbx,%r12,8), %rdi
callq 0x1070
movslq %eax, %r15
movq %r15, %rdi
callq 0x1160
movq %rax, 0x3ff5(%rip)      # 0x8170
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
xorl %eax, %eax
cmpq %rax, %r15
je 0x41a5
movq 0x8(%rbx,%r12,8), %rcx
movb (%rcx,%rax), %cl
movq 0x3fd3(%rip), %rdx      # 0x8170
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x4189
movq (%rbx,%r12,8), %r13
movb 0x1(%r13), %al
cmpb $0x6d, %al
movq %r13, -0x40(%rbp)
jne 0x4209
andl $0x0, 0x3f74(%rip)      # 0x8130
movq 0x8(%rbx,%r12,8), %r15
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x1070
cmpq %r13, %rax
jbe 0x4201
movb (%r15,%r13), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x4201
imull $0xa, %r14d, %eax
movl %eax, 0x3f48(%rip)      # 0x8130
movsbl (%r15,%r13), %ecx
leal (%rax,%rcx), %r14d
addl $-0x30, %r14d
movl %r14d, 0x3f34(%rip)     # 0x8130
incq %r13
jmp 0x41c7
movq -0x40(%rbp), %r13
movb 0x1(%r13), %al
cmpb $0x72, %al
jne 0x4261
andl $0x0, 0x3f24(%rip)      # 0x8138
movq 0x8(%rbx,%r12,8), %r15
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x1070
cmpq %r13, %rax
jbe 0x4259
movb (%r15,%r13), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x4259
imull $0xa, %r14d, %eax
movl %eax, 0x3ef8(%rip)      # 0x8138
movsbl (%r15,%r13), %ecx
leal (%rax,%rcx), %r14d
addl $-0x30, %r14d
movl %r14d, 0x3ee4(%rip)     # 0x8138
incq %r13
jmp 0x421f
movq -0x40(%rbp), %r13
movb 0x1(%r13), %al
cmpb $0x6c, %al
jne 0x42b9
andl $0x0, 0x3ec8(%rip)      # 0x8134
movq 0x8(%rbx,%r12,8), %r15
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x1070
cmpq %r13, %rax
jbe 0x42b1
movb (%r15,%r13), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x42b1
imull $0xa, %r14d, %eax
movl %eax, 0x3e9c(%rip)      # 0x8134
movsbl (%r15,%r13), %ecx
leal (%rax,%rcx), %r14d
addl $-0x30, %r14d
movl %r14d, 0x3e88(%rip)     # 0x8134
incq %r13
jmp 0x4277
movq -0x40(%rbp), %r13
movb 0x1(%r13), %al
cmpb $0x73, %al
jne 0x430d
andl $0x0, 0x3e78(%rip)      # 0x813c
movq 0x8(%rbx,%r12,8), %r15
xorl %r12d, %r12d
xorl %r14d, %r14d
movq %r15, %rdi
callq 0x1070
cmpq %r12, %rax
jbe 0x4309
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x4309
imull $0xa, %r14d, %eax
movl %eax, 0x3e4c(%rip)      # 0x813c
movsbl (%r15,%r12), %ecx
leal (%rax,%rcx), %r14d
addl $-0x30, %r14d
movl %r14d, 0x3e38(%rip)     # 0x813c
incq %r12
jmp 0x42cf
movb 0x1(%r13), %al
cmpb $0x68, %al
je 0x4605
movl -0x50(%rbp), %eax
incl %eax
movl -0x38(%rbp), %edi
incl %eax
jmp 0x40e8
cmpq $0x0, 0x3e44(%rip)      # 0x8170
je 0x4605
cmpq $0x0, 0x3e2e(%rip)      # 0x8168
je 0x4af6
cmpl $-0x1, 0x3de9(%rip)     # 0x8130
jne 0x4353
movl $0x3, 0x3ddd(%rip)      # 0x8130
cmpl $-0x1, 0x3dda(%rip)     # 0x8134
jne 0x4366
movl $0x64, 0x3dce(%rip)     # 0x8134
cmpl $-0x1, 0x3dcb(%rip)     # 0x8138
jne 0x4379
movl $0xa, 0x3dbf(%rip)      # 0x8138
cmpl $-0x1, 0x3dbc(%rip)     # 0x813c
jne 0x438c
movl $0x2, 0x3db0(%rip)      # 0x813c
movl $0x9c40, %edi           # imm = 0x9C40
callq 0x1160
movq %rax, 0x5373(%rip)      # 0x9710
andl $0x0, 0x52ac(%rip)      # 0x9650
andl $0x0, 0x52f5(%rip)      # 0x96a0
movq 0x3db6(%rip), %rdi      # 0x8168
leaq 0xcba(%rip), %rsi       # 0x5073
callq 0x1130
movq %rax, -0x58(%rbp)
pushq $0x1
popq %rax
xorl %esi, %esi
movq %rax, -0x38(%rbp)
movq -0x58(%rbp), %r13
cmpl $0x7, %esi
ja 0x460f
movq %r13, %rdi
leaq 0xdcc(%rip), %r12       # 0x51ae
movl %esi, -0x40(%rbp)
movq %r12, %rsi
leaq -0x29(%rbp), %r14
movq %r14, %rdx
xorl %eax, %eax
callq 0x11e0
movzbl -0x29(%rbp), %eax
movl %eax, -0x50(%rbp)
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x11e0
movzbl -0x29(%rbp), %ebx
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x11e0
movzbl -0x29(%rbp), %r15d
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x11e0
movl -0x40(%rbp), %esi
cmpl $0x7, %esi
ja 0x43cf
shll $0x8, %ebx
addl -0x50(%rbp), %ebx
shll $0x10, %r15d
orl %ebx, %r15d
movzbl -0x29(%rbp), %r14d
shll $0x18, %r14d
orl %r15d, %r14d
movl %esi, %eax
leaq 0xbc0(%rip), %rdx       # 0x5020
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
movq -0x38(%rbp), %rdx
movslq %edx, %rax
jmpq *%rcx
movl %r14d, 0x3cc9(%rip)     # 0x8140
pushq $0x1
popq %rsi
jmp 0x43cf
movq -0x70(%rbp), %rcx
movl %r14d, (%rcx,%rax,4)
movslq 0x3cb2(%rip), %rax      # 0x8140
xorl %esi, %esi
leaq 0x5209(%rip), %rcx      # 0x96a0
cmpl (%rcx,%rax,4), %edx
leal 0x1(%rdx), %eax
sete %sil
movl $0x0, %ecx
cmovel %ecx, %eax
orl $0x4, %esi
jmp 0x458b
leaq 0x51e8(%rip), %rcx      # 0x96a0
movl %r14d, (%rcx,%rax,4)
cmpl 0x3c7e(%rip), %edx      # 0x8140
jne 0x45e9
leal 0x4(,%r14,4), %r14d
movq %r14, %rdi
callq 0x1160
movq %rax, -0x70(%rbp)
movq %r14, %rdi
callq 0x1160
movq %rax, -0x68(%rbp)
movq $0x0, -0x38(%rbp)
pushq $0x3
popq %rsi
jmp 0x43cf
movq -0x60(%rbp), %rcx
movl %r14d, (%rcx,%rax,4)
incl %edx
movslq 0x3c37(%rip), %rax      # 0x8140
xorl %esi, %esi
leaq 0x513e(%rip), %rcx      # 0x9650
cmpl (%rcx,%rax,4), %edx
sete %sil
movl $0x0, %eax
cmovel %eax, %edx
movq %rdx, -0x38(%rbp)
addl $0x3, %esi
jmp 0x43cf
movq 0x51e4(%rip), %rcx      # 0x9718
movl %r14d, (%rcx,%rax,4)
incl %edx
pushq $0x7
popq %rsi
movq %rdx, -0x38(%rbp)
cmpl -0x44(%rbp), %edx
jne 0x43cf
leaq 0x1167(%rip), %rdi      # 0x56b8
callq 0x11a0
pushq $0x8
popq %rsi
movl -0x44(%rbp), %eax
jmp 0x458b
leaq 0x50eb(%rip), %rcx      # 0x9650
movl %r14d, (%rcx,%rax,4)
cmpl 0x3bd1(%rip), %eax      # 0x8140
jne 0x45f7
shll $0x2, %r14d
movq %r14, %rdi
callq 0x1160
movq %rax, -0x60(%rbp)
pushq $0x2
popq %rsi
pushq $0x1
popq %rax
movq %rax, -0x38(%rbp)
jmp 0x43cf
movq -0x68(%rbp), %rcx
movl %r14d, (%rcx,%rax,4)
incl %edx
movslq 0x3b9b(%rip), %rax      # 0x8140
xorl %esi, %esi
leaq 0x50f2(%rip), %rcx      # 0x96a0
cmpl (%rcx,%rax,4), %edx
sete %sil
movl $0x0, %eax
cmovel %eax, %edx
movq %rdx, -0x38(%rbp)
addl $0x5, %esi
jmp 0x43cf
leal (,%r14,4), %edi
callq 0x1160
movq %rax, 0x513b(%rip)      # 0x9718
pushq $0x7
popq %rsi
movl %r14d, -0x44(%rbp)
jmp 0x43cf
incl %edx
movq %rdx, -0x38(%rbp)
pushq $0x2
popq %rsi
jmp 0x43cf
incl %edx
movq %rdx, -0x38(%rbp)
pushq $0x1
popq %rsi
jmp 0x43cf
callq 0x4011
jmp 0x4ae5
movq -0x58(%rbp), %rdi
callq 0x1110
movq %rsp, -0x80(%rbp)
movl 0x3b16(%rip), %eax      # 0x8138
movq %rsp, %r12
imulq $0x14, %rax, %rax
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movl 0x3afb(%rip), %eax      # 0x8138
movq %rsp, %r13
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
subq %rcx, %r13
movq %r13, %rsp
movq %rsp, %rcx
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %rcx
movq %rcx, -0x50(%rbp)
movq %rcx, %rsp
movl -0x44(%rbp), %eax
movl %eax, 0x50ac(%rip)      # 0x9720
movl 0x3ac6(%rip), %eax      # 0x8140
movl %eax, 0x50a8(%rip)      # 0x9728
movl 0x3aaa(%rip), %eax      # 0x8130
cmpl $0x2, %eax
jne 0x46fa
movl 0x3aa3(%rip), %edi      # 0x8134
xorl %esi, %esi
movq %r13, %rdx
callq 0x3ec0
movl %eax, %r14d
callq 0x10a0
movq %rax, %r15
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movl %r14d, %ecx
callq 0x3942
callq 0x10a0
subq %r15, %rax
cvtsi2sd %rax, %xmm0
divsd 0x939(%rip), %xmm0      # 0x5008
mulsd 0x939(%rip), %xmm0      # 0x5010
movl 0x5013(%rip), %edx      # 0x96f0
movl 0x5009(%rip), %ecx      # 0x96ec
leaq 0xac7(%rip), %rdi       # 0x51b1
movl %r14d, %esi
movb $0x1, %al
callq 0x1030
movl 0x3a36(%rip), %eax      # 0x8130
cmpl $0x1, %eax
movq %r12, -0x78(%rbp)
je 0x4723
xorpd %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
cmpl $0x3, %eax
jne 0x4919
xorl %edi, %edi
callq 0x10f0
movl %eax, %edi
callq 0x1100
leaq 0xc(%r12), %rbx
xorpd %xmm0, %xmm0
movss %xmm0, -0x58(%rbp)
xorpd %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
xorl %r12d, %r12d
movsd %xmm0, -0x38(%rbp)
movslq 0x39ef(%rip), %rax      # 0x8138
cmpq %rax, %r12
jge 0x4878
movl 0x39dc(%rip), %edi      # 0x8134
movl %edi, -0x44(%rbp)
movl %r12d, %esi
movq %r13, %rdx
callq 0x3ec0
movl %eax, %r15d
callq 0x10a0
movq %r13, %r14
movq %rax, %r13
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movl %r15d, %ecx
callq 0x3942
callq 0x10a0
subq %r13, %rax
cvtsi2sd %rax, %xmm2
movsd 0x86b(%rip), %xmm0      # 0x5008
divsd %xmm0, %xmm2
movsd 0x867(%rip), %xmm1      # 0x5010
mulsd %xmm1, %xmm2
movsd %xmm2, -0x88(%rbp)
movq 0x4f74(%rip), %rax      # 0x9730
subq %r13, %rax
movq %r14, %r13
cvtsi2sd %rax, %xmm3
divsd %xmm0, %xmm3
mulsd %xmm1, %xmm3
movl 0x4f1b(%rip), %edx      # 0x96f0
movl 0x4f11(%rip), %ecx      # 0x96ec
mulsd 0x835(%rip), %xmm3      # 0x5018
divsd %xmm2, %xmm3
movapd %xmm3, %xmm1
movsd %xmm3, -0x90(%rbp)
leaq 0x9fb(%rip), %rdi       # 0x51f5
movl %r15d, %esi
movapd %xmm2, %xmm0
movb $0x2, %al
callq 0x1030
movl 0x4ee2(%rip), %eax      # 0x96f0
movl %eax, -0xc(%rbx)
movl 0x4ed5(%rip), %eax      # 0x96ec
movl %eax, -0x8(%rbx)
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbx)
movl 0x4efe(%rip), %eax      # 0x9724
movl %eax, (%rbx)
movq -0x50(%rbp), %rcx
movsd -0x88(%rbp), %xmm2
movsd %xmm2, (%rcx,%r12,8)
movsd -0x38(%rbp), %xmm0
addsd -0x90(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
cvtsi2ss %eax, %xmm0
movsd -0x40(%rbp), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, -0x40(%rbp)
movss -0x58(%rbp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, -0x58(%rbp)
incq %r12
addq $0x14, %rbx
jmp 0x4742
movq -0x78(%rbp), %r12
leaq 0xc(%r12), %rbx
xorl %r15d, %r15d
leaq 0x9b7(%rip), %r14       # 0x5242
movslq %eax, %rcx
cmpq %rcx, %r15
jge 0x48c8
movl -0x4(%rbx), %esi
movl (%r13,%r15,4), %edx
movl (%rbx), %ecx
movl -0xc(%rbx), %r8d
movl -0x8(%rbx), %r9d
movq -0x50(%rbp), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
movb $0x1, %al
callq 0x1030
incq %r15
movl 0x3876(%rip), %eax      # 0x8138
addq $0x14, %rbx
jmp 0x488b
cvtsi2sd %eax, %xmm1
cvtsi2ss %eax, %xmm2
movsd -0x40(%rbp), %xmm0
divsd %xmm1, %xmm0
movss -0x58(%rbp), %xmm1
divss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x9a3(%rip), %rdi       # 0x5290
movb $0x2, %al
callq 0x1030
cvtsi2sdl 0x383c(%rip), %xmm1 # 0x8138
movsd -0x38(%rbp), %xmm0
divsd %xmm1, %xmm0
leaq 0x9bb(%rip), %rdi       # 0x52c7
movb $0x1, %al
callq 0x1030
movl 0x3817(%rip), %eax      # 0x8130
cmpl $0x4, %eax
jne 0x4a5b
leaq 0x10(%r12), %r13
xorl %ebx, %ebx
leaq 0x881(%rip), %r12       # 0x51b1
movslq 0x3801(%rip), %rax      # 0x8138
cmpq %rax, %rbx
jge 0x49f0
movl %ebx, %edi
callq 0x3dac
movl %eax, %r14d
callq 0x10a0
movq %rax, %r15
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movl %r14d, %ecx
callq 0x3942
callq 0x10a0
subq %r15, %rax
cvtsi2sd %rax, %xmm0
divsd 0x68d(%rip), %xmm0      # 0x5008
mulsd 0x68d(%rip), %xmm0      # 0x5010
movsd %xmm0, -0x38(%rbp)
movl 0x4d62(%rip), %edx      # 0x96f0
movl 0x4d58(%rip), %ecx      # 0x96ec
movq %r12, %rdi
movl %r14d, %esi
movb $0x1, %al
callq 0x1030
movl 0x4d49(%rip), %eax      # 0x96f0
movl %eax, -0x10(%r13)
movl 0x4d3b(%rip), %eax      # 0x96ec
movl %eax, -0xc(%r13)
movl %r14d, -0x8(%r13)
movl 0x4d65(%rip), %eax      # 0x9724
movl %eax, -0x4(%r13)
orl $-0x1, (%r13)
movq -0x50(%rbp), %rax
movsd -0x38(%rbp), %xmm1
movsd %xmm1, (%rax,%rbx,8)
movsd -0x40(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
incq %rbx
addq $0x14, %r13
jmp 0x4930
cvtsi2sd %eax, %xmm1
movsd -0x40(%rbp), %xmm0
divsd %xmm1, %xmm0
leaq 0x8e3(%rip), %rdi       # 0x52e7
movb $0x1, %al
callq 0x1030
movq -0x78(%rbp), %r15
addq $0xc, %r15
xorl %r14d, %r14d
leaq 0x8e1(%rip), %rbx       # 0x52fe
movslq 0x3714(%rip), %rax      # 0x8138
cmpq %rax, %r14
jge 0x4a55
movl -0x4(%r15), %esi
movl (%r15), %edx
movl -0xc(%r15), %ecx
movl -0x8(%r15), %r8d
movq -0x50(%rbp), %rax
movsd (%rax,%r14,8), %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x1030
incq %r14
addq $0x14, %r15
jmp 0x4a1d
movl 0x36d5(%rip), %eax      # 0x8130
testl %eax, %eax
jne 0x4aba
callq 0x3c1b
movl %eax, %ebx
callq 0x10a0
movq %rax, %r14
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movl %ebx, %ecx
callq 0x3942
callq 0x10a0
subq %r14, %rax
cvtsi2sd %rax, %xmm0
divsd 0x572(%rip), %xmm0      # 0x5008
mulsd 0x572(%rip), %xmm0      # 0x5010
movl 0x4c4c(%rip), %edx      # 0x96f0
movl 0x4c42(%rip), %ecx      # 0x96ec
leaq 0x700(%rip), %rdi       # 0x51b1
movl %ebx, %esi
movb $0x1, %al
callq 0x1030
movq 0x4c57(%rip), %rdi      # 0x9718
callq 0x1140
movq -0x60(%rbp), %rdi
callq 0x1140
movq -0x70(%rbp), %rdi
callq 0x1140
movq -0x68(%rbp), %rdi
callq 0x1140
movq -0x80(%rbp), %rsp
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3613(%rip), %rbx      # 0x8110
movq %rbx, %rdi
callq 0x1070
movslq %eax, %r14
movq %r14, %rdi
callq 0x1160
movq %rax, 0x3651(%rip)      # 0x8168
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
cmpq %rax, %r14
je 0x4340
movb (%rax,%rbx), %cl
movq 0x3635(%rip), %rdx      # 0x8168
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x4b20
nop