LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: primitive::operator>>(std::istream&, primitive::config_t&)
istream & operator >> (istream & in, config_t & a) {
        int w, h, t, s, n; in >> w >> h >> t >> s >> n;
        assert (w == width);
        assert (h == height);
        assert (t == pack_size);
        assert (s == erasing_sum);
        assert (n == turn_number);
        a.packs.resize(turn_number);
        repeat (i,n) in >> a.packs[i];
        return in;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x14(%rsp), %rsi
callq 0x20e0
leaq 0x10(%rsp), %rsi
movq %rax, %rdi
callq 0x20e0
leaq 0xc(%rsp), %rsi
movq %rax, %rdi
callq 0x20e0
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x20e0
leaq 0x4(%rsp), %rsi
movq %rax, %rdi
callq 0x20e0
movl $0x1f4, %esi            # imm = 0x1F4
movq %r14, %rdi
callq 0x3e06
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x4(%rsp), %rax
cmpq %rax, %r12
jge 0x251a
movq (%r14), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0x3e3e
incq %r12
addq $0x9, %r15
jmp 0x24f9
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: primitive::operator>>(std::istream&, primitive::input_t&)
istream & operator >> (istream & in, input_t & a) {
        in >> a.turn >> a.remaining_time;
        in >>     a.self_obstacles >>     a.self_field;
        in >> a.opponent_obstacles >> a.opponent_field;
        assert (a.self_obstacles == 0 or a.opponent_obstacles == 0);
        return in;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x20e0
leaq 0x4(%r14), %rsi
movq %rax, %rdi
callq 0x20e0
leaq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x20e0
leaq 0xc(%r14), %rsi
movq %rax, %rdi
callq 0x3ed9
leaq 0xac(%r14), %rsi
movq %rbx, %rdi
callq 0x20e0
addq $0xb0, %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x3ed9
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: primitive::rotate(primitive::blocks_t<3ul, 3ul>, int)
pack_t rotate(pack_t a, rotate_t r) {
        assert (pack_size == 3);
        pack_t b;
        switch (r % 4 + (r < 0 ? 4 : 0)) {
            case 0: b = a; break;
            case 1: repeat (x, pack_size) repeat (y, pack_size) b.at[x][y] = a.at[2-y][  x]; break;
            case 2: repeat (x, pack_size) repeat (y, pack_size) b.at[x][y] = a.at[2-x][2-y]; break;
            case 3: repeat (x, pack_size) repeat (y, pack_size) b.at[x][y] = a.at[  y][2-x]; break;
        }
        return b;
    }

// Assembly:
movl %edx, %ecx
movq %rdi, -0x20(%rsp)
movb %sil, -0x18(%rsp)
movl $0x4, %esi
movl %edx, %eax
cltd
idivl %esi
shrl $0x1f, %ecx
leal (%rdx,%rcx,4), %eax
cmpl $0x3, %eax
ja 0x263c
leaq 0xa9ef(%rip), %rcx      # 0xd010
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb -0x18(%rsp), %al
movb %al, -0x8(%rsp)
movq -0x20(%rsp), %rax
movq %rax, -0x10(%rsp)
movq -0x10(%rsp), %rax
movb -0x8(%rsp), %dl
retq
leaq -0x10(%rsp), %rax
leaq -0x18(%rsp), %rcx
xorl %edx, %edx
cmpq $0x3, %rdx
je 0x263c
movq %rax, %rsi
xorl %edi, %edi
cmpq $-0x3, %rdi
je 0x2672
movb (%rcx,%rdi), %r8b
movb %r8b, (%rsi)
decq %rdi
incq %rsi
jmp 0x265d
incq %rdx
addq $0x3, %rax
addq $-0x3, %rcx
jmp 0x2652
leaq -0x10(%rsp), %rax
leaq -0x1e(%rsp), %rcx
xorl %edx, %edx
cmpq $0x3, %rdx
je 0x263c
movq %rcx, %rsi
xorl %edi, %edi
cmpq $0x3, %rdi
je 0x26ac
movb (%rsi), %r8b
movb %r8b, (%rax,%rdi)
incq %rdi
addq $0x3, %rsi
jmp 0x2696
incq %rdx
addq $0x3, %rax
decq %rcx
jmp 0x268b
leaq -0x10(%rsp), %rax
leaq -0x20(%rsp), %rcx
xorl %edx, %edx
movabsq $0x6, %rsi
cmpq $0x3, %rdx
je 0x263c
movq %rax, %rdi
movq %rsi, %r8
cmpq $-0x3, %r8
je 0x26f4
movb (%rcx,%r8), %r9b
movb %r9b, (%rdi)
addq $-0x3, %r8
incq %rdi
jmp 0x26de
incq %rdx
addq $0x3, %rax
incq %rcx
jmp 0x26ce
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: primitive::fill_obstacles(primitive::blocks_t<3ul, 3ul>, int)
pack_t fill_obstacles(pack_t a, int obstacles) {
        repeat_reverse (y, pack_size) { // yが先
            repeat (x, pack_size) {
                if (obstacles and a.at[x][y] == empty_block) {
                    a.at[x][y] = obstacle_block;
                    obstacles -= 1;
                }
            }
        }
        return a;
    }

// Assembly:
movq %rdi, -0x10(%rsp)
movb %sil, -0x8(%rsp)
movl $0x2, %eax
testl %eax, %eax
js 0x2742
movl %eax, %ecx
addq %rsp, %rcx
addq $-0x10, %rcx
xorl %esi, %esi
cmpq $0x9, %rsi
je 0x273e
testl %edx, %edx
je 0x2736
cmpb $0x0, (%rcx,%rsi)
jne 0x2738
movb $0xb, (%rcx,%rsi)
decl %edx
jmp 0x2738
xorl %edx, %edx
addq $0x3, %rsi
jmp 0x271e
decl %eax
jmp 0x270f
movq -0x10(%rsp), %rax
movb -0x8(%rsp), %dl
retq
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: primitive::is_valid_output(primitive::blocks_t<16ul, 10ul> const&, primitive::blocks_t<3ul, 3ul> const&, primitive::output_t const&)
bool is_valid_output(field_t const & field, pack_t const & a_pack, output_t const & output) {
        if (0 <= output.x and output.x + pack_size <= width) return true;
        pack_t pack = rotate(a_pack, output.rotate); // お邪魔ブロックは既に置かれているとする
        repeat (dy, pack_size) repeat (dx, pack_size) if (pack.at[dx][dy] != empty_block) {
            int x = output.x + dx;
            if (x < 0 or width <= x) return false;
        }
        return true;
    }

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl (%rdx), %ebx
movb $0x1, %al
cmpl $0x8, %ebx
jb 0x27fc
movq (%rsi), %rdi
movl 0x4(%rdx), %edx
movzbl 0x8(%rsi), %esi
callq 0x25f9
movq %rsp, %rcx
movq %rax, (%rcx)
movb %dl, 0x8(%rcx)
xorl %eax, %eax
cmpq $0x3, %rax
je 0x27f5
xorl %edx, %edx
movl %ebx, %esi
cmpq $0x9, %rdx
je 0x27ed
cmpb $0x0, (%rcx,%rdx)
sete %dil
cmpl $0xa, %esi
setb %r8b
orb %dil, %r8b
incl %esi
addq $0x3, %rdx
testb %r8b, %r8b
jne 0x27c8
jmp 0x27f5
incq %rax
incq %rcx
jmp 0x27be
cmpq $0x3, %rax
setae %al
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r14
movq %rdx, %r15
movq %rsi, %r12
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movq %rdi, 0x8(%rsp)
movups %xmm0, (%rdi)
movq (%rcx), %rdi
movl 0x4(%r8), %edx
movzbl 0x8(%rcx), %esi
callq 0x25f9
leaq 0x28(%rsp), %rbp
movq %rax, (%rbp)
movb %dl, 0x8(%rbp)
xorl %eax, %eax
cmpq $0x3, %rax
je 0x28d4
movq %rax, 0x10(%rsp)
movq %rbp, 0x18(%rsp)
xorl %r13d, %r13d
cmpq $0x3, %r13
je 0x28bf
movb (%rbp), %al
testb %al, %al
je 0x28b6
movslq (%r14), %rcx
leaq (%rcx,%r13), %rbx
imulq $0x13, %rbx, %rdx
addq %r12, %rdx
movslq (%r15,%rbx,4), %rsi
movb %al, (%rsi,%rdx)
movslq (%r15,%rbx,4), %rax
cmpb $0xb, (%rax,%rdx)
je 0x28b0
movl %ecx, %ecx
addq %r13, %rcx
movl %eax, %eax
shlq $0x20, %rcx
orq %rax, %rcx
movq %rcx, 0x20(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0xa702
movl (%r15,%rbx,4), %eax
incl %eax
movl %eax, (%r15,%rbx,4)
incq %r13
addq $0x3, %rbp
jmp 0x285e
movq 0x10(%rsp), %rax
incq %rax
movq 0x18(%rsp), %rbp
incq %rbp
jmp 0x2847
movq 0x8(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0xa6ce
movq %r14, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: simulation::estimate_with_erasing(primitive::blocks_t<16ul, 10ul> const&)
result_t estimate_with_erasing(field_t const & field) {
        vector<pair<result_t, int> > acc = estimate_with_erasing_all(field);
        return whole(max_element, acc, [&](pair<result_t, int> const & a, pair<result_t, int> const & b) {
            return make_tuple(a.first.chain, - a.second, a.first.score) < make_tuple(b.first.chain, - b.second, b.first.score);
        })->first;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rsi
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0x2b67
movq (%rbx), %r15
movq 0x8(%rbx), %r12
cmpq %r12, %r15
je 0x2e81
leaq 0xc(%r15), %r13
leaq 0xc(%rsp), %rbx
movq %rsp, %r14
cmpq %r12, %r13
je 0x2e81
xorl %eax, %eax
subl 0x8(%r15), %eax
movl (%r15), %ecx
movl %ecx, 0xc(%rsp)
movl %eax, 0x10(%rsp)
movl 0x4(%r15), %eax
movl %eax, 0x14(%rsp)
xorl %eax, %eax
subl 0x8(%r13), %eax
movl (%r13), %ecx
movl %ecx, (%rsp)
movl %eax, 0x4(%rsp)
movl 0x4(%r13), %eax
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x5ef2
testb %al, %al
cmovneq %r13, %r15
addq $0xc, %r13
jmp 0x2e33
movq (%r15), %rbx
leaq 0x18(%rsp), %rdi
callq 0x9f22
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x9f22
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: simulation::estimate_with_drop(primitive::blocks_t<16ul, 10ul> const&)
result_t estimate_with_drop(field_t const & field) {
        const array<int,width> height_map = make_height_map(field);
        result_t acc = { -1, 0 };
        repeat (x, width) {
            repeat_from (b,1,9+1) {
                blocks_t<height + 1, width> nfield = {};
                repeat (nx, width) repeat (y, height_map[nx]) nfield.at[nx][y] = field.at[nx][y];
                nfield.at[x][height_map[x]] = b;
                array<int,width> nheight_map = height_map;
                nheight_map[x] += 1;
                vector<point_t> modified_blocks { point(height_map[x], x) };
                result_t result = simulate(nfield, nheight_map, modified_blocks, 0);
                setmax(acc, result);
            }
        }
        return acc;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdi, %rsi
leaq 0x38(%rsp), %rdi
movq %rsi, 0x20(%rsp)
callq 0x3fa6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x18(%rsp), %rcx
movq %rax, (%rcx)
xorl %r14d, %r14d
leaq 0xbe(%rsp), %r15
leaq 0xa0(%rsp), %r12
leaq 0x88(%rsp), %rbp
xorl %ebx, %ebx
cmpq $0xa, %rbx
je 0x3026
imulq $0x11, %rbx, %rax
addq %rsp, %rax
addq $0xbe, %rax
movq %rax, 0x30(%rsp)
movq %rbx, %rax
shlq $0x20, %rax
movq %rax, 0x28(%rsp)
pushq $0x1
popq %r13
cmpl $0xa, %r13d
je 0x301e
movl $0xaa, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20d0
movq %r15, %rax
movq 0x20(%rsp), %rcx
xorl %edx, %edx
cmpq $0xa, %rdx
je 0x2f81
movl 0x38(%rsp,%rdx,4), %esi
testl %esi, %esi
cmovlel %r14d, %esi
xorl %edi, %edi
cmpq %rdi, %rsi
je 0x2f74
movb (%rcx,%rdi), %r8b
movb %r8b, (%rax,%rdi)
incq %rdi
jmp 0x2f62
incq %rdx
addq $0x10, %rcx
addq $0x11, %rax
jmp 0x2f50
movl 0x38(%rsp,%rbx,4), %eax
movq 0x58(%rsp), %rcx
movq %rcx, 0x80(%rsp)
movups 0x38(%rsp), %xmm0
movups 0x48(%rsp), %xmm1
movaps %xmm1, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
incl 0x60(%rsp,%rbx,4)
movslq %eax, %rcx
movq 0x30(%rsp), %rdx
movb %r13b, (%rdx,%rcx)
orq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xf(%rsp), %rcx
callq 0x4150
movq %rbp, %rdi
movq %r12, %rsi
callq 0x4102
movq %r15, %rdi
leaq 0x60(%rsp), %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x4457
movq %rax, 0x10(%rsp)
movq %rbp, %rdi
callq 0xa6ce
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x4583
movq %r12, %rdi
callq 0xa6ce
incl %r13d
jmp 0x2f2d
incq %rbx
jmp 0x2f01
movq 0x18(%rsp), %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xa6ce
jmp 0x3052
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0xa6ce
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: initial_photon(int, int, primitive::blocks_t<16ul, 10ul> const&)
shared_ptr<photon_t> initial_photon(int turn, int obstacles, field_t const & field) {
    shared_ptr<photon_t> pho = make_shared<photon_t>();
    pho->turn = turn;
    pho->score = 0;
    pho->obstacles = obstacles;
    pho->dropped_obstacles = count_obstacle_blocks(field);
    pho->dropped_numbers = count_number_blocks(field);
    pho->field = field;
    pho->output = invalid_output;
    pho->result = {};
    pho->parent.reset();
    pho->beam_generation = 0;
    pho->cached = {};
    pho->next = {};
    // evaluation
    pho->evaluation.score = 0;
    pho->evaluation.permanent_bonus = 0;
    pho->evaluation.estimateds.emplace_back((result_t) { 0, 0 }, 0);
    return pho;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %rcx, %r14
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rbx
callq 0x45a4
movq (%rbx), %rax
movl %r15d, (%rax)
andl $0x0, 0x4(%rax)
movl %ebp, 0x8(%rax)
movq %r14, %rdi
callq 0x248f
movq (%rbx), %rcx
movl %eax, 0xc(%rcx)
movq %r14, %rdi
callq 0x45bf
movq (%rbx), %r15
movl %eax, 0x10(%r15)
leaq 0x14(%r15), %rdi
movl $0xa0, %edx
movq %r14, %rsi
callq 0x2130
movq $-0x21524111, 0xb4(%r15) # imm = 0xDEADBEEF
movq (%rbx), %rdi
andq $0x0, 0xbc(%rdi)
addq $0xf0, %rdi
callq 0x45fc
movq (%rbx), %r14
andl $0x0, 0x100(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x104(%r14)
movups %xmm0, 0x114(%r14)
movups %xmm0, 0x124(%r14)
addq $0x138, %r14            # imm = 0x138
leaq 0x8(%rsp), %r15
movl $0x300, %edx            # imm = 0x300
movq %r15, %rdi
xorl %esi, %esi
callq 0x20d0
movq %r14, %rdi
movq %r15, %rsi
callq 0x4620
movq %r15, %rdi
callq 0x4654
movq (%rbx), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0xc8(%rdi)
addq $0xd8, %rdi
andq $0x0, (%r15)
leaq 0x4(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x8(%rsp), %rsi
callq 0x4418
movq %rbx, %rax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x5f78
movq %r14, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: step_photon(std::shared_ptr<photon_t> const&, primitive::blocks_t<3ul, 3ul> const&, primitive::output_t)
shared_ptr<photon_t> step_photon(shared_ptr<photon_t> const & pho, pack_t const & pack, output_t output) {
    if (not pho->cached[output.x+pack_size-1][output.rotate]) {
        int numbers = count_number_blocks(pack);
        int consumed = count_consumed_obstacles(pack, pho->obstacles);
        pack_t filled_pack = fill_obstacles(pack, consumed);
        step_photon_inner(pho, numbers, consumed, filled_pack, output.x, output.rotate);
    }
    return pho->next[output.x+pack_size-1][output.rotate];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r13
movq %rdi, %rbp
movq (%rsi), %rax
shlq $0x20, %rcx
movabsq $0x200000000, %rbx      # imm = 0x200000000
addq %rcx, %rbx
movq %rbx, %rcx
sarq $0x1e, %rcx
addq %rax, %rcx
sarq $0x20, %rbx
movq %r13, %r15
sarq $0x20, %r15
cmpb $0x0, 0x104(%r15,%rcx)
jne 0x3646
movq %rdx, %r12
movq %rsi, %r14
movq %r13, %rax
shrq $0x20, %rax
movq %rax, 0x8(%rsp)
movq %rdx, %rdi
callq 0x46b4
movl %eax, 0x4(%rsp)
movq (%r14), %rax
movl 0x8(%rax), %esi
movq %r12, %rdi
callq 0x2753
movq %rbp, 0x10(%rsp)
movl %eax, %ebp
movq (%r12), %rdi
movzbl 0x8(%r12), %esi
movl %eax, %edx
callq 0x2700
leaq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movb %dl, 0x8(%rcx)
movq %r14, %rdi
movl 0x4(%rsp), %esi
movl %ebp, %edx
movq 0x10(%rsp), %rbp
movl %r13d, %r8d
movq 0x8(%rsp), %r9
callq 0x33c7
movq (%r14), %rax
shlq $0x6, %rbx
addq %rax, %rbx
shlq $0x4, %r15
leaq (%r15,%rbx), %rsi
addq $0x138, %rsi            # imm = 0x138
movq %rbp, %rdi
callq 0x605a
movq %rbp, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: step_photon_all(std::shared_ptr<photon_t> const&, primitive::blocks_t<3ul, 3ul> const&)
void step_photon_all(shared_ptr<photon_t> const & pho, pack_t const & pack) {
    int numbers = count_number_blocks(pack);
    int consumed = count_consumed_obstacles(pack, pho->obstacles);
    pack_t filled_pack = fill_obstacles(pack, consumed);
    repeat_from (x, - pack_size + 1, width) repeat (r, 4) {
        step_photon_inner(pho, numbers, consumed, filled_pack, x, r);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x46b4
movl %eax, %ebp
movq (%rbx), %rax
movl 0x8(%rax), %esi
movq %r15, %rdi
callq 0x2753
movl %eax, %r14d
movq (%r15), %rdi
movzbl 0x8(%r15), %esi
movl %eax, %edx
callq 0x2700
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movb %dl, 0x8(%r15)
pushq $-0x2
popq %r12
cmpl $0xa, %r12d
je 0x36f3
xorl %r13d, %r13d
cmpl $0x4, %r13d
je 0x36ee
movq %rbx, %rdi
movl %ebp, %esi
movl %r14d, %edx
movq %r15, %rcx
movl %r12d, %r8d
movl %r13d, %r9d
callq 0x33c7
incl %r13d
jmp 0x36cd
incl %r12d
jmp 0x36c4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: evaluate_photon_for_output(std::shared_ptr<photon_t> const&, int, opponent_info_t const&)
double evaluate_photon_for_output(shared_ptr<photon_t> const & pho, int base_turn, opponent_info_t const & oppo) {
    int age = pho->turn - base_turn;
    double acc = 0;
    if (is_effective_firing(pho->result.score, pho->obstacles, age, oppo)) {
        if (pho->obstacles < 40) {
            double k = pow(1 + 0.18, -age+1);
            acc += 400 + k * (1.2 * pho->result.score); // 発火した それが可能でしかも勝てるというのは大きい
            acc -= 5 * pho->dropped_obstacles;
            acc -= 3 * max(0, pho->obstacles);
        } else {
            acc = pho->result.score; // 負けてる時はもう全力で
        }
    } else {
        if (pho->result.chain >= chain_of_fire) {
            double k = pow(1 + 0.18, -age+1);
            acc += k * pho->result.score;
            acc -= 3 * max(0, min(30, pho->obstacles));
        } else {
            acc += max(0.1, 1 - 0.03 * (age - 1)) * pho->evaluation.score;
        }
    }
    return acc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rcx
movq %rdi, %rbx
movq (%rdi), %r12
movl (%r12), %r15d
movl 0x8(%r12), %r14d
subl %esi, %r15d
movl 0xbc(%r12), %ebp
movl %ebp, %edi
movl %r14d, %esi
callq 0x3702
testb %al, %al
je 0x37d6
cmpl $0x27, %r14d
jg 0x382f
pushq $0x1
popq %rax
subl %r15d, %eax
cvtsi2sd %eax, %xmm1
movsd 0x9a39(%rip), %xmm0     # 0xd1c8
callq 0x2240
movq (%rbx), %rax
cvtsi2sdl 0xbc(%rax), %xmm1
mulsd 0x9a29(%rip), %xmm1     # 0xd1d0
mulsd %xmm0, %xmm1
addsd 0x9a25(%rip), %xmm1     # 0xd1d8
xorpd %xmm0, %xmm0
addsd %xmm1, %xmm0
imull $0x5, 0xc(%rax), %ecx
cvtsi2sd %ecx, %xmm1
subsd %xmm1, %xmm0
movl 0x8(%rax), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovgl %eax, %ecx
leal (%rcx,%rcx,2), %eax
jmp 0x3825
cmpl $0x6, 0xc0(%r12)
jl 0x3835
pushq $0x1
popq %rax
subl %r15d, %eax
cvtsi2sd %eax, %xmm1
movsd 0x99d5(%rip), %xmm0     # 0xd1c8
callq 0x2240
movq (%rbx), %rax
cvtsi2sdl 0xbc(%rax), %xmm1
mulsd %xmm0, %xmm1
xorpd %xmm0, %xmm0
addsd %xmm1, %xmm0
movl 0x8(%rax), %eax
cmpl $0x1e, %eax
pushq $0x1e
popq %rcx
cmovll %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovgl %ecx, %eax
leal (%rax,%rax,2), %eax
cvtsi2sd %eax, %xmm1
subsd %xmm1, %xmm0
jmp 0x3867
cvtsi2sd %ebp, %xmm0
jmp 0x3867
decl %r15d
cvtsi2sd %r15d, %xmm1
mulsd 0x996b(%rip), %xmm1     # 0xd1b0
addsd 0x996b(%rip), %xmm1     # 0xd1b8
maxsd 0x996b(%rip), %xmm1     # 0xd1c0
mulsd 0xc8(%r12), %xmm1
xorpd %xmm0, %xmm0
addsd %xmm1, %xmm0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: outputs_photon_from(std::shared_ptr<photon_t>, int)
vector<output_t> outputs_photon_from(shared_ptr<photon_t> pho, int turn) {
    vector<output_t> outputs;
    while (pho and pho->turn > turn) {
        outputs.push_back(pho->output);
        pho = pho->parent.lock();
    }
    if (not pho or pho->turn != turn) outputs.clear();
    whole(reverse, outputs);
    return outputs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movups %xmm0, (%rdi)
leaq 0x10(%rsp), %r15
movl $0xf0, %r13d
leaq 0x8(%rsp), %r12
movq (%r14), %rsi
testq %rsi, %rsi
je 0x3959
cmpl %ebp, (%rsi)
jle 0x395e
addq $0xb4, %rsi
movq %rbx, %rdi
callq 0x46f2
movq (%r14), %rsi
addq %r13, %rsi
movq %r12, %rdi
callq 0xcb24
movq %r14, %rdi
movq %r12, %rsi
callq 0xc96a
movq %r15, %rdi
callq 0x5f78
jmp 0x391b
movq (%rbx), %rdi
jmp 0x3969
movq (%rbx), %rdi
jne 0x3969
movq 0x8(%rbx), %rsi
jmp 0x3979
movq 0x8(%rbx), %rsi
cmpq %rdi, %rsi
je 0x3979
movq %rdi, 0x8(%rbx)
movq %rdi, %rsi
callq 0x608e
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3992
movq %rax, %r14
movq %rbx, %rdi
callq 0xcb98
movq %r14, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: prune_photon(std::shared_ptr<photon_t> const&, primitive::output_t)
void prune_photon(shared_ptr<photon_t> const & pho, output_t output) {
    assert (pho);
    repeat_from (x, - pack_size + 1, width) repeat (r, 4) {
        if (x == output.x and r == output.rotate) continue;
        pho->cached[x+pack_size-1][r] = false;
        pho->next[x+pack_size-1][r] = nullptr;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
movslq %esi, %rax
movq %rax, 0x8(%rsp)
movq %rsi, %r13
shrq $0x20, %r13
pushq $-0x2
popq %rbp
movl $0x104, %r12d           # imm = 0x104
movl $0x138, %r14d           # imm = 0x138
cmpq $0xa, %rbp
je 0x3a48
movq %rbp, 0x18(%rsp)
xorq 0x8(%rsp), %rbp
movq %r14, 0x10(%rsp)
xorl %r15d, %r15d
cmpq $0x4, %r15
je 0x3a31
movq %r13, %rax
xorq %r15, %rax
orq %rbp, %rax
je 0x3a28
movq (%rbx), %rdi
leaq (%rdi,%r12), %rax
movb $0x0, (%r15,%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
addq %r14, %rdi
leaq 0x20(%rsp), %rsi
callq 0xc96a
leaq 0x28(%rsp), %rdi
callq 0x5f78
incq %r15
addq $0x10, %r14
jmp 0x39ec
movq 0x18(%rsp), %rbp
incq %rbp
addq $0x4, %r12
movq 0x10(%rsp), %r14
addq $0x40, %r14
jmp 0x39d4
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: main
int main() {
    cout << ai_name << endl;
    cout.flush();
    config_t config; cin >> config;
    AI ai(config);
    repeat (i, config.packs.size()) {
        input_t input; cin >> input;
        if (not cin) {
#ifndef RELEASE
            cerr << "error: input failed" << endl;
#endif
            break;
        }
        output_t output = ai.think(input);
        cout << output << endl;
        cout.flush();
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movq 0x10496(%rip), %rbx     # 0x13fc8
leaq 0x1063f(%rip), %rsi     # 0x14178
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x2100
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq 0x10472(%rip), %rbx     # 0x13fd8
movq %rbx, %rdi
callq 0x2497
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0x474c
xorl %ebp, %ebp
pushq $0x9
popq %r15
leaq 0x178(%rsp), %r14
movq 0x10438(%rip), %r12     # 0x13fc8
leaq 0x20(%rsp), %r13
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cqto
idivq %r15
cmpq %rbp, %rax
jbe 0x3c0e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2529
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
jne 0x3bf3
leaq 0x28(%rsp), %rdi
movq %r14, %rsi
callq 0x481a
movq %rax, 0x20(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x2588
movq %rax, %rdi
callq 0x20a0
movq %r12, %rdi
callq 0x2100
incq %rbp
jmp 0x3b95
movq 0x103f6(%rip), %rdi     # 0x13ff0
leaq 0x9652(%rip), %rsi      # 0xd253
callq 0x2160
movq %rax, %rdi
callq 0x20a0
leaq 0x28(%rsp), %rdi
callq 0x5e88
movq %rsp, %rdi
callq 0xa468
xorl %eax, %eax
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3c3f
jmp 0x3c38
movq %rax, %rbx
jmp 0x3c4c
jmp 0x3c3f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x5e88
movq %rsp, %rdi
callq 0xa468
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: std::istream& primitive::operator>><3ul, 3ul>(std::istream&, primitive::blocks_t<3ul, 3ul>&)
istream & operator >> (istream & in, blocks_t<H, W> & a) {
        repeat_reverse (y, H) {
            repeat (x, W) {
                int c; in >> c; a.at[x][y] = c;
                assert ((a.at[x][y] == 0 and 0 == empty_block)
                        or (1 <= a.at[x][y] and a.at[x][y] <= 9)
                        or (a.at[x][y] == 11 and 11 == obstacle_block));
            }
        }
        string s; in >> s; assert (s == "END");
        return in;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x2
popq %rbp
leaq 0x8(%rsp), %r15
testl %ebp, %ebp
js 0x3e8a
movl %ebp, %r12d
addq %r14, %r12
xorl %r13d, %r13d
cmpq $0x9, %r13
je 0x3e86
movq %rbx, %rdi
movq %r15, %rsi
callq 0x20e0
movb 0x8(%rsp), %al
movb %al, (%r12,%r13)
addq $0x3, %r13
jmp 0x3e67
decl %ebp
jmp 0x3e5a
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x21b0
leaq 0x8(%rsp), %rdi
callq 0x2278
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2278
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: std::array<int, 10ul> simulation::make_height_map<16ul, 10ul>(primitive::blocks_t<16ul, 10ul> const&)
array<int,W> make_height_map(blocks_t<H,W> const & field) {
        array<int,W> h;
        repeat (x,W) {
            int y = 0;
            while (y < H and field.at[x][y] != empty_block) ++ y;
            h[x] = y;
        }
        return h;
    }

// Assembly:
movq %rdi, %rax
xorl %ecx, %ecx
pushq $0x10
popq %rdx
cmpq $0xa, %rcx
je 0x3fd5
xorl %edi, %edi
cmpq $0x10, %rdi
je 0x3fc7
cmpb $0x0, (%rsi,%rdi)
je 0x3fc9
incq %rdi
jmp 0x3fb6
movl %edx, %edi
movl %edi, (%rax,%rcx,4)
incq %rcx
addq $0x10, %rsi
jmp 0x3fae
retq
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: simulation::result_t simulation::simulate<19ul, 10ul>(primitive::blocks_t<19ul, 10ul>&, std::array<int, 10ul>&, std::vector<point_t, std::allocator<point_t>>, int)
result_t simulate(blocks_t<H,W> & field, array<int,W> & height_map, vector<point_t> modified_blocks, int initial_chain) {
        // 2. ブロックの消滅&落下処理
        int score = 0;
        int chain = initial_chain;
        while (not modified_blocks.empty()) {
            // 検査
            vector<pair<point_t,int> > erases = collect_erases(field, modified_blocks);
            if (erases.empty()) break; // 消滅なし
            ++ chain; // ここでincrement
            // 消滅&落下
            int erase_count; tie(erase_count, modified_blocks) = apply_erases(field, erases);
            modified_blocks = erase_blocks(field, height_map, modified_blocks);
            score += calculate_score(chain, erase_count);
        }
        // 3. 4. 5. 6. お邪魔ブロック関連処理
        // nop
        // 7. ターン終了
        result_t result;
        result.score = score;
        result.chain = chain;
        return result;
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rcx, 0x8(%rsp)
movq %rdx, %r14
movq %rsi, 0x18(%rsp)
movq %rdi, %r12
movl $0x0, 0x4(%rsp)
leaq 0x50(%rsp), %r13
movq (%r14), %rax
cmpq 0x8(%r14), %rax
je 0x40ce
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0xa8a4
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rbp
movq %rax, 0x20(%rsp)
cmpq %rbp, %rax
je 0x40b9
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0xaabf
movq %r14, 0x40(%rsp)
leaq 0x14(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0xabf4
leaq 0x58(%rsp), %rdi
callq 0xa6ce
movq %r13, %rdi
movq %r12, %rsi
movq 0x18(%rsp), %rdx
movq %r14, %rcx
callq 0xac11
movq 0x8(%rsp), %rbx
incl %ebx
movq %r14, %rdi
movq %r13, %rsi
callq 0xbe7e
movq %r13, %rdi
callq 0xa6ce
movl 0x14(%rsp), %eax
movq %rbx, 0x8(%rsp)
movslq %ebx, %rcx
cltd
pushq $0x2
popq %rsi
idivl %esi
leaq 0x8f6f(%rip), %rdx      # 0xd020
imull (%rdx,%rcx,4), %eax
addl %eax, 0x4(%rsp)
leaq 0x28(%rsp), %rdi
callq 0xbde2
cmpq %rbp, 0x20(%rsp)
jne 0x3fff
movq 0x8(%rsp), %rcx
shlq $0x20, %rcx
movl 0x4(%rsp), %eax
orq %rcx, %rax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %rbp
retq
jmp 0x40ed
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbde2
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: std::vector<point_t, std::allocator<point_t>> simulation::erase_blocks<16ul, 10ul>(primitive::blocks_t<16ul, 10ul>&, std::array<int, 10ul>&, std::vector<point_t, std::allocator<point_t>> const&)
vector<point_t> erase_blocks(blocks_t<H,W> & field, array<int,W> & height_map, vector<point_t> const & points_to_erase) {
        auto & at = field.at;
        array<int,W> old_height_map = height_map;
        for (point_t p : points_to_erase) {
            at[p.x][p.y] = empty_block;
            setmin(height_map[p.x], p.y);
        }
        vector<point_t> modified_blocks;
        repeat (x,W) {
            for (int y = height_map[x] + 1; y < old_height_map[x]; ++ y) {
                if (at[x][y] != empty_block) {
                    at[x][height_map[x]] = at[x][y];
                    if (at[x][height_map[x]] != obstacle_block) {
                        modified_blocks.push_back(point(height_map[x], x));
                    }
                    ++ height_map[x];
                    at[x][y] = empty_block;
                }
            }
        }
        return modified_blocks;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r14
movq %rdi, (%rsp)
movq 0x20(%rdx), %rax
movq %rax, 0x40(%rsp)
movups (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movaps %xmm1, 0x30(%rsp)
movaps %xmm0, 0x20(%rsp)
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
cmpq %rcx, %rax
je 0x41ed
movq (%rax), %rdx
movq %rdx, %r9
sarq $0x20, %r9
movq %r9, %rdi
shlq $0x4, %rdi
addq %rsi, %rdi
movslq %edx, %r8
movb $0x0, (%r8,%rdi)
cmpl %r8d, (%r14,%r9,4)
jle 0x41e7
movl %edx, (%r14,%r9,4)
addq $0x8, %rax
jmp 0x41bc
xorps %xmm0, %xmm0
movq (%rsp), %rax
andq $0x0, 0x10(%rax)
movups %xmm0, (%rax)
xorl %r13d, %r13d
movq %rsi, 0x8(%rsp)
movq %rsi, %rbp
cmpq $0xa, %r13
je 0x4285
movslq (%r14,%r13,4), %r15
movslq 0x20(%rsp,%r13,4), %r12
movq %r13, %rbx
shlq $0x4, %rbx
addq 0x8(%rsp), %rbx
movq %r13, %rax
shlq $0x20, %rax
movq %rax, 0x10(%rsp)
incq %r15
cmpq %r12, %r15
jge 0x427c
movb (%rbp,%r15), %al
testb %al, %al
je 0x422e
movslq (%r14,%r13,4), %rcx
movb %al, (%rbx,%rcx)
movslq (%r14,%r13,4), %rax
cmpb $0xb, (%rbx,%rax)
je 0x426e
movl %eax, %eax
orq 0x10(%rsp), %rax
movq %rax, 0x18(%rsp)
movq (%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xa702
movl (%r14,%r13,4), %eax
incl %eax
movl %eax, (%r14,%r13,4)
movb $0x0, (%rbp,%r15)
jmp 0x422e
incq %r13
addq $0x10, %rbp
jmp 0x4207
movq (%rsp), %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%rsp), %rdi
callq 0xa6ce
movq %r14, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: std::ostream& primitive::operator<<<16ul, 10ul>(std::ostream&, primitive::blocks_t<16ul, 10ul> const&)
ostream & operator << (ostream & out, blocks_t<H, W> const & a) {
        repeat_reverse (y, H) {
            if (y != H-1) out << endl;
            repeat (x, W) {
                switch (a.at[x][y]) {
                    case empty_block: out << ' '; break;
                    case obstacle_block: out << '#'; break;
                    default: out << int(a.at[x][y]); break;
                }
            }
        }
        return out;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %rbx
pushq $0xf
popq %r12
pushq $0x23
popq %rbp
pushq $0x20
popq %r15
testl %r12d, %r12d
js 0x67f2
cmpl $0xf, %r12d
je 0x67a6
movq %rbx, %rdi
callq 0x20a0
movl %r12d, %r13d
addq (%rsp), %r13
xorl %r14d, %r14d
cmpq $0xa0, %r14
je 0x67ed
movzbl (%r13,%r14), %eax
cmpl $0xb, %eax
je 0x67d0
testl %eax, %eax
jne 0x67dc
movq %rbx, %rdi
movl %r15d, %esi
jmp 0x67d5
movq %rbx, %rdi
movl %ebp, %esi
callq 0x21a0
jmp 0x67e7
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2230
addq $0x10, %r14
jmp 0x67b0
decl %r12d
jmp 0x6793
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]codevs-for-student-2016/Main.cpp
// Function: std::pair<int, std::vector<point_t, std::allocator<point_t>>> simulation::apply_erases<19ul, 10ul>(primitive::blocks_t<19ul, 10ul> const&, std::vector<std::pair<point_t, int>, std::allocator<std::pair<point_t, int>>> const&)
pair<int, vector<point_t> > apply_erases(blocks_t<H,W> const & field, vector<pair<point_t,int> > const & erases) {
        static const int dy[] = { -1, -1, 0, 1 }; // 下 右下 右 右上
        static const int dx[] = {  0,  1, 1, 1 };
        int erase_count = 0;
        vector<point_t> used;
        for (auto && it : erases) {
            point_t p; int j; tie(p, j) = it;
            int cnt = 0, acc = 0;
            for (; acc != erasing_sum; ++ cnt) {
                acc += field.at[p.x][p.y];
                used.push_back(p);
                p.y += dy[j];
                p.x += dx[j];
            }
            erase_count += cnt;
        }
        whole(sort, used);
        used.erase(whole(unique, used), used.end());
        return { erase_count, used };
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, 0x30(%rsp)
leaq 0x10(%rsp), %rax
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
movq (%rdx), %rcx
movq 0x8(%rdx), %rax
movq %rax, 0x38(%rsp)
xorl %ebp, %ebp
leaq 0x2b46(%rip), %r13      # 0xd640
cmpq 0x38(%rsp), %rcx
je 0xab73
movq (%rcx), %rax
movq %rax, 0x8(%rsp)
movq %rcx, 0x40(%rsp)
movslq 0x8(%rcx), %r15
movq %rax, %rcx
shrq $0x20, %rcx
xorl %r12d, %r12d
cmpl $0xa, %r12d
je 0xab68
movslq %ecx, %rcx
imulq $0x13, %rcx, %rcx
addq %r14, %rcx
cltq
movsbl (%rax,%rcx), %ebx
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xb6d0
addl %ebx, %r12d
movl 0x8(%rsp), %eax
movl 0xc(%rsp), %ecx
leaq 0x2add(%rip), %rdx      # 0xd630
addl (%rdx,%r15,4), %eax
movl %eax, 0x8(%rsp)
addl (%r13,%r15,4), %ecx
movl %ecx, 0xc(%rsp)
incl %ebp
jmp 0xab1c
movq 0x40(%rsp), %rcx
addq $0xc, %rcx
jmp 0xaafa
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xb7b7
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0xbd74
leaq 0x10(%rsp), %rdi
movq 0x8(%rdi), %rdx
movq %rax, %rsi
callq 0xb6ee
movq 0x30(%rsp), %rbx
movl %ebp, (%rbx)
movq %rbx, %rdi
addq $0x8, %rdi
leaq 0x10(%rsp), %rsi
callq 0x4102
leaq 0x10(%rsp), %rdi
callq 0xa6ce
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xabde
jmp 0xabde
jmp 0xabde
jmp 0xabde
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xa6ce
movq %rbx, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH09_SequentialContainers/examples/refreshIter.cc
// Function: printVec(std::vector<int, std::allocator<int>> const&)
void printVec(const vector<int>& vi)
{
    // print the vector's elements
    auto iter = vi.begin();
    while (iter != vi.end())
        cout << *iter++ << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r15
movq 0x2d85(%rip), %r14      # 0x3fd8
cmpq 0x8(%rbx), %r15
je 0x1272
movl (%r15), %esi
addq $0x4, %r15
movq %r14, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1060
jmp 0x1253
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH09_SequentialContainers/examples/refreshIter.cc
// Function: main
int main()
{
    // silly loop to remove even-valued elements
    // and insert a duplicate of odd-valued elements
    vector<int> vi = {0,1,2,3,4,5,6,7,8,9};
    printVec(vi);

    // we call begin, not cbegin because we're changing vi
    auto iter = vi.begin();
    while (iter != vi.end()) {
        if (*iter % 2) {    // if the element is odd
            iter = vi.insert(iter, *iter);  // duplicate  it
            iter += 2; // advance past this element and the new one
        } else
            iter = vi.erase(iter);          // remove even elements
            // don't advance the iterator;
            // iter denotes the element after the one we erased
    }
    printVec(vi);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x50, %rsp
movups 0xd85(%rip), %xmm0      # 0x2014
leaq -0x60(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movups 0xd66(%rip), %xmm0      # 0x2004
movaps %xmm0, (%rsi)
movabsq $0x900000008, %rax      # imm = 0x900000008
movq %rax, 0x20(%rsi)
leaq -0x30(%rbp), %rbx
pushq $0xa
popq %rdx
leaq -0x11(%rbp), %rcx
movq %rbx, %rdi
callq 0x134e
movq %rbx, %rdi
callq 0x123c
movq (%rbx), %r14
movq -0x28(%rbp), %rdx
cmpq %rdx, %r14
je 0x1318
testb $0x1, (%r14)
jne 0x1301
movq %r14, %rsi
addq $0x4, %rsi
cmpq %rdx, %rsi
je 0x12f7
subq %rsi, %rdx
movq %r14, %rdi
callq 0x10d0
movq -0x28(%rbp), %rdx
addq $-0x4, %rdx
movq %rdx, -0x28(%rbp)
jmp 0x12cd
movq %rbx, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x1384
movq %rax, %r14
addq $0x8, %r14
jmp 0x12cd
leaq -0x30(%rbp), %rdi
callq 0x123c
leaq -0x30(%rbp), %rdi
callq 0x144e
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x1339
jmp 0x1339
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x144e
movq %rbx, %rdi
callq 0x10f0
nop
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/list.cc
// Function: hcproxy::List::AddTail(hcproxy::Node*)
void List::AddTail(Node* node) {
  CHECK(node);
  CHECK(!node->prev_);
  CHECK(!node->next_);
  if (tail_) {
    CHECK(head_);
    CHECK(!tail_->next_);
    tail_->next_ = node;
  } else {
    CHECK(!head_);
    head_ = node;
  }
  node->prev_ = tail_;
  node->next_ = nullptr;
  tail_ = node;
  CHECK(head_ && tail_);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
testq %rsi, %rsi
je 0x18592
cmpq $0x0, (%rsi)
jne 0x185d0
cmpq $0x0, 0x8(%rsi)
jne 0x1860e
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x18571
testq %rcx, %rcx
je 0x1864c
cmpq $0x0, 0x8(%rax)
jne 0x1868a
leaq 0x8(%rax), %rdx
jmp 0x1857d
movq %rdi, %rdx
testq %rcx, %rcx
jne 0x186c5
movq %rsi, (%rdx)
movq %rax, (%rsi)
andq $0x0, 0x8(%rsi)
movq %rsi, 0x8(%rdi)
addq $0x20, %rsp
popq %rbx
retq
leaq 0xb6a6b(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
pushq $0x16
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb6a93(%rip), %rsi     # 0xcf048
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xbbd05(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1870a
leaq 0xb6a2d(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
pushq $0x17
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb6a1d(%rip), %rsi     # 0xcf010
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xbbcc7(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1870a
leaq 0xb69ef(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
pushq $0x18
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb69ec(%rip), %rsi     # 0xcf01d
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xbbc89(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1870a
leaq 0xb69b1(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
pushq $0x1a
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb69ca(%rip), %rsi     # 0xcf039
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xbbc4b(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1870a
leaq 0xb6973(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
pushq $0x1b
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb697d(%rip), %rsi     # 0xcf02a
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xbbc0d(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1870a
leaq 0xb6938(%rip), %rsi     # 0xcf004
movq %rsp, %rbx
pushq $0x1e
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb6950(%rip), %rsi     # 0xcf038
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xbbbd2(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x1870a
jmp 0x1870a
jmp 0x1870a
jmp 0x1870a
jmp 0x1870a
jmp 0x1870a
movq %rsp, %rdi
callq 0x189a6
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/parser.cc
// Function: hcproxy::Parser::ParseRequest(int, std::function<void (std::basic_string_view<char, std::char_traits<char>>)>)
void Parser::ParseRequest(int fd, Callback cb) {
  CHECK(fd >= 0);
  CHECK(cb);
  auto* eh = new ParseEventHandler(opt_, fd, std::move(cb));
  event_loop_.ScheduleOrRun([this, eh]() { event_loop_.Add(eh, EPOLLIN); });
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
testl %esi, %esi
js 0x18b03
movq %rdx, %r15
movq %rdi, 0x28(%rsp)
movq 0x10(%rdx), %r12
testq %r12, %r12
je 0x18b40
movl %esi, %ebp
leaq 0x10(%r15), %r14
pushq $0x78
popq %rdi
callq 0x21400
movq %rax, %rbx
movq 0x18(%r15), %r13
movq %r13, 0x48(%rsp)
movups (%r15), %xmm0
movaps %xmm0, 0x30(%rsp)
movq %r12, 0x40(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq %rax, %rdi
movl %ebp, %esi
callq 0x1919c
leaq 0xf2a99(%rip), %rax     # 0x10b510
movq %rax, (%rbx)
leaq 0x38(%rbx), %r15
movq %r13, 0x50(%rbx)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x38(%rbx)
movq %r12, 0x48(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq %rbx, %rdi
addq $0x58, %rdi
movq 0x28(%rsp), %r14
movq (%r14), %rsi
leaq 0x8(%rsp), %rdx
callq 0x1920c
andq $0x0, 0x70(%rbx)
leaq 0x30(%rsp), %rdi
callq 0x19180
movq 0x10(%r14), %rdi
leaq 0x58(%rsp), %rsi
movq %r14, (%rsi)
movq %rbx, 0x8(%rsi)
leaq 0x66e(%rip), %rax       # 0x19144
movq %rax, 0x18(%rsi)
leaq 0x677(%rip), %rax       # 0x19158
movq %rax, 0x10(%rsi)
callq 0x1febc
leaq 0x58(%rsp), %rdi
callq 0x19180
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb65b6(%rip), %rsi     # 0xcf0c0
leaq 0x8(%rsp), %rbx
pushq $0x7e
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb7379(%rip), %rsi     # 0xcfea1
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xbb792(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x18b7f
leaq 0xb6579(%rip), %rsi     # 0xcf0c0
leaq 0x8(%rsp), %rbx
pushq $0x7f
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb6569(%rip), %rsi     # 0xcf0ce
callq 0x8b1d0
movq 0x20(%rsp), %rdi
leaq 0xbb755(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
jmp 0x18b7f
jmp 0x18b7f
leaq 0x8(%rsp), %rdi
callq 0x189a6
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x19180
jmp 0x18bc5
movq %rax, %r14
movq %r15, %rdi
callq 0x19180
movq %rbx, %rdi
callq 0x1925e
jmp 0x18bb0
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x19180
pushq $0x78
popq %rsi
movq %rbx, %rdi
callq 0x20470
movq %r14, %rdi
callq 0xcc660
nop
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/connector.cc
// Function: hcproxy::(anonymous namespace)::ConnectEventHandler::Finish(hcproxy::EventLoop*, int)
void Finish(EventLoop* loop, int err) {
    loop->Remove(this);
    if (err == 0) {
      LOG(INFO) << "[" << fd() << "] connected";
      cb_(fd());
    } else {
      LOG(WARN) << "[" << fd() << "] unable to connect: " << Errno(err);
      CHECK(close(fd()) == 0) << Errno();
      cb_(-1);
    }
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movq %rdi, %rbx
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x1fb6c
leaq 0xb544c(%rip), %rsi     # 0xcf609
movq %rsp, %r14
testl %ebp, %ebp
je 0x1a229
pushq $0x47
popq %rdx
pushq $0x1
popq %rcx
movq %r14, %rdi
callq 0x1f4c8
movq 0x18(%r14), %rdi
leaq 0xb4f66(%rip), %rsi     # 0xcf143
callq 0x8b1d0
movl 0x18(%rbx), %esi
movq 0x18(%rsp), %rdi
callq 0x8b570
movq 0x18(%rsp), %rdi
leaq 0xb54b3(%rip), %rsi     # 0xcf6ae
callq 0x8b1d0
movq 0x18(%rsp), %rdi
movl %ebp, %esi
callq 0x1f61a
movq %rsp, %rdi
callq 0x193e6
movl 0x18(%rbx), %edi
callq 0x15140
testl %eax, %eax
jne 0x1a284
addq $0x38, %rbx
pushq $-0x1
popq %rsi
jmp 0x1a273
pushq $0x44
popq %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x1f4c8
movq 0x18(%r14), %rdi
leaq 0xb4f02(%rip), %rsi     # 0xcf143
callq 0x8b1d0
movl 0x18(%rbx), %esi
movq 0x18(%rsp), %rdi
callq 0x8b570
movq 0x18(%rsp), %rdi
leaq 0xb5443(%rip), %rsi     # 0xcf6a2
callq 0x8b1d0
movq %rsp, %rdi
callq 0x19502
movl 0x18(%rbx), %esi
addq $0x38, %rbx
movq %rbx, %rdi
callq 0x1a330
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xb537e(%rip), %rsi     # 0xcf609
movq %rsp, %rbx
pushq $0x48
popq %rdx
pushq $0x3
popq %rcx
movq %rbx, %rdi
callq 0x1f4c8
movq 0x18(%rbx), %rdi
leaq 0xb541d(%rip), %rsi     # 0xcf6c4
callq 0x8b1d0
movq 0x18(%rsp), %rdi
leaq 0xba013(%rip), %rsi     # 0xd42cb
callq 0x8b1d0
movq %rsp, %rdi
callq 0x19465
jmp 0x1a2c9
jmp 0x1a2d5
movq %rsp, %rdi
callq 0x189a6
jmp 0x1a2e2
jmp 0x1a2e2
movq %rax, %rbx
movq %rsp, %rdi
callq 0x19502
jmp 0x1a2ed
movq %rax, %rbx
movq %rsp, %rdi
callq 0x193e6
movq %rbx, %rdi
callq 0xcc660
nop
// File: /workspace/github_cpp_makefile_star2_O2/romkatv[P]hcproxy/src/thread_pool.cc
// Function: hcproxy::ThreadPool::~ThreadPool()
ThreadPool::~ThreadPool() {
  {
    std::lock_guard<std::mutex> lock(mutex_);
    exit_ = true;
  }
  cv_.notify_all();
  sleeper_cv_.notify_one();
  for (std::thread& t : threads_) t.join();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
movq %r14, %rdi
callq 0x1b8a4
movb $0x1, 0x8(%rbx)
movq %r14, %rdi
callq 0x158d0
leaq 0x38(%rbx), %r14
movq %r14, %rdi
callq 0x2d9b0
leaq 0x68(%rbx), %r15
movq %r15, %rdi
callq 0x2d9a0
leaq 0xb8(%rbx), %r12
movq 0xb8(%rbx), %r13
movq 0xc0(%rbx), %rbp
cmpq %rbp, %r13
je 0x1bcec
movq %r13, %rdi
callq 0x9e080
addq $0x8, %r13
jmp 0x1bcd9
movq %r12, %rdi
callq 0x1c06c
addq $0x98, %rbx
movq %rbx, %rdi
callq 0x1c0e4
movq %r15, %rdi
callq 0x2d970
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2d970
jmp 0x1bd23
movq %rax, %rdi
callq 0x189b9
nop