// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %rcx, %rbp
movl %edx, (%rsp)
movl %esi, %r12d
movq %rdi, %rbx
movl $0x448, %edi            # imm = 0x448
callq 0x2160
movq %rax, %r14
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r14)
leaq 0x1190c(%rip), %rax     # 0x14d30
movq %rax, (%r14)
leaq 0x10(%r14), %r15
leaq 0x18(%r14), %rdi
xorl %r13d, %r13d
movl $0x430, %edx            # imm = 0x430
xorl %esi, %esi
callq 0x20d0
movq %r14, 0x8(%rbx)
movq %r15, (%rbx)
movl %r12d, 0x10(%r14)
movl $0x0, 0x14(%r14)
movl (%rsp), %eax
movl %eax, 0x18(%r14)
movdqa 0xbbb0(%rip), %xmm0     # 0xf010
movdqa 0xbbb8(%rip), %xmm1     # 0xf020
movq %rbp, %rax
xorl %ecx, %ecx
movd %ecx, %xmm2
xorl %ecx, %ecx
movd (%rax,%rcx), %xmm3
pcmpeqb %xmm0, %xmm3
punpcklbw %xmm3, %xmm3    # xmm3 = xmm3[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm3, %xmm3    # xmm3 = xmm3[0,0,1,1,2,2,3,3]
pand %xmm1, %xmm3
paddd %xmm3, %xmm2
addq $0x4, %rcx
cmpq $0x10, %rcx
jne 0x3473
pshufd $0xee, %xmm2, %xmm3     # xmm3 = xmm2[2,3,2,3]
paddd %xmm2, %xmm3
pshufd $0x55, %xmm3, %xmm2     # xmm2 = xmm3[1,1,1,1]
paddd %xmm3, %xmm2
movd %xmm2, %ecx
incq %r13
addq $0x10, %rax
cmpq $0xa, %r13
jne 0x346d
movl %ecx, 0x1c(%r14)
xorl %eax, %eax
pxor %xmm1, %xmm1
pcmpeqd %xmm2, %xmm2
movq %rbp, %rcx
xorl %edx, %edx
movd %edx, %xmm3
xorl %edx, %edx
movd (%rcx,%rdx), %xmm4
movdqa %xmm4, %xmm5
pcmpeqb %xmm1, %xmm5
pcmpeqb %xmm0, %xmm4
por %xmm5, %xmm4
punpcklbw %xmm4, %xmm4    # xmm4 = xmm4[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm4, %xmm4    # xmm4 = xmm4[0,0,1,1,2,2,3,3]
paddd %xmm4, %xmm3
psubd %xmm2, %xmm3
addq $0x4, %rdx
cmpq $0x10, %rdx
jne 0x34d2
pshufd $0xee, %xmm3, %xmm4     # xmm4 = xmm3[2,3,2,3]
paddd %xmm3, %xmm4
pshufd $0x55, %xmm4, %xmm3     # xmm3 = xmm4[1,1,1,1]
paddd %xmm4, %xmm3
movd %xmm3, %edx
incq %rax
addq $0x10, %rcx
cmpq $0xa, %rax
jne 0x34cc
movl %edx, 0x20(%r14)
leaq 0x24(%r14), %rdi
movl $0xa0, %edx
movq %rbp, %rsi
callq 0x2120
movq $-0x21524111, 0xc4(%r14) # imm = 0xDEADBEEF
movq $0x0, 0xcc(%r14)
leaq 0x100(%r14), %rdi
callq 0x4ee6
movl $0x0, 0x110(%r14)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x114(%r14)
movdqu %xmm0, 0x124(%r14)
movdqu %xmm0, 0x134(%r14)
leaq 0x8(%rsp), %r15
xorl %r12d, %r12d
movl $0x300, %edx            # imm = 0x300
movq %r15, %rdi
xorl %esi, %esi
callq 0x20d0
leaq 0x150(%r14), %r13
xorl %ebp, %ebp
movdqu (%r15,%rbp), %xmm0
pxor %xmm1, %xmm1
movdqu %xmm1, (%r15,%rbp)
movq (%r13,%rbp), %rdi
movdqu %xmm0, -0x8(%r13,%rbp)
testq %rdi, %rdi
je 0x35cb
callq 0x730e
addq $0x10, %rbp
cmpq $0x40, %rbp
jne 0x35a5
incq %r12
addq $0x40, %r15
addq $0x40, %r13
cmpq $0xc, %r12
jne 0x35a3
leaq 0x308(%rsp), %r15
leaq 0x300(%rsp), %r12
leaq 0x8(%rsp), %r13
xorl %ebp, %ebp
movq (%r12,%rbp), %rdi
testq %rdi, %rdi
je 0x360b
callq 0x730e
addq $-0x10, %rbp
cmpq $-0x40, %rbp
jne 0x35fd
addq $-0x40, %r15
addq $-0x40, %r12
cmpq %r13, %r15
jne 0x35fb
movq %r14, %rdi
addq $0xe8, %rdi
pxor %xmm0, %xmm0
movdqu %xmm0, 0xd8(%r14)
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x4(%rsp), %rdx
movl $0x0, (%rdx)
callq 0x4cf0
movq %rbx, %rax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r14, %rdi
callq 0x730e
movq %rbx, %rdi
callq 0x2230