// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, -0x8(%rsp)
movq %rdx, -0x10(%rsp)
cmpl $-0x1, %r9d
je 0x174a
movslq %r9d, %r12
movq -0x8(%rsp), %rax
movl (%rax,%r12,4), %ecx
movslq (%r8), %rbx
movl 0x4(%rsi,%rbx,4), %r15d
movl %r15d, %r14d
subl (%rsi,%rbx,4), %r14d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %ecx, %r14d
jl 0x174c
xorl %ebp, %ebp
cmpl $0x2, %r9d
jl 0x1653
leal -0x1(%r9), %r11d
leaq 0x9051(%rip), %rdx      # 0xa6a0
movl (%rdx,%r11,4), %ebp
testl %ecx, %ecx
jle 0x1694
movq -0x10(%rsp), %rdx
movl (%rdx,%r12,4), %r12d
movq 0x90a9(%rip), %r13      # 0xa710
decl %r12d
decl %r15d
movq %rcx, %r11
movslq %r15d, %r10
movl (%rdi,%r10,4), %r10d
addl %ebp, %r10d
leal (%r12,%r11), %edx
movslq %edx, %rdx
cmpl (%r13,%rdx,4), %r10d
jne 0x174c
decl %r15d
decq %r11
jne 0x1670
testl %r9d, %r9d
je 0x174a
cmpl %r14d, %ecx
jne 0x16cc
movslq 0x4(%r8), %rax
testq %rax, %rax
js 0x1757
movslq 0x4(%rsi,%rax,4), %rdx
movl -0x4(%rdi,%rdx,4), %edx
addl %ebp, %edx
movl %edx, (%r8)
movslq 0x4(%rsi,%rax,4), %rax
movl -0x8(%rdi,%rax,4), %eax
addl %ebp, %eax
movl %eax, 0x4(%r8)
leal 0x1(%rcx), %eax
movl 0x4(%rsi,%rbx,4), %edx
subl (%rsi,%rbx,4), %edx
cmpl %edx, %eax
jne 0x170f
movslq 0x4(%r8), %r11
testq %r11, %r11
js 0x16f2
movslq 0x4(%rsi,%r11,4), %rdx
movl -0x4(%rdi,%rdx,4), %r11d
addl %ebp, %r11d
jmp 0x16f8
movl $0xffffffff, %r11d      # imm = 0xFFFFFFFF
movl %r11d, 0x4(%r8)
movl %ecx, %edx
notl %edx
addl 0x4(%rsi,%rbx,4), %edx
movslq %edx, %rdx
movl (%rdi,%rdx,4), %edx
addl %ebp, %edx
movl %edx, (%r8)
movl 0x4(%rsi,%rbx,4), %r11d
movl %r11d, %edx
subl (%rsi,%rbx,4), %edx
cmpl %edx, %eax
jge 0x1742
movl %ecx, %eax
notl %eax
addl %eax, %r11d
movslq %r11d, %rax
movl (%rdi,%rax,4), %eax
addl %ebp, %eax
movl %eax, (%r8)
movl 0x4(%rsi,%rbx,4), %eax
subl %ecx, %eax
addl $-0x2, %eax
cltq
addl (%rdi,%rax,4), %ebp
movl %ebp, 0x4(%r8)
decl %r9d
jmp 0x1609
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
decl %r9d
movl %r9d, %eax
jmp 0x174c