// File: 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
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
cmpl $-0x1, -0x2c(%rbp)
jne 0x39c1
movl $0x0, -0x4(%rbp)
jmp 0x3c3d
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
cmpl $0x1, -0x2c(%rbp)
jle 0x3a00
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0xa8f6(%rip), %rax      # 0xe2f0
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq 0x7cbe(%rip), %rax      # 0xb6cc
movq %rax, -0x48(%rbp)
movl 0x7cbc(%rip), %eax      # 0xb6d4
movl %eax, -0x40(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
cmpl $0x3, -0x50(%rbp)
jge 0x3bef
movq -0x28(%rbp), %rax
movslq -0x50(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
jge 0x3a4c
jmp 0x3bef
leaq -0x70(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x9db0
movq -0x90(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x34c0
jmp 0x3a6d
movl $0x0, -0x80(%rbp)
movslq -0x80(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x9d90
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jae 0x3bbe
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x3b05
movslq -0x80(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x9dd0
movl (%rax), %eax
addl -0x38(%rbp), %eax
movq -0x10(%rbp), %rcx
movl -0x30(%rbp), %edx
addl -0x3c(%rbp), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
je 0x3af7
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x84(%rbp)
jmp 0x3bc8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x9df0
jmp 0x3c49
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x3bae
cmpl $0x0, -0x2c(%rbp)
jne 0x3b21
movl $0x0, -0x4(%rbp)
movl $0x1, -0x84(%rbp)
jmp 0x3bc8
movl -0x38(%rbp), %eax
movl %eax, -0x9c(%rbp)
movslq -0x80(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x9dd0
movl -0x9c(%rbp), %ecx
addl (%rax), %ecx
movslq -0x4c(%rbp), %rax
movl %ecx, -0x48(%rbp,%rax,4)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
cmpl $0x3, -0x4c(%rbp)
jne 0x3bac
movl -0x48(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x44(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x40(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
decl %r8d
callq 0x3990
movl %eax, -0xa0(%rbp)
jmp 0x3b97
movl -0xa0(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x84(%rbp)
jmp 0x3bc8
jmp 0x3bae
jmp 0x3bb0
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0x3a74
movl $0x0, -0x84(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x9df0
movl -0x84(%rbp), %eax
testl %eax, %eax
je 0x3bdf
jmp 0x3bdd
jmp 0x3c3d
jmp 0x3be1
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x3a29
movl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x3c00
movl $0x1, -0x4(%rbp)
jmp 0x3c3d
movl -0x48(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x44(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x40(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl -0x2c(%rbp), %r8d
subl $0x1, %r8d
callq 0x3990
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x2250
nopw %cs:(%rax,%rax)