// File: /workspace/github_cpp_makefile_star2_O2/kmyk[P]procon26/beam_search.cpp
// Function: beam_search_solver::operator()(board const&, std::vector<block, std::allocator<block>> const&)
vector<placement_t> operator () (board const & a_brd, vector<block> const & blks) {
        // 初期化
        n = blks.size();
        repeat (j,2) remaining_small_blks[j].resize(n);
        repeat_reverse (i,n-1) {
            repeat (j,2) {
                remaining_small_blks[j][i] = remaining_small_blks[j][i+1];
            }
            if (blks[i+1].area() <= 2) {
                remaining_small_blks[blks[i+1].area() - 1][i] += 1;
            }
        }
        highscore = a_brd.area();
        if (make_pair(a_brd.area(), 0) < make_pair(g_best_score, g_best_stone)) {
            g_best_score = a_brd.area();
            g_best_stone = 0;
        }
        // ビームサーチ 初期状態
        vector<photon_ptr> beam;
        for (auto && brd : a_brd.split()) { // 初期の非連結成分同士は真に独立
            photon_ptr ppho = make_shared<photon_t>();
            photon_t & pho = *ppho;
            pho.brd = brd;
            pho.score = a_brd.area();
            pho.stone_count = 0;
            pho.circumference = 0; // 相対的なもののみ気にするので0でよい
            pho.remaining_stone = 0;
            for (auto && blk : blks) pho.remaining_stone += blk.area();
            pho.plc.resize(n, { false });
            pho.bix = 0;
            for (int & it : pho.isolated) it = 0;
            pho.solver = this;
            beam.push_back(ppho);
        }
int nthbeam = 0;
        // ビーム発射
        vector<photon_ptr> next;
        unordered_set<bitset<board_size*board_size> > used_board;
        while (not beam.empty()) {
            for (auto && ppho : beam) {
                photon_t const & pho = *ppho;
                // ハイスコアの更新
                if (make_pair(pho.score, pho.stone_count) < make_pair(highscore, least_stone)) {
                    highscore = pho.score;
                    least_stone = pho.stone_count;
                    result = pho.plc;
                }
                // 石を置く
                int bix = pho.bix;
                while (bix < n and pho.plc[bix].used) bix += 1;
                if (bix < n) {
                    block const & blk = blks[bix];
                    { // 置かなかった場合
                        photon_ptr npho = make_shared<photon_t>();
                        *npho = pho;
                        npho->bix = bix + 1;
                        npho->dead_stone += blk.area();
                        npho->remaining_stone -= blk.area();
                        next.push_back(npho);
                    }
                    bool is_just_used = false; // ぴったり嵌るような使われ方をしたか // used_componentsと処理が被っている
                    set<vector<int> > used_components;
                    int pushed_count = 0;
                    placement_t p = initial_placement(blk, pho.brd.stone_offset());
                    do {
                        int skip;
                        if (pho.brd.is_puttable(blk, p, 2+bix, &skip)) {
                            photon_ptr pnpho = make_shared<photon_t>();
                            *pnpho = pho;
                            photon_t & npho = *pnpho;
                            npho.plc[bix] = p;
                            npho.stone_count += 1;
                            npho.bix = bix + 1;
                            npho.score -= blk.area();
                            npho.remaining_stone -= blk.area();
                            // circumference 更新
                            repeat (j, blk.area()) {
                                point_t q = blk.stones(p.f,p.r)[j] + p.p;
                                repeat (i,4) {
                                    auto r = q + dp[i];
                                    npho.circumference +=
                                        not is_on_board(r) ? -1 :
                                        npho.brd.at(r) == 0 ? 1 :
                                        -1;
                                }
                                npho.brd.put(q, 2+bix);
                            }
                            // ぴったり嵌まる場合
                            if (pho.circumference - npho.circumference == blk.circumference()) {
                                if (is_just_used) continue;
                                is_just_used = true;
                                if (1 <= blk.area() and blk.area() <= 4) {
                                    npho.isolated[blk.area() - 1] -= 1;
                                }
                            }
                            npho.brd.update();
                            // 接続する空白
                            vector<point_t> neighbors;
                            repeat (j, blk.area()) {
                                point_t q = blk.stones(p.f,p.r)[j] + p.p;
                                repeat (i,4) {
                                    auto r = q + dp[i];
                                    if (is_on_board(r) and npho.brd.at(r) == 0) {
                                        neighbors.push_back(r);
                                    }
                                }
                            }
                            // cache
                            if (used_board.count(npho.brd.packed())) continue;
                            if (2 <= n and cache and cache->count(npho.brd.packed())) continue;
                            used_board.insert(npho.brd.packed());
                            // 周囲の孤立した空白の探索
                            set<point_t> looked_cell;
                            vector<int> components;
                            bool is_diverged = false; // there are some too large components
                            for (point_t q : neighbors) {
                                if (looked_cell.count(q)) continue;
                                set<point_t> current;
                                current.insert(q);
                                int n = 1; // 空白の大きさ
                                stack<point_t> stk;
                                stk.push(q);
                                // dfs
                                while (not stk.empty()) {
                                    point_t r = stk.top(); stk.pop();
                                    repeat (i,4) {
                                        auto s = r + dp[i];
                                        if (looked_cell.count(s)) {
                                            n = 1000000007;
                                            break;
                                        }
                                        if (not current.count(s) and is_on_board(s) and npho.brd.at(s) == 0) {
                                            current.insert(s);
                                            stk.push(s);
                                            n += 1;
                                        }
                                    }
                                    if (5 <= n) break;
                                }
                                if (1 <= n and n <= 4) {
                                    npho.isolated[n-1] += 1;
                                }
                                if (5 <= n) is_diverged = true;
                                if (not is_diverged) {
                                    // 空白の種類の判別
                                    if (n == 1 or n == 2) {
                                        components.push_back(n);
                                    } else if (n == 3) {
                                        vector<point_t> ps(current.begin(), current.end());
                                        components.push_back(3 + (cross(ps[1] - ps[0], ps[2] - ps[0]) == 0 ? 0 : 1));
                                    } else if (n == 4) {
                                        vector<point_t> ps(current.begin(), current.end());
                                        int sy = abs(ps[3].y + ps[2].y + ps[1].y - 3 * ps[0].y);
                                        int sx = abs(ps[3].x + ps[2].x + ps[1].x - 3 * ps[0].x);
                                        components.push_back(component_pack_table[min(sy, sx) + max(sy, sx) * 10]);
                                    }
                                }
                                copy(current.begin(), current.end(), inserter(looked_cell, looked_cell.begin()));
                            }
                            if (not is_diverged) { // 小さい空白だけに分割する場合の重複排除
                                sort(components.begin(), components.end());
                                if (used_components.count(components)) continue;
                                used_components.insert(components);
                            }
                            if (is_just_used) {
                                repeat (i,pushed_count) next.pop_back();
                                next.push_back(pnpho);
                                break; // justなら必ずそれを使うことにする
                            }
                            next.push_back(pnpho);
                            pushed_count += 1;
                        }
                        p.p.x += skip - 1;
                    } while (next_placement(p, blk, pho.brd.stone_offset(), pho.brd.stone_offset() + pho.brd.stone_size()));
                }
                if (beam_width * 10 < next.size()) { // 全部貯めてるとoom killerさん
                    sort(next.rbegin(), next.rend(), &photon_ptr_comparator);
                    next.resize(beam_width);
                }
            }
            sort(next.rbegin(), next.rend(), &photon_ptr_comparator);
            if (beam_width < next.size()) next.resize(beam_width);
            for (auto && ppho : next) ppho->brd.shrink();
            if (cache) for (auto && ppho : next) cache->insert(ppho->brd.packed());
            next.swap(beam);
            next.clear();
            used_board.clear();
            // ここからその石に関して終わったので出力
cerr << "beam " << (nthbeam ++) << " : " << beam.size() << endl;
if (cache) cerr << "cache " << cache->size() << endl;
            // 全体のハイスコアの更新と出力
            if (make_pair(highscore, least_stone) < make_pair(g_best_score, g_best_stone)) {
                g_provisional_result = { result };
                g_best_score = highscore;
                g_best_stone = least_stone;
#ifdef NPRACTICE
                cout << g_provisional_result;
#endif
                cerr << g_best_score << " " << g_best_stone << endl;
            }
            // 石ごとに途中経過を出力
repeat (i, min<int>(3, beam.size())) {
    cerr << beam[i]->brd;
    cerr << "score: " << beam[i]->score << endl;
    cerr << "evaluate: " << evaluate(*beam[i]) << endl;
    cerr << "circumference: " << beam[i]->circumference << endl;
}
        }
        // ビーム終了
        return result;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2b8, %rsp            # imm = 0x2B8
movq %rdx, (%rsp)
movq %rsi, %rbp
movq %rdi, 0x228(%rsp)
movq 0x8(%rcx), %rax
movq %rcx, 0x98(%rsp)
subq (%rcx), %rax
movl $0x418, %ecx            # imm = 0x418
cqto
idivq %rcx
movl %eax, 0x20ec(%rsi)
leaq 0x2120(%rsi), %r15
movl $0x2120, %ebx           # imm = 0x2120
cmpq $0x2150, %rbx           # imm = 0x2150
je 0x2954
leaq (%rbx,%rbp), %rdi
movslq 0x20ec(%rbp), %rsi
callq 0x40e6
addq $0x18, %rbx
jmp 0x2935
movl 0x20ec(%rbp), %r12d
addl $-0x2, %r12d
testl %r12d, %r12d
js 0x29ce
movl %r12d, %r13d
xorl %eax, %eax
cmpq $0x30, %rax
je 0x2982
movq (%r15,%rax), %rcx
movl 0x4(%rcx,%r13,4), %edx
movl %edx, (%rcx,%r13,4)
addq $0x18, %rax
jmp 0x2969
leal 0x1(%r12), %eax
imulq $0x418, %rax, %r14      # imm = 0x418
movq 0x98(%rsp), %rax
movq (%rax), %rdi
addq %r14, %rdi
callq 0x7a40
cmpl $0x3, %eax
jge 0x29c9
movq 0x98(%rsp), %rax
addq (%rax), %r14
movq %r14, %rdi
callq 0x7a40
decl %eax
cltq
imulq $0x18, %rax, %rax
movq (%r15,%rax), %rax
incl (%rax,%r13,4)
decl %r12d
jmp 0x295f
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x7928
movl %eax, 0x20e0(%rbp)
movq %rbx, %rdi
callq 0x7928
leaq 0xf769(%rip), %rcx      # 0x12158
movl (%rcx), %ecx
cmpl %ecx, %eax
jl 0x2a03
jg 0x2a1f
leaq 0xf75e(%rip), %rax      # 0x1215c
cmpl $0x0, (%rax)
jle 0x2a1f
movq (%rsp), %rdi
callq 0x7928
leaq 0xf745(%rip), %rcx      # 0x12158
movl %eax, (%rcx)
leaq 0xf740(%rip), %rax      # 0x1215c
andl $0x0, (%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
andq $0x0, 0x50(%rsp)
leaq 0x130(%rsp), %rdi
movq (%rsp), %rsi
callq 0x7c44
movq 0x130(%rsp), %r14
movq 0x138(%rsp), %r13
leaq 0x1f8(%rsp), %r15
movq %rbp, 0x30(%rsp)
cmpq %r13, %r14
je 0x2b54
movq %r15, %rdi
callq 0x4117
movq 0x1f8(%rsp), %rbp
movl $0x20b0, %edx           # imm = 0x20B0
movq %rbp, %rdi
movq %r14, %rsi
callq 0x2120
movq (%rsp), %rdi
callq 0x7928
movl %eax, 0x20b0(%rbp)
andq $0x0, 0x20b4(%rbp)
andl $0x0, 0x20c0(%rbp)
movq 0x98(%rsp), %rax
movq (%rax), %r12
movq 0x8(%rax), %rbx
cmpq %rbx, %r12
je 0x2acd
movq %r12, %rdi
callq 0x7a40
addl %eax, 0x20c0(%rbp)
addq $0x418, %r12            # imm = 0x418
jmp 0x2ab1
leaq 0x20c8(%rbp), %rdi
movq 0x30(%rsp), %rax
movslq 0x20ec(%rax), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, 0x280(%rsp)
andl $0x0, 0x290(%rsp)
leaq 0x280(%rsp), %rdx
callq 0x4132
andl $0x0, 0x20e0(%rbp)
xorl %eax, %eax
cmpq $0x10, %rax
je 0x2b1d
andl $0x0, 0x20e4(%rbp,%rax)
addq $0x4, %rax
jmp 0x2b09
movq 0x30(%rsp), %rax
movq %rax, 0x20f8(%rbp)
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x416e
leaq 0x200(%rsp), %rdi
callq 0x4cb4
addq $0x20b0, %r14           # imm = 0x20B0
movq 0x30(%rsp), %rbp
jmp 0x2a5b
leaq 0x130(%rsp), %rdi
callq 0x4d30
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x2b0(%rsp), %rax
movq %rax, -0x30(%rax)
movq $0x1, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl $0x3f800000, -0x10(%rax) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
leaq 0x20c8(%rbp), %rax
movq %rax, 0xb0(%rsp)
leaq 0x20f0(%rbp), %rax
movq %rax, 0x230(%rsp)
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq $0x0, 0xa8(%rsp)
movabsq $0x100000000, %rdi      # imm = 0x100000000
cmpq %rsi, %rdx
je 0x3a8c
movq %rsi, 0x238(%rsp)
cmpq %rsi, %rdx
je 0x374a
movq %rdx, 0x240(%rsp)
movq (%rdx), %rbx
movl 0x20b0(%rbx), %eax
movl 0x20b4(%rbx), %ecx
movl 0x20e0(%rbp), %edx
cmpl %edx, %eax
jl 0x2c17
jg 0x2c41
cmpl 0x20e4(%rbp), %ecx
jge 0x2c41
movl %eax, 0x20e0(%rbp)
movl %ecx, 0x20e4(%rbp)
leaq 0x20c8(%rbx), %rsi
movq 0xb0(%rsp), %rdi
callq 0x419a
movabsq $0x100000000, %rdi      # imm = 0x100000000
movslq 0x20e0(%rbx), %rax
movslq 0x20ec(%rbp), %rcx
movq %rax, %r8
shlq $0x20, %r8
leal 0x1(%rax), %edx
movq %rdx, 0x58(%rsp)
imulq $0x14, %rax, %rdx
cmpq %rcx, %rax
jge 0x36c6
movq 0x20c8(%rbx), %rsi
cmpb $0x1, (%rsi,%rdx)
jne 0x2c90
incq %rax
addq %rdi, %r8
movq 0x58(%rsp), %rsi
incl %esi
movq %rsi, 0x58(%rsp)
addq $0x14, %rdx
jmp 0x2c62
sarq $0x20, %r8
movq %r8, 0x248(%rsp)
imulq $0x418, %r8, %rcx       # imm = 0x418
movq 0x98(%rsp), %rax
addq (%rax), %rcx
movq %rcx, (%rsp)
leaq 0x130(%rsp), %rdi
callq 0x4117
movq 0x130(%rsp), %rdi
movq %rbx, %rsi
callq 0x427a
movq 0x130(%rsp), %rax
movq 0x58(%rsp), %rcx
movl %ecx, 0x20e0(%rax)
movq (%rsp), %rdi
callq 0x7a40
movq 0x130(%rsp), %rcx
addl %eax, 0x20bc(%rcx)
movq (%rsp), %rdi
callq 0x7a40
movq 0x130(%rsp), %rcx
subl %eax, 0x20c0(%rcx)
leaq 0x10(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x416e
leaq 0x138(%rsp), %rdi
callq 0x4cb4
andl $0x0, 0x200(%rsp)
andq $0x0, 0x208(%rsp)
leaq 0x200(%rsp), %rax
movq %rax, 0x210(%rsp)
movq %rax, 0x218(%rsp)
andq $0x0, 0x220(%rsp)
movq %rbx, %rdi
callq 0x78da
movq (%rsp), %r14
movq %rax, 0x130(%rsp)
leaq 0x6c(%rsp), %rdi
movq %r14, %rsi
leaq 0x130(%rsp), %rdx
callq 0x8812
movq 0x58(%rsp), %rax
incl %eax
movl %eax, 0x68(%rsp)
leaq 0x290(%r14), %rax
movq %rax, 0xf8(%rsp)
movl $0x0, 0x64(%rsp)
movl $0x0, 0x3c(%rsp)
movq %rbx, 0xb8(%rsp)
movq %rbx, %rdi
movq (%rsp), %rsi
leaq 0x6c(%rsp), %rdx
movl 0x68(%rsp), %ecx
leaq 0xcc(%rsp), %r8
callq 0x7a62
testb %al, %al
je 0x3639
leaq 0xe8(%rsp), %rdi
callq 0x4117
movq 0xe8(%rsp), %rdi
movq %rbx, %rsi
callq 0x427a
movq 0xe8(%rsp), %r12
movq 0x20c8(%r12), %rax
imulq $0x14, 0x248(%rsp), %rcx
movl 0x7c(%rsp), %edx
movl %edx, 0x10(%rax,%rcx)
movups 0x6c(%rsp), %xmm0
movups %xmm0, (%rax,%rcx)
incl 0x20b4(%r12)
movq 0x58(%rsp), %rax
movl %eax, 0x20e0(%r12)
movq (%rsp), %rdi
callq 0x7a40
subl %eax, 0x20b0(%r12)
movq (%rsp), %rdi
callq 0x7a40
subl %eax, 0x20c0(%r12)
xorl %r15d, %r15d
movq (%rsp), %rdi
callq 0x7a40
movq 0xb8(%rsp), %rcx
cltq
cmpq %rax, %r15
jge 0x2f39
movl 0x78(%rsp), %eax
movl 0x7c(%rsp), %ecx
imulq $0x60, %rax, %rax
addq 0xf8(%rsp), %rax
imulq $0x18, %rcx, %rcx
movq (%rcx,%rax), %rax
movl 0x70(%rsp), %r13d
movl 0x74(%rsp), %r14d
addl (%rax,%r15,8), %r13d
addl 0x4(%rax,%r15,8), %r14d
movq %r14, %rbp
shlq $0x20, %rbp
xorl %ebx, %ebx
cmpq $0x4, %rbx
je 0x2f1c
leaq 0x819d(%rip), %rcx      # 0xb060
movl (%rcx,%rbx,8), %eax
addl %r13d, %eax
movl 0x4(%rcx,%rbx,8), %ecx
addl %r14d, %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, 0x130(%rsp)
leaq 0x130(%rsp), %rdi
callq 0x9de0
pushq $-0x1
popq %rcx
testb %al, %al
je 0x2f0f
movq 0x130(%rsp), %rsi
movq %r12, %rdi
callq 0x7916
negl %eax
movl $0x0, %ecx
sbbl %ecx, %ecx
orl $0x1, %ecx
addl %ecx, 0x20b8(%r12)
incq %rbx
jmp 0x2eb6
movl %r13d, %eax
orq %rax, %rbp
movq %r12, %rdi
movq %rbp, %rsi
movl 0x68(%rsp), %edx
callq 0x7b7e
incq %r15
jmp 0x2e62
movl 0x20b8(%rcx), %ebx
movl 0x20b8(%r12), %ebp
movq (%rsp), %rdi
callq 0x865c
subl %ebp, %ebx
cmpl %eax, %ebx
jne 0x2f9e
testb $0x1, 0x3c(%rsp)
je 0x2f6a
pushq $0x18
popq %rbx
movq 0x30(%rsp), %rbp
jmp 0x360e
movq (%rsp), %rdi
callq 0x7a40
movb $0x1, %cl
movl %ecx, 0x3c(%rsp)
testl %eax, %eax
jle 0x2f9e
movq (%rsp), %rdi
callq 0x7a40
cmpl $0x4, %eax
jg 0x2f9e
movq (%rsp), %rdi
callq 0x7a40
cltq
decl 0x20e0(%r12,%rax,4)
movq %r12, %rdi
callq 0x7850
xorps %xmm0, %xmm0
movaps %xmm0, 0x1b0(%rsp)
andq $0x0, 0x1c0(%rsp)
xorl %r14d, %r14d
movq (%rsp), %rdi
callq 0x7a40
leaq 0x130(%rsp), %rbx
cltq
cmpq %rax, %r14
jge 0x307b
movl 0x78(%rsp), %eax
movl 0x7c(%rsp), %ecx
imulq $0x60, %rax, %rax
addq 0xf8(%rsp), %rax
imulq $0x18, %rcx, %rcx
movq (%rcx,%rax), %rax
movl 0x70(%rsp), %r15d
addl (%rax,%r14,8), %r15d
movl 0x74(%rsp), %ebp
addl 0x4(%rax,%r14,8), %ebp
xorl %r13d, %r13d
cmpq $0x4, %r13
je 0x3073
leaq 0x8049(%rip), %rcx      # 0xb060
movl (%rcx,%r13,8), %eax
addl %r15d, %eax
movl 0x4(%rcx,%r13,8), %ecx
addl %ebp, %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, 0x130(%rsp)
leaq 0x130(%rsp), %rdi
callq 0x9de0
testb %al, %al
je 0x306e
movq 0x130(%rsp), %rsi
movq %r12, %rdi
callq 0x7916
testl %eax, %eax
jne 0x306e
leaq 0x1b0(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x42c8
incq %r13
jmp 0x300a
incq %r14
jmp 0x2fbd
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7f7a
leaq 0x280(%rsp), %rdi
movq %rbx, %rsi
callq 0x4ee6
testq %rax, %rax
je 0x30a8
pushq $0x18
popq %rbx
movq 0x30(%rsp), %rbp
jmp 0x3601
movq 0x30(%rsp), %rbp
cmpl $0x2, 0x20ec(%rbp)
jl 0x30ed
movq 0x2150(%rbp), %r14
testq %r14, %r14
je 0x30ed
leaq 0x130(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7f7a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4ee6
testq %rax, %rax
je 0x30ed
pushq $0x18
popq %rbx
jmp 0x3601
leaq 0x130(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x7f7a
leaq 0x280(%rsp), %rdi
movq %rbx, %rsi
callq 0x4ff0
andl $0x0, 0x1d0(%rsp)
andq $0x0, 0x1d8(%rsp)
leaq 0x1d0(%rsp), %rax
movq %rax, 0x1e0(%rsp)
movq %rax, 0x1e8(%rsp)
andq $0x0, 0x1f0(%rsp)
andq $0x0, 0xe0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xd0(%rsp)
movq 0x1b0(%rsp), %rbp
movq 0x1b8(%rsp), %rbx
xorl %r14d, %r14d
movq %rbx, 0x250(%rsp)
cmpq %rbx, %rbp
je 0x3531
movq (%rbp), %rax
movq %rax, 0xc0(%rsp)
leaq 0x1c8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x42e6
testq %rax, %rax
jne 0x338d
andl $0x0, 0x108(%rsp)
andq $0x0, 0x110(%rsp)
leaq 0x108(%rsp), %rax
movq %rax, 0x118(%rsp)
movq %rax, 0x120(%rsp)
andq $0x0, 0x128(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x5400
movl $0x1, 0xc(%rsp)
leaq 0x130(%rsp), %rbx
movq %rbx, %rdi
callq 0x4300
movq %rbx, %rdi
leaq 0xc0(%rsp), %rsi
callq 0x5768
movq 0x160(%rsp), %rax
cmpq 0x140(%rsp), %rax
je 0x3396
movl %r14d, %ebx
cmpq 0x168(%rsp), %rax
jne 0x324a
movq 0x178(%rsp), %rax
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x8(%rax), %r14
movq %r14, %r15
shrq $0x20, %r15
leaq 0x130(%rsp), %rdi
callq 0x599c
xorl %r13d, %r13d
cmpq $0x4, %r13
je 0x3327
leaq 0x7dea(%rip), %rcx      # 0xb060
movl (%rcx,%r13,8), %eax
addl %r14d, %eax
movl 0x4(%rcx,%r13,8), %ecx
addl %r15d, %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, 0x80(%rsp)
leaq 0x1c8(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x42e6
testq %rax, %rax
jne 0x3339
leaq 0x100(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x42e6
testq %rax, %rax
jne 0x331f
leaq 0x80(%rsp), %rdi
callq 0x9de0
testb %al, %al
je 0x331f
movq 0x80(%rsp), %rsi
movq %r12, %rdi
callq 0x7916
testl %eax, %eax
jne 0x331f
leaq 0x100(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x5400
leaq 0x130(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x5768
incl 0xc(%rsp)
incq %r13
jmp 0x3265
movl 0xc(%rsp), %eax
cmpl $0x5, %eax
movl %ebx, %r14d
jl 0x3213
jmp 0x339a
movl $0x3b9aca07, 0xc(%rsp)  # imm = 0x3B9ACA07
movb $0x1, %bl
movq 0x118(%rsp), %rdi
movq 0x1e0(%rsp), %rcx
leaq 0x108(%rsp), %rsi
leaq 0x1c8(%rsp), %rdx
callq 0x5c8e
leaq 0x130(%rsp), %rdi
callq 0x5e48
leaq 0x100(%rsp), %rdi
callq 0x5e76
movl %ebx, %r14d
movq 0x250(%rsp), %rbx
addq $0x8, %rbp
jmp 0x3171
movl 0xc(%rsp), %eax
leal -0x1(%rax), %ecx
cmpl $0x3, %ecx
ja 0x33b0
movl %ecx, %eax
incl 0x20e4(%r12,%rax,4)
movl 0xc(%rsp), %eax
movb $0x1, %bl
cmpl $0x4, %eax
jg 0x3343
testb $0x1, %r14b
jne 0x3529
leal -0x1(%rax), %ecx
cmpl $0x1, %ecx
ja 0x33e3
leaq 0xd0(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x431c
movl %r14d, %ebx
jmp 0x3343
cmpl $0x4, %eax
je 0x348b
cmpl $0x3, %eax
jne 0x3529
movq 0x118(%rsp), %rsi
leaq 0x80(%rsp), %rdi
leaq 0x108(%rsp), %rdx
leaq 0xa0(%rsp), %rcx
callq 0x433a
movq 0x80(%rsp), %rsi
leaq 0x8(%rsi), %rdi
callq 0x9c53
movq %rax, 0xa0(%rsp)
movq 0x80(%rsp), %rsi
leaq 0x10(%rsi), %rdi
callq 0x9c53
movq %rax, 0x278(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x278(%rsp), %rsi
callq 0x9e30
cmpl $0x1, %eax
pushq $0x4
popq %rax
sbbl $0x0, %eax
movl %eax, 0xc8(%rsp)
leaq 0xd0(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x5b98
jmp 0x351c
movq 0x118(%rsp), %rsi
leaq 0x80(%rsp), %rdi
leaq 0x108(%rsp), %rdx
leaq 0xa0(%rsp), %rbx
movq %rbx, %rcx
callq 0x433a
movq 0x80(%rsp), %rax
movl 0x14(%rax), %ecx
addl 0x1c(%rax), %ecx
addl 0xc(%rax), %ecx
imull $-0x3, 0x4(%rax), %edx
movl 0x10(%rax), %esi
addl %ecx, %edx
movl %edx, %ecx
negl %ecx
cmovsl %edx, %ecx
addl 0x18(%rax), %esi
addl 0x8(%rax), %esi
imull $-0x3, (%rax), %eax
addl %esi, %eax
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
cmpl %ecx, %edx
movl %ecx, %eax
cmovbl %edx, %eax
cmovbl %ecx, %edx
imull $0xa, %edx, %ecx
addl %eax, %ecx
movl %ecx, 0xa0(%rsp)
movq 0x230(%rsp), %rdi
movq %rbx, %rsi
callq 0x3c62
leaq 0xd0(%rsp), %rdi
movq %rax, %rsi
callq 0x431c
leaq 0x80(%rsp), %rdi
callq 0x409a
movl %r14d, %ebx
jmp 0x3343
testb $0x1, %r14b
movq 0x30(%rsp), %rbp
jne 0x3585
movq 0xd0(%rsp), %rdi
movq 0xd8(%rsp), %rsi
callq 0x5ecd
leaq 0x1f8(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x436c
testq %rax, %rax
je 0x3570
pushq $0x18
popq %rbx
jmp 0x35e7
leaq 0x1f8(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x6398
testb $0x1, 0x3c(%rsp)
je 0x35b8
movl 0x64(%rsp), %eax
testl %eax, %eax
movl $0x0, %ebx
cmovgl %eax, %ebx
subl $0x1, %ebx
jb 0x35d2
movq 0x18(%rsp), %rdi
leaq -0x10(%rdi), %rax
movq %rax, 0x18(%rsp)
addq $-0x8, %rdi
callq 0x4cb4
jmp 0x359a
leaq 0x10(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x416e
incl 0x64(%rsp)
xorl %ebx, %ebx
jmp 0x35e7
leaq 0x10(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x416e
pushq $0x17
popq %rbx
leaq 0xd0(%rsp), %rdi
callq 0x3f70
leaq 0x1c8(%rsp), %rdi
callq 0x5e76
leaq 0x1b0(%rsp), %rdi
callq 0x409a
leaq 0xf0(%rsp), %rdi
callq 0x4cb4
testl %ebx, %ebx
je 0x3631
cmpl $0x17, %ebx
movq 0xb8(%rsp), %rbx
jne 0x364c
jmp 0x36b9
movq 0xb8(%rsp), %rbx
movl 0xcc(%rsp), %eax
movl 0x70(%rsp), %ecx
addl %ecx, %eax
decl %eax
movl %eax, 0x70(%rsp)
movq %rbx, %rdi
callq 0x78da
movq %rax, 0x130(%rsp)
movq %rbx, %rdi
callq 0x78da
movq %rax, %r14
movq %rbx, %rdi
callq 0x78e2
movq %rax, %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
andq %rdx, %rcx
addl %r14d, %eax
addq %r14, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, 0x1c8(%rsp)
leaq 0x6c(%rsp), %rdi
movq (%rsp), %rsi
leaq 0x130(%rsp), %rdx
leaq 0x1c8(%rsp), %rcx
callq 0x8825
testb %al, %al
jne 0x2dbc
leaq 0x1f8(%rsp), %rdi
callq 0x65f6
movslq 0x20e8(%rbp), %rax
imulq $0xa, %rax, %rdx
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x4, %rsi
cmpq %rdx, %rsi
jbe 0x3727
movq %rcx, 0x270(%rsp)
movq %rax, 0x268(%rsp)
leaq 0x270(%rsp), %rdi
leaq 0x268(%rsp), %rsi
leaq -0x128c(%rip), %rdx     # 0x2485
callq 0x4386
movslq 0x20e8(%rbp), %rsi
leaq 0x10(%rsp), %rdi
callq 0x43aa
movq 0x240(%rsp), %rdx
addq $0x10, %rdx
movabsq $0x100000000, %rdi      # imm = 0x100000000
movq 0x238(%rsp), %rsi
jmp 0x2be3
movq 0x10(%rsp), %rax
movq 0x18(%rsp), %rcx
movq %rcx, 0x260(%rsp)
movq %rax, 0x258(%rsp)
leaq 0x260(%rsp), %rdi
leaq 0x258(%rsp), %rsi
leaq -0x12f6(%rip), %rdx     # 0x2485
callq 0x4386
movslq 0x20e8(%rbp), %rsi
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
movq %r14, %rax
subq %rbx, %rax
sarq $0x4, %rax
cmpq %rsi, %rax
jbe 0x37c2
leaq 0x10(%rsp), %rdi
callq 0x43aa
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r14
jmp 0x37c2
movq (%rbx), %rdi
callq 0x7692
addq $0x10, %rbx
cmpq %r14, %rbx
jne 0x37b6
cmpq $0x0, 0x2150(%rbp)
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r15
je 0x3815
cmpq %r15, %rbx
je 0x380b
movq 0x2150(%rbp), %r14
movq (%rbx), %rsi
leaq 0x130(%rsp), %r12
movq %r12, %rdi
callq 0x7f7a
movq %r14, %rdi
movq %r12, %rsi
callq 0x4ff0
addq $0x10, %rbx
jmp 0x37db
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r15
movq 0x20(%rsp), %rax
movaps 0x40(%rsp), %xmm0
movaps %xmm0, 0x10(%rsp)
movq 0x50(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movq %rbx, 0x40(%rsp)
movq %r15, 0x48(%rsp)
movq %rax, 0x50(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x43da
leaq 0x280(%rsp), %rdi
callq 0x73d0
movq 0xe795(%rip), %rdi      # 0x11ff0
leaq 0x7826(%rip), %rsi      # 0xb088
callq 0x2140
movq %rax, %rdi
movq 0xa8(%rsp), %rsi
callq 0x2260
movq %rax, %rdi
leaq 0x780d(%rip), %rsi      # 0xb08e
callq 0x2140
movq 0x48(%rsp), %rsi
subq 0x40(%rsp), %rsi
sarq $0x4, %rsi
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x2090
cmpq $0x0, 0x2150(%rbp)
je 0x38dc
movq 0xe73b(%rip), %rdi      # 0x11ff0
leaq 0x77d6(%rip), %rsi      # 0xb092
callq 0x2140
movq 0x2150(%rbp), %rcx
movq 0x18(%rcx), %rsi
movq %rax, %rdi
callq 0x20f0
movq %rax, %rdi
callq 0x2090
movl 0x20e0(%rbp), %eax
leaq 0xe86f(%rip), %rcx      # 0x12158
movl (%rcx), %ecx
cmpl %ecx, %eax
jl 0x390a
jg 0x398b
leaq 0xe860(%rip), %rax      # 0x1215c
movl (%rax), %eax
cmpl %eax, 0x20e4(%rbp)
jge 0x398b
leaq 0x130(%rsp), %rbx
movq %rbx, %rdi
movq 0xb0(%rsp), %rsi
callq 0x43e2
leaq 0xe847(%rip), %rdi      # 0x12170
movq %rbx, %rsi
callq 0x747c
movq %rbx, %rdi
callq 0x742c
movl 0x20e0(%rbp), %esi
leaq 0xe812(%rip), %rax      # 0x12158
movl %esi, (%rax)
movl 0x20e4(%rbp), %eax
leaq 0xe807(%rip), %rcx      # 0x1215c
movl %eax, (%rcx)
movq 0xe692(%rip), %rdi      # 0x11ff0
callq 0x2260
movq %rax, %rdi
leaq 0x7a0c(%rip), %rsi      # 0xb379
callq 0x2140
leaq 0xe7e3(%rip), %rcx      # 0x1215c
movl (%rcx), %esi
movq %rax, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x2090
movq 0xa8(%rsp), %rax
incl %eax
movq %rax, 0xa8(%rsp)
xorl %r15d, %r15d
xorl %r12d, %r12d
movabsq $0x100000000, %rdi      # imm = 0x100000000
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %rsi, %rax
subq %rdx, %rax
shrq $0x4, %rax
cmpl $0x3, %eax
pushq $0x3
popq %rcx
cmovgel %ecx, %eax
cltq
cmpq %rax, %r12
jge 0x2bd2
movq (%rdx,%r15), %rsi
movq 0xe610(%rip), %rdi      # 0x11ff0
callq 0x8927
movq 0xe604(%rip), %rdi      # 0x11ff0
leaq 0x76a6(%rip), %rsi      # 0xb099
callq 0x2140
movq 0x40(%rsp), %rcx
movq (%rcx,%r15), %rcx
movl 0x20b0(%rcx), %esi
movq %rax, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x2090
movq 0xe5d2(%rip), %rdi      # 0x11ff0
leaq 0x767c(%rip), %rsi      # 0xb0a1
callq 0x2140
movq %rax, %r14
movq 0x40(%rsp), %rax
movq (%rax,%r15), %rsi
movq %rbp, %rdi
callq 0x259a
movq %r14, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2090
movq 0xe59b(%rip), %rdi      # 0x11ff0
leaq 0x7650(%rip), %rsi      # 0xb0ac
callq 0x2140
movq 0x40(%rsp), %rcx
movq (%rcx,%r15), %rcx
movl 0x20b8(%rcx), %esi
movq %rax, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x2090
incq %r12
addq $0x10, %r15
jmp 0x39a3
movq 0x228(%rsp), %rbx
movq %rbx, %rdi
movq 0xb0(%rsp), %rsi
callq 0x43e2
leaq 0x280(%rsp), %rdi
callq 0x74ec
leaq 0x10(%rsp), %rdi
callq 0x4436
leaq 0x40(%rsp), %rdi
callq 0x4436
movq %rbx, %rax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3b4d
movq %rax, %rbx
jmp 0x3c17
jmp 0x3b4d
jmp 0x3b98
jmp 0x3af4
jmp 0x3b98
jmp 0x3af4
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x409a
jmp 0x3b9b
jmp 0x3b4d
jmp 0x3b4d
jmp 0x3b62
movq %rax, %rbx
jmp 0x3b72
jmp 0x3b4d
jmp 0x3b4d
jmp 0x3b84
jmp 0x3b4d
jmp 0x3bd1
jmp 0x3b62
jmp 0x3b4d
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x4cb4
jmp 0x3c00
jmp 0x3b8d
jmp 0x3bd1
jmp 0x3b84
jmp 0x3be3
jmp 0x3bd1
movq %rax, %rbx
jmp 0x3c00
jmp 0x3b84
jmp 0x3b84
jmp 0x3b84
jmp 0x3b5d
movq %rax, %rbx
jmp 0x3ba8
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
callq 0x4cb4
leaq 0x130(%rsp), %rdi
callq 0x4d30
jmp 0x3c17
movq %rax, %rbx
jmp 0x3bf3
jmp 0x3be3
jmp 0x3b98
movq %rax, %rbx
jmp 0x3bb5
jmp 0x3bd1
jmp 0x3be3
jmp 0x3be3
movq %rax, %rbx
leaq 0x130(%rsp), %rdi
callq 0x5e48
leaq 0x100(%rsp), %rdi
callq 0x5e76
leaq 0xd0(%rsp), %rdi
callq 0x3f70
leaq 0x1c8(%rsp), %rdi
callq 0x5e76
jmp 0x3bd4
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
callq 0x409a
jmp 0x3be6
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x4cb4
leaq 0x1f8(%rsp), %rdi
callq 0x65f6
leaq 0x280(%rsp), %rdi
callq 0x74ec
leaq 0x10(%rsp), %rdi
callq 0x4436
leaq 0x40(%rsp), %rdi
callq 0x4436
movq %rbx, %rdi
callq 0x2270
nop