// File: /workspace/github_cpp_makefile_star2_O2/deanturpin[P]curly/./curly.h
// Function: curly(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
std::string curly(const std::string &url, const bool use_network = true) {

  // Known errors
  const std::vector<std::pair<unsigned int, std::string>> errors {
  {0, "ok"},
  {1536, "no-network"},
  {32512, "path-to-curl-incorrect"},
  };

  // Construct the command with redirects to stdout and stderr
  const std::string file = "/tmp/stdout.txt";
  const std::string command =
    "/usr/bin/curl \'" + url + "\' 2> /tmp/stderr.txt 1> " + file;

  // Attempt to run command (unless network access is disable)
  const unsigned int error_code = use_network ? system(command.c_str()) : 0;

  // Look up string for error code
  const auto it = std::find_if(errors.cbegin(), errors.cend(), [&error_code](const auto &e){
                                return e.first == error_code;
                               });

  const std::string error_string =
    (it != errors.cend() ? it->second : std::to_string(error_code));

  // Read the response written to the stdout file
  std::stringstream ss("{\"error\" : \"" + error_string + "\"}");
  std::ifstream in(file);
  if (error_code == 0 && in.good()) {
    ss.str("");
    ss << in.rdbuf();
  }

  // Return the response (or error)
  return ss.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x2b0(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0x2bd0(%rip), %rdx      # 0x5048
leaq 0xa8(%rsp), %r12
movq %r12, %rdi
callq 0x3068
leaq 0xd0(%rsp), %r13
leaq 0x68(%rsp), %rsi
movl $0x600, (%rsi)          # imm = 0x600
leaq 0x2ba9(%rip), %rdx      # 0x504b
movq %r13, %rdi
callq 0x3084
leaq 0xf8(%rsp), %r13
leaq 0x88(%rsp), %rsi
movl $0x7f00, (%rsi)         # imm = 0x7F00
leaq 0x2b8f(%rip), %rdx      # 0x5056
movq %r13, %rdi
callq 0x30a0
leaq 0x30(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
pushq $0x3
popq %rdx
leaq 0x48(%rsp), %rcx
callq 0x30bc
pushq $0x58
popq %r12
leaq (%rsp,%r12), %rdi
addq $0xa8, %rdi
callq 0x20b0
addq $-0x28, %r12
cmpq $-0x20, %r12
jne 0x24ed
leaq 0x2b5f(%rip), %rsi      # 0x506d
leaq 0x68(%rsp), %rdi
leaq 0xa8(%rsp), %rdx
callq 0x30f6
leaq 0x2b56(%rip), %rsi      # 0x507d
leaq 0x2b0(%rsp), %rdi
movq %r15, %rdx
callq 0x316f
leaq 0x2b4f(%rip), %rdx      # 0x508d
leaq 0xa8(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x3150
leaq 0x88(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x3131
leaq 0xa8(%rsp), %rdi
callq 0x20b0
leaq 0x2b0(%rsp), %rdi
callq 0x20b0
xorl %ebp, %ebp
testb %r14b, %r14b
je 0x259d
movq 0x88(%rsp), %rdi
callq 0x2150
movl %eax, %ebp
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdi
movq %rdi, %rcx
subq %rsi, %rcx
pushq $0x28
popq %r8
movq %rcx, %rax
cqto
idivq %r8
sarq $0x2, %rax
testq %rax, %rax
jle 0x25e8
cmpl %ebp, (%rsi)
je 0x262a
cmpl %ebp, 0x28(%rsi)
je 0x261a
cmpl %ebp, 0x50(%rsi)
je 0x2620
cmpl %ebp, 0x78(%rsi)
je 0x2626
addq $0xa0, %rsi
decq %rax
addq $-0xa0, %rcx
jmp 0x25bd
movq %rcx, %rax
cqto
idivq %r8
cmpq $0x1, %rax
je 0x2612
cmpq $0x2, %rax
je 0x260a
cmpq $0x3, %rax
jne 0x263f
cmpl %ebp, (%rsi)
je 0x262a
addq $0x28, %rsi
cmpl %ebp, (%rsi)
je 0x262a
addq $0x28, %rsi
cmpl %ebp, (%rsi)
cmovneq %rdi, %rsi
jmp 0x262a
addq $0x28, %rsi
jmp 0x262a
addq $0x50, %rsi
jmp 0x262a
addq $0x78, %rsi
cmpq %rdi, %rsi
je 0x263f
addq $0x8, %rsi
leaq 0x48(%rsp), %rdi
callq 0x2220
jmp 0x264b
leaq 0x48(%rsp), %rdi
movl %ebp, %esi
callq 0x31e5
leaq 0x2a54(%rip), %rsi      # 0x50a6
leaq 0x10(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x316f
leaq 0x2a4b(%rip), %rdx      # 0x50b3
leaq 0xa8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3150
leaq 0x2b0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
pushq $0x18
popq %rdx
callq 0x2280
leaq 0xa8(%rsp), %rdi
callq 0x20b0
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0xa8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x22a0
testl %ebp, %ebp
jne 0x271f
movq 0xa8(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xc8(%rsp,%rax)
jne 0x271f
leaq 0x2a25(%rip), %rsi      # 0x5104
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x30f6
leaq 0x2c8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2240
leaq 0x10(%rsp), %rdi
callq 0x20b0
leaq 0x2c0(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x2050
leaq 0x2c8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2270
leaq 0xa8(%rsp), %rdi
callq 0x2060
leaq 0x2b0(%rsp), %rdi
callq 0x2110
leaq 0x48(%rsp), %rdi
callq 0x20b0
leaq 0x88(%rsp), %rdi
callq 0x20b0
leaq 0x68(%rsp), %rdi
callq 0x20b0
leaq 0x30(%rsp), %rdi
callq 0x3224
movq %rbx, %rax
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20b0
jmp 0x285a
jmp 0x2857
jmp 0x27d6
movq %rax, %rbx
jmp 0x2867
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x20b0
jmp 0x27bf
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x20b0
jmp 0x2874
movq %rax, %rbx
jmp 0x2874
movq %rax, %rbx
jmp 0x287e
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x20b0
jmp 0x27f3
movq %rax, %rbx
leaq 0x2b0(%rsp), %rdi
jmp 0x2886
movq %rax, %rbx
jmp 0x288b
movq %rax, %rbx
jmp 0x2895
movq %rax, %rbx
pushq $0x58
popq %r14
leaq (%rsp,%r14), %rdi
addq $0xa8, %rdi
callq 0x20b0
addq $-0x28, %r14
cmpq $-0x20, %r14
jne 0x2817
jmp 0x289f
jmp 0x2835
movq %rax, %rbx
leaq -0x28(%r13), %r14
addq $-0x20, %r13
movq %r13, %rdi
callq 0x20b0
movq %r14, %r13
cmpq %r12, %r14
jne 0x2838
jmp 0x289f
movq %rax, %rbx
jmp 0x289f
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x2060
leaq 0x2b0(%rsp), %rdi
callq 0x2110
leaq 0x48(%rsp), %rdi
callq 0x20b0
leaq 0x88(%rsp), %rdi
callq 0x20b0
leaq 0x68(%rsp), %rdi
callq 0x20b0
leaq 0x30(%rsp), %rdi
callq 0x3224
movq %rbx, %rdi
callq 0x22c0