// File: /workspace/github_cpp_makefile_star2_O3/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 0x31f1
incq %rdx
cmpq $0x10, %rdx
jne 0x31dd
movl $0x10, %edx
movl %edx, 0x68(%rsp,%rax,4)
incq %rax
addq $0x10, %rcx
cmpq $0xa, %rax
jne 0x31db
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 0x3280
leaq (%rbx,%r15,4), %rsi
movq %r13, %rdi
callq 0x2120
addq $0x4, %r15
addq $0x11, %r13
cmpq $0x28, %r15
jne 0x326a
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 0x4970
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x48f0
leaq 0xbe(%rsp), %rdi
leaq 0x90(%rsp), %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x4d2f
movq %rax, %r13
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x333b
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq %r13, %rax
shrq $0x20, %rax
cmpl %r13d, %r12d
jl 0x334f
jg 0x3357
cmpl %eax, 0x10(%rsp)
jge 0x3357
movl %r13d, %r12d
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x336e
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
incl %ebp
cmpl $0xa, %ebp
jne 0x324d
incq %r15
cmpq $0xa, %r15
jne 0x3214
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 0x33c6
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
jmp 0x33c6
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x33dd
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2230