// File: /workspace/github_cpp_makefile_star2_O1/Leeingnyo[P]newPuyoC/./board.h
// Function: Board::DropObstacleUpdate()
void DropObstacleUpdate() {
        static bool isProgressed = false;
        if (!isProgressed) {
            if (obstacle_number_taken > 0) {
                isProgressed = true;
            }
            else {
                state = State::NEED_NEXT;
                return;
            }
        }
        if (drop_predelay_t++ < DROP_PREDELAY)
            return;
        if (drop_t++ < DROP_FRAME)
            return;
        drop_t = 0;
        // generate obstacles at empty top of map
        if (obstacle_number_taken > 0) {
            bool empty[MAP_WIDTH] = { false, };
            for (int i = 0; i < MAP_WIDTH; i++) {
                empty[i] = map[0][i].IsBlank();
            }
            std::vector<int> empty_position;
            for (int i = 0; i < MAP_WIDTH; i++) {
                if (empty[i]) {
                    empty_position.push_back(i);
                }
            }
            int empty_number = empty_position.size();
            if (obstacle_number_taken >= empty_number) {
                for (auto position : empty_position) {
                    map[0][position] = Puyo(PuyoKind::OBSTACLE);
                }
                obstacle_number_taken -= empty_number;
            } else {
                if (empty_number > 0) {
                    std::random_shuffle(empty_position.begin(), empty_position.end());
                    for (int i = 0; i < obstacle_number_taken; i++) {
                        map[0][empty_position[i]] = Puyo(PuyoKind::OBSTACLE);
                    }
                    obstacle_number_taken = 0;
                }
            }
        }
        // shift down
        bool isChanged = ShiftDown();
        // no more move
        if (!isChanged) {
            isProgressed = false;
            drop_predelay_t = 0;
            if (map[1][2].IsBlank()) state = State::NEED_NEXT;
            else state = State::GAMEOVER;
            return;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x8b9b(%rip)      # 0x11310
jne 0x8788
cmpl $0x0, 0x74(%rbx)
jle 0x897f
movb $0x1, 0x8b88(%rip)      # 0x11310
movl 0xa0(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xa0(%rbx)
cmpl 0x9c(%rbx), %eax
jl 0x8986
movl 0xa8(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xa8(%rbx)
cmpl 0xa4(%rbx), %eax
jl 0x8986
movl $0x0, 0xa8(%rbx)
cmpl $0x0, 0x74(%rbx)
jle 0x8917
movw $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
xorl %eax, %eax
cmpb $0x0, (%rbx,%rax)
sete -0x2c(%rbp,%rax)
incq %rax
cmpq $0x6, %rax
jne 0x87e1
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
leaq -0x24(%rbp), %r15
movl $0x0, (%r15)
xorl %eax, %eax
movslq %eax, %rcx
cmpb $0x1, -0x2c(%rbp,%rcx)
jne 0x883e
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x8833
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x883e
movq %r14, %rdi
movq %r15, %rdx
callq 0x91ce
movl -0x24(%rbp), %ecx
leal 0x1(%rcx), %eax
movl %eax, -0x24(%rbp)
cmpl $0x5, %ecx
jl 0x8813
movq -0x50(%rbp), %r14
movq -0x48(%rbp), %r15
movq %r15, %rcx
subq %r14, %rcx
shrq $0x2, %rcx
movl 0x74(%rbx), %eax
subl %ecx, %eax
jge 0x88f2
testl %ecx, %ecx
jle 0x8909
cmpq %r15, %r14
sete %al
leaq 0x4(%r14), %rcx
cmpq %r15, %rcx
sete %cl
orb %al, %cl
jne 0x88cf
movl $0x4, %r12d
callq 0x30a0
cltq
movq %r12, %rcx
sarq $0x2, %rcx
incq %rcx
cqto
idivq %rcx
leaq (,%rdx,4), %rax
cmpq %rax, %r12
je 0x88be
leaq (%r14,%r12), %rax
leaq (%r14,%rdx,4), %rcx
movl (%rax), %edx
movl (%rcx), %esi
movl %esi, (%rax)
movl %edx, (%rcx)
leaq (%r14,%r12), %rax
addq $0x4, %rax
addq $0x4, %r12
cmpq %r15, %rax
jne 0x888b
movslq 0x74(%rbx), %rcx
testq %rcx, %rcx
jle 0x8904
movq -0x50(%rbp), %rdx
xorl %eax, %eax
xorl %esi, %esi
movslq (%rdx,%rsi,4), %rdi
movb $0x5, (%rbx,%rdi)
incq %rsi
cmpq %rsi, %rcx
jne 0x88e0
jmp 0x8906
cmpq %r15, %r14
je 0x8906
movslq (%r14), %rcx
movb $0x5, (%rbx,%rcx)
addq $0x4, %r14
jmp 0x88f2
xorl %eax, %eax
movl %eax, 0x74(%rbx)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x8917
callq 0x3260
leaq 0x48(%rbx), %rax
movl $0xc, %ecx
xorl %edx, %edx
leaq -0x1(%rcx), %rsi
movq $-0x6, %rdi
cmpb $0x0, 0x6(%rax,%rdi)
jne 0x8948
movb (%rax,%rdi), %r8b
testb %r8b, %r8b
je 0x8948
movb %r8b, 0x6(%rax,%rdi)
movb $0x0, (%rax,%rdi)
movb $0x1, %dl
incq %rdi
jne 0x892d
addq $-0x6, %rax
cmpq $0x1, %rcx
movq %rsi, %rcx
ja 0x8922
testb $0x1, %dl
jne 0x8986
movb $0x0, 0x89aa(%rip)      # 0x11310
movl $0x0, 0xa0(%rbx)
cmpb $0x0, 0x8(%rbx)
je 0x897f
movl $0x6, 0x68(%rbx)
jmp 0x8986
movl $0x4, 0x68(%rbx)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x89a4
callq 0x3260
movq %rbx, %rdi
callq 0x3480