// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq 0x5214(%rip), %rax      # 0x9020
movq %rax, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
cmpl $0x1, -0x1c(%rbp)
jle 0x3e33
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x9883(%rip), %rax      # 0xd6b0
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movslq -0x24(%rbp), %rcx
leaq 0x9342(%rip), %rax      # 0xd180
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
movl 0x97e7(%rip), %eax      # 0xd638
movl %eax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x2, -0x44(%rbp)
jge 0x3fba
movslq -0x24(%rbp), %rcx
leaq 0x9310(%rip), %rax      # 0xd180
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0x1, %ecx
subl -0x44(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0x3e93
jmp 0x3fba
movq -0x18(%rbp), %rax
movl -0x3c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
cmpl (%rcx,%rdx,4), %eax
jl 0x3faa
cmpl $0x1, -0x20(%rbp)
jne 0x3f09
cmpl $0x0, -0x40(%rbp)
jle 0x3f09
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
addl -0x2c(%rbp), %eax
movq 0x9842(%rip), %rcx      # 0xd720
movl -0x28(%rbp), %edx
subl $0x1, %edx
addl -0x40(%rbp), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jne 0x3efd
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x3f9c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x411c
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rdx
addl (%rax,%rdx,4), %ecx
movslq -0x38(%rbp), %rax
movl %ecx, -0x34(%rbp,%rax,4)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
cmpl $0x2, -0x38(%rbp)
jne 0x3f98
movl -0x34(%rbp), %ecx
movslq -0x24(%rbp), %rdx
leaq 0x9244(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x30(%rbp), %ecx
movslq -0x24(%rbp), %rdx
leaq 0x922c(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
cmpl $0x1, -0x20(%rbp)
jle 0x3f8c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
subl $0x1, %edx
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movl -0x24(%rbp), %r8d
movl -0x28(%rbp), %r9d
callq 0x3de0
movl %eax, -0x4(%rbp)
jmp 0x411c
movl $0x0, -0x4(%rbp)
jmp 0x411c
jmp 0x3f9a
jmp 0x3f9c
movl -0x48(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x3ea9
jmp 0x3fac
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x3e5b
cmpl $0x1, -0x20(%rbp)
jle 0x4007
cmpl $0x1, -0x38(%rbp)
jne 0x3fde
movl -0x34(%rbp), %ecx
movslq -0x24(%rbp), %rdx
leaq 0x91ac(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
subl $0x1, %edx
movl -0x20(%rbp), %ecx
subl $0x1, %ecx
movl -0x24(%rbp), %r8d
movl -0x28(%rbp), %r9d
callq 0x3de0
movl %eax, -0x4(%rbp)
jmp 0x411c
cmpl $0x1, -0x20(%rbp)
je 0x4028
movl -0x20(%rbp), %esi
leaq 0x5106(%rip), %rdi      # 0x911d
movb $0x0, %al
callq 0x2030
movl $0x1, %edi
callq 0x2190
cmpl $0x0, -0x40(%rbp)
jle 0x403a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x411c
cmpl $0x0, -0x38(%rbp)
jne 0x408b
leaq 0x50ef(%rip), %rdi      # 0x9136
movb $0x0, %al
callq 0x2030
movslq -0x24(%rbp), %rcx
leaq 0x9127(%rip), %rax      # 0xd180
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movslq -0x24(%rbp), %rcx
leaq 0x910e(%rip), %rax      # 0xd180
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl $0x0, -0x4(%rbp)
jmp 0x411c
cmpl $0x2, -0x38(%rbp)
jne 0x40dd
movl -0x34(%rbp), %esi
movl -0x30(%rbp), %edx
leaq 0x50b8(%rip), %rdi      # 0x9156
movb $0x0, %al
callq 0x2030
movl -0x34(%rbp), %ecx
movslq -0x24(%rbp), %rdx
leaq 0x90cd(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl -0x30(%rbp), %ecx
movslq -0x24(%rbp), %rdx
leaq 0x90b5(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x411c
cmpl $0x1, -0x38(%rbp)
jne 0x4115
movl -0x34(%rbp), %esi
leaq 0x5078(%rip), %rdi      # 0x9165
movb $0x0, %al
callq 0x2030
movl -0x34(%rbp), %ecx
movslq -0x24(%rbp), %rdx
leaq 0x907e(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x411c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)