// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_uni_locate.cpp
// Function: findups(int*, int, int, int, int*, int*, int*, int*, int*, int)
int findups(int *m,int startm,int mrlen,int round,int *B1,int *B2,int *B3,int *Ls,int *Rs,int count){
    if(DEBUGFLAG==1){
        printf("\n[%d]を探す(round %d / %d)",occart2[round-1][2],round,loops);
        for(int i = 0; i<10; i++){printf("[%d]",occart2[round-1][i]);}
        uhdisp(occart2[round-1][2]);
    }
    if(round==loops){return findupsintop(m,startm,mrlen,B1,B2,B3,Ls,Rs,count);}
    int rofs=0;
    if(round>1){rofs=dc2s[round-1];}
    for(int y8=dc2s[round];y8<dc2s[round+1];y8++){
        std::vector<int> x;
        xdisp(x,y8);
        int ofs = 0;
        for(int y9=0;y9<x.size();y9++){
            //printf(" %d",rofs+D[y9]);
            if(rofs+x[y9]==occart2[round-1][2]){ //該当する1文字を見つけたら
                gate++;
                if(DEBUGFLAG==1){
                     printf("\n[%dの%d文字目に発見(+%d)]",y8,y9,ofs);
                }
                coreans++;
                //左がないなら左を探す(このroundで1つ見つかれば良い)
                for(int i = 0; i<10; i++){occart2[round][i] = occart2[round-1][i];} //コアを見つけたら下階層からゲット
                if(y9==0 || occart2[round-1][0]>-1){ //先頭にないか，左[0]が埋まっているなら左は追加できない
                }
                else{ 
                    if(occart2[round][1] == -1){ //2つとも埋まっていないなら
                        occart2[round][1] = rofs+x[y9-1];
                        if(1<y9){occart2[round][0] = rofs+x[y9-2];}
                        //printf("\n[%d]記入数 %d %d",y9-D_2[y8],occart2[round][0],occart2[round][1]);
                        if(occart2[round][7]%2==0){
                            if(coreAcheck(m,round-1,count,round,startm)==-1){
                                 if(DEBUGFLAG==1){printf("Aミスマッチ");}
                                continue;
                            }
                            else{occart2[round][7]++;} //1文字少なくとも入れたはずだし0が帰ってきていれば必ずAコアは調べ終わっている
                        }
                        else{leftopennd(m,round-1,count,round);}
                    }
                    else{ //1つ埋まっていないなら
                        occart2[round][0] = rofs+x[y9-1];
                        leftopen(m,round-1,count,round);
                    }
                }
                //printf("\n演算[%d = %d][%d]",y9+1,D_2[y8],occart2[round-1][6]);
                if(y9+1<x.size() && occart2[round-1][6]==-1){ //右があり，右が埋まっていないなら
                    if(occart2[round][5]==-1){ //2文字埋まってないなら
                        if(occart2[round][4]==-1){ //3文字埋まってないなら
                            occart2[round][4] = rofs+x[y9+1];
                            if(y9+2<x.size()){occart2[round][5] = rofs+x[y9+2];}
                            if(y9+3<x.size()){occart2[round][6] = rofs+x[y9+3];}
                            if(occart2[round][7]/2<1){
                                if(coreCcheck(m,round-1,count,round)==-1){
                                     if(DEBUGFLAG==1){printf("Cコアミスマッチ");}
                                    continue;}
                            } //Cのチェックもしていないなら
                            else{rightopennd3(m,round-1,count,round,3);}
                        }
                        else{
                            occart2[round][5] = rofs+x[y9+1];
                            if(y9+2<x.size()){occart2[round][6] = rofs+x[y9+2];}
                            rightopennd3(m,round-1,count,round,2);
                        }
                    }
                    else{ //1つだけ
                        occart2[round][6] = rofs+x[y9+1];
                        rightopennd3(m,round-1,count,round,1);
                    }
                    //exit(7);
                }
                //printf("\n結果:");
                //for(int i = 0; i<10; i++){printf("[%d]",occart2[round][i]);}
                if(occart2[round][6]> -1 && occart2[round][0] > -1){
                    //printf("\n[早速チェック]");
                    int e2[2] = {occart2[round][1],occart2[round][0]};
                    int tk = rpsck(m,Ls,B1,e2,round-count-1);
                    //if(tk==-1){printf("\nこれはコアではない");}
                    if(tk==0){
                        int e[3] = {occart2[round][4],occart2[round][5],occart2[round][6]};
                        tk = psck(m,Rs,B2,e,round-count-1);
                        //if(tk==-1){printf("\nこれはコアではない");}
                        if(tk==0){ //左右も完璧に合ってた
                            //printf("\n正しい出現を%dの+%dに発見!\n",y8,occart2[round][3]+ofs);
                            findinround1(y8,round+1,occart2[round][3]+ofs);
                            //exit(1);
                        }
                    }
                }
                else{ //もっと上の階層に再帰するしかない
                    int e[3] = {occart2[round][4],occart2[round][5],occart2[round][6]};
                    int tk = psck(m,Rs,B2,e,round-count-1);
                    if(tk!=-1){
                        occart2[round][2] = y8;occart2[round][3] += ofs;
                        findups(m,startm,mrlen,round+1,B1,B2,B3,Ls,Rs,count+1);
                    }
                    //else{printf("\n[排除できる例(%d,%d)]",y8,y9-D_2[y8]);}
                }
            }
            if(round>0){ofs+=D3access(rofs+x[y9]);}else{ofs++;}
        }
    }
   if(DEBUGFLAG==1){printf("\nfindups--[%d]探し 終了--\n",occart2[round-1][2]);}
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, 0x4c(%rsp)
movl 0xd8(%rsp), %eax
cmpl %ecx, 0x585a(%rip)      # 0xa19c
jne 0x496d
subq $0x8, %rsp
movq %r8, %rcx
movq %r9, %r8
pushq %rax
pushq 0xe0(%rsp)
pushq 0xe0(%rsp)
callq 0x4572
addq $0x20, %rsp
xorl %eax, %eax
jmp 0x4d7f
movq %rdi, 0x8(%rsp)
movl %esi, 0x28(%rsp)
movq %r8, 0x68(%rsp)
movq %r9, 0x30(%rsp)
leal -0x1(%rcx), %edx
movl $0x0, 0x4(%rsp)
leaq 0x595e(%rip), %rsi      # 0xa2f0
cmpl $0x2, %ecx
jl 0x49a0
movl %edx, %eax
movl (%rsi,%rax,4), %eax
movl %eax, 0x4(%rsp)
movslq %ecx, %rax
movl (%rsi,%rax,4), %r8d
leal 0x1(%rcx), %edi
movl %edi, 0x2c(%rsp)
movslq %edi, %rdi
movq %rdi, 0x78(%rsp)
movl %edx, 0x14(%rsp)
movslq %edx, %rdx
imulq $0x28, %rdx, %r14
leaq 0x8af8(%rip), %rbx      # 0xd4c0
leaq (%rbx,%r14), %rdx
movq %rdx, 0x38(%rsp)
imulq $0x28, %rax, %r15
leaq (%rbx,%r15), %r13
movl 0xd8(%rsp), %eax
movl %eax, %edx
notl %edx
movq %rcx, 0x20(%rsp)
addl %ecx, %edx
movl %edx, 0x1c(%rsp)
incl %eax
movq %rax, 0x80(%rsp)
leaq 0x50(%rsp), %r12
movq 0x78(%rsp), %rax
cmpl (%rsi,%rax,4), %r8d
jge 0x4d7c
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
movq %r12, %rdi
movl %r8d, 0x18(%rsp)
movl %r8d, %esi
callq 0x2c26
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
jbe 0x4d5b
movl (%rax,%r12,4), %ecx
addl 0x4(%rsp), %ecx
movq 0x38(%rsp), %rdx
cmpl 0x8(%rdx), %ecx
jne 0x4ca5
incl 0x5a6e(%rip)            # 0xa4d4
incl 0x59c0(%rip)            # 0xa42c
xorl %ecx, %ecx
cmpq $0xa, %rcx
je 0x4a87
leaq (%r14,%rcx,4), %rdx
movl (%rbx,%rdx), %edx
leaq (%r15,%rcx,4), %rsi
movl %edx, (%rbx,%rsi)
incq %rcx
jmp 0x4a6e
testq %r12, %r12
je 0x4b30
movq 0x38(%rsp), %rcx
cmpl $0x0, (%rcx)
jns 0x4b30
movl -0x4(%rax,%r12,4), %ecx
addl 0x4(%rsp), %ecx
cmpl $-0x1, 0x4(%r13)
je 0x4ace
movl %ecx, (%r13)
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x20(%rsp), %rcx
callq 0x3d25
jmp 0x4b30
movl %ecx, 0x4(%r13)
cmpq $0x1, %r12
movl 0x14(%rsp), %esi
je 0x4ae9
movl -0x8(%rax,%r12,4), %eax
addl 0x4(%rsp), %eax
movl %eax, (%r13)
testb $0x1, 0x1c(%r13)
jne 0x4b1a
movq 0x8(%rsp), %rdi
movl 0xd8(%rsp), %edx
movq 0x20(%rsp), %rcx
movl 0x28(%rsp), %r8d
callq 0x3ead
cmpl $-0x1, %eax
je 0x4cc4
incl 0x1c(%r13)
jmp 0x4b30
movq 0x8(%rsp), %rdi
movl 0xd8(%rsp), %edx
movq 0x20(%rsp), %rcx
callq 0x3dda
leaq 0x1(%r12), %rdx
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rdx, %rcx
jbe 0x4b8a
movq 0x38(%rsp), %rsi
cmpl $-0x1, 0x18(%rsi)
jne 0x4b8a
cmpl $-0x1, 0x14(%r13)
pushq $0x1
popq %r8
je 0x4ccc
movl (%rax,%rdx,4), %eax
addl 0x4(%rsp), %eax
movl %eax, 0x18(%r13)
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x20(%rsp), %rcx
callq 0x3825
movl 0x18(%r13), %eax
testl %eax, %eax
js 0x4c26
movl (%r13), %ecx
testl %ecx, %ecx
js 0x4c26
movl 0x4(%r13), %eax
movl %eax, 0x70(%rsp)
movl %ecx, 0x74(%rsp)
movq 0x8(%rsp), %rdi
movq 0xc8(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movl 0x1c(%rsp), %r8d
callq 0x2c6e
testl %eax, %eax
jne 0x4ca5
movq 0x10(%r13), %rax
movq %rax, 0x40(%rsp)
movl 0x18(%r13), %eax
movl %eax, 0x48(%rsp)
movq 0x8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movl 0x1c(%rsp), %r8d
callq 0x2eb0
testl %eax, %eax
jne 0x4ca5
movl 0xc(%r13), %edx
addl %ebp, %edx
movl 0x18(%rsp), %edi
movl 0x2c(%rsp), %esi
callq 0x4443
jmp 0x4ca5
movq 0x10(%r13), %rcx
movq %rcx, 0x40(%rsp)
movl %eax, 0x48(%rsp)
movq 0x8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movl 0x1c(%rsp), %r8d
callq 0x2eb0
cmpl $-0x1, %eax
je 0x4ca5
movl 0x18(%rsp), %eax
movl %eax, 0x8(%r13)
addl %ebp, 0xc(%r13)
movq 0x8(%rsp), %rdi
movl 0x28(%rsp), %esi
movl 0x4c(%rsp), %edx
movl 0x2c(%rsp), %ecx
movq 0x68(%rsp), %r8
movq 0x30(%rsp), %r9
pushq 0x80(%rsp)
pushq 0xd8(%rsp)
pushq 0xd8(%rsp)
pushq 0xd8(%rsp)
callq 0x4920
addq $0x20, %rsp
cmpl $0x0, 0x20(%rsp)
jle 0x4cc2
movq 0x50(%rsp), %rax
movl (%rax,%r12,4), %edi
addl 0x4(%rsp), %edi
callq 0x3770
addl %eax, %ebp
jmp 0x4cc4
incl %ebp
incq %r12
jmp 0x4a30
movl 0x4(%rax,%r12,4), %esi
addl 0x4(%rsp), %esi
leaq 0x2(%r12), %rdx
cmpl $-0x1, 0x10(%r13)
je 0x4cf7
movl %esi, 0x14(%r13)
pushq $0x2
popq %r8
cmpq %rdx, %rcx
ja 0x4b65
jmp 0x4b70
movl %esi, 0x10(%r13)
cmpq %rdx, %rcx
jbe 0x4d0d
movl 0x8(%rax,%r12,4), %edx
addl 0x4(%rsp), %edx
movl %edx, 0x14(%r13)
leaq 0x3(%r12), %rdx
cmpq %rdx, %rcx
jbe 0x4d24
movl 0xc(%rax,%r12,4), %eax
addl 0x4(%rsp), %eax
movl %eax, 0x18(%r13)
cmpl $0x1, 0x1c(%r13)
pushq $0x3
popq %r8
jg 0x4b70
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x20(%rsp), %rcx
callq 0x3a68
cmpl $-0x1, %eax
jne 0x4b8a
jmp 0x4cc4
leaq 0x50(%rsp), %r12
movq %r12, %rdi
callq 0x6e42
movl 0x18(%rsp), %r8d
incl %r8d
leaq 0x5579(%rip), %rsi      # 0xa2f0
jmp 0x49fe
pushq $0x1
popq %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4d99
jmp 0x4d99
jmp 0x4d99
jmp 0x4d99
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x6e42
movq %rbx, %rdi
callq 0x2240