// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x28, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x9119(%rip)      # 0x10308
jne 0x7202
cmpl $0x0, 0x74(%rbx)
jle 0x732d
movb $0x1, 0x9106(%rip)      # 0x10308
movl 0xa0(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xa0(%rbx)
cmpl 0x9c(%rbx), %eax
jl 0x7334
movl 0xa8(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xa8(%rbx)
cmpl 0xa4(%rbx), %eax
jl 0x7334
andl $0x0, 0xa8(%rbx)
cmpl $0x0, 0x74(%rbx)
jle 0x7304
andw $0x0, -0x20(%rbp)
andl $0x0, -0x24(%rbp)
xorl %eax, %eax
cmpq $0x6, %rax
je 0x7268
cmpb $0x0, (%rbx,%rax)
sete -0x24(%rbp,%rax)
incq %rax
jmp 0x7254
leaq -0x40(%rbp), %r14
andq $0x0, 0x10(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
xorl %eax, %eax
leaq -0x1c(%rbp), %r15
movl %eax, -0x1c(%rbp)
cmpl $0x6, %eax
jge 0x72a2
movslq %eax, %rcx
cmpb $0x1, -0x24(%rbp,%rcx)
jne 0x729e
movq %r14, %rdi
movq %r15, %rsi
callq 0x7bfe
movl -0x1c(%rbp), %eax
incl %eax
jmp 0x727e
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rsi, %rcx
subq %rdi, %rcx
shrq $0x2, %rcx
movl 0x74(%rbx), %eax
subl %ecx, %eax
jge 0x72e6
testl %ecx, %ecx
jle 0x72fb
callq 0x7c23
movl 0x74(%rbx), %ecx
movq -0x40(%rbp), %rdx
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x72f8
movslq (%rdx,%rsi,4), %rdi
movb $0x5, (%rbx,%rdi)
incq %rsi
jmp 0x72d4
cmpq %rsi, %rdi
je 0x72f8
movslq (%rdi), %rcx
movb $0x5, (%rbx,%rcx)
addq $0x4, %rdi
jmp 0x72e6
movl %eax, 0x74(%rbx)
leaq -0x40(%rbp), %rdi
callq 0x7dd2
movq %rbx, %rdi
callq 0x7384
testb %al, %al
jne 0x7334
movb $0x0, 0x8ff1(%rip)      # 0x10308
andl $0x0, 0xa0(%rbx)
cmpb $0x0, 0x8(%rbx)
je 0x732d
movl $0x6, 0x68(%rbx)
jmp 0x7334
movl $0x4, 0x68(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7341
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x7dd2
movq %rbx, %rdi
callq 0x3470
nop