// File: /workspace/github_cpp_makefile_star2_O1/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
testl %edi, %edi
setg %dl
jle 0x4755
movq %rsi, %rbx
xorl %ecx, %ecx
movl %edi, -0x48(%rbp)
movslq %ecx, %r14
movq (%rbx,%r14,8), %rax
cmpb $0x2d, (%rax)
jne 0x4737
movb %dl, -0x58(%rbp)
movq %rcx, -0x40(%rbp)
cmpb $0x69, 0x1(%rax)
jne 0x454c
movq 0x8(%rbx,%r14,8), %rdi
callq 0x1070
movq %rax, %r15
movslq %r15d, %r12
movq %r12, %rdi
callq 0x1160
movq %rax, 0x4c44(%rip)      # 0x9168
testl %r12d, %r12d
jle 0x454c
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %eax, %eax
movq 0x8(%rbx,%r14,8), %rcx
movb (%rcx,%rax), %cl
movq 0x4c27(%rip), %rdx      # 0x9168
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r15
jne 0x4532
movq (%rbx,%r14,8), %rax
cmpb $0x71, 0x1(%rax)
jne 0x459d
movq 0x8(%rbx,%r14,8), %rdi
callq 0x1070
movq %rax, %r15
movslq %r15d, %r12
movq %r12, %rdi
callq 0x1160
movq %rax, 0x4bfb(%rip)      # 0x9170
testl %r12d, %r12d
jle 0x459d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
xorl %eax, %eax
movq 0x8(%rbx,%r14,8), %rcx
movb (%rcx,%rax), %cl
movq 0x4bde(%rip), %rdx      # 0x9170
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r15
jne 0x4583
movq (%rbx,%r14,8), %rax
movq %rax, -0x38(%rbp)
cmpb $0x6d, 0x1(%rax)
jne 0x4602
movl $0x0, 0x4b7b(%rip)      # 0x9130
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x4602
xorl %r12d, %r12d
xorl %r13d, %r13d
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x4602
addl %r13d, %r13d
leal (%r13,%r13,4), %eax
movl %eax, 0x4b52(%rip)      # 0x9130
movsbl (%r15,%r12), %ecx
leal (%rcx,%rax), %r13d
addl $-0x30, %r13d
movl %r13d, 0x4b3e(%rip)     # 0x9130
incq %r12
movq %r15, %rdi
callq 0x1070
cmpq %r12, %rax
ja 0x45c6
movq -0x38(%rbp), %rax
cmpb $0x72, 0x1(%rax)
jne 0x4663
movl $0x0, 0x4b22(%rip)      # 0x9138
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x4663
xorl %r12d, %r12d
xorl %r13d, %r13d
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x4663
addl %r13d, %r13d
leal (%r13,%r13,4), %eax
movl %eax, 0x4af9(%rip)      # 0x9138
movsbl (%r15,%r12), %ecx
leal (%rcx,%rax), %r13d
addl $-0x30, %r13d
movl %r13d, 0x4ae5(%rip)     # 0x9138
incq %r12
movq %r15, %rdi
callq 0x1070
cmpq %r12, %rax
ja 0x4627
movq -0x38(%rbp), %rax
cmpb $0x6c, 0x1(%rax)
jne 0x46c4
movl $0x0, 0x4abd(%rip)      # 0x9134
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x46c4
xorl %r12d, %r12d
xorl %r13d, %r13d
movb (%r15,%r12), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x46c4
addl %r13d, %r13d
leal (%r13,%r13,4), %eax
movl %eax, 0x4a94(%rip)      # 0x9134
movsbl (%r15,%r12), %ecx
leal (%rcx,%rax), %r13d
addl $-0x30, %r13d
movl %r13d, 0x4a80(%rip)     # 0x9134
incq %r12
movq %r15, %rdi
callq 0x1070
cmpq %r12, %rax
ja 0x4688
movq -0x38(%rbp), %rax
cmpb $0x73, 0x1(%rax)
jne 0x4724
movl $0x0, 0x4a64(%rip)      # 0x913c
movq 0x8(%rbx,%r14,8), %r15
cmpb $0x0, (%r15)
je 0x4724
xorl %r14d, %r14d
xorl %r12d, %r12d
movb (%r15,%r14), %al
addb $-0x30, %al
cmpb $0x9, %al
ja 0x4724
addl %r12d, %r12d
leal (%r12,%r12,4), %eax
movl %eax, 0x4a3c(%rip)      # 0x913c
movsbl (%r15,%r14), %ecx
leal (%rcx,%rax), %r12d
addl $-0x30, %r12d
movl %r12d, 0x4a28(%rip)     # 0x913c
incq %r14
movq %r15, %rdi
callq 0x1070
cmpq %r14, %rax
ja 0x46e9
movq -0x38(%rbp), %rax
cmpb $0x68, 0x1(%rax)
je 0x4746
movq -0x40(%rbp), %rcx
incl %ecx
movl -0x48(%rbp), %edi
incl %ecx
cmpl %edi, %ecx
setl %dl
jl 0x44e8
jmp 0x4755
callq 0x4403
testb $0x1, -0x58(%rbp)
jne 0x4fc6
cmpq $0x0, 0x4a13(%rip)      # 0x9170
je 0x4cf9
cmpq $0x0, 0x49fd(%rip)      # 0x9168
jne 0x47b4
leaq 0x499c(%rip), %rbx      # 0x9110
movq %rbx, %rdi
callq 0x1070
movq %rax, %r14
movslq %r14d, %r15
movq %r15, %rdi
callq 0x1160
movq %rax, 0x49d7(%rip)      # 0x9168
testl %r15d, %r15d
jle 0x47b4
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %eax, %eax
movb (%rax,%rbx), %cl
movq 0x49bf(%rip), %rdx      # 0x9168
movb %cl, (%rdx,%rax)
incq %rax
cmpq %rax, %r14
jne 0x479f
cmpl $-0x1, 0x4975(%rip)     # 0x9130
jne 0x47c7
movl $0x3, 0x4969(%rip)      # 0x9130
cmpl $-0x1, 0x4966(%rip)     # 0x9134
jne 0x47da
movl $0x64, 0x495a(%rip)     # 0x9134
cmpl $-0x1, 0x4957(%rip)     # 0x9138
jne 0x47ed
movl $0xa, 0x494b(%rip)      # 0x9138
cmpl $-0x1, 0x4948(%rip)     # 0x913c
jne 0x4800
movl $0x2, 0x493c(%rip)      # 0x913c
movl $0x9c40, %edi           # imm = 0x9C40
callq 0x1160
movq %rax, 0x5eff(%rip)      # 0xa710
xorl %eax, %eax
movl %eax, 0x5e37(%rip)      # 0xa650
movl %eax, 0x5e81(%rip)      # 0xa6a0
movq 0x4942(%rip), %rdi      # 0x9168
leaq 0x184e(%rip), %rsi      # 0x607b
callq 0x1130
movq %rax, -0x50(%rbp)
movl $0x1, %edx
xorl %r13d, %r13d
movq %rdx, -0x40(%rbp)
movq -0x50(%rbp), %r14
movq %r14, %rdi
leaq 0x1966(%rip), %rbx      # 0x61b6
movq %rbx, %rsi
leaq -0x29(%rbp), %r12
movq %r12, %rdx
xorl %eax, %eax
callq 0x11e0
movzbl -0x29(%rbp), %r15d
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x11e0
movzbl -0x29(%rbp), %ebx
shll $0x8, %ebx
orl %r15d, %ebx
movq %r14, %rdi
leaq 0x192c(%rip), %rsi      # 0x61b6
movq %r12, %rdx
movq %r12, %r15
xorl %eax, %eax
callq 0x11e0
movzbl -0x29(%rbp), %r12d
shll $0x10, %r12d
orl %ebx, %r12d
movq %r14, %rdi
leaq 0x1909(%rip), %rsi      # 0x61b6
movq %r15, %rdx
xorl %eax, %eax
callq 0x11e0
movzbl -0x29(%rbp), %r15d
shll $0x18, %r15d
orl %r12d, %r15d
cmpl $0x7, %r13d
jne 0x4914
movq 0x5e48(%rip), %rax      # 0xa718
movq -0x40(%rbp), %rdx
movslq %edx, %rdx
movl %r15d, (%rax,%rdx,4)
incl %edx
movl $0x7, %r13d
cmpl -0x30(%rbp), %edx
jne 0x4900
leaq 0x1dd1(%rip), %rdi      # 0x66c0
movq %rdx, %rbx
callq 0x11a0
movq %rbx, %rdx
movl $0x8, %r13d
movq -0x38(%rbp), %rbx
leaq 0x5d95(%rip), %r14      # 0xa6a0
leaq 0x5d3e(%rip), %r12      # 0xa650
jmp 0x492a
movq -0x38(%rbp), %rbx
leaq 0x5d81(%rip), %r14      # 0xa6a0
leaq 0x5d2a(%rip), %r12      # 0xa650
movq -0x40(%rbp), %rdx
cmpl $0x6, %r13d
jne 0x4954
leal (,%r15,4), %edi
movq %rdx, %r13
callq 0x1160
movq %r13, %rdx
movq %rax, 0x5dce(%rip)      # 0xa718
movl $0x7, %r13d
movl %r15d, -0x30(%rbp)
cmpl $0x5, %r13d
jne 0x4985
movslq %edx, %rax
movq -0x58(%rbp), %rcx
movl %r15d, (%rcx,%rax,4)
incl %eax
movslq 0x47d2(%rip), %rcx      # 0x9140
xorl %edx, %edx
xorl %r13d, %r13d
cmpl (%r14,%rcx,4), %eax
sete %cl
je 0x497e
movl %eax, %edx
movb %cl, %r13b
addl $0x5, %r13d
cmpl $0x4, %r13d
jne 0x49b8
movslq %edx, %rax
movq -0x48(%rbp), %rcx
movl %r15d, (%rcx,%rax,4)
movslq 0x47a3(%rip), %rcx      # 0x9140
xorl %eax, %eax
xorl %r13d, %r13d
cmpl (%r14,%rcx,4), %edx
sete %cl
je 0x49af
incl %edx
movl %edx, %eax
movb %cl, %r13b
orl $0x4, %r13d
movl %eax, %edx
cmpl $0x3, %r13d
jne 0x49e5
movslq %edx, %rax
movl %r15d, (%rbx,%rax,4)
incl %eax
movslq 0x4772(%rip), %rcx      # 0x9140
xorl %edx, %edx
xorl %r13d, %r13d
cmpl (%r12,%rcx,4), %eax
sete %cl
je 0x49de
movl %eax, %edx
movb %cl, %r13b
addl $0x3, %r13d
cmpl $0x2, %r13d
jne 0x4a33
movslq %edx, %rcx
movl %r15d, (%r14,%rcx,4)
movslq 0x4747(%rip), %rax      # 0x9140
cmpl %eax, %ecx
jne 0x4a2b
movslq (%r14,%rax,4), %rax
leaq 0x4(,%rax,4), %r14
movq %r14, %rdi
callq 0x1160
movq %rax, -0x48(%rbp)
movq %r14, %rdi
callq 0x1160
movq %rax, -0x58(%rbp)
xorl %edx, %edx
movl $0x3, %r13d
jmp 0x4a33
incl %edx
movl $0x2, %r13d
cmpl $0x1, %r13d
jne 0x4a70
movslq %edx, %rcx
movl %r15d, (%r12,%rcx,4)
movslq 0x46f9(%rip), %rax      # 0x9140
cmpl %eax, %ecx
jne 0x4a68
movslq (%r12,%rax,4), %rdi
shlq $0x2, %rdi
callq 0x1160
movq %rax, %rbx
movl $0x1, %edx
movl $0x2, %r13d
jmp 0x4a70
incl %edx
movl $0x1, %r13d
testl %r13d, %r13d
jne 0x4a82
movl %r15d, 0x46c4(%rip)     # 0x9140
movl $0x1, %r13d
movq %rbx, -0x38(%rbp)
cmpl $0x8, %r13d
jl 0x483e
movq -0x50(%rbp), %rdi
callq 0x1100
movq %rsp, -0x78(%rbp)
movl 0x4695(%rip), %eax      # 0x9138
movq %rsp, %rbx
leaq (%rax,%rax,4), %rax
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movl 0x4676(%rip), %eax      # 0x9138
movq %rsp, %rdx
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
subq %rcx, %rdx
movq %rdx, %rsp
movq %rsp, %r13
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
subq %rax, %r13
movq %r13, %rsp
movl -0x30(%rbp), %eax
movl %eax, 0x5c2b(%rip)      # 0xa720
movl 0x4645(%rip), %eax      # 0x9140
movl %eax, 0x5c27(%rip)      # 0xa728
cmpl $0x2, 0x4628(%rip)      # 0x9130
movq -0x48(%rbp), %r15
movq %rdx, -0x70(%rbp)
jne 0x4b77
movl 0x461c(%rip), %edi      # 0x9134
xorl %esi, %esi
callq 0x42c2
movl %eax, %r14d
callq 0x1090
movq %rax, %r12
movq -0x38(%rbp), %rdi
movq %r15, %rsi
movq -0x58(%rbp), %rdx
movl %r14d, %ecx
callq 0x3cfa
callq 0x1090
subq %r12, %rax
cvtsi2sd %rax, %xmm0
divsd 0x14de(%rip), %xmm0     # 0x6030
mulsd 0x14de(%rip), %xmm0     # 0x6038
movl 0x5b90(%rip), %edx      # 0xa6f0
movl 0x5b86(%rip), %ecx      # 0xa6ec
leaq 0x164c(%rip), %rdi      # 0x61b9
movl %r14d, %esi
movb $0x1, %al
callq 0x1030
movl 0x45b3(%rip), %eax      # 0x9130
cmpl $0x1, %eax
movq %rbx, -0x60(%rbp)
movq %r13, -0x68(%rbp)
je 0x4ba9
xorpd %xmm0, %xmm0
cmpl $0x3, %eax
jne 0x4dd6
xorl %edi, %edi
callq 0x10e0
movl %eax, %edi
callq 0x10f0
movq -0x60(%rbp), %rbx
cmpl $0x0, 0x4588(%rip)      # 0x9138
jle 0x4d03
addq $0xc, %rbx
xorps %xmm4, %xmm4
xorpd %xmm1, %xmm1
xorl %r12d, %r12d
xorpd %xmm3, %xmm3
movss %xmm4, -0x30(%rbp)
movsd %xmm1, -0x50(%rbp)
movsd %xmm3, -0x40(%rbp)
movl 0x4556(%rip), %r13d     # 0x9134
movl %r13d, %edi
movl %r12d, %esi
movq -0x70(%rbp), %rdx
callq 0x42c2
movl %eax, %r14d
callq 0x1090
movq %rax, %r15
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x58(%rbp), %rdx
movl %r14d, %ecx
callq 0x3cfa
callq 0x1090
subq %r15, %rax
xorps %xmm2, %xmm2
cvtsi2sd %rax, %xmm2
movsd 0x140c(%rip), %xmm0     # 0x6030
divsd %xmm0, %xmm2
movsd 0x1408(%rip), %xmm1     # 0x6038
mulsd %xmm1, %xmm2
movsd %xmm2, -0x80(%rbp)
movq 0x5af0(%rip), %rax      # 0xa730
subq %r15, %rax
xorps %xmm3, %xmm3
cvtsi2sd %rax, %xmm3
divsd %xmm0, %xmm3
mulsd %xmm1, %xmm3
movl 0x5a97(%rip), %edx      # 0xa6f0
movl 0x5a8d(%rip), %ecx      # 0xa6ec
mulsd 0x13d9(%rip), %xmm3     # 0x6040
divsd %xmm2, %xmm3
movapd %xmm3, %xmm1
movsd %xmm3, -0x88(%rbp)
leaq 0x157f(%rip), %rdi      # 0x61fd
movl %r14d, %esi
movapd %xmm2, %xmm0
movb $0x2, %al
callq 0x1030
movss -0x30(%rbp), %xmm4
movsd -0x50(%rbp), %xmm1
movsd -0x40(%rbp), %xmm3
movl 0x5a4f(%rip), %eax      # 0xa6f0
movl %eax, -0xc(%rbx)
movl 0x5a42(%rip), %eax      # 0xa6ec
movl %eax, -0x8(%rbx)
movl %r13d, -0x4(%rbx)
movq -0x68(%rbp), %r13
movl 0x5a69(%rip), %eax      # 0xa724
movl %eax, (%rbx)
movsd -0x80(%rbp), %xmm0
movsd %xmm0, (%r13,%r12,8)
addsd -0x88(%rbp), %xmm1
addsd %xmm0, %xmm3
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
addss %xmm0, %xmm4
incq %r12
movslq 0x444e(%rip), %rax      # 0x9138
addq $0x14, %rbx
cmpq %rax, %r12
jl 0x4bc8
jmp 0x4d0e
callq 0x4403
jmp 0x4fc6
xorps %xmm4, %xmm4
xorpd %xmm3, %xmm3
xorpd %xmm1, %xmm1
movsd %xmm1, -0x50(%rbp)
movl 0x441f(%rip), %eax      # 0x9138
testl %eax, %eax
movsd %xmm3, -0x40(%rbp)
jle 0x4d7c
movss %xmm4, -0x30(%rbp)
movq -0x60(%rbp), %rax
leaq 0xc(%rax), %rbx
xorl %r15d, %r15d
leaq 0x1511(%rip), %r14      # 0x624a
movq -0x70(%rbp), %r12
movl -0x4(%rbx), %esi
movl (%r12,%r15,4), %edx
movl (%rbx), %ecx
movl -0xc(%rbx), %r8d
movl -0x8(%rbx), %r9d
movsd (%r13,%r15,8), %xmm0
movq %r14, %rdi
movb $0x1, %al
callq 0x1030
incq %r15
movslq 0x43cf(%rip), %rax      # 0x9138
addq $0x14, %rbx
cmpq %rax, %r15
jl 0x4d3d
movsd -0x40(%rbp), %xmm3
movss -0x30(%rbp), %xmm4
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
xorps %xmm2, %xmm2
cvtsi2ss %eax, %xmm2
movapd %xmm3, %xmm0
divsd %xmm1, %xmm0
divss %xmm2, %xmm4
xorps %xmm1, %xmm1
cvtss2sd %xmm4, %xmm1
leaq 0x14f4(%rip), %rdi      # 0x6298
movb $0x2, %al
callq 0x1030
xorps %xmm1, %xmm1
cvtsi2sdl 0x4382(%rip), %xmm1 # 0x9138
movsd -0x50(%rbp), %xmm0
divsd %xmm1, %xmm0
leaq 0x1509(%rip), %rdi      # 0x62cf
movb $0x1, %al
callq 0x1030
movsd -0x40(%rbp), %xmm0
movq -0x48(%rbp), %r15
cmpl $0x4, 0x4353(%rip)      # 0x9130
jne 0x4f34
movl 0x434f(%rip), %eax      # 0x9138
testl %eax, %eax
jle 0x4ec9
movq -0x60(%rbp), %rax
leaq 0x10(%rax), %r13
xorl %ebx, %ebx
movq %r15, -0x48(%rbp)
movq -0x68(%rbp), %r12
movsd %xmm0, -0x40(%rbp)
movl %ebx, %edi
callq 0x41c1
movl %eax, %r14d
callq 0x1090
movq %rax, %r15
movq -0x38(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x58(%rbp), %rdx
movl %r14d, %ecx
callq 0x3cfa
callq 0x1090
subq %r15, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x11ea(%rip), %xmm0     # 0x6030
mulsd 0x11ea(%rip), %xmm0     # 0x6038
movsd %xmm0, -0x50(%rbp)
movl 0x5897(%rip), %edx      # 0xa6f0
movl 0x588d(%rip), %ecx      # 0xa6ec
leaq 0x1353(%rip), %rdi      # 0x61b9
movl %r14d, %esi
movb $0x1, %al
callq 0x1030
movsd -0x40(%rbp), %xmm0
movl 0x5875(%rip), %eax      # 0xa6f0
movl %eax, -0x10(%r13)
movl 0x5867(%rip), %eax      # 0xa6ec
movl %eax, -0xc(%r13)
movl %r14d, -0x8(%r13)
movl 0x5891(%rip), %eax      # 0xa724
movl %eax, -0x4(%r13)
movl $0xffffffff, (%r13)     # imm = 0xFFFFFFFF
movsd -0x50(%rbp), %xmm1
movsd %xmm1, (%r12,%rbx,8)
addsd %xmm1, %xmm0
incq %rbx
movslq 0x4280(%rip), %rax      # 0x9138
addq $0x14, %r13
cmpq %rax, %rbx
jl 0x4e03
movq -0x48(%rbp), %r15
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
leaq 0x1414(%rip), %rdi      # 0x62ef
movb $0x1, %al
callq 0x1030
cmpl $0x0, 0x424f(%rip)      # 0x9138
movq -0x60(%rbp), %r13
movq -0x68(%rbp), %r12
jle 0x4f34
addq $0xc, %r13
xorl %r14d, %r14d
leaq 0x1405(%rip), %rbx      # 0x6306
movl -0x4(%r13), %esi
movl (%r13), %edx
movl -0xc(%r13), %ecx
movl -0x8(%r13), %r8d
movsd (%r12,%r14,8), %xmm0
movq %rbx, %rdi
movb $0x1, %al
callq 0x1030
incq %r14
movslq 0x420d(%rip), %rax      # 0x9138
addq $0x14, %r13
cmpq %rax, %r14
jl 0x4f01
cmpl $0x0, 0x41f5(%rip)      # 0x9130
movq -0x38(%rbp), %r12
jne 0x4f9d
callq 0x402e
movl %eax, %ebx
callq 0x1090
movq %rax, %r14
movq %r12, %rdi
movq %r15, %rsi
movq -0x58(%rbp), %rdx
movl %ebx, %ecx
callq 0x3cfa
callq 0x1090
subq %r14, %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
divsd 0x10b7(%rip), %xmm0     # 0x6030
mulsd 0x10b7(%rip), %xmm0     # 0x6038
movl 0x5769(%rip), %edx      # 0xa6f0
movl 0x575f(%rip), %ecx      # 0xa6ec
leaq 0x1225(%rip), %rdi      # 0x61b9
movl %ebx, %esi
movb $0x1, %al
callq 0x1030
movq 0x5774(%rip), %rdi      # 0xa718
callq 0x1140
movq %r12, %rdi
callq 0x1140
movq %r15, %rdi
callq 0x1140
movq -0x58(%rbp), %rdi
callq 0x1140
movq -0x78(%rbp), %rsp
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop