// File: /workspace/github_cpp_makefile_star2_O3/TooruAkagi[P]GCIS_Index/gcis_uni_locate.cpp
// Function: coreAcheck(int*, int, int, int, int)
int coreAcheck(int *m,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];
                std::vector<int> x;
                xdisp(x,l);
                if(l<0){
                    if(DEBUGFLAG==1){printf("-1を回避(j==%d)",j);}
                    break;}
                 if(DEBUGFLAG==1){printf("open[%d(+%d)]",l,rofs);}
                for(int i = x.size()-1;i>=0;i--){
                    if(count==1 && Alen>0){ //count1ならAコアの判定をする
                         if(DEBUGFLAG==1){printf("\n[%d-%d]",rofs+x[i],m[startm-1+Alen]);}
                        if(x[i]+rofs == m[startm-1+Alen]){
                            Alen--;continue;
                        }
                        else{return -1;}
                    }
                    else{ //count1以外か，コアを判定し終わったら
                        e[etg] = rofs+x[i];etg++;
                        if(etg==2){ //コアの横の文字が2つ集まったら
                            occart2[tround][1] = e[0]; //1こめ
                            occart2[tround][0] = e[1]; //1こめ
                            if(count>1){return coreAcheck(m,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(m,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
movl %edx, %r14d
movq %rdi, 0x48(%rsp)
movq $-0x1, 0x10(%rsp)
leal -0x1(%rsi), %eax
movl %eax, (%rsp)
xorl %r13d, %r13d
movl $0x0, %ebp
cmpl $0x2, %esi
jl 0x428c
movl (%rsp), %eax
leaq 0x7057(%rip), %rdx      # 0xb2e0
movl (%rdx,%rax,4), %ebp
movl %ecx, 0x1c(%rsp)
movslq %ecx, %rax
leaq (%rax,%rax,4), %rax
leaq 0xa212(%rip), %rcx      # 0xe4b0
leaq (%rcx,%rax,8), %rax
movq %rax, 0x8(%rsp)
movl 0xa6ba(%rip), %r12d     # 0xe968
movq %r8, 0x40(%rsp)
leal -0x1(%r8), %eax
movq %rax, 0x50(%rsp)
leal -0x1(%r14), %eax
movl %eax, 0x18(%rsp)
movl $0x1, %eax
movb $0x1, %r15b
movq 0x8(%rsp), %rcx
movl (%rcx,%rax,4), %ebx
pxor %xmm0, %xmm0
movdqa %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x20(%rsp), %rdi
movl %ebx, %esi
callq 0x2d93
movq 0x20(%rsp), %rdi
testl %ebx, %ebx
js 0x4357
movq 0x28(%rsp), %rax
subq %rdi, %rax
shrq $0x2, %rax
decl %eax
js 0x435e
movl %eax, %eax
incq %rax
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %r8
movl -0x4(%rdi,%rax,4), %ecx
addl %ebp, %ecx
cmpl $0x1, %r14d
jne 0x433d
testl %r12d, %r12d
jle 0x433d
leal (%r8,%r12), %edx
movslq %edx, %rdx
cmpl (%rsi,%rdx,4), %ecx
jne 0x43af
decl %r12d
jmp 0x434e
movslq %r13d, %r13
movl %ecx, 0x10(%rsp,%r13,4)
incl %r13d
cmpl $0x2, %r13d
je 0x4367
decq %rax
jg 0x431b
xorl %ebx, %ebx
jmp 0x43cc
movl $0x2, %ebx
jmp 0x4360
xorl %ebx, %ebx
testq %rdi, %rdi
jne 0x43cc
jmp 0x43d9
movq 0x10(%rsp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq 0x8(%rsp), %rax
movq %xmm0, (%rax)
cmpl $0x2, %r14d
jl 0x43b9
movq %rsi, %rdi
movl (%rsp), %esi
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
movq 0x40(%rsp), %r8
callq 0x424d
movl %eax, 0x4(%rsp)
movl $0x1, %ebx
movl $0x2, %r13d
movq 0x20(%rsp), %rdi
jmp 0x4360
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
jmp 0x43c7
movl $0x0, 0x4(%rsp)
movl $0x2, %r13d
movl $0x1, %ebx
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
testl %ebx, %ebx
jne 0x43f1
xorl %eax, %eax
testb $0x1, %r15b
movl $0x0, %r15d
jne 0x42cc
jmp 0x43f6
cmpl $0x2, %ebx
jne 0x442c
cmpl $0x2, %r14d
jl 0x4432
cmpl $0x1, %r13d
jne 0x440e
movl 0x10(%rsp), %eax
movq 0x8(%rsp), %rcx
movl %eax, 0x4(%rcx)
movq 0x48(%rsp), %rdi
movl (%rsp), %esi
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
movq 0x40(%rsp), %r8
callq 0x424d
movl %eax, %ebx
jmp 0x4446
movl 0x4(%rsp), %ebx
jmp 0x4446
cmpl $0x1, %r14d
jne 0x44d6
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %r12d, %r12d
jle 0x4457
movl %ebx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, %r13d
je 0x44a8
cmpl $0x1, %r13d
je 0x4488
xorl %ebx, %ebx
testl %r13d, %r13d
jne 0x4446
leaq 0x3ce0(%rip), %rdi      # 0x8151
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2030
movq 0x8(%rsp), %rax
movq $-0x1, (%rax)
jmp 0x4446
movl 0x10(%rsp), %ebx
leaq 0x3ced(%rip), %rdi      # 0x8180
movl %ebx, %esi
xorl %eax, %eax
callq 0x2030
movq 0x8(%rsp), %rax
movl %ebx, 0x4(%rax)
xorl %ebx, %ebx
jmp 0x4446
movl 0x10(%rsp), %ebx
movl 0x14(%rsp), %r14d
leaq 0x3cb9(%rip), %rdi      # 0x8171
movl %ebx, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0x2030
movq 0x8(%rsp), %rax
movl %ebx, 0x4(%rax)
xorl %ebx, %ebx
movl %r14d, (%rax)
jmp 0x4446
leaq 0x3c5b(%rip), %rdi      # 0x8138
movl %r14d, %esi
xorl %eax, %eax
callq 0x2030
movl $0x1, %edi
callq 0x21a0
jmp 0x44f3
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x450d
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2220