// File: kmyk[P]codevs-for-student-2016/Main.cpp
// Function: simulation::drop_pack(primitive::blocks_t<19ul, 10ul>&, std::array<int, 10ul>&, primitive::blocks_t<3ul, 3ul> const&, primitive::output_t const&)
vector<point_t> drop_pack(blocks_t<height + pack_size, width> & field, array<int,width> & height_map, pack_t const & a_pack, output_t const & output) {
        vector<point_t> modified_blocks;
        pack_t pack = rotate(a_pack, output.rotate); // お邪魔ブロックは既に置かれているとする
        repeat (dy, 3) repeat (dx, 3) {
            if (pack.at[dx][dy] != empty_block) {
                int nx = output.x + dx;
                assert (0 <= nx and nx < width);
                field.at[nx][height_map[nx]] = pack.at[dx][dy];
                if (field.at[nx][height_map[nx]] != obstacle_block) {
                    modified_blocks.push_back(point(height_map[nx], nx));
                }
                ++ height_map[nx];
            }
        }
        return modified_blocks;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x98(%rbp)
movq %rdi, %rax
movq %rax, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movb $0x0, -0x29(%rbp)
callq 0x6770
movq -0x20(%rbp), %rax
movb 0x8(%rax), %cl
movb %cl, -0x38(%rbp)
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %edx
movb -0x38(%rbp), %al
movb %al, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movzbl -0x48(%rbp), %esi
callq 0x2a40
movb %dl, -0x58(%rbp)
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x32(%rbp)
movb -0x58(%rbp), %al
movb %al, -0x2a(%rbp)
movl $0x0, -0x64(%rbp)
cmpl $0x3, -0x64(%rbp)
jge 0x30e5
movl $0x0, -0x68(%rbp)
cmpl $0x3, -0x68(%rbp)
jge 0x30d5
leaq -0x32(%rbp), %rdi
movslq -0x68(%rbp), %rsi
callq 0x6600
movq %rax, %rdi
movslq -0x64(%rbp), %rsi
callq 0x6630
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x30c5
movq -0x28(%rbp), %rax
movl (%rax), %eax
addl -0x68(%rbp), %eax
movl %eax, -0x6c(%rbp)
leaq -0x32(%rbp), %rdi
movslq -0x68(%rbp), %rsi
callq 0x6600
movq %rax, %rdi
movslq -0x64(%rbp), %rsi
callq 0x6630
movb (%rax), %al
movb %al, -0xa1(%rbp)
movq -0x10(%rbp), %rdi
movslq -0x6c(%rbp), %rsi
callq 0x6790
movq %rax, -0xb0(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x6c(%rbp), %rsi
callq 0x67f0
movq -0xb0(%rbp), %rdi
movslq (%rax), %rsi
callq 0x67c0
movb -0xa1(%rbp), %cl
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
movslq -0x6c(%rbp), %rsi
callq 0x6790
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x6c(%rbp), %rsi
callq 0x67f0
movq -0xa0(%rbp), %rdi
movslq (%rax), %rsi
callq 0x67c0
movsbl (%rax), %eax
cmpl $0xb, %eax
je 0x30b1
movq -0x18(%rbp), %rdi
movslq -0x6c(%rbp), %rsi
callq 0x67f0
movl (%rax), %edi
movl -0x6c(%rbp), %esi
callq 0x2550
movq -0x98(%rbp), %rdi
movq %rax, -0x74(%rbp)
leaq -0x74(%rbp), %rsi
callq 0x6820
jmp 0x3092
jmp 0x30b1
movq -0x98(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
callq 0x6850
jmp 0x310b
movq -0x18(%rbp), %rdi
movslq -0x6c(%rbp), %rsi
callq 0x67f0
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x30c7
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x2f99
jmp 0x30d7
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x2f88
movb $0x1, -0x29(%rbp)
testb $0x1, -0x29(%rbp)
jne 0x30fb
movq -0x98(%rbp), %rdi
callq 0x6850
movq -0x90(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
movq -0x80(%rbp), %rdi
callq 0x22f0
nopw %cs:(%rax,%rax)