// File: /workspace/github_cpp_makefile_star2_O3/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, 0x8bfb(%rip)      # 0x11310
jne 0x8728
cmpl $0x0, 0x74(%rbx)
jle 0x8928
movb $0x1, 0x8be8(%rip)      # 0x11310
movl 0xa0(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xa0(%rbx)
cmpl 0x9c(%rbx), %eax
jl 0x892f
movl 0xa8(%rbx), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0xa8(%rbx)
cmpl 0xa4(%rbx), %eax
jl 0x892f
movl $0x0, 0xa8(%rbx)
cmpl $0x0, 0x74(%rbx)
jle 0x88c0
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 0x8781
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 0x87de
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x87d3
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x87de
movq %r14, %rdi
movq %r15, %rdx
callq 0x916e
movl -0x24(%rbp), %ecx
leal 0x1(%rcx), %eax
movl %eax, -0x24(%rbp)
cmpl $0x5, %ecx
jl 0x87b3
movq -0x50(%rbp), %r14
movq -0x48(%rbp), %r15
movq %r15, %rdx
subq %r14, %rdx
shrq $0x2, %rdx
movl 0x74(%rbx), %ecx
movl %ecx, %eax
subl %edx, %eax
jge 0x8894
testl %edx, %edx
jle 0x88b3
cmpq %r15, %r14
sete %al
leaq 0x4(%r14), %rdx
cmpq %r15, %rdx
sete %dl
orb %al, %dl
jne 0x8878
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 0x8860
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 0x882d
movl 0x74(%rbx), %ecx
movq -0x50(%rbp), %r14
testl %ecx, %ecx
jle 0x88ae
movl %ecx, %ecx
xorl %eax, %eax
xorl %edx, %edx
movslq (%r14,%rdx,4), %rsi
movb $0x5, (%rbx,%rsi)
incq %rdx
cmpq %rdx, %rcx
jne 0x8882
jmp 0x88b0
cmpq %r15, %r14
je 0x88b0
movq %r14, %rcx
movslq (%rcx), %rdx
movb $0x5, (%rbx,%rdx)
addq $0x4, %rcx
cmpq %r15, %rcx
jne 0x889c
jmp 0x88b0
xorl %eax, %eax
movl %eax, 0x74(%rbx)
testq %r14, %r14
je 0x88c0
movq %r14, %rdi
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 0x88f1
movb (%rax,%rdi), %r8b
testb %r8b, %r8b
je 0x88f1
movb %r8b, 0x6(%rax,%rdi)
movb $0x0, (%rax,%rdi)
movb $0x1, %dl
incq %rdi
jne 0x88d6
addq $-0x6, %rax
cmpq $0x1, %rcx
movq %rsi, %rcx
ja 0x88cb
testb $0x1, %dl
jne 0x892f
movb $0x0, 0x8a01(%rip)      # 0x11310
movl $0x0, 0xa0(%rbx)
cmpb $0x0, 0x8(%rbx)
je 0x8928
movl $0x6, 0x68(%rbx)
jmp 0x892f
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 0x894d
callq 0x3260
movq %rbx, %rdi
callq 0x3480
nop