// File: 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
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
testb $0x1, 0x1be9f(%rip)     # 0x28360
jne 0xc4ee
movq -0x88(%rbp), %rax
cmpl $0x0, 0x74(%rax)
jle 0xc4d9
movb $0x1, 0x1be89(%rip)     # 0x28360
jmp 0xc4ec
movq -0x88(%rbp), %rax
movl $0x4, 0x68(%rax)
jmp 0xc7a5
jmp 0xc4ee
movq -0x88(%rbp), %rcx
movl 0xa0(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0xa0(%rcx)
cmpl 0x9c(%rcx), %eax
jge 0xc513
jmp 0xc7a5
movq -0x88(%rbp), %rcx
movl 0xa8(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0xa8(%rcx)
cmpl 0xa4(%rcx), %eax
jge 0xc538
jmp 0xc7a5
movq -0x88(%rbp), %rax
movl $0x0, 0xa8(%rax)
cmpl $0x0, 0x74(%rax)
jle 0xc743
leaq -0xe(%rbp), %rdi
xorl %esi, %esi
movl $0x6, %edx
callq 0x41b0
movl $0x0, -0x14(%rbp)
cmpl $0x6, -0x14(%rbp)
jge 0xc59b
movq -0x88(%rbp), %rdi
movslq -0x14(%rbp), %rax
addq %rax, %rdi
callq 0xb7a0
movb %al, %cl
movslq -0x14(%rbp), %rax
andb $0x1, %cl
movb %cl, -0xe(%rbp,%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xc56a
leaq -0x30(%rbp), %rdi
callq 0xff80
movl $0x0, -0x34(%rbp)
cmpl $0x6, -0x34(%rbp)
jge 0xc5f4
movslq -0x34(%rbp), %rax
testb $0x1, -0xe(%rbp,%rax)
je 0xc5e7
leaq -0x30(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0xffa0
jmp 0xc5cb
jmp 0xc5e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x10200
jmp 0xc7ae
jmp 0xc5e9
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0xc5ab
leaq -0x30(%rbp), %rdi
callq 0x10010
movq %rax, %rcx
movq -0x88(%rbp), %rax
movl %ecx, -0x48(%rbp)
movl 0x74(%rax), %eax
cmpl -0x48(%rbp), %eax
jl 0xc69c
leaq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x10030
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x10060
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x10090
testb $0x1, %al
jne 0xc64b
jmp 0xc685
leaq -0x58(%rbp), %rdi
callq 0x100d0
movl (%rax), %eax
movl %eax, -0x64(%rbp)
leaq -0x65(%rbp), %rdi
movl $0x5, %esi
callq 0xb560
jmp 0xc669
movq -0x88(%rbp), %rax
movslq -0x64(%rbp), %rcx
movb -0x65(%rbp), %dl
movb %dl, (%rax,%rcx)
leaq -0x58(%rbp), %rdi
callq 0x100f0
jmp 0xc638
movq -0x88(%rbp), %rax
movl -0x48(%rbp), %edx
movl 0x74(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x74(%rax)
jmp 0xc73a
cmpl $0x0, -0x48(%rbp)
jle 0xc738
leaq -0x30(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x10030
movq -0x90(%rbp), %rdi
movq %rax, -0x70(%rbp)
callq 0x10060
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0x10110
jmp 0xc6d9
movl $0x0, -0x7c(%rbp)
movq -0x88(%rbp), %rcx
movl -0x7c(%rbp), %eax
cmpl 0x74(%rcx), %eax
jge 0xc72a
leaq -0x7d(%rbp), %rdi
movl $0x5, %esi
callq 0xb560
jmp 0xc6ff
movslq -0x7c(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x101e0
movq %rax, %rcx
movq -0x88(%rbp), %rax
movslq (%rcx), %rcx
movb -0x7d(%rbp), %dl
movb %dl, (%rax,%rcx)
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0xc6e0
movq -0x88(%rbp), %rax
movl $0x0, 0x74(%rax)
jmp 0xc73a
leaq -0x30(%rbp), %rdi
callq 0x10200
movq -0x88(%rbp), %rdi
callq 0xc9a0
andb $0x1, %al
movb %al, -0x7e(%rbp)
testb $0x1, -0x7e(%rbp)
jne 0xc7a5
movq -0x88(%rbp), %rdi
movb $0x0, 0x1bbf8(%rip)     # 0x28360
movl $0x0, 0xa0(%rdi)
addq $0x6, %rdi
addq $0x2, %rdi
callq 0xb7a0
testb $0x1, %al
jne 0xc785
jmp 0xc795
movq -0x88(%rbp), %rax
movl $0x4, 0x68(%rax)
jmp 0xc7a3
movq -0x88(%rbp), %rax
movl $0x6, 0x68(%rax)
jmp 0xc7a5
addq $0x90, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x44f0
nopw (%rax,%rax)