// File: /workspace/github_cpp_makefile_star2_O1/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, %rbx
xorl %eax, %eax
movq %rdi, %rcx
xorl %edx, %edx
cmpb $0x0, (%rcx,%rdx)
je 0x3182
incq %rdx
cmpq $0x10, %rdx
jne 0x316e
movl $0x10, %edx
movl %edx, 0x68(%rsp,%rax,4)
incq %rax
addq $0x10, %rcx
cmpq $0xa, %rax
jne 0x316c
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
xorl %r15d, %r15d
movq $0x0, 0x10(%rsp)
movq %r15, %rax
shlq $0x4, %rax
addq %r15, %rax
addq %rsp, %rax
addq $0xbe, %rax
movq %rax, 0x28(%rsp)
movl 0x68(%rsp,%r15,4), %eax
movslq %eax, %rcx
movq %rcx, 0x20(%rsp)
movq %r15, %rcx
shlq $0x20, %rcx
orq %rax, %rcx
movq %rcx, 0x18(%rsp)
movl $0x1, %ebp
movq %r15, %r14
movl $0xaa, %edx
leaq 0xbe(%rsp), %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0x20d0
xorl %r15d, %r15d
movslq 0x68(%rsp,%r15), %rdx
testq %rdx, %rdx
jle 0x3211
leaq (%rbx,%r15,4), %rsi
movq %r13, %rdi
callq 0x2120
addq $0x4, %r15
addq $0x11, %r13
cmpq $0x28, %r15
jne 0x31fb
movq 0x28(%rsp), %rax
movq 0x20(%rsp), %rcx
movb %bpl, (%rax,%rcx)
movq 0x88(%rsp), %rax
movq %rax, 0xb0(%rsp)
movups 0x68(%rsp), %xmm0
movups 0x78(%rsp), %xmm1
movaps %xmm1, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movq %r14, %r15
incl 0x90(%rsp,%r14,4)
movq 0x18(%rsp), %rax
movq %rax, 0x30(%rsp)
movl $0x1, %edx
leaq 0x50(%rsp), %r14
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
leaq 0xf(%rsp), %rcx
callq 0x48ba
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x483a
leaq 0xbe(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x4c24
movq %rax, %r13
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x32cc
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq %r13, %rax
shrq $0x20, %rax
cmpl %r13d, %r12d
jl 0x32e0
jg 0x32e8
cmpl %eax, 0x10(%rsp)
jge 0x32e8
movl %r13d, %r12d
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x32ff
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
incl %ebp
cmpl $0xa, %ebp
jne 0x31de
incq %r15
cmpq $0xa, %r15
jne 0x31a5
movq 0x10(%rsp), %rcx
shlq $0x20, %rcx
movl %r12d, %eax
orq %rcx, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x3357
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
jmp 0x3357
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x336e
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2230