// File: /workspace/github_cpp_makefile_star2_O2/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 %r8d, %ebx
movl %edx, %r13d
movq %rdi, %r15
orq $-0x1, 0x8(%rsp)
leal -0x1(%rsi), %edi
movq $0x0, 0x20(%rsp)
movl $0x0, %r12d
cmpl $0x2, %esi
jl 0x3eee
movl %edi, %eax
leaq 0x6406(%rip), %rdx      # 0xa2f0
movl (%rdx,%rax,4), %r12d
movl %edi, 0x18(%rsp)
movl %ecx, 0x1c(%rsp)
movslq %ecx, %rax
imulq $0x28, %rax, %rax
leaq 0x95bc(%rip), %rcx      # 0xd4c0
addq %rax, %rcx
movl 0x9a6a(%rip), %r14d     # 0xd978
leal -0x1(%r13), %eax
movl %eax, 0x14(%rsp)
pushq $0x1
popq %rax
pxor %xmm0, %xmm0
xorl %edx, %edx
movq %rcx, 0x28(%rsp)
cmpq $0x2, %rdx
je 0x4011
movq %rdx, 0x50(%rsp)
subl %edx, %eax
shll $0x2, %eax
movl (%rax,%rcx), %ebp
movdqa %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
leaq 0x30(%rsp), %rdi
movl %ebp, %esi
callq 0x2c26
testl %ebp, %ebp
js 0x4002
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movl %ecx, %ecx
decq %rcx
testl %ecx, %ecx
js 0x3fbf
movl %ecx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
movl (%rax,%rdx,4), %edx
addl %r12d, %edx
cmpl $0x1, %r13d
jne 0x3fa2
testl %r14d, %r14d
jle 0x3fa2
leal (%rbx,%r14), %esi
decl %esi
movslq %esi, %rsi
cmpl (%r15,%rsi,4), %edx
jne 0x3fe2
decl %r14d
jmp 0x3f6e
movq 0x20(%rsp), %rsi
movslq %esi, %rsi
movl %edx, 0x8(%rsp,%rsi,4)
incl %esi
movq %rsi, 0x20(%rsp)
cmpl $0x2, %esi
jne 0x3f6e
jmp 0x4056
leaq 0x30(%rsp), %rdi
callq 0x6e42
movq 0x50(%rsp), %rdx
incq %rdx
movq 0x28(%rsp), %rcx
pushq $0x1
popq %rax
pxor %xmm0, %xmm0
jmp 0x3f24
pushq $-0x1
popq %r12
leaq 0x30(%rsp), %rdi
callq 0x6e42
movl %r12d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30(%rsp), %rdi
callq 0x6e42
movq 0x28(%rsp), %rcx
cmpl $0x2, %r13d
jl 0x4041
cmpl $0x1, 0x20(%rsp)
jne 0x4025
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rcx)
movq %r15, %rdi
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl %ebx, %r8d
callq 0x3ead
movl %eax, %r12d
jmp 0x3ff0
cmpl $0x1, %r13d
jne 0x411c
testl %r14d, %r14d
jle 0x4096
pushq $-0x1
popq %r12
jmp 0x3ff0
xorl %r12d, %r12d
movq 0x8(%rsp), %xmm0
pshufd $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
movq 0x28(%rsp), %rax
movq %xmm0, (%rax)
cmpl $0x2, %r13d
jl 0x3fe6
movq %r15, %rdi
movl 0x18(%rsp), %esi
movl 0x14(%rsp), %edx
movl 0x1c(%rsp), %ecx
movl %ebx, %r8d
callq 0x3ead
movl %eax, %r12d
jmp 0x3fe6
movq 0x20(%rsp), %rax
cmpl $0x2, %eax
je 0x40f0
cmpl $0x1, %eax
je 0x40cd
xorl %r12d, %r12d
testl %eax, %eax
jne 0x3ff0
leaq 0x309a(%rip), %rdi      # 0x7151
xorl %r12d, %r12d
xorl %eax, %eax
movq %rcx, %rbx
callq 0x2030
orq $-0x1, (%rbx)
jmp 0x3ff0
movl 0x8(%rsp), %ebx
leaq 0x30a8(%rip), %rdi      # 0x7180
xorl %r12d, %r12d
movl %ebx, %esi
xorl %eax, %eax
movq %rcx, %r14
callq 0x2030
movl %ebx, 0x4(%r14)
jmp 0x3ff0
movl 0x8(%rsp), %ebx
movl 0xc(%rsp), %ebp
leaq 0x3072(%rip), %rdi      # 0x7171
xorl %r12d, %r12d
movl %ebx, %esi
movl %ebp, %edx
xorl %eax, %eax
movq %rcx, %r14
callq 0x2030
movl %ebx, 0x4(%r14)
movl %ebp, (%r14)
jmp 0x3ff0
leaq 0x3015(%rip), %rdi      # 0x7138
movl %r13d, %esi
xorl %eax, %eax
callq 0x2030
pushq $0x1
popq %rdi
callq 0x21c0
jmp 0x4137
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x6e42
movq %rbx, %rdi
callq 0x2240