// File: /workspace/github_cpp_makefile_star2_O1/TooruAkagi[P]GCIS_Index/gcis_uni_locate.cpp
// Function: rpsck(int*, int*, int*, int*, int)
int rpsck(int *m,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];
    std::vector<int> x;
    xdisp(x,l);
    if(x.size()<mlen){
        if(DEBUGFLAG==1){printf("\n長さにより左が確実に不一致");}
        return -1;}
    int rofs=0;if(round>1){rofs=dc2s[round-1];}
    for(i = 0;i<mlen;i++){
        if(x[x.size()-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)",x[x.size()-1-i]+rofs,rofs);}
    }
    //printf("[正解]");
    if(round==0){return 0;}
    //printf("<状況チェック%d-%d>",mlen,D_2[l+1]-D_2[l]);
    if(mlen ==x.size()){
        //printf("ゲート1");
        if(e2[1]<0){/*printf("<round %d>まで一致",round-1);*/return round-1;}
        n2 = e2[1];
        std::vector<int> x2;
        xdisp(x2,n2);
        e2[0] = rofs+x2[x2.size()-1];
        e2[1] = rofs+x2[x2.size()-2];
    } //e2[1]の左側2つ
    if(mlen+1==x.size()){
        //printf("ゲート2");
        if(e2[1]<0){e2[1]=-1;}
        else{
            n2 = e2[1];
            std::vector<int> x2;
            xdisp(x2,n2);
            e2[1] = rofs+x2[x2.size()-1];} //e2があるなら定義，なければ-1
        e2[0] = rofs+x[x.size()-1-mlen];
    } //e2[0]の左端とe2[1]の右側2つ
    if(mlen+1<x.size()){
        //printf("ゲート3");
        e2[0] = rofs+x[x.size()-1-mlen];
        e2[1] = rofs+x[x.size()-2-mlen];
    } //e2[0]のさらに左側2つ
    //printf("next e2[%d,%d(+%d)] =>",e2[0],e2[1],rofs);
    return rpsck(m,Ls,B1,e2,round-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
cmpl $-0x1, %r8d
je 0x2ff7
movl %r8d, %ebx
movq %rdx, %r12
movq %rdi, %r13
movslq %r8d, %rax
movq %rsi, 0x48(%rsp)
movl (%rsi,%rax,4), %r14d
movl (%rdx,%rax,4), %r15d
movq %rcx, 0x50(%rsp)
movl (%rcx), %esi
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x2e23
movslq %r15d, %r8
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %rdx
subq %rcx, %rdx
movq %rdx, %rax
sarq $0x2, %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %r8, %rax
jb 0x3075
movq %r12, 0x40(%rsp)
xorl %r12d, %r12d
cmpl $0x2, %ebx
jl 0x2efb
leal -0x1(%rbx), %esi
leaq 0x83e9(%rip), %rdi      # 0xb2e0
movl (%rdi,%rsi,4), %r12d
testl %r15d, %r15d
jle 0x2f2d
addq %rdx, %rcx
addl %r8d, %r14d
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movslq %edx, %rsi
movl (%rcx,%rsi,4), %esi
addl %r12d, %esi
leal (%r14,%rdx), %edi
movslq %edi, %rdi
cmpl (%r13,%rdi,4), %esi
jne 0x3075
decl %edx
decq %r15
jne 0x2f0b
testl %ebx, %ebx
je 0x2ffe
cmpq %r8, %rax
movq 0x50(%rsp), %r15
jne 0x2f95
movl 0x4(%r15), %esi
testl %esi, %esi
js 0x3002
movq %r8, %r14
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x2e23
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movl -0x4(%rax), %ecx
addl %r12d, %ecx
movl %ecx, (%r15)
movl -0x8(%rax), %eax
addl %r12d, %eax
movl %eax, 0x4(%r15)
testq %rdi, %rdi
je 0x2f92
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movq %r14, %r8
leaq 0x1(%r8), %r14
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
sarq $0x2, %rax
cmpq %r14, %rax
jne 0x3024
movl 0x4(%r15), %esi
testl %esi, %esi
js 0x3008
movq %r8, %rbp
xorps %xmm0, %xmm0
movq %rsp, %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x2e23
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
movl -0x4(%rax), %eax
addl %r12d, %eax
movl %eax, 0x4(%r15)
testq %rdi, %rdi
je 0x2ff2
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movq %rbp, %r8
jmp 0x3010
xorl %ebp, %ebp
jmp 0x308c
xorl %ebp, %ebp
jmp 0x3075
decl %ebx
movl %ebx, %ebp
jmp 0x3075
movl $0xffffffff, 0x4(%r15)  # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rax
movq %r8, %rcx
notq %rcx
movl (%rax,%rcx,4), %eax
addl %r12d, %eax
movl %eax, (%r15)
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rdx
subq %rax, %rdx
movq %rdx, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
movq 0x48(%rsp), %rsi
jbe 0x305e
subq %r8, %rcx
notq %r8
addq %rax, %rdx
movl (%rdx,%r8,4), %edx
addl %r12d, %edx
movl %edx, (%r15)
addl -0x8(%rax,%rcx,4), %r12d
movl %r12d, 0x4(%r15)
decl %ebx
movq %r13, %rdi
movq 0x40(%rsp), %rdx
movq %r15, %rcx
movl %ebx, %r8d
callq 0x2e6b
movl %eax, %ebp
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x308c
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x309f
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x30bf
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
jmp 0x30bf
jmp 0x30bc
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x30d6
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2220