// File: /workspace/github_cpp_makefile_star2_O3/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 0xdf7b(%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 0x3c4a
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 0x5eff
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 0x69ae
movq 0x40(%rbx), %rax
cmpq %rax, 0x48(%rbx)
je 0x3bea
leaq 0x8(%rbx), %rcx
movq %rcx, 0x88(%rsp)
movsd 0x86d2(%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 0x8798
movl (%rbx), %esi
leaq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x9e91
movl $0x9, %r8d
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
leaq 0x8778(%rip), %rcx      # 0xc109
callq 0x3210
leaq 0x20(%rsp), %rsi
movq %rsi, 0x10(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x39be
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x39c6
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 0x8743(%rip), %rsi      # 0xc12d
callq 0x3380
leaq 0x40(%rsp), %rsi
movq %rsi, 0x30(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3a17
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x3a1f
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 0x3a7d
movq %rdx, 0xe0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xf0(%rsp)
jmp 0x3a86
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 0x8668(%rip), %rsi      # 0xc113
callq 0x3380
movq %r13, 0x50(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x3ad3
movq %rdx, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0x3add
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 0x3b12
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3b2e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3b4a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x3b6f
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 0x9a14
movq %rbp, %rdi
leaq 0x150(%rsp), %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x9b04
movq %rbp, %rdi
callq 0x9ac4
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x3bcf
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 0x395a
leaq 0x1c8(%rsp), %rdi
callq 0x4f50
leaq 0x198(%rsp), %rdi
callq 0x4fec
leaq 0x168(%rsp), %rdi
callq 0x4fec
leaq 0x150(%rsp), %rdi
callq 0x4fa4
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3c38
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 0x8503(%rip), %rdi      # 0xc154
leaq 0x850c(%rip), %rsi      # 0xc164
leaq 0x8518(%rip), %rcx      # 0xc177
movl $0x1a, %edx
callq 0x3100
jmp 0x3c75
movq %rax, %rbx
jmp 0x3d3c
jmp 0x3c75
movq %rax, %rbx
jmp 0x3d2f
movq %rax, %rbx
jmp 0x3ce4
movq %rax, %rbx
jmp 0x3cc8
movq %rax, %rbx
jmp 0x3cac
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
cmpq %r15, %rdi
je 0x3cac
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x3cc8
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x3ce4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x31e0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x3d2f
movq 0xa0(%rsp), %rsi
jmp 0x3d27
movq %rax, %rbx
jmp 0x3d18
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x9ac4
movq 0x50(%rsp), %rdi
cmpq %r13, %rdi
je 0x3d2f
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x31e0
leaq 0x150(%rsp), %rdi
callq 0x49aa
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3d56
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0x31e0
movq %rbx, %rdi
callq 0x3360