// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %rsp
movl %r9d, %ebx
movl %r8d, 0xc(%rsp)
movl %ecx, 0x20(%rsp)
movq %rdx, %r15
movq %rsi, 0x30(%rsp)
movq %rdi, 0x10(%rsp)
xorl %r13d, %r13d
leaq 0x6d75(%rip), %rcx      # 0xa6a0
cmpl $0x2, %r9d
jl 0x3938
leal -0x1(%rbx), %eax
movl (%rcx,%rax,4), %r13d
movslq %ebx, %rdx
movslq (%rcx,%rdx,4), %r14
movl 0x4(%rcx,%rdx,4), %esi
cmpl %esi, %r14d
jge 0x3b65
movq %rdx, %rax
movl 0xc(%rsp), %edx
movl %edx, %ecx
movq %rcx, 0x28(%rsp)
movq %rax, %rcx
leaq (%rax,%rax,4), %rax
incq %rcx
movq %rcx, 0x48(%rsp)
leaq 0x6800(%rip), %rcx      # 0xa170
leaq (%rcx,%rax,8), %rax
movq %rax, 0x18(%rsp)
movq 0x10(%rsp), %rax
addq $0xc, %rax
movq %rax, 0x50(%rsp)
movl %edx, %ecx
negl %ecx
movl %edx, %eax
notl %eax
movq %rax, 0x38(%rsp)
xorl %r12d, %r12d
movq %rcx, 0x40(%rsp)
movq 0x30(%rsp), %rax
movslq (%rax,%r14,4), %rdi
movl 0x4(%rax,%r14,4), %edx
cmpl %edi, %edx
jle 0x3b56
movl %esi, 0x24(%rsp)
movl 0x6c7f(%rip), %r8d      # 0xa63c
movq 0x50(%rsp), %rax
leaq (%rax,%rdi,4), %rax
movl %edx, %r9d
subl %edi, %r9d
xorl %ecx, %ecx
xorl %r10d, %r10d
xorl %r11d, %r11d
movl -0xc(%rax,%rcx,4), %esi
addl %r13d, %esi
cmpl %r8d, %esi
jne 0x39f6
leal 0x1(%r11), %ebp
testl %r11d, %r11d
cmovel %r10d, %r12d
cmpl 0xc(%rsp), %ebp
je 0x3a1e
movl %ebp, %r11d
jmp 0x39f9
xorl %r11d, %r11d
testl %ebx, %ebx
jle 0x3a05
movl %esi, %esi
movl (%r15,%rsi,4), %esi
jmp 0x3a0a
movl $0x1, %esi
addl %esi, %r10d
incq %rcx
cmpl %ecx, %r9d
jne 0x39d4
movl 0x24(%rsp), %esi
jmp 0x3b56
movq 0x40(%rsp), %r8
leal (%r8,%rcx), %esi
cmpl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
jae 0x3a72
leal (%r8,%rdi), %esi
addl %ecx, %esi
movslq %esi, %rsi
movq 0x10(%rsp), %r8
movl (%r8,%rsi,4), %esi
addl %r13d, %esi
movq 0x18(%rsp), %r9
movl %esi, (%r9)
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
cmpl %ecx, 0x28(%rsp)
je 0x3a84
movq 0x38(%rsp), %rsi
addl %edi, %esi
addl %ecx, %esi
movslq %esi, %rsi
movq 0x10(%rsp), %r8
movl (%r8,%rsi,4), %r8d
addl %r13d, %r8d
jmp 0x3a84
movq 0x18(%rsp), %r9
movl $0xffffffff, (%r9)      # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
subl %edi, %edx
leal -0x1(%rdx), %esi
subq %rcx, %rsi
movl %r8d, 0x4(%r9)
movl %r14d, 0x8(%r9)
movl %r12d, %edi
subl 0x6c6f(%rip), %edi      # 0xa70c
movl %edi, 0xc(%r9)
testl %esi, %esi
jle 0x3adf
addq $-0x2, %rdx
movl -0x8(%rax,%rcx,4), %edi
addl %r13d, %edi
movq 0x18(%rsp), %r8
movl %edi, 0x10(%r8)
movq 0x18(%rsp), %r9
cmpl %ecx, %edx
je 0x3ae7
movl -0x4(%rax,%rcx,4), %edx
addl %r13d, %edx
movl %edx, 0x14(%r9)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl $0x3, %esi
jb 0x3af4
movl (%rax,%rcx,4), %edx
addl %r13d, %edx
jmp 0x3af4
movl $0xffffffff, 0x10(%r9)  # imm = 0xFFFFFFFF
movl $0xffffffff, 0x14(%r9)  # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, 0x18(%r9)
movl $0x3, 0x1c(%r9)
movq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq %r15, %rdx
movl 0x20(%rsp), %ecx
movq 0x28(%rsp), %r8
movq 0x48(%rsp), %rbp
movl %ebp, %r9d
pushq $0x1
pushq 0xc0(%rsp)
pushq 0xc0(%rsp)
pushq 0xc0(%rsp)
pushq 0xc0(%rsp)
pushq 0xc0(%rsp)
callq 0x2c37
addq $0x30, %rsp
leaq 0x6b4d(%rip), %rax      # 0xa6a0
movl (%rax,%rbp,4), %esi
incq %r14
movslq %esi, %rax
cmpq %rax, %r14
jl 0x399c
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq