// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_locate.cpp
// Function: findC(unsigned int*, int*, int*, int, int, int, int*, int*, int*, int*, int*, int*)
int findC(unsigned int *D,int *D_2,int *D_3,int startm,int mrlen,int round,int *kmpc,int *B1,int *B2,int *B3,int *Ls,int *Rs){ //コアがある1種類の文字だけで構成されている時
    //printf("\nコアは1種類の文字%dが%d個続いている",coredata[7],mrlen);
    //int len = 0;
    int rofs=0;
    if(round>1){rofs=dc2s[round-1];}
    int bsp[3] = {0,0,0}; //コアが完全一致した時，どこまで戻るか
    int i = 0;
    int tg = 0;
    int ofs = 0;
    int kpofs = 0;
    //int e2[2];
    int y9;
    for(int y8=dc2s[round];y8<dc2s[round+1];y8++){
        //printf("\n[%d(%d)]",y8,D_2[y8+1]-D_2[y8]);
        ofs=0;tg = 0;
        for(y9=D_2[y8];y9<D_2[y8+1];y9++){
            if(rofs+D[y9]==coredata[7]){
                tg++;if(tg==1){kpofs = ofs;} //1文字一致を確認したらオフセットくらいは覚えておく
                if(tg==mrlen){ //CコアがなければB = Cの発見と同じ.コアはどうせ1つしかないのでそのままbreak
                    //printf("\n(コア発見[%d文字目(%d)] / %d(+%d))",y9-D_2[y8],tg,y8,ofs);
                    bsp[0] = y9; //コアの最後尾の位置
                    bsp[1] = y9-D_2[y8]+1 - mrlen; //手前に残ってる文字数
                    bsp[2] = D_2[y8+1]-y9-1; //この先に残ってる文字数
                    if(bsp[1]>0){occart2[round][0] = rofs+D[y9-mrlen];}else{occart2[round][0] = -1;}
                    if(bsp[1]>1){occart2[round][1] = rofs+D[y9-mrlen-1];}else{occart2[round][1] = -1;}
                    occart2[round][2] = y8;
                    occart2[round][3] = kpofs-ocofs; //コアとのずれを最初に払っておく
                    if(bsp[2]>0){occart2[round][4] = rofs+D[y9+1];}else{occart2[round][4] = -1;}
                    if(bsp[2]>1){occart2[round][5] = rofs+D[y9+2];}else{occart2[round][5] = -1;}
                    if(bsp[2]>2){occart2[round][6] = rofs+D[y9+3];}else{occart2[round][6] = -1;}
                    occart2[round][7] = 3; //ABC全部発見 
                    //printf("\nチェック：");
                    //for(int i = 0;i<10;i++){printf("[%d]",occart2[round][i]);}
                    findups(D,D_2,D_3,startm,mrlen,round+1,B1,B2,B3,Ls,Rs,1); //その不完全なコアの出現を探す
                    break;
                }
            }else{ //不一致
                tg=0;
            }
            //printf(" %d",rofs+D[y9]);
            if(round>0){ofs+=D_3[rofs+D[y9]];}else{ofs++;}
        }
        //if(fis>0){printf("(左に右出現[%d文字])",fis);} //先頭から出現
    }
    //printf("\nend of searching.(%d)[%d]",len,i);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %r9d, %ebx
movl %ecx, 0x1c(%rsp)
movq %rdx, %r15
movq %rsi, 0x30(%rsp)
movq %rdi, 0x10(%rsp)
xorl %r14d, %r14d
movl %r8d, 0xc(%rsp)
movl %r8d, %eax
movq %rax, 0x28(%rsp)
leaq 0x5f91(%rip), %rsi      # 0x96a0
movl $0x0, %r13d
cmpl $0x2, %r9d
jl 0x3722
leal -0x1(%rbx), %eax
movl (%rsi,%rax,4), %r13d
movslq %ebx, %rcx
movslq (%rsi,%rcx,4), %rax
leal 0x1(%rbx), %edx
movl %edx, 0x18(%rsp)
movslq %edx, %rdx
movq %rdx, 0x60(%rsp)
imulq $0x28, %rcx, %rcx
leaq 0x5a2d(%rip), %rdx      # 0x9170
leaq (%rdx,%rcx), %rdi
movq %rdi, 0x20(%rsp)
addq %rdx, %rcx
addq $0x4, %rcx
movq %rcx, 0x50(%rsp)
movq 0x10(%rsp), %rcx
addq $0xc, %rcx
movq %rcx, 0x58(%rsp)
movl 0xc(%rsp), %ecx
movl %ecx, %edx
negl %edx
notl %ecx
movq %rcx, 0x40(%rsp)
pushq $0x1
popq %rbp
movq %rdx, 0x48(%rsp)
movq 0x60(%rsp), %rcx
movslq (%rsi,%rcx,4), %rcx
cmpq %rcx, %rax
jge 0x3931
movq 0x30(%rsp), %rcx
movslq (%rcx,%rax,4), %rdi
leaq 0x1(%rax), %rdx
movq %rdx, 0x38(%rsp)
movslq 0x4(%rcx,%rax,4), %rsi
movl 0x5e8f(%rip), %r8d      # 0x963c
movq 0x58(%rsp), %rcx
leaq (%rcx,%rdi,4), %rcx
xorl %edx, %edx
xorl %r10d, %r10d
xorl %r9d, %r9d
leaq (%rdi,%rdx), %r11
cmpq %rsi, %r11
jge 0x3920
movl -0xc(%rcx,%rdx,4), %r11d
addl %r13d, %r11d
cmpl %r8d, %r11d
jne 0x37ef
leal 0x1(%r10), %r12d
testl %r10d, %r10d
cmovel %r9d, %r14d
cmpl 0xc(%rsp), %r12d
je 0x3808
movl %r12d, %r10d
jmp 0x37f2
xorl %r10d, %r10d
movl %ebp, %r12d
testl %ebx, %ebx
jle 0x3800
movl %r11d, %r11d
movl (%r15,%r11,4), %r12d
addl %r12d, %r9d
incq %rdx
jmp 0x37be
movq 0x48(%rsp), %r9
leal (%r9,%rdx), %r8d
cmpl $0x7fffffff, %r8d       # imm = 0x7FFFFFFF
jae 0x385e
leal (%r9,%rdi), %r8d
addl %edx, %r8d
movslq %r8d, %r8
movq 0x10(%rsp), %r9
movl (%r9,%r8,4), %r8d
addl %r13d, %r8d
movq 0x20(%rsp), %r10
movl %r8d, (%r10)
pushq $-0x1
popq %r8
cmpl %edx, 0x28(%rsp)
je 0x386b
movq 0x40(%rsp), %r8
addl %edi, %r8d
addl %edx, %r8d
movslq %r8d, %r8
movq 0x10(%rsp), %r9
movl (%r9,%r8,4), %r8d
addl %r13d, %r8d
jmp 0x386b
movq 0x20(%rsp), %r10
orl $-0x1, (%r10)
pushq $-0x1
popq %r8
subl %edi, %esi
leal -0x1(%rsi), %edi
subq %rdx, %rdi
movq 0x50(%rsp), %r9
movl %r8d, (%r9)
movl %eax, 0x8(%r10)
movl %r14d, %eax
subl 0x5e84(%rip), %eax      # 0x970c
movl %eax, 0xc(%r10)
testl %edi, %edi
jle 0x38be
addq $-0x2, %rsi
movl -0x8(%rcx,%rdx,4), %eax
addl %r13d, %eax
movl %eax, 0x10(%r10)
cmpl %edx, %esi
je 0x38c3
movl -0x4(%rcx,%rdx,4), %eax
addl %r13d, %eax
movl %eax, 0x14(%r10)
pushq $-0x1
popq %rax
cmpl $0x3, %edi
jb 0x38cb
movl (%rcx,%rdx,4), %eax
addl %r13d, %eax
jmp 0x38cb
orl $-0x1, 0x10(%r10)
orl $-0x1, 0x14(%r10)
pushq $-0x1
popq %rax
movl %eax, 0x18(%r10)
movl $0x3, 0x1c(%r10)
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %r15, %rdx
movl 0x1c(%rsp), %ecx
movq 0x28(%rsp), %r8
movl 0x18(%rsp), %r9d
pushq $0x1
pushq 0xd0(%rsp)
pushq 0xd0(%rsp)
pushq 0xd0(%rsp)
pushq 0xd0(%rsp)
pushq 0xd0(%rsp)
callq 0x2aba
addq $0x30, %rsp
movq 0x38(%rsp), %rax
leaq 0x5d74(%rip), %rsi      # 0x96a0
jmp 0x377d
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq