// File: /workspace/github_cpp_makefile_star2_O1/nvanbenschoten[P]byzantine-agreement/src/main.cc
// Function: GetProcesses(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::experimental::fundamentals_v1::optional<unsigned short>)
generals::ProcessList GetProcesses(
    const std::string hostfile,
    std::experimental::optional<unsigned short> default_port) {
  generals::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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdx, %r14
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, 0x10(%rsp)
movq $0x0, 0x10(%rdi)
leaq 0x90(%rsp), %rdi
movl $0x8, %edx
callq 0x5560
movq 0x90(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xb0(%rsp,%rax)
jne 0x65b5
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x70(%rsp), %r15
leaq 0x18(%rsp), %r12
leaq 0x60(%rsp), %r13
leaq 0x38(%rsp), %rbp
leaq 0xa(%rsp), %rbx
leaq 0x90(%rsp), %rdi
movq %r12, %rsi
callq 0x5420
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x6575
movq %r15, 0x60(%rsp)
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xe3ee
movb $0x0, 0xc(%rsp)
cmpb $0x1, 0x2(%r14)
jne 0x651e
movzwl (%r14), %eax
movw %ax, 0xa(%rsp)
movb $0x1, 0xc(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x15587
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x6543
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x10(%rsp), %rdi
movq %rbp, %rsi
callq 0x9ada
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x64c8
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x64c8
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x6591
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x90(%rsp), %rdi
callq 0x50d0
movq 0x10(%rsp), %rax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x51a0
movq %rax, %rbx
leaq 0x102c1(%rip), %rsi     # 0x1688a
movq %rax, %rdi
callq 0x5150
movq 0x19a18(%rip), %rsi     # 0x1fff0
movq 0x19991(%rip), %rdx     # 0x1ff70
movq %rbx, %rdi
callq 0x55d0
jmp 0x66e0
movq %rax, %r14
jmp 0x674f
movq %rax, %r14
movq %rbx, %rdi
callq 0x5270
jmp 0x674f
movq %rax, %r14
jmp 0x675c
movq %rdx, %rbx
movq %rax, %r14
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x664d
movq 0x48(%rsp), %rsi
jmp 0x663d
movq %rdx, %rbx
movq %rax, %r14
movq 0x60(%rsp), %rdi
cmpq %r15, %rdi
je 0x664d
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x664d
movq %rdx, %rbx
movq %rax, %r14
cmpl $0x1, %ebx
jne 0x6733
movq %r14, %rdi
callq 0x5400
leaq 0x80(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x5590
movq 0x198e8(%rip), %rax     # 0x1ff60
addq $0x10, %rax
movq %rax, (%r15)
movq %r14, %rdi
callq 0x5160
movl $0x10, %edi
callq 0x51a0
movq %rax, %rbx
movq %r15, %rdi
callq 0x54f0
leaq 0x38(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x9a9c
movb $0x1, %bpl
leaq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x5410
leaq 0x18e3b(%rip), %rax     # 0x1f500
movq %rax, (%rbx)
xorl %ebp, %ebp
leaq 0x18d67(%rip), %rsi     # 0x1f438
movq 0x198a8(%rip), %rdx     # 0x1ff80
movq %rbx, %rdi
callq 0x55d0
movq %rax, %r14
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x6707
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x6707
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x6714
movq %rbx, %rdi
callq 0x5270
leaq 0x80(%rsp), %rdi
callq 0x5690
callq 0x5580
jmp 0x6733
movq %rax, %rdi
callq 0x9b2f
movq %rax, %r14
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x674f
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x90(%rsp), %rdi
callq 0x50d0
movq 0x10(%rsp), %rdi
callq 0x9b3a
movq %r14, %rdi
callq 0x5600