// File: /workspace/github_cpp_makefile_star2_O1/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, 0x6c(%rsp)
movl 0xd8(%rsp), %edx
cmpl %ecx, 0x638c(%rip)      # 0xb18c
jne 0x4e2b
subq $0x8, %rsp
movq %r8, %rcx
movq %r9, %r8
pushq %rdx
pushq 0xe0(%rsp)
pushq 0xe0(%rsp)
callq 0x4a81
addq $0x20, %rsp
xorl %eax, %eax
jmp 0x525f
movl $0x0, (%rsp)
leaq 0x64a7(%rip), %r10      # 0xb2e0
cmpl $0x2, %ecx
jl 0x4e48
leal -0x1(%rcx), %eax
movl (%r10,%rax,4), %eax
movl %eax, (%rsp)
movslq %ecx, %r11
movl (%r10,%r11,4), %ebp
movl $0x1, %eax
cmpl 0x4(%r10,%r11,4), %ebp
jge 0x525f
movq %rdi, 0x8(%rsp)
movl %esi, 0x20(%rsp)
movq %r8, 0x70(%rsp)
movq %r9, 0x58(%rsp)
leaq 0x1(%r11), %rax
movq %rax, 0x50(%rsp)
leal -0x1(%rcx), %eax
movl %eax, 0x4(%rsp)
movslq %eax, %rsi
shlq $0x3, %rsi
leaq (%rsi,%rsi,4), %rbx
leaq 0x961c(%rip), %r12      # 0xe4b0
leaq (%r12,%rbx), %rax
movq %rax, 0x60(%rsp)
shlq $0x3, %r11
leaq (%r11,%r11,4), %r15
leaq (%r12,%r15), %r13
movl %edx, %eax
notl %eax
movq %rcx, 0x18(%rsp)
addl %ecx, %eax
movl %eax, 0x14(%rsp)
leal 0x1(%rdx), %eax
movq %rax, 0x80(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x30(%rsp), %rdi
movl %ebp, %esi
callq 0x2e23
movl %ebp, 0x10(%rsp)
movq 0x30(%rsp), %rdi
cmpq %rdi, 0x38(%rsp)
je 0x522d
xorl %ebp, %ebp
xorl %r14d, %r14d
movl (%rdi,%rbp,4), %eax
addl (%rsp), %eax
movq 0x60(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x5166
incl 0x65b1(%rip)            # 0xb4c4
incl 0x6503(%rip)            # 0xb41c
xorl %eax, %eax
leaq (%rbx,%rax,4), %rcx
movl (%r12,%rcx), %ecx
leaq (%r15,%rax,4), %rdx
movl %ecx, (%r12,%rdx)
incq %rax
cmpq $0xa, %rax
jne 0x4f1b
testq %rbp, %rbp
je 0x4fdd
movq 0x60(%rsp), %rax
cmpl $0x0, (%rax)
jns 0x4fdd
movl -0x4(%rdi,%rbp,4), %eax
addl (%rsp), %eax
cmpl $-0x1, 0x4(%r13)
je 0x4f79
movl %eax, (%r13)
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x18(%rsp), %rcx
callq 0x418b
jmp 0x4fdd
movl %eax, 0x4(%r13)
cmpq $0x1, %rbp
je 0x4f8e
movl -0x8(%rdi,%rbp,4), %eax
addl (%rsp), %eax
movl %eax, (%r13)
testb $0x1, 0x1c(%r13)
jne 0x4fc3
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x18(%rsp), %rcx
movl 0x20(%rsp), %r8d
callq 0x4342
cmpl $-0x1, %eax
je 0x5185
incl 0x1c(%r13)
jmp 0x4fdd
movq 0x8(%rsp), %rdi
movl 0x4(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x18(%rsp), %rcx
callq 0x4259
leaq 0x1(%rbp), %rdx
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rdx, %rcx
jbe 0x5037
movq 0x60(%rsp), %rsi
cmpl $-0x1, 0x18(%rsi)
jne 0x5037
movl $0x1, %r8d
cmpl $-0x1, 0x14(%r13)
movq 0x8(%rsp), %rdi
je 0x51a7
movl (%rax,%rdx,4), %eax
addl (%rsp), %eax
movl %eax, 0x18(%r13)
movl 0x4(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x18(%rsp), %rcx
callq 0x3c18
movl 0x18(%r13), %eax
testl %eax, %eax
js 0x50df
movl (%r13), %ecx
testl %ecx, %ecx
js 0x50df
movl 0x4(%r13), %eax
movl %eax, 0x78(%rsp)
movl %ecx, 0x7c(%rsp)
movq 0x8(%rsp), %rdi
movq 0xc8(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x78(%rsp), %rcx
movl 0x14(%rsp), %r8d
callq 0x2e6b
testl %eax, %eax
jne 0x5166
movl 0x10(%r13), %eax
movl %eax, 0x24(%rsp)
movl 0x14(%r13), %eax
movl %eax, 0x28(%rsp)
movl 0x18(%r13), %eax
movl %eax, 0x2c(%rsp)
movq 0x8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq 0x24(%rsp), %rcx
movl 0x14(%rsp), %r8d
callq 0x30de
testl %eax, %eax
jne 0x5166
movl 0xc(%r13), %edx
addl %r14d, %edx
movl 0x10(%rsp), %edi
movq 0x50(%rsp), %rsi
callq 0x4932
jmp 0x5166
movl 0x10(%r13), %ecx
movl %ecx, 0x24(%rsp)
movl 0x14(%r13), %ecx
movl %ecx, 0x28(%rsp)
movl %eax, 0x2c(%rsp)
movq 0x8(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq 0x24(%rsp), %rcx
movl 0x14(%rsp), %r8d
callq 0x30de
cmpl $-0x1, %eax
je 0x5166
movl 0x10(%rsp), %eax
movl %eax, 0x8(%r13)
addl %r14d, 0xc(%r13)
movq 0x8(%rsp), %rdi
movl 0x20(%rsp), %esi
movl 0x6c(%rsp), %edx
movq 0x50(%rsp), %rcx
movq 0x70(%rsp), %r8
movq 0x58(%rsp), %r9
pushq 0x80(%rsp)
pushq 0xd8(%rsp)
pushq 0xd8(%rsp)
pushq 0xd8(%rsp)
callq 0x4dde
addq $0x20, %rsp
cmpl $0x0, 0x18(%rsp)
jle 0x5182
movq 0x30(%rsp), %rax
movl (%rax,%rbp,4), %edi
addl (%rsp), %edi
callq 0x3b6f
addl %eax, %r14d
jmp 0x5185
incl %r14d
incq %rbp
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %rbp, %rax
ja 0x4ef9
jmp 0x522d
movl 0x4(%rax,%rbp,4), %esi
addl (%rsp), %esi
leaq 0x2(%rbp), %rdx
cmpl $-0x1, 0x10(%r13)
je 0x51d1
movl %esi, 0x14(%r13)
movl $0x2, %r8d
cmpq %rdx, %rcx
ja 0x5018
jmp 0x5022
movl %esi, 0x10(%r13)
cmpq %rdx, %rcx
jbe 0x51e5
movl 0x8(%rax,%rbp,4), %edx
addl (%rsp), %edx
movl %edx, 0x14(%r13)
leaq 0x3(%rbp), %rdx
cmpq %rdx, %rcx
jbe 0x51f9
movl 0xc(%rax,%rbp,4), %eax
addl (%rsp), %eax
movl %eax, 0x18(%r13)
movl $0x3, %r8d
cmpl $0x1, 0x1c(%r13)
jg 0x5022
movl 0x4(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x18(%rsp), %rcx
callq 0x3ec9
cmpl $-0x1, %eax
jne 0x5037
jmp 0x5185
testq %rdi, %rdi
je 0x523f
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movl 0x10(%rsp), %ebp
incl %ebp
leaq 0x6094(%rip), %rax      # 0xb2e0
movq 0x50(%rsp), %rcx
cmpl (%rax,%rcx,4), %ebp
jl 0x4ec3
movl $0x1, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5279
jmp 0x5279
jmp 0x5279
jmp 0x5279
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x5293
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2220