// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movq %rsi, 0x30(%rsp)
movq %rdi, 0x18(%rsp)
cmpl $-0x1, %r9d
je 0x18dc
movslq %r9d, %rax
xorl %ebp, %ebp
movl $0x0, %r15d
cmpl $0x2, %r9d
jl 0x17a1
leal -0x1(%r9), %edi
leaq 0x8f03(%rip), %rsi      # 0xa6a0
movl (%rsi,%rdi,4), %r15d
movq %rdx, 0x20(%rsp)
movslq (%rdx,%rax,4), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, 0x28(%rsp)
movl (%rcx,%rax,4), %r14d
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movq $-0x1, (%rsp)
movq %r9, 0x40(%rsp)
leal -0x1(%r9), %eax
movl %eax, 0xc(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x30(%rsp), %rsi
movq %r8, 0x10(%rsp)
movslq (%r8,%r12,4), %rcx
xorl %edx, %edx
testq %rcx, %rcx
js 0x1861
movslq (%rsi,%rcx,4), %r9
movl 0x4(%rsi,%rcx,4), %ecx
movb $0x1, %dl
cmpl %r9d, %ecx
jle 0x1868
movq 0x8f0a(%rip), %rdi      # 0xa710
movq 0x18(%rsp), %r8
leaq (%r8,%r9,4), %r8
subl %r9d, %ecx
xorl %r9d, %r9d
cmpl %r14d, %r13d
jge 0x1834
movl (%r8,%r9,4), %r10d
addl %r15d, %r10d
movslq %r13d, %r11
addq 0x38(%rsp), %r11
cmpl (%rdi,%r11,4), %r10d
jne 0x186c
incl %r13d
jmp 0x1855
movl $0x1, %ebx
cmpl $0x0, 0x40(%rsp)
je 0x187a
movl (%r8,%r9,4), %r10d
addl %r15d, %r10d
movslq %ebp, %rbp
movl %r10d, (%rsp,%rbp,4)
incl %ebp
cmpl $0x3, %ebp
je 0x1896
incq %r9
cmpl %r9d, %ecx
jne 0x1815
xorl %ebx, %ebx
jmp 0x187e
movl $0x2, %ebx
jmp 0x1883
xorl %ebx, %ebx
jmp 0x1883
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ebx
xorl %edx, %edx
jmp 0x187e
xorl %edx, %edx
xorl %eax, %eax
movq 0x10(%rsp), %r8
testb %dl, %dl
je 0x18e5
incq %r12
cmpq $0x3, %r12
jne 0x17e5
jmp 0x18e0
movl (%rsp), %eax
movq 0x10(%rsp), %rbp
movl %eax, (%rbp)
movl 0x4(%rsp), %eax
movl %eax, 0x4(%rbp)
movl 0x8(%rsp), %eax
movl %eax, 0x8(%rbp)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq %rbp, %r8
movl 0xc(%rsp), %r9d
callq 0x175f
movq 0x30(%rsp), %rsi
movq %rbp, %r8
movl $0x3, %ebp
xorl %edx, %edx
jmp 0x1883
xorl %eax, %eax
jmp 0x1923
movl $0x2, %ebx
cmpl $0x2, %ebx
jne 0x1923
movl $0x1, %eax
cmpl %r14d, %r13d
jl 0x1923
movl (%rsp), %eax
movl %eax, (%r8)
movl 0x4(%rsp), %eax
movl %eax, 0x4(%r8)
movl 0x8(%rsp), %eax
movl %eax, 0x8(%r8)
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
movl 0xc(%rsp), %r9d
callq 0x175f
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq