// File: /workspace/github_cpp_makefile_star2_O1/tanakh[P]icfpc2015/main.cpp
// Function: to_problem(picojson::value&)
problem to_problem(value &v) {
  problem ret;

  object obj = v.get<object>();
  ret.id = obj["id"].get<int64_t>();
  for (auto &i: obj["units"].get<picojson::array>())
    ret.units.push_back(to_unit(i));
  ret.width = obj["width"].get<int64_t>();
  ret.height = obj["height"].get<int64_t>();
  for (auto &i: obj["filled"].get<picojson::array>())
    ret.filled.push_back(to_cell(i));
  ret.source_length = obj["sourceLength"].get<int64_t>();
  for (auto &i: obj["sourceSeeds"].get<picojson::array>())
    ret.source_seeds.push_back(i.get<int64_t>());

  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x18(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x28(%rdi)
movq %rax, 0x38(%rdi)
movups %xmm0, 0x48(%rdi)
movq %rax, 0x58(%rdi)
cmpl $0x5, (%rsi)
jne 0x4886
movq 0x8(%rsi), %rsi
leaq 0x28(%rsp), %rdi
callq 0xc96a
leaq 0x10(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x112b9(%rip), %rsi     # 0x1585a
leaq 0x112b4(%rip), %rdx     # 0x1585c
movq %rsp, %rdi
callq 0xf8e6
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0xb898
cmpl $0x6, (%rax)
jne 0x48b8
movl 0x8(%rax), %eax
movl %eax, (%rbx)
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x45d9
callq 0x32f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x10dc1(%rip), %rsi     # 0x153a7
leaq 0x10dbf(%rip), %rdx     # 0x153ac
callq 0xf8e6
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0xb898
cmpl $0x4, (%rax)
jne 0x48ea
movq 0x8(%rax), %r15
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x461a
callq 0x32f0
movq (%r15), %r14
movq 0x8(%r15), %rbp
cmpq %rbp, %r14
je 0x465a
leaq 0x8(%rbx), %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x41fb
movq %r15, %rdi
movq %r12, %rsi
callq 0x1003c
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4651
callq 0x32f0
addq $0x10, %r14
cmpq %rbp, %r14
jne 0x462d
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x10d46(%rip), %rsi     # 0x153ad
leaq 0x10d44(%rip), %rdx     # 0x153b2
callq 0xf8e6
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0xb898
cmpl $0x6, (%rax)
jne 0x491c
movl 0x8(%rax), %eax
movl %eax, 0x20(%rbx)
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x469d
callq 0x32f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x10d09(%rip), %rsi     # 0x153b3
leaq 0x10d08(%rip), %rdx     # 0x153b9
callq 0xf8e6
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0xb898
cmpl $0x6, (%rax)
jne 0x494e
movl 0x8(%rax), %eax
movl %eax, 0x24(%rbx)
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x46e0
callq 0x32f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x10ccd(%rip), %rsi     # 0x153ba
leaq 0x10ccc(%rip), %rdx     # 0x153c0
callq 0xf8e6
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0xb898
cmpl $0x4, (%rax)
jne 0x4980
movq 0x8(%rax), %r15
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x4721
callq 0x32f0
movq (%r15), %r14
movq 0x8(%r15), %rbp
cmpq %rbp, %r14
je 0x4768
leaq 0x28(%rbx), %r15
movq %rsp, %r12
movq %r14, %rdi
callq 0x403a
movq %rax, (%rsp)
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x4754
movq %rax, (%rsi)
addq $0x8, 0x30(%rbx)
jmp 0x475f
movq %r15, %rdi
movq %r12, %rdx
callq 0xfaec
addq $0x10, %r14
cmpq %rbp, %r14
jne 0x4734
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x10c4c(%rip), %rsi     # 0x153c1
leaq 0x10c51(%rip), %rdx     # 0x153cd
callq 0xf8e6
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0xb898
cmpl $0x6, (%rax)
jne 0x49b2
movl 0x8(%rax), %eax
movl %eax, 0x40(%rbx)
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x47ab
callq 0x32f0
movq %rsp, %rdi
movq %r13, (%rdi)
leaq 0x10c16(%rip), %rsi     # 0x153ce
leaq 0x10c1a(%rip), %rdx     # 0x153d9
callq 0xf8e6
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0xb898
cmpl $0x4, (%rax)
jne 0x49e4
movq 0x8(%rax), %r14
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x47ec
callq 0x32f0
movq (%r14), %r12
movq 0x8(%r14), %r13
cmpq %r13, %r12
je 0x4838
leaq 0x48(%rbx), %r14
movq %rsp, %r15
cmpl $0x6, (%r12)
jne 0x4854
movl 0x8(%r12), %eax
movl %eax, (%rsp)
movq 0x50(%rbx), %rsi
cmpq 0x58(%rbx), %rsi
je 0x4824
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x50(%rbx)
jmp 0x482f
movq %r14, %rdi
movq %r15, %rdx
callq 0x1023a
addq $0x10, %r12
cmpq %r13, %r12
jne 0x47ff
leaq 0x28(%rsp), %rdi
callq 0xceb0
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x3150
movq %rax, %r15
leaq 0x10ed1(%rip), %rsi     # 0x15739
movq %rax, %rdi
callq 0x3100
movq 0x18779(%rip), %rsi     # 0x1cff0
movq 0x1873a(%rip), %rdx     # 0x1cfb8
movq %r15, %rdi
callq 0x3490
movl $0x10, %edi
callq 0x3150
movq %rax, %r15
leaq 0x10e5b(%rip), %rsi     # 0x156f5
movq %rax, %rdi
callq 0x3100
movq 0x18747(%rip), %rsi     # 0x1cff0
movq 0x18708(%rip), %rdx     # 0x1cfb8
movq %r15, %rdi
callq 0x3490
movl $0x10, %edi
callq 0x3150
movq %rax, %r15
leaq 0x10e6d(%rip), %rsi     # 0x15739
movq %rax, %rdi
callq 0x3100
movq 0x18715(%rip), %rsi     # 0x1cff0
movq 0x186d6(%rip), %rdx     # 0x1cfb8
movq %r15, %rdi
callq 0x3490
movl $0x10, %edi
callq 0x3150
movq %rax, %r15
leaq 0x10e80(%rip), %rsi     # 0x1577e
movq %rax, %rdi
callq 0x3100
movq 0x186e3(%rip), %rsi     # 0x1cff0
movq 0x186a4(%rip), %rdx     # 0x1cfb8
movq %r15, %rdi
callq 0x3490
movl $0x10, %edi
callq 0x3150
movq %rax, %r15
leaq 0x10e09(%rip), %rsi     # 0x15739
movq %rax, %rdi
callq 0x3100
movq 0x186b1(%rip), %rsi     # 0x1cff0
movq 0x18672(%rip), %rdx     # 0x1cfb8
movq %r15, %rdi
callq 0x3490
movl $0x10, %edi
callq 0x3150
movq %rax, %r15
leaq 0x10dd7(%rip), %rsi     # 0x15739
movq %rax, %rdi
callq 0x3100
movq 0x1867f(%rip), %rsi     # 0x1cff0
movq 0x18640(%rip), %rdx     # 0x1cfb8
movq %r15, %rdi
callq 0x3490
movl $0x10, %edi
callq 0x3150
movq %rax, %r15
leaq 0x10dea(%rip), %rsi     # 0x1577e
movq %rax, %rdi
callq 0x3100
movq 0x1864d(%rip), %rsi     # 0x1cff0
movq 0x1860e(%rip), %rdx     # 0x1cfb8
movq %r15, %rdi
callq 0x3490
movl $0x10, %edi
callq 0x3150
movq %rax, %r15
leaq 0x10d73(%rip), %rsi     # 0x15739
movq %rax, %rdi
callq 0x3100
movq 0x1861b(%rip), %rsi     # 0x1cff0
movq 0x185dc(%rip), %rdx     # 0x1cfb8
movq %r15, %rdi
callq 0x3490
movl $0x10, %edi
callq 0x3150
movq %rax, %r15
leaq 0x10d86(%rip), %rsi     # 0x1577e
movq %rax, %rdi
callq 0x3100
movq 0x185e9(%rip), %rsi     # 0x1cff0
movq 0x185aa(%rip), %rdx     # 0x1cfb8
movq %r15, %rdi
callq 0x3490
jmp 0x4a22
jmp 0x4a22
jmp 0x4a22
jmp 0x4a22
jmp 0x4a22
jmp 0x4a22
movq %rax, %r14
movq %r15, %rdi
callq 0x3250
jmp 0x4a59
movq %rax, %r14
movq %r15, %rdi
callq 0x3250
jmp 0x4a9c
jmp 0x4a8f
jmp 0x4a8f
jmp 0x4a8f
jmp 0x4a8f
jmp 0x4a8f
jmp 0x4a8f
jmp 0x4a8f
jmp 0x4a56
jmp 0x4a56
jmp 0x4a56
jmp 0x4a56
jmp 0x4a56
jmp 0x4a56
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r13, %rdi
jne 0x4a88
jmp 0x4a92
movq %rax, %r14
jmp 0x4a9c
jmp 0x4a8f
jmp 0x4a8f
movq %rax, %r14
movq %r15, %rdi
callq 0x3250
jmp 0x4a92
jmp 0x4a8f
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x4a92
callq 0x32f0
jmp 0x4a92
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0xceb0
movq %rbx, %rdi
callq 0xb914
movq %r14, %rdi
callq 0x34b0