// File: 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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
cmpl $-0x1, -0x34(%rbp)
jne 0x2b12
movl $0x0, -0x4(%rbp)
jmp 0x2cf4
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
cmpl $0x1, -0x34(%rbp)
jle 0x2b51
movl -0x34(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xab65(%rip), %rax      # 0xd6b0
movl (%rax,%rcx,4), %eax
movl %eax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movq 0x6b55(%rip), %rax      # 0x96b4
movq %rax, -0x50(%rbp)
movl 0x6b53(%rip), %eax      # 0x96bc
movl %eax, -0x48(%rbp)
movl $0x0, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
cmpl $0x3, -0x58(%rbp)
jge 0x2ca2
movq -0x30(%rbp), %rax
movslq -0x58(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jge 0x2b9d
jmp 0x2ca2
movq -0x18(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movq -0x18(%rbp), %rcx
movl -0x5c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x2c92
movl -0x44(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x2c06
movq -0x10(%rbp), %rax
movslq -0x60(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x40(%rbp), %eax
movq 0xab3f(%rip), %rcx      # 0xd720
movl -0x38(%rbp), %edx
addl -0x44(%rbp), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
je 0x2bfb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2cf4
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x2c82
cmpl $0x0, -0x34(%rbp)
jne 0x2c18
movl $0x0, -0x4(%rbp)
jmp 0x2cf4
movl -0x40(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x60(%rbp), %rdx
addl (%rax,%rdx,4), %ecx
movslq -0x54(%rbp), %rax
movl %ecx, -0x50(%rbp,%rax,4)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
cmpl $0x3, -0x54(%rbp)
jne 0x2c80
movl -0x50(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x4c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x48(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
subl $0x1, %r9d
callq 0x2ae0
movl %eax, -0x4(%rbp)
jmp 0x2cf4
jmp 0x2c82
jmp 0x2c84
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x2bab
jmp 0x2c94
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x2b7a
movl -0x44(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x2cb3
movl $0x1, -0x4(%rbp)
jmp 0x2cf4
movl -0x50(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl -0x4c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x48(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
subl $0x1, %r9d
callq 0x2ae0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)