// File: /workspace/github_cpp_makefile_star2_O1/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 $0x58, %rsp
movq %r9, 0x28(%rsp)
movl %ecx, %r14d
movq %rdi, %r13
movq $-0x1, 0x10(%rsp)
xorl %edi, %edi
movl $0x0, %r12d
cmpl $0x2, %edx
jl 0x248a
leal -0x1(%rdx), %eax
leaq 0x821a(%rip), %rcx      # 0xa6a0
movl (%rcx,%rax,4), %r12d
movslq %r8d, %rax
leaq (%rax,%rax,4), %rax
leaq 0x7cd8(%rip), %rcx      # 0xa170
leaq (%rcx,%rax,8), %r9
movl 0x8186(%rip), %ebx      # 0xa628
movq 0x28(%rsp), %rax
decl %eax
movq %rax, 0x50(%rsp)
decl %edx
leal -0x1(%r14), %eax
movl %eax, 0x1c(%rsp)
xorl %r15d, %r15d
movl %edi, %eax
xorl $0x1, %eax
movslq (%r9,%rax,4), %rcx
movb $0x1, %r10b
testq %rcx, %rcx
js 0x25cf
movslq 0x4(%rsi,%rcx,4), %rax
movslq (%rsi,%rcx,4), %rcx
cmpl %ecx, %eax
setg %bpl
jle 0x25b7
movq %rdi, 0x20(%rsp)
movq %rsi, %r10
movq 0x821c(%rip), %r11      # 0xa710
movl -0x4(%r13,%rax,4), %esi
addl %r12d, %esi
cmpl $0x1, %r14d
jne 0x251e
testl %ebx, %ebx
jle 0x251e
movq 0x50(%rsp), %rdi
addl %ebx, %edi
movslq %edi, %rdi
cmpl (%r11,%rdi,4), %esi
jne 0x259a
decl %ebx
jmp 0x252f
movslq %r15d, %r15
movl %esi, 0x10(%rsp,%r15,4)
incl %r15d
cmpl $0x2, %r15d
je 0x253d
decq %rax
cmpq %rcx, %rax
setg %bpl
jg 0x24f4
jmp 0x25ac
movl 0x10(%rsp), %eax
movl %eax, 0x4(%r9)
movl 0x14(%rsp), %eax
movl %eax, (%r9)
movl $0x2, %r15d
cmpl $0x2, %r14d
jl 0x25a4
movq %r13, %rdi
movq %r10, 0x38(%rsp)
movq %r10, %rsi
movl 0x1c(%rsp), %ecx
movq %r9, 0x48(%rsp)
movq 0x28(%rsp), %r9
movl %r8d, 0x34(%rsp)
movq %rdx, 0x40(%rsp)
callq 0x244d
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
movl 0x34(%rsp), %r8d
movq 0x48(%rsp), %r9
movl %eax, 0xc(%rsp)
jmp 0x25af
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
jmp 0x25ac
movl $0x0, 0xc(%rsp)
movq %r10, %rsi
movq 0x20(%rsp), %rdi
movb $0x1, %r10b
testb $0x1, %bpl
jne 0x25cc
leal 0x1(%rdi), %eax
testl %edi, %edi
movl %eax, %edi
je 0x24bb
jmp 0x25cf
xorl %r10d, %r10d
testb %r10b, %r10b
je 0x261d
cmpl $0x2, %r14d
jl 0x2607
cmpl $0x1, %r15d
jne 0x25e8
movl 0x10(%rsp), %eax
movl %eax, 0x4(%r9)
movq %r13, %rdi
movl 0x1c(%rsp), %ecx
movq 0x28(%rsp), %r9
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x244d
cmpl $0x1, %r14d
jne 0x26c7
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
testl %ebx, %ebx
jle 0x2630
movl 0xc(%rsp), %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, %r15d
je 0x2692
cmpl $0x1, %r15d
je 0x266b
movl $0x0, 0xc(%rsp)
testl %r15d, %r15d
jne 0x261d
leaq 0x3aa3(%rip), %rdi      # 0x60f3
movl $0x0, 0xc(%rsp)
xorl %eax, %eax
movq %r9, %rbx
callq 0x1030
movq $-0x1, (%rbx)
jmp 0x261d
movl 0x10(%rsp), %r14d
leaq 0x3aab(%rip), %rdi      # 0x6122
movl $0x0, 0xc(%rsp)
movl %r14d, %esi
xorl %eax, %eax
movq %r9, %rbx
callq 0x1030
movl %r14d, 0x4(%rbx)
jmp 0x261d
movl 0x10(%rsp), %r15d
movl 0x14(%rsp), %r14d
leaq 0x3a70(%rip), %rdi      # 0x6113
movl $0x0, 0xc(%rsp)
movl %r15d, %esi
movl %r14d, %edx
xorl %eax, %eax
movq %r9, %rbx
callq 0x1030
movl %r15d, 0x4(%rbx)
movl %r14d, (%rbx)
jmp 0x261d
leaq 0x3a0c(%rip), %rdi      # 0x60da
movl %r14d, %esi
xorl %eax, %eax
callq 0x1030
movl $0x1, %edi
callq 0x1150