// File: /workspace/github_cpp_makefile_star2_O3/TooruAkagi[P]GCIS_Index/gcis_nep_locate.cpp
// Function: psck(unsigned int*, int*, int*, int*, int*, int)
int psck(unsigned int *D,int *D_2,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;}
         if(DEBUGFLAG==1){printf("\nopen -> [%d] :",l);}
        for(int j = D_2[l];j<D_2[l+1];j++){
            if(cnt<mlen){
                if(D[j]+rofs!=m[starti+cnt]){
                     if(DEBUGFLAG==1){printf("round %d で右不一致(%d !=%d)",round,D[j]+rofs,m[starti+cnt]);}
                    return -1;
                }
                if(DEBUGFLAG==1){printf("hit[%d(%d)]",D[j]+rofs,rofs);}
                cnt++;
            }
            else{
                if(round==0){/*printf("[完全正解+]");*/return 0;}
                a1[cnt2] = rofs+D[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(D,D_2,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(D,D_2,Rs,B2,e,round-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, 0x10(%rsp)
cmpl $-0x1, %r9d
je 0x1851
movslq %r9d, %r11
xorl %eax, %eax
movl $0x0, %r10d
cmpl $0x2, %r9d
jl 0x1785
leal -0x1(%r9), %edi
leaq 0x8f1f(%rip), %r10      # 0xa6a0
movl (%r10,%rdi,4), %r10d
movq %rdx, 0x18(%rsp)
movslq (%rdx,%r11,4), %rdi
movq %rcx, 0x20(%rsp)
movl (%rcx,%r11,4), %r11d
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movq $-0x1, (%rsp)
movq 0x8f62(%rip), %r14      # 0xa710
xorl %r15d, %r15d
xorl %ebp, %ebp
movslq (%r8,%r15,4), %r12
testq %r12, %r12
js 0x181f
movslq (%rsi,%r12,4), %rbx
movl 0x4(%rsi,%r12,4), %r12d
cmpl %ebx, %r12d
jle 0x1816
movq 0x10(%rsp), %rcx
leaq (%rcx,%rbx,4), %r13
subl %ebx, %r12d
xorl %ebx, %ebx
cmpl %r11d, %ebp
jge 0x17f5
movl (%r13,%rbx,4), %ecx
addl %r10d, %ecx
movslq %ebp, %rdx
addq %rdi, %rdx
cmpl (%r14,%rdx,4), %ecx
jne 0x1855
incl %ebp
jmp 0x180e
testl %r9d, %r9d
je 0x1851
movl (%r13,%rbx,4), %ecx
addl %r10d, %ecx
cltq
movl %ecx, (%rsp,%rax,4)
incl %eax
cmpl $0x3, %eax
je 0x1829
incq %rbx
cmpl %ebx, %r12d
jne 0x17d8
incq %r15
cmpq $0x3, %r15
jne 0x17b3
movl $0x1, %eax
cmpl %r11d, %ebp
jl 0x185a
movq (%rsp), %rax
movq %rax, (%r8)
movl 0x8(%rsp), %eax
movl %eax, 0x8(%r8)
decl %r9d
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
callq 0x1748
jmp 0x185a
xorl %eax, %eax
jmp 0x185a
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq