// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_uni_locate.cpp
// Function: psck(int*, int*, int*, int*, int)
int psck(int *m,int *Rs,int *B2,int *e,int round){
    if(DEBUGFLAG==1){printf("\n[psck / round %d]",round);}
    if(round==-1){return 0;}
    int starti = Rs[round];
    int mlen = B2[round];
    int rofs=0;if(round>1){rofs=dc2s[round-1];}
    int cnt = 0;int a1[3] = {-1,-1,-1};int cnt2 = 0;
    //if(gate==16){printf("?_[%d][%d][%d]",a1[0],a1[1],a1[2]);}
    for(int i=0;i<3;i++){
        int l = e[i];if(l<0){break;}
        std::vector<int> x;
        xdisp(x,l);
        for(int j = 0;j<x.size();j++){
            if(cnt<mlen){
                if(x[j]+rofs!=m[starti+cnt]){
                     if(DEBUGFLAG==1){printf("round %d で右不一致(%d !=%d)",round,x[j]+rofs,m[starti+cnt]);}
                    return -1;
                }
                cnt++;
            }
            else{
                if(round==0){/*printf("[完全正解+]");*/return 0;}
                a1[cnt2] = rofs+x[j];cnt2++;
                if(cnt2==3){
                    e[0] = a1[0];e[1] = a1[1];e[2] = a1[2];
                    //printf("[正解]");
                    //printf("next e2[%d,%d,%d] =>",e[0],e[1],e[2]);
                    return psck(m,Rs,B2,e,round-1);
                }
            }
        }
    }
    if(cnt<mlen){/*printf("不足・判別不可");*/return 1;}
    //if(gate==16){printf("?_[%d][%d][%d] -> [%d][%d][%d]",a1[0],a1[1],a1[2],e[0],e[1],e[2]);exit(4);}
    e[0] = a1[0];e[1] = a1[1];e[2] = a1[2];
    return psck(m,Rs,B2,e,round-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
cmpl $-0x1, %r8d
je 0x3039
movslq %r8d, %rax
leal -0x1(%r8), %ecx
movl %ecx, 0xc(%rsp)
xorl %r15d, %r15d
movl $0x0, %ebp
movq %r8, 0x68(%rsp)
cmpl $0x2, %r8d
jl 0x2f03
movl 0xc(%rsp), %ecx
leaq 0x73f0(%rip), %rdx      # 0xa2f0
movl (%rdx,%rcx,4), %ebp
movq %rdi, 0x38(%rsp)
movq 0x20(%rsp), %rcx
movslq (%rcx,%rax,4), %rdx
movq 0x28(%rsp), %rcx
movl (%rcx,%rax,4), %r14d
orl $-0x1, 0x18(%rsp)
orq $-0x1, 0x10(%rsp)
xorl %ecx, %ecx
xorl %r13d, %r13d
movq %rdx, 0x60(%rsp)
cmpq $0x3, %rcx
je 0x302f
movq 0x30(%rsp), %rax
movl (%rax,%rcx,4), %esi
testl %esi, %esi
js 0x302f
movq %rcx, 0x70(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x2c26
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rbx
subq %rax, %rbx
sarq $0x2, %rbx
xorl %r12d, %r12d
movq 0x38(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x60(%rsp), %r8
cmpq %r12, %rbx
je 0x3012
cmpl %r14d, %r15d
jge 0x2fad
movl (%rax,%r12,4), %ecx
addl %ebp, %ecx
movslq %r15d, %rdx
addq %r8, %rdx
cmpl (%rdi,%rdx,4), %ecx
jne 0x2fcd
incl %r15d
jmp 0x2fc8
testl %esi, %esi
je 0x2fd6
movl (%rax,%r12,4), %ecx
addl %ebp, %ecx
movslq %r13d, %r13
movl %ecx, 0x10(%rsp,%r13,4)
incl %r13d
cmpl $0x3, %r13d
je 0x2fe0
incq %r12
jmp 0x2f89
pushq $-0x1
popq %rax
movl %eax, 0x8(%rsp)
jmp 0x3012
movl $0x0, 0x8(%rsp)
jmp 0x3012
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movl 0x18(%rsp), %eax
movl %eax, 0x8(%rcx)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movl 0xc(%rsp), %r8d
callq 0x2eb0
movl %eax, 0x8(%rsp)
pushq $0x3
popq %rax
movl %eax, %r13d
leaq 0x40(%rsp), %rdi
callq 0x6e42
movq 0x70(%rsp), %rcx
incq %rcx
cmpq %r12, %rbx
jbe 0x2f2f
jmp 0x306e
cmpl %r14d, %r15d
jge 0x303d
pushq $0x1
popq %rax
jmp 0x306a
xorl %eax, %eax
jmp 0x3072
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, (%rcx)
movl 0x18(%rsp), %eax
movl %eax, 0x8(%rcx)
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movl 0xc(%rsp), %r8d
callq 0x2eb0
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3083
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x6e42
movq %rbx, %rdi
callq 0x2240