// File: /workspace/github_cpp_makefile_star2_O2/TooruAkagi[P]GCIS_Index/gcis_nep_locate.cpp
// Function: rightopennd3(unsigned int*, int*, int, int, int, int)
int rightopennd3(unsigned int *D,int *D_2,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++){
            //printf("\noccart2[%d] = %d",7-mode+k,occart2[tround][7-mode]);
            for(int i = D_2[occart2[tround][7-mode+k]];i<D_2[1+occart2[tround][7-mode+k]];i++){
                a[tg] = rofs+D[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(D,D_2,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(D,D_2,round-1,count-1,tround,mode);
}

// Assembly:
testl %ecx, %ecx
jle 0x1e45
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
orl $-0x1, 0x20(%rsp)
orq $-0x1, 0x18(%rsp)
xorl %r14d, %r14d
movl $0x0, %ebp
cmpl $0x2, %edx
jl 0x1d0a
leal -0x1(%rdx), %eax
leaq 0x799a(%rip), %r10      # 0x96a0
movl (%r10,%rax,4), %ebp
movslq %r8d, %rax
pushq $0x7
popq %r10
subl %r9d, %r10d
movslq %r10d, %r10
imulq $0x28, %rax, %r11
leaq 0x744e(%rip), %rbx      # 0x9170
leaq (%rbx,%r11), %r13
cmpl $0x0, (%r13,%r10,4)
js 0x1e01
movl %r8d, 0xc(%rsp)
movq %rdx, 0x28(%rsp)
leal -0x1(%rdx), %eax
movl %eax, 0x14(%rsp)
movq %rcx, 0x30(%rsp)
leal -0x1(%rcx), %eax
movl %eax, 0x10(%rsp)
xorl %eax, %eax
testl %r9d, %r9d
movl $0x0, %r15d
cmovgl %r9d, %r15d
xorl %r14d, %r14d
cmpq %r15, %rax
je 0x1df2
movq %r10, %rdx
leaq (%rax,%r10), %r8
movslq (%r13,%r8,4), %r8
movslq (%rsi,%r8,4), %r10
movq %rsi, %rcx
movslq 0x4(%rsi,%r8,4), %r12
movslq %r14d, %r8
leaq (%rsp,%r8,4), %r8
addq $0x18, %r8
cmpq %r12, %r10
jge 0x1dac
movl (%rdi,%r10,4), %esi
addl %ebp, %esi
movl %esi, (%r8)
incq %r10
incl %r14d
addq $0x4, %r8
cmpl %r14d, %r9d
jne 0x1d8d
jmp 0x1db7
incq %rax
movq %rcx, %rsi
movq %rdx, %r10
jmp 0x1d61
movl 0x10(%rsp), %r8d
movslq %r9d, %rax
shlq $0x2, %rax
subq %rax, %r11
addq $0x1c, %r11
xorl %eax, %eax
movq %rcx, %rsi
cmpq %rax, %r15
je 0x1de4
movl 0x18(%rsp,%rax,4), %ecx
leaq (%r11,%rax,4), %rdx
movl %ecx, (%rbx,%rdx)
incq %rax
jmp 0x1dcf
movl 0x14(%rsp), %edx
movl %r8d, %ecx
movl 0xc(%rsp), %r8d
jmp 0x1e32
movl 0xc(%rsp), %r8d
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %rdx
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
movslq %r9d, %r10
shlq $0x2, %r10
subq %r10, %r11
addq $0x1c, %r11
cmpq %rax, %r14
je 0x1e2e
movl 0x18(%rsp,%rax,4), %ebp
leaq (%r11,%rax,4), %r10
movl %ebp, (%rbx,%r10)
incq %rax
jmp 0x1e18
decl %edx
decl %ecx
callq 0x1cce
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq