// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_uni_locate.cpp
// Function: rightopennd3(int*, int, int, int, int)
int rightopennd3(int *m,int round,int count,int tround,int mode){ //左の[4-6]をcount回開ける
    //printf("\n[%d-右%dオープン(%d)]",mode,count,round);
    //for(int i = 0; i<10; i++){printf("[%d]",occart2[tround][i]);}
    if(count<1){return 0;}
    //printf("\n");
    int a[3] = {-1,-1,-1};int tg = 0;
    int rofs=0;
    if(round>1){rofs=dc2s[round-1];}
    if(occart2[tround][7-mode] > -1){
        for(int k = 0; k<mode; k++){
            std::vector<int> x;
            xdisp(x,occart2[tround][7-mode+k]);
            //printf("\noccart2[%d] = %d",7-mode+k,occart2[tround][7-mode]);
            for(int i = 0;i<x.size();i++){
                a[tg] = rofs+x[i];tg++;
                //printf(" got(%d [+%d]) ",rofs+D[i],rofs);
                if(tg==mode){
                    for(int j = 0;j<mode;j++){
                        //printf("\noccart2[%d] = %d",7-mode+j,a[j]);
                        occart2[tround][7-mode+j] = a[j];
                    }
                    return rightopennd3(m,round-1,count-1,tround,mode);
                }
            }
        }
    }
    //printf("完全には埋まらず"); //右が3つ出てこない場合でも，展開は続行する(展開の過程で3つうまることもある)
    for(int j = 0;j<tg;j++){
        //printf("\noccart2[%d] = %d",7-mode+j,a[j]);
        occart2[tround][7-mode+j] = a[j];
    }
    return rightopennd3(m,round-1,count-1,tround,mode);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r8d, 0x4(%rsp)
movl %ecx, 0x8(%rsp)
movq %rdi, 0x28(%rsp)
testl %edx, %edx
jle 0x3a3d
orl $-0x1, 0x20(%rsp)
orq $-0x1, 0x18(%rsp)
xorl %ebp, %ebp
movl $0x0, %r13d
cmpl $0x2, %esi
jl 0x3872
leal -0x1(%rsi), %eax
leaq 0x6a82(%rip), %rcx      # 0xa2f0
movl (%rcx,%rax,4), %r13d
movslq 0x8(%rsp), %rax
pushq $0x7
popq %rcx
movl 0x4(%rsp), %edi
subl %edi, %ecx
movslq %ecx, %rcx
imulq $0x28, %rax, %r12
leaq 0x9c32(%rip), %rax      # 0xd4c0
addq %r12, %rax
movq %rcx, 0x80(%rsp)
movq %rax, 0x78(%rsp)
cmpl $0x0, (%rax,%rcx,4)
movslq %edi, %rcx
js 0x39f7
movq %rsi, 0x58(%rsp)
leal -0x1(%rsi), %eax
movl %eax, 0x10(%rsp)
movq %rdx, 0x60(%rsp)
leal -0x1(%rdx), %eax
movl %eax, 0xc(%rsp)
xorl %ebx, %ebx
testl %ecx, %ecx
movl $0x0, %eax
cmovgl 0x4(%rsp), %eax
movq %rax, 0x70(%rsp)
movl %ecx, %r14d
movl %ecx, %eax
negl %eax
movq %rax, 0x68(%rsp)
movq %rcx, 0x48(%rsp)
leaq (,%rcx,4), %rax
movq %r12, 0x50(%rsp)
subq %rax, %r12
addq $0x1c, %r12
xorl %ebp, %ebp
cmpq 0x70(%rsp), %rbx
je 0x39e3
andq $0x0, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x80(%rsp), %rax
addq %rbx, %rax
movq 0x78(%rsp), %rcx
movl (%rcx,%rax,4), %esi
leaq 0x30(%rsp), %rdi
callq 0x2c26
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rax
subq %rcx, %rax
sarq $0x2, %rax
movslq %ebp, %rsi
leaq (%rsp,%rsi,4), %rdx
addq $0x18, %rdx
movl %esi, %edi
addq 0x68(%rsp), %rdi
xorl %esi, %esi
cmpq %rsi, %rax
je 0x399e
movl (%rcx,%rsi,4), %r8d
addl %r13d, %r8d
movl %r8d, (%rdx,%rsi,4)
incq %rsi
movl %edi, %r8d
addl %esi, %r8d
jne 0x3958
decq %rsi
cmpq %rsi, %rax
seta %al
movl %eax, 0x14(%rsp)
xorl %eax, %eax
cmpq %rax, %r14
je 0x39a5
movl 0x18(%rsp,%rax,4), %ecx
leaq (%r12,%rax,4), %rdx
leaq 0x9b2a(%rip), %rsi      # 0xd4c0
movl %ecx, (%rsi,%rdx)
incq %rax
jmp 0x3982
addl %esi, %ebp
xorl %r15d, %r15d
jmp 0x39cb
movq 0x28(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %r15d
movl %r15d, %r8d
callq 0x3825
movl %r15d, %ebp
movl 0x14(%rsp), %r15d
leaq 0x30(%rsp), %rdi
callq 0x6e42
incq %rbx
testb %r15b, %r15b
je 0x38fd
jmp 0x3a3d
movq 0x60(%rsp), %rdx
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %r12
movq 0x48(%rsp), %rcx
xorl %eax, %eax
testl %ebp, %ebp
cmovlel %eax, %ebp
shlq $0x2, %rcx
subq %rcx, %r12
addq $0x1c, %r12
leaq 0x9ab0(%rip), %r8       # 0xd4c0
cmpq %rax, %rbp
je 0x3a26
movl 0x18(%rsp,%rax,4), %ecx
leaq (%r12,%rax,4), %rdi
movl %ecx, (%r8,%rdi)
incq %rax
jmp 0x3a10
decl %esi
decl %edx
movq 0x28(%rsp), %rdi
movl 0x8(%rsp), %ecx
movl 0x4(%rsp), %r8d
callq 0x3825
xorl %eax, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3a53
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x6e42
movq %rbx, %rdi
callq 0x2240