// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_uni_build.cpp
// Function: main
int main(int argc, char *argv[]){
    int onhelp = 0;
    for(int i = 0;i<argc;i++){
    //printf("[%d : %s]",i,argv[i]);
    if('-'==argv[i][0]){ //符号
        if('i'==argv[i][1]){ //input
            int k = strlen(argv[i+1]);
            printf("<<%d,%d,%d>>",k,sizeof(argv[i+1]),sizeof(argv[i+1][0]));
            fname = (char*)malloc(k);
            for(int k2=0;k2<k;k2++){fname[k2]=argv[i+1][k2];}
        }
        if('o'==argv[i][1]){ //output
            int k = strlen(argv[i+1]);
            wname = (char*)malloc(k);
            for(int k2=0;k2<k;k2++){wname[k2]=argv[i+1][k2];}
        }
        if('h'==argv[i][1]){shelp();return 0;} //help
        i++;
        continue;
    }
  }
  if(fname==NULL){
    int k = strlen(defaultfname);
    fname = (char*)malloc(k);
    for(int k2=0;k2<k;k2++){fname[k2]=defaultfname[k2];}
  }
  if(wname==NULL){
    int k = strlen(defaultwname);
    wname = (char*)malloc(k);
    for(int k2=0;k2<k;k2++){wname[k2]=defaultwname[k2];}
  }
    FILE *fp;
    unsigned int *D;
    int *D_2;
    int i = 0;int round = 0;dcs[0] = 0;dc2s[0] = 0; 
    unsigned char chr;
    unsigned int a;
    fp = fopen(fname, "r");
    int flag = 0; //0:loops,1:dcs,2:dc2s,3:D,4:D_2,5:D3,6:NS
    int w = 1;
    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(flag == 9){printf("\n[%d]:%u",flag,a);exit(1);}
        if(flag==7){NS[w]=a;w++;if(w==Sizelist[0]){flag++;printf("\n-finishing load index-\n");}}
        if(flag==6){Sizelist[0]=a;NS = (unsigned int*)malloc(4*Sizelist[0]);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);
    for(int o = loops-1;o>=0;o--){exceptr[o]=-1;}
    Sizelist[1] = dc2s[loops];Sizelist[2] = dc2s[loops];
    for(int yj = 0;yj<dc2s[loops];yj++){
        if(D_3[yj]>255){Sizelist[1] = yj;break;}
    }
    for(int yj = Sizelist[1];yj<dc2s[loops];yj++){
        if(D_3[yj]>65535){Sizelist[2] = yj;break;}
    }
    D_3s = (unsigned char*)malloc(Sizelist[1]);
    D_3m = (unsigned short int*)malloc((Sizelist[2]-Sizelist[1])*2);
    for(int yj = 0;yj<Sizelist[1];yj++){D_3s[yj] = D_3[yj];}
    for(int yj = 0;yj<Sizelist[2]-Sizelist[1];yj++){D_3m[yj] = D_3[yj+Sizelist[1]];}
    //D_3をサイズごとに分割して保存している
    int roid;
    int totalsps = 0;
    int maxl = dc2s[loops];
    int *tx;
    tx = (int*)malloc((maxl+1)*4); //D_2の置き換え配列
    k = (bool*)malloc(Sizelist[7]); //最初に十分な領域を割り当てる.
    k3 = (bool*)malloc(Sizelist[8]);
    for(i=0;i<maxl;i++){
        //if(i==(maxl-5)){printf("[%d]まではOK(%d)",i,kad);} //Sizelist[7]を大きくするとセグフォしなくなります
        tx[i] = kad;
        roid=dmlen(i,D,D_2);
        diff(D,D_2[i],D_2[i+1]-D_2[i]);
        logg(roid,k); //1--反転なし:2--roid番目から文字が反転
        blogg(i,D,D_2,k);
    } //ガンマ符号
    tx[maxl] = kad;
    //printf("\n[D]配列サイズ : %d[%d bytes] / [D_2] = %d[%d bytes]\n",kad,kad/8,maxl,maxl*4);
    Sizelist[7] = kad;
    totalsps += kad/8; //符号化したD
    fano0(D,D_2,k3); //fの先頭の文字のコーディングをする．kadが消えるので，再生すること．
    //printf("[D1]:%d[%d bytes]\n",kad2,kad2/8);
    Sizelist[8] = kad2;
    totalsps += kad2/8; //符号化したD[先頭]
    free(D);
    for(i=0;i<=maxl;i++){D_2[i]=tx[i];} //作ったtxをD_2に差し替えるs
    free(tx);
    for(int o = 0;o<loops;o++){printf("\n%d[%d]",o,exceptr[o]);}
    int newn = kad2;
    //int t2=newn/lpurse;int t3=newn/spurse;
    Sizelist[3] = newn/lpurse + 1;Sizelist[4] =newn/spurse + 2;
    k3sub = (int*)malloc(Sizelist[3]*4);
    k3sub2 = (unsigned short int*)malloc(Sizelist[4]*2);
    
    totalsps += rsbuild(k3,k3sub,k3sub2,Sizelist[3]-1,newn);
    totalsps += Sizelist[0]*4 + dc2s[loops]*4; //NF && D
    d2under = (bool*)malloc((maxl+1)*6);
    d2top = (bool*)malloc(maxl+1+D_2[maxl]/64);
    printf("\n[[%d]]",maxl+1+D_2[maxl]/64);
    totalsps += fano(D_2,0,maxl+1,6,d2under,d2top);
    newn = kad2;
    //t2=newn/lpurse;t3=newn/spurse;
    Sizelist[5] = newn/lpurse + 1;Sizelist[6] =newn/spurse + 1;
    d2topsub = (int*)malloc(Sizelist[5]*4);
    d2topsub2 = (unsigned short int*)malloc(Sizelist[6]*2);
    totalsps += rsbuild(d2top,d2topsub,d2topsub2,Sizelist[5]-1,newn);
    printf("\nsps : %d byte(%d,%d)",totalsps,Sizelist[7],Sizelist[8]);
    write74();

    printf("codeindex is generated\n");
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movl %edi, %ebp
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpl %ebp, %r15d
jge 0x22a9
movslq %r15d, %r12
movq (%rbx,%r12,8), %rax
cmpb $0x2d, (%rax)
jne 0x22a1
movb 0x1(%rax), %al
cmpb $0x69, %al
jne 0x224a
movq 0x8(%rbx,%r12,8), %rdi
callq 0x1060
movq %rax, %r13
leaq 0xeca(%rip), %rdi       # 0x30c6
movl %r13d, %esi
pushq $0x8
popq %rdx
pushq $0x1
popq %rcx
xorl %eax, %eax
callq 0x1030
movslq %r13d, %r13
movq %r13, %rdi
callq 0x1110
movq %rax, 0x2f7a(%rip)      # 0x5198
testl %r13d, %r13d
cmovlel %r14d, %r13d
xorl %eax, %eax
cmpq %rax, %r13
je 0x2243
movq 0x8(%rbx,%r12,8), %rcx
movb (%rcx,%rax), %cl
movq 0x2f5d(%rip), %rdx      # 0x5198
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x2227
movq (%rbx,%r12,8), %rax
movb 0x1(%rax), %al
cmpb $0x6f, %al
jne 0x2296
movq 0x8(%rbx,%r12,8), %rdi
callq 0x1060
movslq %eax, %r13
movq %r13, %rdi
callq 0x1110
movq %rax, 0x2f36(%rip)      # 0x51a0
testl %r13d, %r13d
cmovlel %r14d, %r13d
xorl %eax, %eax
cmpq %rax, %r13
je 0x228f
movq 0x8(%rbx,%r12,8), %rcx
movb (%rcx,%rax), %cl
movq 0x2f19(%rip), %rdx      # 0x51a0
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x2273
movq (%rbx,%r12,8), %rax
movb 0x1(%rax), %al
cmpb $0x68, %al
je 0x2999
incl %r15d
incl %r15d
jmp 0x21c8
cmpq $0x0, 0x2ee7(%rip)      # 0x5198
je 0x29af
cmpq $0x0, 0x2ee1(%rip)      # 0x51a0
je 0x29f4
andl $0x0, 0x2ef4(%rip)      # 0x51c0
andl $0x0, 0x2f3d(%rip)      # 0x5210
movq 0x2ebe(%rip), %rdi      # 0x5198
leaq 0xdc4(%rip), %rsi       # 0x30a5
callq 0x10d0
movq %rax, 0x20(%rsp)
pushq $0x1
popq %rcx
xorl %r14d, %r14d
movl %ecx, %eax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rbx
cmpl $0x7, %r14d
ja 0x254c
movq %rbx, %rdi
leaq 0xdc2(%rip), %rbp       # 0x30d3
movq %rbp, %rsi
leaq 0xf(%rsp), %r15
movq %r15, %rdx
xorl %eax, %eax
callq 0x1190
movzbl 0xf(%rsp), %eax
movl %eax, 0x30(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1190
movzbl 0xf(%rsp), %r12d
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1190
movzbl 0xf(%rsp), %r13d
movq %rbx, %rdi
movq %rbp, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x1190
cmpl $0x7, %r14d
ja 0x22fd
shll $0x8, %r12d
addl 0x30(%rsp), %r12d
shll $0x10, %r13d
orl %r12d, %r13d
movzbl 0xf(%rsp), %edi
shll $0x18, %edi
orl %r13d, %edi
movl %r14d, %eax
leaq 0xc71(%rip), %rdx       # 0x3004
movslq (%rdx,%rax,4), %rcx
addq %rdx, %rcx
movq 0x10(%rsp), %rdx
movslq %edx, %rax
jmpq *%rcx
movl %edi, 0x2d82(%rip)      # 0x512c
pushq $0x1
popq %r14
jmp 0x22fd
movq 0x18(%rsp), %rcx
movl %edi, (%rcx,%rax,4)
movslq 0x2d6a(%rip), %rax      # 0x512c
xorl %r14d, %r14d
leaq 0x2e44(%rip), %rcx      # 0x5210
cmpl (%rcx,%rax,4), %edx
leal 0x1(%rdx), %eax
sete %r14b
movl $0x0, %ecx
cmovel %ecx, %eax
orl $0x4, %r14d
jmp 0x24ca
leaq 0x2e22(%rip), %rcx      # 0x5210
movl %edi, (%rcx,%rax,4)
cmpl 0x2d35(%rip), %edx      # 0x512c
jne 0x252c
leal 0x4(,%rdi,4), %ebp
movq %rbp, %rdi
callq 0x1110
movq %rax, 0x18(%rsp)
movq %rbp, %rdi
callq 0x1110
movq %rax, 0x2f68(%rip)      # 0x5388
movq $0x0, 0x10(%rsp)
pushq $0x3
popq %r14
jmp 0x22fd
movq 0x28(%rsp), %rcx
movl %edi, (%rcx,%rax,4)
incl %edx
movslq 0x2ce9(%rip), %rax      # 0x512c
xorl %r14d, %r14d
leaq 0x2d73(%rip), %rcx      # 0x51c0
cmpl (%rcx,%rax,4), %edx
sete %r14b
movl $0x0, %eax
cmovel %eax, %edx
movq %rdx, 0x10(%rsp)
addl $0x3, %r14d
jmp 0x22fd
movq 0x2ee7(%rip), %rcx      # 0x5358
movl %edi, (%rcx,%rax,4)
incl %edx
pushq $0x7
popq %r14
movq %rdx, 0x10(%rsp)
cmpl 0x2cbb(%rip), %edx      # 0x5140
jne 0x22fd
leaq 0xe5a(%rip), %rdi       # 0x32ec
callq 0x1150
pushq $0x8
popq %r14
jmp 0x22fd
leaq 0x2d19(%rip), %rcx      # 0x51c0
movl %edi, (%rcx,%rax,4)
cmpl 0x2c7c(%rip), %eax      # 0x512c
jne 0x253c
shll $0x2, %edi
callq 0x1110
movq %rax, 0x28(%rsp)
pushq $0x2
popq %r14
pushq $0x1
popq %rax
movq %rax, 0x10(%rsp)
jmp 0x22fd
movq 0x2ead(%rip), %rcx      # 0x5388
movl %edi, (%rcx,%rax,4)
incl %edx
movslq 0x2c45(%rip), %rax      # 0x512c
xorl %r14d, %r14d
leaq 0x2d1f(%rip), %rcx      # 0x5210
cmpl (%rcx,%rax,4), %edx
sete %r14b
movl $0x0, %eax
cmovel %eax, %edx
movq %rdx, 0x10(%rsp)
addl $0x5, %r14d
jmp 0x22fd
movl %edi, 0x2c2c(%rip)      # 0x5140
shll $0x2, %edi
callq 0x1110
movq %rax, 0x2e35(%rip)      # 0x5358
pushq $0x7
popq %r14
jmp 0x22fd
incl %edx
movq %rdx, 0x10(%rsp)
pushq $0x2
popq %r14
jmp 0x22fd
incl %edx
movq %rdx, 0x10(%rsp)
pushq $0x1
popq %r14
jmp 0x22fd
movq 0x20(%rsp), %rdi
callq 0x10c0
movl 0x2bd0(%rip), %eax      # 0x512c
leaq 0x2d9d(%rip), %rdx      # 0x5300
movq %rax, %rcx
testl %ecx, %ecx
jle 0x2574
orl $-0x1, -0x4(%rdx,%rcx,4)
decq %rcx
jmp 0x2566
cltq
leaq 0x2c93(%rip), %rcx      # 0x5210
movl (%rcx,%rax,4), %ebp
movslq %ebp, %rax
movl %eax, 0x2bbb(%rip)      # 0x5144
movl %eax, 0x2bb9(%rip)      # 0x5148
movq 0x2df2(%rip), %rcx      # 0x5388
xorl %r12d, %r12d
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
cmpq %r12, %rdx
je 0x25b7
cmpl $0x100, (%rcx,%r12,4)   # imm = 0x100
jge 0x25bc
incq %r12
jmp 0x25a3
movl %ebp, %r12d
jmp 0x25c3
movl %r12d, 0x2b81(%rip)     # 0x5144
movslq %r12d, %r15
movq %r15, %rdx
cmpq %rax, %rdx
jge 0x25e4
cmpl $0x10000, (%rcx,%rdx,4) # imm = 0x10000
jge 0x25dc
incq %rdx
jmp 0x25c9
movl %edx, 0x2b66(%rip)      # 0x5148
movl %edx, %ebp
movq %r15, %rdi
callq 0x1110
movq %rax, 0x2d9d(%rip)      # 0x5390
subl %r15d, %ebp
addl %ebp, %ebp
movslq %ebp, %rdi
callq 0x1110
movq %rax, 0x2d69(%rip)      # 0x5370
xorl %ecx, %ecx
movslq %r12d, %rax
cmpq %rax, %rcx
jge 0x2631
movq 0x2d70(%rip), %rax      # 0x5388
movb (%rax,%rcx,4), %al
movq 0x2d6e(%rip), %rdx      # 0x5390
movb %al, (%rdx,%rcx)
incq %rcx
movl 0x2b15(%rip), %r12d     # 0x5144
jmp 0x2609
movl 0x2b11(%rip), %ecx      # 0x5148
subl %eax, %ecx
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
movq 0x2d29(%rip), %rsi      # 0x5370
shlq $0x2, %rax
addq 0x2d36(%rip), %rax      # 0x5388
cmpq %rdx, %rcx
je 0x2664
movzwl (%rax,%rdx,4), %edi
movw %di, (%rsi,%rdx,2)
incq %rdx
jmp 0x2652
movslq 0x2ac1(%rip), %rax      # 0x512c
leaq 0x2b9e(%rip), %rcx      # 0x5210
movslq (%rcx,%rax,4), %rbx
leaq 0x1(%rbx), %rax
movq %rax, 0x20(%rsp)
leaq 0x4(,%rbx,4), %rdi
callq 0x1110
movq %rax, %r12
movslq 0x2ac6(%rip), %rdi      # 0x515c
callq 0x1110
movq %rax, 0x2cf6(%rip)      # 0x5398
movslq 0x2ab7(%rip), %rdi      # 0x5160
callq 0x1110
movq %rax, 0x2ceb(%rip)      # 0x53a0
xorl %r13d, %r13d
testl %ebx, %ebx
movl $0x0, %eax
movq %rbx, 0x10(%rsp)
cmovgl %ebx, %eax
movq %rax, 0x30(%rsp)
movq 0x28(%rsp), %rbx
movq 0x18(%rsp), %r14
movl 0x2acf(%rip), %r15d     # 0x51ac
cmpq %r13, 0x30(%rsp)
je 0x2737
movl %r15d, (%r12,%r13,4)
movl %r13d, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1682
movl %eax, %ebp
leaq 0x1(%r13), %r15
movl (%r14,%r13,4), %esi
movl 0x4(%r14,%r13,4), %edx
subl %esi, %edx
movq %rbx, %rdi
callq 0x149b
movq 0x2c82(%rip), %rsi      # 0x5398
movl %ebp, %edi
callq 0x1400
movq 0x2c74(%rip), %rcx      # 0x5398
movl %r13d, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x145b
movq %r15, %r13
jmp 0x26d6
movq 0x10(%rsp), %r13
movl %r15d, (%r12,%r13,4)
movl %r15d, 0x2a15(%rip)     # 0x515c
movq 0x2c52(%rip), %rdx      # 0x53a0
movq 0x28(%rsp), %r14
movq %r14, %rdi
movq 0x18(%rsp), %rsi
callq 0x15cf
movl 0x2a4a(%rip), %eax      # 0x51b0
movl %eax, 0x29f4(%rip)      # 0x5160
pushq $0x8
popq %rbx
cltd
idivl %ebx
movl %eax, %ebp
movq %r14, %rdi
callq 0x10e0
xorl %eax, %eax
movq 0x18(%rsp), %rdx
cmpq %r13, %rax
jg 0x2794
movl (%r12,%rax,4), %ecx
movl %ecx, (%rdx,%rax,4)
incq %rax
jmp 0x2783
movl %r15d, %eax
cltd
idivl %ebx
movl %eax, %r13d
movq %r12, %rdi
callq 0x10e0
leaq 0x92a(%rip), %r15       # 0x30d6
xorl %r12d, %r12d
leaq 0x2b4a(%rip), %rbx      # 0x5300
movslq 0x296f(%rip), %rax      # 0x512c
cmpq %rax, %r12
jge 0x27da
movl (%rbx), %edx
movq %r15, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x1030
incq %r12
addq $0x4, %rbx
jmp 0x27b6
addl %r13d, %ebp
movl 0x29cc(%rip), %r14d     # 0x51b0
movl %r14d, %eax
cltd
idivl 0x2942(%rip)            # 0x5130
movl %eax, %r15d
leal 0x1(%r15), %eax
movl %eax, 0x2951(%rip)      # 0x514c
movl %r14d, %eax
cltd
idivl 0x292f(%rip)            # 0x5134
movl %eax, %r12d
leal 0x2(%r12), %eax
movl %eax, 0x293d(%rip)      # 0x5150
leal 0x4(,%r15,4), %eax
movslq %eax, %rdi
callq 0x1110
movq %rax, %r13
movq %rax, 0x2b53(%rip)      # 0x5380
leal 0x4(,%r12,2), %eax
movslq %eax, %rdi
callq 0x1110
movq %rax, 0x2b24(%rip)      # 0x5368
movq 0x2b55(%rip), %rdi      # 0x53a0
movq %r13, %rsi
movq %rax, %rdx
movl %r15d, %ecx
movl %r14d, %r8d
callq 0x1bd5
movslq 0x28c9(%rip), %rcx      # 0x512c
leaq 0x29a6(%rip), %rdx      # 0x5210
movl (%rdx,%rcx,4), %ecx
addl 0x28cd(%rip), %ecx      # 0x5140
addl %ebp, %eax
leal (%rax,%rcx,4), %r13d
movq 0x20(%rsp), %r15
imull $0x6, %r15d, %eax
movslq %eax, %rdi
callq 0x1110
movq %rax, 0x2b17(%rip)      # 0x53a8
movq 0x18(%rsp), %rbx
movq 0x10(%rsp), %rax
movl (%rbx,%rax,4), %eax
pushq $0x40
popq %rcx
cltd
idivl %ecx
addl %r15d, %eax
movslq %eax, %r14
movq %r14, %rdi
callq 0x1110
movq %rax, 0x2af7(%rip)      # 0x53b0
leaq 0x81e(%rip), %rdi       # 0x30de
movl %r14d, %esi
xorl %eax, %eax
callq 0x1030
movq 0x2ad7(%rip), %r8       # 0x53a8
movq 0x2ad8(%rip), %r9       # 0x53b0
pushq $0x6
popq %rcx
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x151b
movl %eax, %ebx
movl 0x28c0(%rip), %ebp      # 0x51b0
movl %ebp, %eax
cltd
idivl 0x2837(%rip)            # 0x5130
movl %eax, %r14d
leal 0x1(%r14), %eax
movl %eax, 0x284e(%rip)      # 0x5154
movl %ebp, %eax
cltd
idivl 0x2825(%rip)            # 0x5134
movl %eax, %r15d
leal 0x1(%r15), %eax
movl %eax, 0x283c(%rip)      # 0x5158
leal 0x4(,%r14,4), %eax
movslq %eax, %rdi
callq 0x1110
movq %rax, %r12
movq %rax, 0x2a42(%rip)      # 0x5378
leal 0x2(,%r15,2), %eax
movslq %eax, %rdi
callq 0x1110
movq %rax, 0x2a13(%rip)      # 0x5360
movq 0x2a5c(%rip), %rdi      # 0x53b0
movq %r12, %rsi
movq %rax, %rdx
movl %r14d, %ecx
movl %ebp, %r8d
callq 0x1bd5
addl %eax, %ebx
addl %r13d, %ebx
movl 0x27ec(%rip), %edx      # 0x515c
movl 0x27ea(%rip), %ecx      # 0x5160
leaq 0x769(%rip), %rdi       # 0x30e6
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
callq 0x1f08
leaq 0x943(%rip), %rdi       # 0x32d5
callq 0x1150
jmp 0x299e
callq 0x212d
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x273a(%rip), %rbx      # 0x50f0
movq %rbx, %rdi
callq 0x1060
movslq %eax, %r14
movq %r14, %rdi
callq 0x1110
movq %rax, 0x27c8(%rip)      # 0x5198
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
cmpq %rax, %r14
je 0x22b7
movb (%rax,%rbx), %cl
movq 0x27ac(%rip), %rdx      # 0x5198
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x29d9
leaq 0x26fb(%rip), %rbx      # 0x50f6
movq %rbx, %rdi
callq 0x1060
movslq %eax, %r14
movq %r14, %rdi
callq 0x1110
movq %rax, 0x278b(%rip)      # 0x51a0
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
cmpq %rax, %r14
je 0x22c5
movb (%rax,%rbx), %cl
movq 0x276f(%rip), %rdx      # 0x51a0
movb %cl, (%rdx,%rax)
incq %rax
jmp 0x2a1e
nop