// File: /workspace/github_cpp_makefile_star2_O3/TooruAkagi[P]GCIS_Index/gcis_nep_locate.cpp
// Function: coreAcheck(unsigned int*, int*, int, int, int, int)
int coreAcheck(unsigned int *D,int *D_2,int round,int count,int tround,int startm){ //左の[0][1]をcount回開ける
    if(DEBUGFLAG==1){
        printf("\n[2-左%dオープン(%d)]count==1ならAコアを%d文字調べる\n",count,round,coredata[2]);
        for(int i = 0; i<10; i++){printf("[%d]",occart2[tround][i]);}
    }
    int rofs=0;int e[2] = {-1,-1};int etg = 0;
    if(round>1){rofs=dc2s[round-1];}
    int l = occart2[tround][1];
    int Alen = coredata[2];
    //printf("Aチェック(%d / %d)",occart2[tround][0],occart2[tround][1]);
    //count>=2 の時，必ず2つ準びできるので，for以降に行くことはない.count==1の時，Aを判定して終わる場合は
    //-1が一部残ってforを抜けるはずなので,
            for(int j = 0;j<2;j++){
                l = occart2[tround][1-j];
                if(l<0){
                    if(DEBUGFLAG==1){printf("-1を回避(j==%d)",j);}
                    break;}
                 if(DEBUGFLAG==1){printf("open[%d(+%d)]",l,rofs);}
                for(int i = D_2[l+1]-1;i>=D_2[l];i--){
                    if(count==1 && Alen>0){ //count1ならAコアの判定をする
                         if(DEBUGFLAG==1){printf("\n[%d-%d]",rofs+D[i],m[startm-1+Alen]);}
                        if(D[i]+rofs == m[startm-1+Alen]){
                            Alen--;continue;
                        }
                        else{return -1;}
                    }
                    else{ //count1以外か，コアを判定し終わったら
                        e[etg] = rofs+D[i];etg++;
                        if(etg==2){ //コアの横の文字が2つ集まったら
                            occart2[tround][1] = e[0]; //1こめ
                            occart2[tround][0] = e[1]; //1こめ
                            if(count>1){return coreAcheck(D,D_2,round-1,count-1,tround,startm);}
                            return 0; //Aを見終わったならそのままreturnしていいはず
                        }
                    }
                }
            }
    //coreAcheckは最低1文字ある状態で呼ぶ．
    if(count>1){
        if(etg==1){occart2[tround][1] = e[0];}
        return coreAcheck(D,D_2,round-1,count-1,tround,startm);} //無理やりチェック
    if(count != 1){printf("おかしい(count = %d)",count);exit(1);}
    if(Alen>0){return -1;}
    //printf("未定義[etg = %d]",etg);
    if(etg==0){printf("Aでぴったり切れている");occart2[tround][1] = -1;occart2[tround][0] = -1;return 0;}
    if(etg==2){printf("追加 > %d.%d",e[0],e[1]);occart2[tround][1] = e[0];occart2[tround][0] = e[1];return 0;}
    if(etg==1){printf("追加 > %d",e[0]);occart2[tround][1] = e[0];return 0;}
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r14d
movq $-0x1, 0x8(%rsp)
xorl %eax, %eax
movl $0x0, %r11d
cmpl $0x2, %edx
jl 0x2223
leal -0x1(%rdx), %r10d
leaq 0x8481(%rip), %r11      # 0xa6a0
movl (%r11,%r10,4), %r11d
movslq %r8d, %r10
leaq (%r10,%r10,4), %r10
leaq 0x7f3f(%rip), %rbx      # 0xa170
leaq (%rbx,%r10,8), %r9
movq %r9, (%rsp)
movl 0x83e8(%rip), %r10d     # 0xa628
movq 0x84c9(%rip), %rbx      # 0xa710
movq %r14, 0x10(%rsp)
decl %r14d
movl $0x1, %r13d
movb $0x1, %r9b
movq (%rsp), %r15
movslq (%r15,%r13,4), %r15
testq %r15, %r15
js 0x22bc
movslq 0x4(%rsi,%r15,4), %r13
movslq (%rsi,%r15,4), %rbp
cmpl %ebp, %r13d
jle 0x22ad
movl -0x4(%rdi,%r13,4), %r15d
addl %r11d, %r15d
cmpl $0x1, %ecx
jne 0x2297
testl %r10d, %r10d
jle 0x2297
leal (%r14,%r10), %r12d
movslq %r12d, %r12
cmpl (%rbx,%r12,4), %r15d
jne 0x2308
decl %r10d
jmp 0x22a5
cltq
movl %r15d, 0x8(%rsp,%rax,4)
incl %eax
cmpl $0x2, %eax
je 0x22d4
decq %r13
cmpq %rbp, %r13
jg 0x2273
xorl %r13d, %r13d
testb $0x1, %r9b
movl $0x0, %r9d
jne 0x2258
cmpl $0x2, %ecx
jl 0x230f
cmpl $0x1, %eax
jne 0x22ec
movl 0x8(%rsp), %eax
movq (%rsp), %r9
movl %eax, 0x4(%r9)
jmp 0x22ec
movq 0x8(%rsp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq (%rsp), %rax
movq %xmm0, (%rax)
cmpl $0x2, %ecx
jl 0x234d
decl %edx
decl %ecx
movq 0x10(%rsp), %r9
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21ed
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x234f
cmpl $0x1, %ecx
jne 0x23a9
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %r10d, %r10d
jg 0x234f
cmpl $0x2, %eax
je 0x237f
cmpl $0x1, %eax
je 0x2360
testl %eax, %eax
jne 0x234d
leaq 0x3db4(%rip), %rdi      # 0x60eb
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1030
movq (%rsp), %rax
movq $-0x1, (%rax)
jmp 0x234f
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rsp), %ebp
leaq 0x3daf(%rip), %rdi      # 0x611a
xorl %ebx, %ebx
movl %ebp, %esi
xorl %eax, %eax
callq 0x1030
movq (%rsp), %rax
movl %ebp, 0x4(%rax)
jmp 0x234f
movl 0x8(%rsp), %ebp
movl 0xc(%rsp), %r14d
leaq 0x3d7c(%rip), %rdi      # 0x610b
xorl %ebx, %ebx
movl %ebp, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x1030
movq (%rsp), %rax
movl %ebp, 0x4(%rax)
movl %r14d, (%rax)
jmp 0x234f
leaq 0x3d22(%rip), %rdi      # 0x60d2
movl %ecx, %esi
xorl %eax, %eax
callq 0x1030
movl $0x1, %edi
callq 0x1150