// File: /workspace/github_cpp_makefile_star2_O1/xukmin[P]rase/calculate-routing-metrics.cc
// Function: BuildExampleRoutingNetworks(SimulationOptions const&)
void BuildExampleRoutingNetworks(const SimulationOptions& options) {
  double scale = 600.0 / (options.region.max_y - options.region.min_y);

  RandomizedSensorPlacer placer(options.num_sensors, options.region);
  std::vector<Position> positions;
  GeneratePositionsThatCanBeConnected(
      options.lower_communication_range, &placer, &positions);

  SensorNetwork network;
  network.DeploySensors(positions, options.lower_communication_range);

  for (int i = 0; i < options.builders.size(); i++) {
    options.builders[i]->BuildRouting(&network);

    const std::string filename =
        "routings-" + IntToString(options.num_sensors) + "-" +
        options.builders[i]->name() + ".svg";
    SvgPrinter printer(filename, options.builders[i]->title(),
                       options.region, scale);
    printer.PrintNetwork(network);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1e8, %rsp            # imm = 0x1E8
movsd 0x20(%rdi), %xmm0
subsd 0x10(%rdi), %xmm0
movsd %xmm0, 0x8(%rsp)
movl (%rdi), %eax
leaq 0xdf2b(%rip), %rcx      # 0x117d0
addq $0x10, %rcx
movq %rcx, 0xb0(%rsp)
movl %eax, 0xb8(%rsp)
movups 0x8(%rdi), %xmm0
movups 0x18(%rdi), %xmm1
movups %xmm0, 0xc0(%rsp)
movups %xmm1, 0xd0(%rsp)
testl %eax, %eax
jle 0x3c9a
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movsd 0x28(%rdi), %xmm0
leaq 0xb0(%rsp), %rdi
callq 0x5f4f
leaq 0x170(%rsp), %rax
xorpd %xmm0, %xmm0
movapd %xmm0, -0x20(%rax)
xorl %ecx, %ecx
movq %rcx, -0x10(%rax)
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x1a0(%rsp), %rax
movl %ecx, (%rax)
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movapd %xmm0, 0x20(%rax)
movapd %xmm0, 0x30(%rax)
movq %rcx, 0x40(%rax)
movsd 0x28(%rbx), %xmm0
leaq 0x150(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x69ee
movq 0x40(%rbx), %rax
cmpq %rax, 0x48(%rbx)
je 0x3c3a
leaq 0x8(%rbx), %rcx
movq %rcx, 0x88(%rsp)
movsd 0x8682(%rip), %xmm0     # 0xc008
divsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0xf0(%rsp), %r15
leaq 0x60(%rsp), %r13
xorl %r12d, %r12d
leaq 0xe0(%rsp), %rbp
movq (%rax,%r12,8), %rdi
leaq 0x150(%rsp), %rsi
callq 0x8732
movl (%rbx), %esi
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x9e49
movl $0x9, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x8708(%rip), %rcx      # 0xc0e9
callq 0x3210
leaq 0x20(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3a0e
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x3a16
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x18(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x10(%rsp), %rdi
leaq 0x86d3(%rip), %rsi      # 0xc10d
callq 0x3380
leaq 0x40(%rsp), %rsi
movq %rsi, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3a67
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x3a6f
movupd (%rcx), %xmm0
movupd %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x38(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
leaq 0x30(%rsp), %rdi
callq 0x3080
movq %r15, 0xe0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3acd
movq %rdx, 0xe0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xf0(%rsp)
jmp 0x3ad6
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0xe8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbp, %rdi
leaq 0x85f8(%rip), %rsi      # 0xc0f3
callq 0x3380
movq %r13, 0x50(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3b23
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0x3b2d
movupd (%rcx), %xmm0
movupd %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xe0(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b62
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3b7e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3b9a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x3bbf
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %rdx
addq $0x28, %rdx
movq %rbp, %rdi
leaq 0x50(%rsp), %rsi
movq 0x88(%rsp), %rcx
movsd 0x8(%rsp), %xmm0
callq 0x99d0
movq %rbp, %rdi
leaq 0x150(%rsp), %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x9ac0
movq %rbp, %rdi
callq 0x9a80
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x3c1f
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x31e0
incq %r12
movq 0x40(%rbx), %rax
movq 0x48(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
ja 0x39aa
leaq 0x1c8(%rsp), %rdi
callq 0x4fa6
leaq 0x198(%rsp), %rdi
callq 0x5036
leaq 0x168(%rsp), %rdi
callq 0x5036
leaq 0x150(%rsp), %rdi
callq 0x4ff4
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3c88
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x31e0
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8493(%rip), %rdi      # 0xc134
leaq 0x849c(%rip), %rsi      # 0xc144
leaq 0x84a8(%rip), %rcx      # 0xc157
movl $0x1a, %edx
callq 0x3100
jmp 0x3cc5
movq %rax, %rbx
jmp 0x3d8c
jmp 0x3cc5
movq %rax, %rbx
jmp 0x3d7f
movq %rax, %rbx
jmp 0x3d34
movq %rax, %rbx
jmp 0x3d18
movq %rax, %rbx
jmp 0x3cfc
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %r15, %rdi
je 0x3cfc
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3d18
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3d34
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x3d7f
movq 0xa0(%rsp), %rsi
jmp 0x3d77
movq %rax, %rbx
jmp 0x3d68
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x9a80
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x3d7f
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x31e0
leaq 0x150(%rsp), %rdi
callq 0x49f0
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3da6
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x31e0
movq %rbx, %rdi
callq 0x3360