// File: TooruAkagi[P]GCIS_Index/gcis_nep_locate.cpp
// Function: rpsck(unsigned int*, int*, int*, int*, int*, int)
int rpsck(unsigned int *D,int *D_2,int *Ls,int *B1,int *e2,int round){
    //不一致があれば-1を，round x まで合っていればxを返す．
    if(DEBUGFLAG==1){printf("\nrpsck / [round %d]",round);}
    if(round==-1){return 0;}
    int starti = Ls[round];
    int mlen = B1[round];
    int i = 0;int n2;
    int l = e2[0];
    if(D_2[l+1]-D_2[l]<mlen){
        if(DEBUGFLAG==1){printf("\n長さにより左が確実に不一致");}
        return -1;}
    if(DEBUGFLAG==1){
        printf("open -> [%d] :",l);
        printf("Debug[%d文字,%d / %d/%d]",D_2[l+1]-D_2[l],mlen,starti+mlen-1-i,D_2[l+1]-1-i);
    }
    int rofs=0;if(round>1){rofs=dc2s[round-1];}
    for(i = 0;i<mlen;i++){
        if(D[D_2[l+1]-1-i]+rofs!=m[starti+mlen-1-i]){
            //printf("\n[round %d で 左不一致 %d != %d]",round,D[D_2[l+1]-1-i]+rofs,m[starti+mlen-1-i]);
            return -1;
        }
        if(DEBUGFLAG==1){printf("\nrhit%d(%d)",D[D_2[l+1]-1-i]+rofs,rofs);}
    }
    //printf("[正解]");
    if(round==0){return 0;}
    //printf("<状況チェック%d-%d>",mlen,D_2[l+1]-D_2[l]);
    if(mlen ==D_2[l+1]-D_2[l]){
        //printf("ゲート1");
        if(e2[1]<0){/*printf("<round %d>まで一致",round-1);*/return round-1;}
        n2 = e2[1];
        e2[0] = rofs+D[D_2[n2+1]-1];
        e2[1] = rofs+D[D_2[n2+1]-2];
    } //e2[1]の左側2つ
    if(mlen+1==D_2[l+1]-D_2[l]){
        //printf("ゲート2");
        if(e2[1]<0){e2[1]=-1;}
        else{
            n2 = e2[1];
            e2[1] = rofs+D[D_2[n2+1]-1];} //e2があるなら定義，なければ-1
        e2[0] = rofs+D[D_2[l+1]-1-mlen];
    } //e2[0]の左端とe2[1]の右側2つ
    if(mlen+1<D_2[l+1]-D_2[l]){
        //printf("ゲート3");
        e2[0] = rofs+D[D_2[l+1]-1-mlen];
        e2[1] = rofs+D[D_2[l+1]-2-mlen];
    } //e2[0]のさらに左側2つ
    //printf("next e2[%d,%d(+%d)] =>",e2[0],e2[1],rofs);
    return rpsck(D,D_2,Ls,B1,e2,round-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
cmpl $-0x1, -0x34(%rbp)
jne 0x2812
movl $0x0, -0x4(%rbp)
jmp 0x2ac8
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movl -0x48(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movq -0x18(%rbp), %rcx
movslq -0x48(%rbp), %rdx
subl (%rcx,%rdx,4), %eax
cmpl -0x3c(%rbp), %eax
jge 0x286a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2ac8
movl $0x0, -0x4c(%rbp)
cmpl $0x1, -0x34(%rbp)
jle 0x288d
movl -0x34(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xae29(%rip), %rax      # 0xd6b0
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x28f3
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movl -0x48(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
subl $0x1, %ecx
subl -0x40(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
addl -0x4c(%rbp), %eax
movq 0xae5a(%rip), %rcx      # 0xd720
movl -0x38(%rbp), %edx
addl -0x3c(%rbp), %edx
subl $0x1, %edx
subl -0x40(%rbp), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
je 0x28e6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2ac8
jmp 0x28e8
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x2894
cmpl $0x0, -0x34(%rbp)
jne 0x2905
movl $0x0, -0x4(%rbp)
jmp 0x2ac8
movl -0x3c(%rbp), %eax
movq -0x18(%rbp), %rcx
movl -0x48(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
movq -0x18(%rbp), %rdx
movslq -0x48(%rbp), %rsi
subl (%rdx,%rsi,4), %ecx
cmpl %ecx, %eax
jne 0x2996
movq -0x30(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jge 0x293f
movl -0x34(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x2ac8
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x44(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdx
movl -0x44(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movl (%rdx,%rsi,4), %edx
subl $0x1, %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x4c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdx
movl -0x44(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movl (%rdx,%rsi,4), %edx
subl $0x2, %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movq -0x18(%rbp), %rcx
movl -0x48(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
movq -0x18(%rbp), %rdx
movslq -0x48(%rbp), %rsi
subl (%rdx,%rsi,4), %ecx
cmpl %ecx, %eax
jne 0x2a2c
movq -0x30(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jge 0x29d2
movq -0x30(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
jmp 0x2a03
movq -0x30(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x44(%rbp)
movl -0x4c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdx
movl -0x44(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movl (%rdx,%rsi,4), %edx
subl $0x1, %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x4c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdx
movl -0x48(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movl (%rdx,%rsi,4), %edx
subl $0x1, %edx
subl -0x3c(%rbp), %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movq -0x18(%rbp), %rcx
movl -0x48(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
movq -0x18(%rbp), %rdx
movslq -0x48(%rbp), %rsi
subl (%rdx,%rsi,4), %ecx
cmpl %ecx, %eax
jge 0x2aa4
movl -0x4c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdx
movl -0x48(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movl (%rdx,%rsi,4), %edx
subl $0x1, %edx
subl -0x3c(%rbp), %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x4c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdx
movl -0x48(%rbp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movl (%rdx,%rsi,4), %edx
subl $0x2, %edx
subl -0x3c(%rbp), %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
subl $0x1, %r9d
callq 0x27e0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)