// File: nvanbenschoten[P]total-order-multicast/src/main.cc
// Function: GetProcesses(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::experimental::fundamentals_v1::optional<unsigned short>)
process::ProcessList GetProcesses(
    const std::string hostfile,
    std::experimental::optional<unsigned short> default_port) {
  process::ProcessList processes;
  std::ifstream file(hostfile);
  if (!file) {
    throw std::runtime_error("could not open hostfile");
  }

  std::string host;
  while (file >> host) {
    try {
      auto addr = net::AddressWithDefaultPort(host, default_port);
      processes.push_back(addr);
    } catch (std::invalid_argument e) {
      throw args::UsageError(e.what());
    }
  }
  return processes;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movq %rdx, -0x300(%rbp)
movq %rsi, -0x2e8(%rbp)
movq %rdi, -0x2f8(%rbp)
movq %rdi, %rax
movq %rax, -0x2f0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x19ec0
movq -0x2e8(%rbp), %rsi
leaq -0x228(%rbp), %rdi
movl $0x8, %edx
callq 0x66d0
jmp 0x16069
movq -0x228(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x228(%rbp,%rax), %rdi
callq 0x6200
movb %al, -0x301(%rbp)
jmp 0x16089
movb -0x301(%rbp), %al
testb $0x1, %al
jne 0x16098
jmp 0x1612d
movl $0x10, %edi
callq 0x6230
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x310(%rbp)
leaq 0x19a91(%rip), %rsi     # 0x2fb47
callq 0x6180
jmp 0x160bd
movq -0x310(%rbp), %rdi
movq 0x2ff25(%rip), %rsi     # 0x45ff0
movq 0x2feae(%rip), %rdx     # 0x45f80
callq 0x6770
jmp 0x16429
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x16409
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x163df
movq -0x310(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
callq 0x6300
jmp 0x163df
leaq -0x258(%rbp), %rdi
callq 0x6610
leaq -0x228(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x6580
movq %rax, -0x318(%rbp)
jmp 0x16155
movq -0x318(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x6560
movb %al, -0x319(%rbp)
jmp 0x16173
movb -0x319(%rbp), %al
testb $0x1, %al
jne 0x16182
jmp 0x163af
leaq -0x2a0(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x61c0
jmp 0x16197
movq -0x300(%rbp), %rsi
leaq -0x2a4(%rbp), %rdi
callq 0x19ee0
jmp 0x161ac
leaq -0x280(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
leaq -0x2a4(%rbp), %rdx
callq 0x2de30
jmp 0x161c8
leaq -0x2a0(%rbp), %rdi
callq 0x68c8
movq -0x2f8(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x19f10
jmp 0x161e9
leaq -0x280(%rbp), %rdi
callq 0xb6b0
jmp 0x163aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x163d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x16263
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x68c8
jmp 0x16263
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x280(%rbp), %rdi
callq 0xb6b0
movl -0x234(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x163d3
movq -0x230(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x6540
movq %rax, %rsi
leaq -0x2b8(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x19f80
movq -0x348(%rbp), %rdi
callq 0x6190
movb $0x1, -0x2da(%rbp)
movl $0x10, %edi
callq 0x6230
movq -0x340(%rbp), %rdi
movq %rax, -0x338(%rbp)
callq 0x6670
movq %rax, -0x330(%rbp)
leaq -0x2d9(%rbp), %rdi
movq %rdi, -0x328(%rbp)
callq 0x67b0
movq -0x330(%rbp), %rsi
movq -0x328(%rbp), %rdx
leaq -0x2d8(%rbp), %rdi
callq 0xb990
jmp 0x16305
movq -0x338(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x19fc0
jmp 0x1631a
movq -0x338(%rbp), %rdi
movb $0x0, -0x2da(%rbp)
leaq 0x2f309(%rip), %rsi     # 0x45638
leaq 0x3cca(%rip), %rdx      # 0x1a000
callq 0x6770
jmp 0x16429
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
jmp 0x16372
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x230(%rbp)
movl %eax, -0x234(%rbp)
leaq -0x2d8(%rbp), %rdi
callq 0x68c8
leaq -0x2d9(%rbp), %rdi
callq 0x6490
testb $0x1, -0x2da(%rbp)
jne 0x16389
jmp 0x16395
movq -0x338(%rbp), %rdi
callq 0x6300
leaq -0x2b8(%rbp), %rdi
callq 0x68d0
callq 0x66f0
jmp 0x163a8
jmp 0x163d3
jmp 0x16139
movb $0x1, -0x19(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x68c8
leaq -0x228(%rbp), %rdi
callq 0x6110
testb $0x1, -0x19(%rbp)
jne 0x163f9
jmp 0x163ed
leaq -0x258(%rbp), %rdi
callq 0x68c8
leaq -0x228(%rbp), %rdi
callq 0x6110
jmp 0x16409
movq -0x2f8(%rbp), %rdi
callq 0x1a020
movq -0x2f0(%rbp), %rax
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
movq -0x2f8(%rbp), %rdi
callq 0x1a020
movq -0x230(%rbp), %rdi
callq 0x67a0
movq %rax, %rdi
callq 0xb3b0
nopl (%rax)