// File: 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
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0x3551
movl $0x0, -0x4(%rbp)
jmp 0x3974
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
leaq -0x58(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x9db0
movq -0xa8(%rbp), %rdi
movl -0x40(%rbp), %esi
callq 0x34c0
jmp 0x359e
leaq -0x58(%rbp), %rdi
callq 0x9d90
movslq -0x34(%rbp), %rcx
cmpq %rcx, %rax
jae 0x35d4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x68(%rbp)
jmp 0x395e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x3969
movl $0x0, -0x6c(%rbp)
cmpl $0x1, -0x2c(%rbp)
jle 0x35f7
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xacff(%rip), %rax      # 0xe2f0
movl (%rax,%rcx,4), %eax
movl %eax, -0x6c(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x3663
leaq -0x58(%rbp), %rdi
callq 0x9d90
movq %rax, %rsi
subq $0x1, %rsi
movslq -0x38(%rbp), %rax
subq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x9dd0
movl (%rax), %eax
addl -0x6c(%rbp), %eax
movq -0x10(%rbp), %rcx
movl -0x30(%rbp), %edx
addl -0x34(%rbp), %edx
subl $0x1, %edx
subl -0x38(%rbp), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
je 0x3656
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x68(%rbp)
jmp 0x395e
jmp 0x3658
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x35fe
cmpl $0x0, -0x2c(%rbp)
jne 0x367c
movl $0x0, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x395e
movslq -0x34(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9d90
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jne 0x3788
movq -0x28(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jge 0x36c2
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
jmp 0x395e
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
leaq -0x88(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0x9db0
movq -0xb8(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x34c0
jmp 0x36f0
movl -0x6c(%rbp), %eax
movl %eax, -0xc0(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x9d90
movq %rax, %rsi
subq $0x1, %rsi
leaq -0x88(%rbp), %rdi
callq 0x9dd0
movl -0xc0(%rbp), %ecx
addl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x6c(%rbp), %eax
movl %eax, -0xbc(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x9d90
movq %rax, %rsi
subq $0x2, %rsi
leaq -0x88(%rbp), %rdi
callq 0x9dd0
movl -0xbc(%rbp), %ecx
addl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
leaq -0x88(%rbp), %rdi
callq 0x9df0
jmp 0x3788
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x9df0
jmp 0x3969
movl -0x34(%rbp), %eax
addl $0x1, %eax
cltq
movq %rax, -0xc8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9d90
movq %rax, %rcx
movq -0xc8(%rbp), %rax
cmpq %rcx, %rax
jne 0x3894
movq -0x28(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jge 0x37cd
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
jmp 0x385d
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
leaq -0xa0(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x9db0
movq -0xd0(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x34c0
jmp 0x37fb
movl -0x6c(%rbp), %eax
movl %eax, -0xd4(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x9d90
movq %rax, %rsi
subq $0x1, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x9dd0
movl -0xd4(%rbp), %ecx
addl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
leaq -0xa0(%rbp), %rdi
callq 0x9df0
jmp 0x385d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x9df0
jmp 0x3969
movl -0x6c(%rbp), %eax
movl %eax, -0xd8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9d90
movq %rax, %rsi
subq $0x1, %rsi
movslq -0x34(%rbp), %rax
subq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x9dd0
movl -0xd8(%rbp), %ecx
addl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
cltq
movq %rax, -0xe0(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9d90
movq %rax, %rcx
movq -0xe0(%rbp), %rax
cmpq %rcx, %rax
jae 0x392a
movl -0x6c(%rbp), %eax
movl %eax, -0xe8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9d90
movq %rax, %rsi
subq $0x1, %rsi
movslq -0x34(%rbp), %rax
subq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x9dd0
movl -0xe8(%rbp), %ecx
addl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x6c(%rbp), %eax
movl %eax, -0xe4(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9d90
movq %rax, %rsi
subq $0x2, %rsi
movslq -0x34(%rbp), %rax
subq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x9dd0
movl -0xe4(%rbp), %ecx
addl (%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
decl %r8d
callq 0x3520
movl %eax, -0xec(%rbp)
jmp 0x394e
movl -0xec(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x68(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9df0
jmp 0x3974
leaq -0x58(%rbp), %rdi
callq 0x9df0
jmp 0x3980
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x2250
nopl (%rax)