// File: /workspace/github_cpp_makefile_star2_O2/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 $0x28, %rsp
orq $-0x1, 0x8(%rsp)
xorl %eax, %eax
movl $0x0, %r10d
cmpl $0x2, %edx
jl 0x2180
leal -0x1(%rdx), %r11d
leaq 0x7524(%rip), %r10      # 0x96a0
movl (%r10,%r11,4), %r10d
movq %rdx, 0x18(%rsp)
movl %r8d, 0x14(%rsp)
movslq %r8d, %r8
imulq $0x28, %r8, %r8
leaq 0x6fd8(%rip), %rdx      # 0x9170
addq %r8, %rdx
movl 0x7486(%rip), %r11d     # 0x9628
movq 0x7567(%rip), %r14      # 0x9710
movq %r9, 0x20(%rsp)
leal -0x1(%r9), %r12d
pushq $0x1
popq %r15
xorl %r13d, %r13d
cmpq $0x2, %r13
je 0x2236
movl %r15d, %r9d
subl %r13d, %r9d
shll $0x2, %r9d
movslq (%r9,%rdx), %r9
testq %r9, %r9
js 0x2236
movslq 0x4(%rsi,%r9,4), %rbx
movslq (%rsi,%r9,4), %rbp
decq %rbx
leaq 0x1(%rbx), %r9
cmpq %rbp, %r9
jle 0x221d
movl (%rdi,%rbx,4), %r9d
addl %r10d, %r9d
cmpl $0x1, %ecx
jne 0x220a
testl %r11d, %r11d
jle 0x220a
leal (%r12,%r11), %r8d
movslq %r8d, %r8
cmpl (%r14,%r8,4), %r9d
jne 0x2222
decl %r11d
jmp 0x21db
cltq
movl %r9d, 0x8(%rsp,%rax,4)
incl %eax
cmpl $0x2, %eax
jne 0x21db
jmp 0x22a5
incq %r13
jmp 0x21b9
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, %ecx
movq 0x20(%rsp), %r9
jl 0x226d
cmpl $0x1, %eax
jne 0x224c
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rdx)
movq 0x18(%rsp), %rdx
decl %edx
decl %ecx
movl 0x14(%rsp), %r8d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2150
cmpl $0x1, %ecx
jne 0x231e
testl %r11d, %r11d
pushq $-0x1
popq %rbx
jg 0x2225
movq %rdx, %r15
cmpl $0x2, %eax
je 0x22f4
cmpl $0x1, %eax
je 0x22d5
testl %eax, %eax
jne 0x22ce
leaq 0x2e55(%rip), %rdi      # 0x50eb
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1030
orq $-0x1, (%r15)
jmp 0x2225
movq 0x8(%rsp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq %xmm0, (%rdx)
cmpl $0x2, %ecx
jl 0x22ce
movq 0x18(%rsp), %rdx
decl %edx
decl %ecx
movl 0x14(%rsp), %r8d
movq 0x20(%rsp), %r9
jmp 0x225a
xorl %ebx, %ebx
jmp 0x2225
movl 0x8(%rsp), %ebp
leaq 0x2e3a(%rip), %rdi      # 0x511a
xorl %ebx, %ebx
movl %ebp, %esi
xorl %eax, %eax
callq 0x1030
movl %ebp, 0x4(%r15)
jmp 0x2225
movl 0x8(%rsp), %ebp
movl 0xc(%rsp), %r14d
leaq 0x2e07(%rip), %rdi      # 0x510b
xorl %ebx, %ebx
movl %ebp, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x1030
movl %ebp, 0x4(%r15)
movl %r14d, (%r15)
jmp 0x2225
leaq 0x2dad(%rip), %rdi      # 0x50d2
movl %ecx, %esi
xorl %eax, %eax
callq 0x1030
pushq $0x1
popq %rdi
callq 0x1150