// File: /workspace/github_cpp_makefile_star2_O3/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 $0x68, %rsp
movq %rcx, 0x20(%rsp)
cmpl $-0x1, %r8d
je 0x323b
movslq %r8d, %rax
leal -0x1(%r8), %ecx
movl %ecx, 0xc(%rsp)
xorl %r12d, %r12d
movl $0x0, %r15d
cmpl $0x2, %r8d
jl 0x3097
movl 0xc(%rsp), %ecx
leaq 0x824d(%rip), %r9       # 0xb2e0
movl (%r9,%rcx,4), %r15d
movq %rsi, 0x48(%rsp)
movslq (%rsi,%rax,4), %r11
movq %rdx, 0x50(%rsp)
movl (%rdx,%rax,4), %ebp
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
movq $-0x1, 0x10(%rsp)
xorl %r14d, %r14d
xorl %ebx, %ebx
movq %rdi, 0x28(%rsp)
movq %r8, 0x60(%rsp)
movq %r11, 0x58(%rsp)
movq 0x20(%rsp), %rax
movl (%rax,%r14,4), %esi
testl %esi, %esi
js 0x31fd
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x2d93
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rax
subq %rdi, %rax
movq 0x28(%rsp), %r9
movq 0x60(%rsp), %r8
je 0x3180
sarq $0x2, %rax
cmpq $0x1, %rax
movl $0x0, %ecx
sbbq %rax, %rcx
movb $0x1, %r13b
movl $0x1, %edx
movq 0x58(%rsp), %r11
cmpl %ebp, %ebx
jge 0x314a
movl -0x4(%rdi,%rdx,4), %esi
addl %r15d, %esi
movslq %ebx, %r10
addq %r11, %r10
cmpl (%r9,%r10,4), %esi
jne 0x3185
incl %ebx
jmp 0x3167
testl %r8d, %r8d
je 0x318f
movl -0x4(%rdi,%rdx,4), %esi
addl %r15d, %esi
movslq %r12d, %r12
movl %esi, 0x10(%rsp,%r12,4)
incl %r12d
cmpl $0x3, %r12d
je 0x3199
cmpq %rdx, %rax
seta %r13b
leaq (%rcx,%rdx), %rsi
incq %rsi
incq %rdx
cmpq $0x1, %rsi
jne 0x312f
jmp 0x31d8
xorl %r13d, %r13d
jmp 0x31d3
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
jmp 0x31d8
movl $0x0, 0x8(%rsp)
jmp 0x31d3
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rax, (%rcx)
movl 0x18(%rsp), %eax
movl %eax, 0x8(%rcx)
movq %r9, %rdi
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movl 0xc(%rsp), %r8d
callq 0x3051
movl %eax, 0x8(%rsp)
movl $0x3, %r12d
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x31e5
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
testb $0x1, %r13b
movq 0x28(%rsp), %rdi
jne 0x3235
incq %r14
cmpq $0x3, %r14
jne 0x30cd
movl $0x1, 0x8(%rsp)
cmpl %ebp, %ebx
jl 0x3235
movq 0x10(%rsp), %rax
movq 0x20(%rsp), %rcx
movq %rax, (%rcx)
movl 0x18(%rsp), %eax
movl %eax, 0x8(%rcx)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movl 0xc(%rsp), %r8d
callq 0x3051
movl %eax, 0x8(%rsp)
movl 0x8(%rsp), %eax
jmp 0x323d
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x324e
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3268
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2220