// File: /workspace/github_cpp_makefile_star2_O2/xukmin[P]rase/calculate-routing-metrics.cc
// Function: SaveMetrics(SimulationOptions const&, RoutingMetrics const&)
void SaveMetrics(const SimulationOptions& options,
                 const RoutingMetrics& metrics) {
  for (int c = 0; c < options.calculators.size(); c++) {
    const std::string filename =
        "metrics-" + IntToString(options.num_sensors) + "-" +
        options.calculators[c]->name() + ".dat";

    printf("Writing %s metrics to %s ...\n",
           options.calculators[c]->name().c_str(), filename.c_str());

    std::ofstream fs(filename.c_str());

    for (double range = options.lower_communication_range;
         range < options.upper_communication_range;
         range += options.communication_range_step) {
      fs << range;
      for (int b = 0; b < options.builders.size(); b++) {
        fs << " " << metrics.GetData(range, b, c);
      }
      fs << std::endl;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x28(%rsp), %r12
leaq 0x88(%rsp), %rbp
xorl %r13d, %r13d
movq 0x60(%r14), %rax
subq 0x58(%r14), %rax
sarq $0x3, %rax
cmpq %r13, %rax
jbe 0x3cbb
movl (%r14), %esi
leaq 0x48(%rsp), %r15
movq %r15, %rdi
callq 0x9206
movq %r12, %rdi
leaq 0x75a3(%rip), %rsi      # 0xb126
movq %r15, %rdx
callq 0x4187
leaq 0x68(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
leaq 0x7590(%rip), %rdx      # 0xb12d
callq 0x4149
movq 0x58(%r14), %rax
movq (%rax,%r13,8), %rdx
addq $0x8, %rdx
movq %rbp, %rdi
movq %r15, %rsi
callq 0x4168
leaq 0x8(%rsp), %rdi
movq %rbp, %rsi
leaq 0x7567(%rip), %rdx      # 0xb12f
callq 0x4149
movq %rbp, %rdi
callq 0x30c0
leaq 0x68(%rsp), %rdi
callq 0x30c0
leaq 0x28(%rsp), %rdi
callq 0x30c0
leaq 0x48(%rsp), %rdi
callq 0x30c0
movq 0x58(%r14), %rax
movq (%rax,%r13,8), %rax
movq 0x8(%rax), %rsi
movq 0x8(%rsp), %rdx
leaq 0x7529(%rip), %rdi      # 0xb134
xorl %eax, %eax
callq 0x3030
movq 0x8(%rsp), %rsi
movq %rbp, %rdi
pushq $0x10
popq %rdx
callq 0x31f0
movsd 0x28(%r14), %xmm0
movsd 0x30(%r14), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3c9c
movq %rbp, %rdi
movsd %xmm0, (%rsp)
callq 0x3300
xorl %r12d, %r12d
movq 0x48(%r14), %rax
subq 0x40(%r14), %rax
sarq $0x3, %rax
cmpq %r12, %rax
jbe 0x3c87
movq %rbp, %rdi
leaq 0x74f3(%rip), %rsi      # 0xb152
callq 0x31a0
movq %rax, %r15
movq %rbx, %rdi
movsd (%rsp), %xmm0
movl %r12d, %esi
movl %r13d, %edx
callq 0x42f6
movq %r15, %rdi
callq 0x3300
incq %r12
jmp 0x3c44
movq %rbp, %rdi
callq 0x30d0
movsd (%rsp), %xmm0
addsd 0x38(%r14), %xmm0
jmp 0x3c28
movq %rbp, %rdi
callq 0x32b0
leaq 0x8(%rsp), %rdi
callq 0x30c0
incq %r13
leaq 0x28(%rsp), %r12
jmp 0x3b54
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x30c0
jmp 0x3cf1
movq %rax, %rbx
jmp 0x3cfb
movq %rax, %rbx
jmp 0x3d1e
movq %rax, %rbx
jmp 0x3d05
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x30c0
leaq 0x28(%rsp), %rdi
callq 0x30c0
leaq 0x48(%rsp), %rdi
jmp 0x3d23
jmp 0x3d0e
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x32b0
leaq 0x8(%rsp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x3360