// File: /workspace/github_cpp_makefile_star2_O1/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, 0x28(%rsp)
cmpl $-0x1, %r8d
je 0x3292
movq %rdi, %r9
movslq %r8d, %rax
xorl %r12d, %r12d
movl $0x0, %r14d
cmpl $0x2, %r8d
jl 0x311f
leal -0x1(%r8), %ecx
leaq 0x81c5(%rip), %rdi      # 0xb2e0
movl (%rdi,%rcx,4), %r14d
movq %rsi, 0x48(%rsp)
movslq (%rsi,%rax,4), %r10
movq %rdx, 0x50(%rsp)
movl (%rdx,%rax,4), %r15d
movl $0xffffffff, 0x18(%rsp) # imm = 0xFFFFFFFF
movq $-0x1, 0x10(%rsp)
leal -0x1(%r8), %eax
movl %eax, 0x1c(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
movq %r9, 0x20(%rsp)
movq %r8, 0x60(%rsp)
movq %r10, 0x58(%rsp)
movq 0x28(%rsp), %rax
movl (%rax,%rbx,4), %esi
testl %esi, %esi
js 0x321a
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x2e23
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
movq 0x20(%rsp), %r9
je 0x31f9
sarq $0x2, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
xorl %edx, %edx
movq 0x60(%rsp), %r8
movq 0x58(%rsp), %r10
cmpl %r15d, %ebp
jge 0x31cf
movl (%rax,%rdx,4), %esi
addl %r14d, %esi
movslq %ebp, %rdi
addq %r10, %rdi
cmpl (%r9,%rdi,4), %esi
jne 0x3234
incl %ebp
jmp 0x31f1
movl $0x1, %r13d
testl %r8d, %r8d
je 0x3244
movl (%rax,%rdx,4), %esi
addl %r14d, %esi
movslq %r12d, %r12
movl %esi, 0x10(%rsp,%r12,4)
incl %r12d
cmpl $0x3, %r12d
je 0x324e
incq %rdx
cmpq %rdx, %rcx
jne 0x31b4
xorl %r13d, %r13d
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3220
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movq 0x20(%rsp), %r9
jmp 0x3220
movl $0x2, %r13d
testl %r13d, %r13d
jne 0x329c
incq %rbx
cmpq $0x3, %rbx
jne 0x315d
jmp 0x3296
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movl $0x1, %r13d
jmp 0x31fc
movl $0x0, 0xc(%rsp)
jmp 0x31fc
movl 0x10(%rsp), %eax
movq 0x28(%rsp), %rcx
movl %eax, (%rcx)
movl 0x14(%rsp), %eax
movl %eax, 0x4(%rcx)
movl 0x18(%rsp), %eax
movl %eax, 0x8(%rcx)
movq %r9, %rdi
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movl 0x1c(%rsp), %r8d
callq 0x30de
movl %eax, 0xc(%rsp)
movl $0x3, %r12d
movq 0x20(%rsp), %r9
jmp 0x31fc
xorl %eax, %eax
jmp 0x32e0
movl $0x2, %r13d
cmpl $0x2, %r13d
movl 0xc(%rsp), %eax
jne 0x32e0
movl $0x1, %eax
cmpl %r15d, %ebp
jl 0x32e0
movl 0x10(%rsp), %eax
movq 0x28(%rsp), %rcx
movl %eax, (%rcx)
movl 0x14(%rsp), %eax
movl %eax, 0x4(%rcx)
movl 0x18(%rsp), %eax
movl %eax, 0x8(%rcx)
movq %r9, %rdi
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movl 0x1c(%rsp), %r8d
callq 0x30de
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x32f1
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x330b
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2220