// File: /workspace/github_cpp_makefile_star2_O3/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, 0x642a(%rip)      # 0xb18c
jne 0x4d8d
subq $0x8, %rsp
movq %r8, %rcx
movq %r9, %r8
pushq %rdx
pushq 0xe0(%rsp)
pushq 0xe0(%rsp)
callq 0x49b9
addq $0x20, %rsp
xorl %eax, %eax
jmp 0x51bd
movl $0x0, 0x8(%rsp)
leaq 0x6544(%rip), %r10      # 0xb2e0
cmpl $0x2, %ecx
jl 0x4dac
leal -0x1(%rcx), %eax
movl (%r10,%rax,4), %eax
movl %eax, 0x8(%rsp)
movslq %ecx, %r11
movl (%r10,%r11,4), %ebp
movl $0x1, %eax
cmpl 0x4(%r10,%r11,4), %ebp
jge 0x51bd
movq %rdi, 0x10(%rsp)
movl %esi, 0x2c(%rsp)
movq %r8, 0x70(%rsp)
movq %r9, 0x50(%rsp)
leaq 0x1(%r11), %rax
movq %rax, 0x48(%rsp)
leal -0x1(%rcx), %eax
movl %eax, 0xc(%rsp)
movslq %eax, %rsi
shlq $0x3, %rsi
leaq (%rsi,%rsi,4), %rbx
leaq 0x96b8(%rip), %r12      # 0xe4b0
leaq (%r12,%rbx), %rax
movq %rax, 0x58(%rsp)
shlq $0x3, %r11
leaq (%r11,%r11,4), %r15
leaq (%r12,%r15), %r13
movl %edx, %eax
notl %eax
movq %rcx, 0x20(%rsp)
addl %ecx, %eax
movl %eax, 0x1c(%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 0x2d93
movl %ebp, 0x18(%rsp)
movq 0x30(%rsp), %rdi
cmpq %rdi, 0x38(%rsp)
je 0x518b
xorl %ebp, %ebp
xorl %r14d, %r14d
movl (%rdi,%rbp,4), %eax
addl 0x8(%rsp), %eax
movq 0x58(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x50c0
incl 0x664c(%rip)            # 0xb4c4
incl 0x659e(%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 0x4e80
testq %rbp, %rbp
je 0x4f44
movq 0x58(%rsp), %rax
cmpl $0x0, (%rax)
jns 0x4f44
movl -0x4(%rdi,%rbp,4), %eax
addl 0x8(%rsp), %eax
cmpl $-0x1, 0x4(%r13)
je 0x4edf
movl %eax, (%r13)
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x20(%rsp), %rcx
callq 0x4092
jmp 0x4f44
movl %eax, 0x4(%r13)
cmpq $0x1, %rbp
je 0x4ef5
movl -0x8(%rdi,%rbp,4), %eax
addl 0x8(%rsp), %eax
movl %eax, (%r13)
testb $0x1, 0x1c(%r13)
jne 0x4f2a
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x20(%rsp), %rcx
movl 0x2c(%rsp), %r8d
callq 0x424d
cmpl $-0x1, %eax
je 0x50e0
incl 0x1c(%r13)
jmp 0x4f44
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x20(%rsp), %rcx
callq 0x4164
leaq 0x1(%rbp), %rdx
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rdx, %rcx
jbe 0x4f9f
movq 0x58(%rsp), %rsi
cmpl $-0x1, 0x18(%rsi)
jne 0x4f9f
movl $0x1, %r8d
cmpl $-0x1, 0x14(%r13)
movq 0x10(%rsp), %rdi
je 0x5102
movl (%rax,%rdx,4), %eax
addl 0x8(%rsp), %eax
movl %eax, 0x18(%r13)
movl 0xc(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x20(%rsp), %rcx
callq 0x3b48
movl 0x18(%r13), %eax
testl %eax, %eax
js 0x5040
movl (%r13), %ecx
testl %ecx, %ecx
js 0x5040
movl 0x4(%r13), %eax
movl %eax, 0x78(%rsp)
movl %ecx, 0x7c(%rsp)
movq 0x10(%rsp), %rdi
movq 0xc8(%rsp), %rsi
movq 0x70(%rsp), %rdx
leaq 0x78(%rsp), %rcx
movl 0x1c(%rsp), %r8d
callq 0x2ddb
testl %eax, %eax
jne 0x50c0
movq 0x10(%r13), %rax
movq %rax, 0x60(%rsp)
movl 0x18(%r13), %eax
movl %eax, 0x68(%rsp)
movq 0x10(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movl 0x1c(%rsp), %r8d
callq 0x3051
testl %eax, %eax
jne 0x50c0
movl 0xc(%r13), %edx
addl %r14d, %edx
movl 0x18(%rsp), %edi
movq 0x48(%rsp), %rsi
callq 0x4870
jmp 0x50c0
movq 0x10(%r13), %rcx
movq %rcx, 0x60(%rsp)
movl %eax, 0x68(%rsp)
movq 0x10(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movl 0x1c(%rsp), %r8d
callq 0x3051
cmpl $-0x1, %eax
je 0x50c0
movl 0x18(%rsp), %eax
movl %eax, 0x8(%r13)
addl %r14d, 0xc(%r13)
movq 0x10(%rsp), %rdi
movl 0x2c(%rsp), %esi
movl 0x6c(%rsp), %edx
movq 0x48(%rsp), %rcx
movq 0x70(%rsp), %r8
movq 0x50(%rsp), %r9
pushq 0x80(%rsp)
pushq 0xd8(%rsp)
pushq 0xd8(%rsp)
pushq 0xd8(%rsp)
callq 0x4d40
addq $0x20, %rsp
cmpl $0x0, 0x20(%rsp)
jle 0x50dd
movq 0x30(%rsp), %rax
movl (%rax,%rbp,4), %edi
addl 0x8(%rsp), %edi
callq 0x3a9f
addl %eax, %r14d
jmp 0x50e0
incl %r14d
incq %rbp
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rax
subq %rdi, %rax
sarq $0x2, %rax
cmpq %rbp, %rax
ja 0x4e5d
jmp 0x518b
movl 0x4(%rax,%rbp,4), %esi
addl 0x8(%rsp), %esi
leaq 0x2(%rbp), %rdx
cmpl $-0x1, 0x10(%r13)
je 0x512d
movl %esi, 0x14(%r13)
movl $0x2, %r8d
cmpq %rdx, %rcx
ja 0x4f7f
jmp 0x4f8a
movl %esi, 0x10(%r13)
cmpq %rdx, %rcx
jbe 0x5142
movl 0x8(%rax,%rbp,4), %edx
addl 0x8(%rsp), %edx
movl %edx, 0x14(%r13)
leaq 0x3(%rbp), %rdx
cmpq %rdx, %rcx
jbe 0x5157
movl 0xc(%rax,%rbp,4), %eax
addl 0x8(%rsp), %eax
movl %eax, 0x18(%r13)
movl $0x3, %r8d
cmpl $0x1, 0x1c(%r13)
jg 0x4f8a
movl 0xc(%rsp), %esi
movl 0xd8(%rsp), %edx
movq 0x20(%rsp), %rcx
callq 0x3dcb
cmpl $-0x1, %eax
jne 0x4f9f
jmp 0x50e0
testq %rdi, %rdi
je 0x519d
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movl 0x18(%rsp), %ebp
incl %ebp
leaq 0x6136(%rip), %rax      # 0xb2e0
movq 0x48(%rsp), %rcx
cmpl (%rax,%rcx,4), %ebp
jl 0x4e27
movl $0x1, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x51d7
jmp 0x51d7
jmp 0x51d7
jmp 0x51d7
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x51f1
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2220