// File: /workspace/github_cpp_makefile_star2_O2/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 $0x68, %rsp
cmpl $-0x1, %r8d
je 0x2cd6
movl %r8d, %ebx
movq %rcx, %r12
movq %rdx, %rbp
movq %rdi, %r13
movslq %r8d, %rax
movq %rsi, 0x60(%rsp)
movl (%rsi,%rax,4), %r14d
movslq (%rdx,%rax,4), %r15
movl (%rcx), %esi
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x2c26
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x2, %rdx
cmpq %r15, %rdx
jae 0x2cdd
pushq $-0x1
popq %rbp
jmp 0x2e6d
xorl %ebp, %ebp
jmp 0x2e77
movq %rbp, 0x58(%rsp)
movq %r12, 0x8(%rsp)
xorl %esi, %esi
movl $0x0, %r12d
cmpl $0x2, %ebx
jl 0x2d02
leal -0x1(%rbx), %edi
leaq 0x75f2(%rip), %r8       # 0xa2f0
movl (%r8,%rdi,4), %r12d
testl %r15d, %r15d
cmovgl %r15d, %esi
leaq (%rax,%rcx), %rdi
addl %r15d, %r14d
pushq $-0x1
popq %rbp
movl %ebp, %r8d
subq $0x1, %rsi
jb 0x2d3c
movslq %r8d, %r8
movl (%rdi,%r8,4), %r9d
addl %r12d, %r9d
leal (%r14,%r8), %r10d
movslq %r10d, %r10
decl %r8d
cmpl (%r13,%r10,4), %r9d
je 0x2d16
jmp 0x2e6d
testl %ebx, %ebx
je 0x2e12
cmpq %r15, %rdx
jne 0x2da4
movq 0x8(%rsp), %r14
movl 0x4(%r14), %esi
testl %esi, %esi
js 0x2e16
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x2c26
leaq 0x30(%rsp), %rdi
movq 0x8(%rdi), %rax
movl -0x4(%rax), %ecx
addl %r12d, %ecx
movl %ecx, (%r14)
movl -0x8(%rax), %eax
addl %r12d, %eax
movl %eax, 0x4(%r14)
callq 0x6e42
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x2, %rdx
leaq 0x1(%r15), %rdi
movq %r15, %rbp
notq %rbp
cmpq %rdi, %rdx
jne 0x2e2e
movq 0x8(%rsp), %r14
movl 0x4(%r14), %esi
testl %esi, %esi
js 0x2e1c
movq %rdi, 0x50(%rsp)
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x2c26
leaq 0x30(%rsp), %rdi
movq 0x8(%rdi), %rax
movl -0x4(%rax), %eax
addl %r12d, %eax
movq 0x8(%rsp), %r14
movl %eax, 0x4(%r14)
callq 0x6e42
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
subq %rax, %rcx
movq %rcx, %rdx
sarq $0x2, %rdx
movq 0x50(%rsp), %rdi
jmp 0x2e21
xorl %ebp, %ebp
jmp 0x2e6d
decl %ebx
movl %ebx, %ebp
jmp 0x2e6d
orl $-0x1, 0x4(%r14)
leaq (%rax,%rcx), %rsi
movl (%rsi,%rbp,4), %esi
addl %r12d, %esi
movl %esi, (%r14)
cmpq %rdi, %rdx
jbe 0x2e4f
addq %rax, %rcx
movl (%rcx,%rbp,4), %ecx
addl %r12d, %ecx
movq 0x8(%rsp), %rsi
movl %ecx, (%rsi)
subq %r15, %rdx
addl -0x8(%rax,%rdx,4), %r12d
movl %r12d, 0x4(%rsi)
decl %ebx
movq %r13, %rdi
movq 0x60(%rsp), %rsi
movq 0x58(%rsp), %rdx
movq 0x8(%rsp), %rcx
movl %ebx, %r8d
callq 0x2c6e
movl %eax, %ebp
leaq 0x10(%rsp), %rdi
callq 0x6e42
movl %ebp, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2e8a
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x6e42
jmp 0x2e9e
jmp 0x2e9b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x6e42
movq %rbx, %rdi
callq 0x2240