// File: /workspace/github_cpp_makefile_star2_O1/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 $0x48, %rsp
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, 0x8(%rsp)
movq %rdx, %r15
movq %rsi, 0x28(%rsp)
movq %rdi, (%rsp)
xorl %r13d, %r13d
leaq 0x6be2(%rip), %rcx      # 0xa6a0
cmpl $0x2, %r9d
jl 0x3acb
leal -0x1(%rbx), %eax
movl (%rcx,%rax,4), %r13d
movslq %ebx, %rdx
movslq (%rcx,%rdx,4), %r14
cmpl 0x4(%rcx,%rdx,4), %r14d
jge 0x3ce9
movq %rdx, %rax
movq %rdx, %rcx
leaq (%rax,%rax,4), %rax
incq %rcx
movq %rcx, 0x20(%rsp)
leaq 0x667a(%rip), %rcx      # 0xa170
leaq (%rcx,%rax,8), %rdx
movq %rdx, 0x18(%rsp)
leaq 0x4(%rcx,%rax,8), %rax
movq %rax, 0x10(%rsp)
movq (%rsp), %rax
addq $0xc, %rax
movq %rax, 0x40(%rsp)
movl %ebp, %eax
negl %eax
movq %rax, 0x38(%rsp)
movl %ebp, %eax
notl %eax
movq %rax, 0x30(%rsp)
xorl %r12d, %r12d
movq 0x28(%rsp), %rcx
movslq (%rcx,%r14,4), %rax
movl 0x4(%rcx,%r14,4), %edx
cmpl %eax, %edx
jle 0x3ccd
movl 0x6af5(%rip), %edi      # 0xa63c
movq 0x40(%rsp), %rcx
leaq (%rcx,%rax,4), %rcx
movl %edx, 0xc(%rsp)
movl %edx, %r8d
subl %eax, %r8d
xorl %edx, %edx
xorl %r9d, %r9d
xorl %r10d, %r10d
movl -0xc(%rcx,%rdx,4), %r11d
addl %r13d, %r11d
cmpl %edi, %r11d
jne 0x3b83
leal 0x1(%r10), %esi
testl %r10d, %r10d
cmovel %r9d, %r12d
cmpl %ebp, %esi
je 0x3ba9
movl %esi, %r10d
jmp 0x3b86
xorl %r10d, %r10d
testl %ebx, %ebx
jle 0x3b93
movl %r11d, %esi
movl (%r15,%rsi,4), %r11d
jmp 0x3b99
movl $0x1, %r11d
addl %r11d, %r9d
incq %rdx
cmpl %edx, %r8d
jne 0x3b62
jmp 0x3ccd
movq 0x38(%rsp), %r9
leaq (%r9,%rdx), %rsi
cmpl $0x7ffffffe, %esi       # imm = 0x7FFFFFFE
ja 0x3bd7
leal (%r9,%rax), %esi
addl %edx, %esi
movslq %esi, %rsi
movq (%rsp), %rdi
movl (%rdi,%rsi,4), %esi
addl %r13d, %esi
movq 0x18(%rsp), %r8
movl %esi, (%r8)
jmp 0x3be3
movq 0x18(%rsp), %r8
movl $0xffffffff, (%r8)      # imm = 0xFFFFFFFF
leaq (%r9,%rdx), %rsi
incq %rsi
cmpl $0x2, %esi
jl 0x3c0e
movq 0x30(%rsp), %rsi
addl %eax, %esi
addl %edx, %esi
movslq %esi, %rsi
movq (%rsp), %rdi
movl (%rdi,%rsi,4), %esi
addl %r13d, %esi
movq 0x10(%rsp), %rdi
movl %esi, (%rdi)
jmp 0x3c19
movq 0x10(%rsp), %rsi
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
notl %eax
addl 0xc(%rsp), %eax
subq %rdx, %rax
movl %r14d, 0x8(%r8)
movl %r12d, %esi
subl 0x6add(%rip), %esi      # 0xa70c
movl %esi, 0xc(%r8)
testl %eax, %eax
jle 0x3c44
movl -0x8(%rcx,%rdx,4), %esi
addl %r13d, %esi
movl %esi, 0x10(%r8)
jmp 0x3c4c
movl $0xffffffff, 0x10(%r8)  # imm = 0xFFFFFFFF
cmpl $0x2, %eax
jl 0x3c5e
movl -0x4(%rcx,%rdx,4), %esi
addl %r13d, %esi
movl %esi, 0x14(%r8)
jmp 0x3c66
movl $0xffffffff, 0x14(%r8)  # imm = 0xFFFFFFFF
cmpl $0x3, %eax
jl 0x3c77
movl (%rcx,%rdx,4), %eax
addl %r13d, %eax
movl %eax, 0x18(%r8)
jmp 0x3c7f
movl $0xffffffff, 0x18(%r8)  # imm = 0xFFFFFFFF
movl $0x3, 0x1c(%r8)
movq (%rsp), %rdi
movq 0x28(%rsp), %rsi
movq %r15, %rdx
movl 0x8(%rsp), %ecx
movl %ebp, %r8d
movq 0x20(%rsp), %r9
pushq $0x1
pushq 0xb0(%rsp)
pushq 0xb0(%rsp)
pushq 0xb0(%rsp)
pushq 0xb0(%rsp)
pushq 0xb0(%rsp)
callq 0x2e6e
addq $0x30, %rsp
incq %r14
leaq 0x69c9(%rip), %rax      # 0xa6a0
movq 0x20(%rsp), %rcx
movslq (%rax,%rcx,4), %rax
cmpq %rax, %r14
jl 0x3b2b
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq