// File: 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
movq %rsp, %rbp
subq $0x400, %rsp            # imm = 0x400
movq %rdi, -0x388(%rbp)
movq %rdi, %rax
movq %rax, -0x398(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x7660
movq -0x388(%rbp), %rdi
movl -0xc(%rbp), %eax
movl %eax, -0x38c(%rbp)
callq 0x76d0
movl -0x38c(%rbp), %ecx
movq -0x388(%rbp), %rdi
movl %ecx, (%rax)
callq 0x76d0
movq -0x388(%rbp), %rdi
movl $0x0, 0x4(%rax)
movl -0x10(%rbp), %eax
movl %eax, -0x37c(%rbp)
callq 0x76d0
movl -0x37c(%rbp), %ecx
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0x27a0
movl %eax, -0x378(%rbp)
jmp 0x4022
movq -0x388(%rbp), %rdi
callq 0x76d0
movl -0x378(%rbp), %ecx
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rdi
callq 0x76f0
movl %eax, -0x39c(%rbp)
jmp 0x4048
movq -0x388(%rbp), %rdi
callq 0x76d0
movl -0x39c(%rbp), %ecx
movq -0x388(%rbp), %rdi
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x3b8(%rbp)
callq 0x76d0
movq -0x3b8(%rbp), %rsi
movq %rax, %rdi
addq $0x14, %rdi
movl $0xa0, %edx
callq 0x2170
movq -0x388(%rbp), %rdi
callq 0x76d0
movq -0x388(%rbp), %rdi
movq 0x220c2(%rip), %rcx     # 0x26168
movq %rcx, 0xb4(%rax)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x30(%rbp)
callq 0x76d0
movq -0x388(%rbp), %rdi
movq -0x34(%rbp), %rcx
movq %rcx, 0xbc(%rax)
callq 0x76d0
movq %rax, %rdi
addq $0xf0, %rdi
callq 0x77a0
movq -0x388(%rbp), %rdi
callq 0x76d0
movl $0x0, 0x100(%rax)
leaq -0x64(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x2100
leaq -0x64(%rbp), %rax
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, -0x3b0(%rbp)
movq %rax, -0x3a8(%rbp)
movq -0x3a8(%rbp), %rax
movq -0x3b0(%rbp), %rcx
addq $0x4, %rax
cmpq %rcx, %rax
movq %rax, -0x3a8(%rbp)
jne 0x4125
movq -0x388(%rbp), %rdi
callq 0x76d0
movq %rax, %rdi
addq $0x104, %rdi            # imm = 0x104
leaq -0x64(%rbp), %rsi
movl $0x30, %edx
callq 0x2170
leaq -0x368(%rbp), %rdi
movq %rdi, -0x3d0(%rbp)
xorl %esi, %esi
movl $0x300, %edx            # imm = 0x300
callq 0x2100
movq -0x3d0(%rbp), %rax
movq %rax, %rcx
addq $0x300, %rcx            # imm = 0x300
movq %rcx, -0x3c8(%rbp)
movq %rax, -0x3c0(%rbp)
movq -0x3c0(%rbp), %rax
movq %rax, -0x3e8(%rbp)
movq %rax, %rcx
addq $0x40, %rcx
movq %rcx, -0x3e0(%rbp)
movq %rax, -0x3d8(%rbp)
movq -0x3d8(%rbp), %rdi
movq %rdi, -0x3f0(%rbp)
callq 0x77e0
movq -0x3f0(%rbp), %rax
movq -0x3e0(%rbp), %rcx
addq $0x10, %rax
cmpq %rcx, %rax
movq %rax, -0x3d8(%rbp)
jne 0x41c3
movq -0x3c8(%rbp), %rcx
movq -0x3e8(%rbp), %rax
addq $0x40, %rax
cmpq %rcx, %rax
movq %rax, -0x3c0(%rbp)
jne 0x41a0
movq -0x388(%rbp), %rdi
callq 0x76d0
movq %rax, %rdi
addq $0x138, %rdi            # imm = 0x138
leaq -0x368(%rbp), %rsi
movq %rsi, -0x3f8(%rbp)
callq 0x7800
movq -0x3f8(%rbp), %rdi
callq 0x7870
movq -0x388(%rbp), %rdi
callq 0x76d0
movq -0x388(%rbp), %rdi
movq $0x0, 0xc8(%rax)
callq 0x76d0
movq -0x388(%rbp), %rdi
movq $0x0, 0xd0(%rax)
callq 0x76d0
movq %rax, %rdi
addq $0xd8, %rdi
movl $0x0, -0x370(%rbp)
movl $0x0, -0x36c(%rbp)
movl $0x0, -0x374(%rbp)
leaq -0x370(%rbp), %rsi
leaq -0x374(%rbp), %rdx
callq 0x7340
jmp 0x42be
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x42f0
jmp 0x42e4
movq -0x388(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x78c0
jmp 0x4300
movq -0x388(%rbp), %rdi
callq 0x78c0
movq -0x398(%rbp), %rax
addq $0x400, %rsp            # imm = 0x400
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x22f0
nopl (%rax)