// File: 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
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movl %ecx, -0x2c(%rbp)
movl %r8d, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
cmpl $0x1, -0x34(%rbp)
jle 0x62d0
movl -0x34(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x73e6(%rip), %rax      # 0xd6b0
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
leaq -0x44(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x20c0
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movslq -0x34(%rbp), %rcx
leaq 0x73a9(%rip), %rax      # 0xd6b0
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rdx
leaq 0x7390(%rip), %rcx      # 0xd6b0
cmpl (%rcx,%rdx,4), %eax
jge 0x6639
movl $0x0, -0x50(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
movq -0x20(%rbp), %rcx
movl -0x5c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x6629
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
movslq -0x58(%rbp), %rdx
addl (%rcx,%rdx,4), %eax
cmpl 0x72da(%rip), %eax      # 0xd64c
jne 0x65e4
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
cmpl $0x1, -0x4c(%rbp)
jne 0x638d
movl -0x50(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jne 0x65e2
movl -0x58(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x58(%rbp), %eax
movq -0x20(%rbp), %rcx
movslq -0x5c(%rbp), %rdx
subl (%rcx,%rdx,4), %eax
addl $0x1, %eax
subl -0x30(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movl -0x5c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
subl -0x58(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x40(%rbp)
jle 0x63fe
movl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %edx
subl -0x30(%rbp), %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movslq -0x34(%rbp), %rdx
leaq 0x6d8d(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
jmp 0x6416
movslq -0x34(%rbp), %rcx
leaq 0x6d77(%rip), %rax      # 0xd180
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
cmpl $0x1, -0x40(%rbp)
jle 0x6449
movl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %edx
subl -0x30(%rbp), %edx
subl $0x1, %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movslq -0x34(%rbp), %rdx
leaq 0x6d43(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
jmp 0x6462
movslq -0x34(%rbp), %rcx
leaq 0x6d2c(%rip), %rax      # 0xd180
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x4(%rax)  # imm = 0xFFFFFFFF
movl -0x5c(%rbp), %ecx
movslq -0x34(%rbp), %rdx
leaq 0x6d10(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x54(%rbp), %ecx
subl 0x7299(%rip), %ecx      # 0xd71c
movslq -0x34(%rbp), %rdx
leaq 0x6cf2(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
cmpl $0x0, -0x3c(%rbp)
jle 0x64c8
movl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movslq -0x34(%rbp), %rdx
leaq 0x6cc4(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
jmp 0x64e1
movslq -0x34(%rbp), %rcx
leaq 0x6cad(%rip), %rax      # 0xd180
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
cmpl $0x1, -0x3c(%rbp)
jle 0x6511
movl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movslq -0x34(%rbp), %rdx
leaq 0x6c7b(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x14(%rax)
jmp 0x652a
movslq -0x34(%rbp), %rcx
leaq 0x6c64(%rip), %rax      # 0xd180
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x14(%rax) # imm = 0xFFFFFFFF
cmpl $0x2, -0x3c(%rbp)
jle 0x655a
movl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rax
movl -0x58(%rbp), %edx
addl $0x3, %edx
movslq %edx, %rdx
addl (%rax,%rdx,4), %ecx
movslq -0x34(%rbp), %rdx
leaq 0x6c32(%rip), %rax      # 0xd180
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
jmp 0x6573
movslq -0x34(%rbp), %rcx
leaq 0x6c1b(%rip), %rax      # 0xd180
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
movslq -0x34(%rbp), %rcx
leaq 0x6c02(%rip), %rax      # 0xd180
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl $0x3, 0x1c(%rax)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
movl -0x34(%rbp), %r9d
addl $0x1, %r9d
movq 0x18(%rbp), %r14
movq 0x20(%rbp), %rbx
movq 0x28(%rbp), %r11
movq 0x30(%rbp), %r10
movq 0x38(%rbp), %rax
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl $0x1, 0x28(%rsp)
callq 0x4e60
jmp 0x6629
jmp 0x65eb
movl $0x0, -0x4c(%rbp)
cmpl $0x0, -0x34(%rbp)
jle 0x6610
movq -0x28(%rbp), %rax
movl -0x38(%rbp), %ecx
movq -0x18(%rbp), %rdx
movslq -0x58(%rbp), %rsi
addl (%rdx,%rsi,4), %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x6619
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x661b
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x6345
jmp 0x662b
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x630d
xorl %eax, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw (%rax,%rax)