// File: 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
movq %rsp, %rbp
subq $0x650, %rsp            # imm = 0x650
movq %rdi, -0x5c0(%rbp)
movb %dl, %al
movq %rdi, %rcx
movq %rcx, -0x5b8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
leaq -0xb8(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
movl $0x0, -0xc4(%rbp)
leaq 0x7a36(%rip), %rdx      # 0xb040
leaq -0xc4(%rbp), %rsi
callq 0x50b0
jmp 0x3618
leaq -0x90(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
movl $0x600, -0xd8(%rbp)     # imm = 0x600
leaq 0x7a0c(%rip), %rdx      # 0xb043
leaq -0xd8(%rbp), %rsi
callq 0x5130
jmp 0x3645
leaq -0x68(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
movl $0x7f00, -0xdc(%rbp)    # imm = 0x7F00
leaq 0x79ed(%rip), %rdx      # 0xb04e
leaq -0xdc(%rbp), %rsi
callq 0x51b0
jmp 0x366f
leaq -0xb8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq $0x3, -0x38(%rbp)
leaq -0xdd(%rbp), %rdi
movq %rdi, -0x5c8(%rbp)
callq 0x5250
movq -0x5c8(%rbp), %rcx
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x5270
jmp 0x36af
leaq -0xdd(%rbp), %rdi
callq 0x52f0
leaq -0xb8(%rbp), %rax
movq %rax, -0x5d8(%rbp)
addq $0x78, %rax
movq %rax, -0x5d0(%rbp)
movq -0x5d0(%rbp), %rdi
addq $-0x28, %rdi
movq %rdi, -0x5e0(%rbp)
callq 0x5230
movq -0x5d8(%rbp), %rcx
movq -0x5e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x5d0(%rbp)
jne 0x36d4
leaq -0x101(%rbp), %rdi
movq %rdi, -0x5e8(%rbp)
callq 0x33f0
movq -0x5e8(%rbp), %rdx
leaq 0x793f(%rip), %rsi      # 0xb065
leaq -0x100(%rbp), %rdi
callq 0x5310
jmp 0x3734
leaq -0x101(%rbp), %rdi
callq 0x3290
movq -0x10(%rbp), %rdx
leaq 0x792a(%rip), %rsi      # 0xb075
leaq -0x168(%rbp), %rdi
callq 0x5460
jmp 0x3759
leaq 0x7925(%rip), %rdx      # 0xb085
leaq -0x148(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x5410
jmp 0x3775
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0x53c0
jmp 0x3791
leaq -0x148(%rbp), %rdi
callq 0x3150
leaq -0x168(%rbp), %rdi
callq 0x3150
testb $0x1, -0x11(%rbp)
je 0x37d9
leaq -0x128(%rbp), %rdi
callq 0x30e0
movq %rax, %rdi
callq 0x31f0
movl %eax, -0x5ec(%rbp)
jmp 0x37cb
movl -0x5ec(%rbp), %eax
movl %eax, -0x5f0(%rbp)
jmp 0x37e3
xorl %eax, %eax
movl %eax, -0x5f0(%rbp)
jmp 0x37e3
movl -0x5f0(%rbp), %eax
movl %eax, -0x16c(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x600(%rbp)
callq 0x5570
movq -0x600(%rbp), %rdi
movq %rax, -0x180(%rbp)
callq 0x55a0
movq %rax, -0x188(%rbp)
leaq -0x16c(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x180(%rbp), %rdi
movq -0x188(%rbp), %rsi
movq -0x190(%rbp), %rdx
callq 0x3d20
movq %rax, -0x5f8(%rbp)
jmp 0x384a
movq -0x5f8(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x55a0
movq %rax, -0x1b8(%rbp)
leaq -0x178(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x55d0
testb $0x1, %al
jne 0x3881
jmp 0x38a4
leaq -0x178(%rbp), %rdi
callq 0x5610
movq %rax, %rsi
addq $0x8, %rsi
leaq -0x1b0(%rbp), %rdi
callq 0x30f0
jmp 0x38a2
jmp 0x38ba
movl -0x16c(%rbp), %esi
leaq -0x1b0(%rbp), %rdi
callq 0x5630
jmp 0x38b8
jmp 0x38ba
leaq 0x77dd(%rip), %rsi      # 0xb09e
leaq -0x380(%rbp), %rdi
leaq -0x1b0(%rbp), %rdx
callq 0x5460
jmp 0x38d6
leaq 0x77ce(%rip), %rdx      # 0xb0ab
leaq -0x360(%rbp), %rdi
leaq -0x380(%rbp), %rsi
callq 0x5410
jmp 0x38f2
movl $0x10, %edi
movl $0x8, %esi
callq 0x5710
movl %eax, -0x604(%rbp)
jmp 0x3909
movl -0x604(%rbp), %edx
leaq -0x340(%rbp), %rdi
leaq -0x360(%rbp), %rsi
callq 0x3390
jmp 0x3924
leaq -0x360(%rbp), %rdi
callq 0x3150
leaq -0x380(%rbp), %rdi
callq 0x3150
leaq -0x588(%rbp), %rdi
leaq -0x100(%rbp), %rsi
movl $0x8, %edx
callq 0x33a0
jmp 0x3956
cmpl $0x0, -0x16c(%rbp)
jne 0x3c56
movq -0x588(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x588(%rbp,%rax), %rdi
callq 0x33c0
movb %al, -0x605(%rbp)
jmp 0x3983
movb -0x605(%rbp), %al
testb $0x1, %al
jne 0x3992
jmp 0x3c56
leaq -0x5a9(%rbp), %rdi
movq %rdi, -0x610(%rbp)
callq 0x33f0
movq -0x610(%rbp), %rdx
leaq 0x7749(%rip), %rsi      # 0xb0fc
leaq -0x5a8(%rbp), %rdi
callq 0x5310
jmp 0x39c1
leaq -0x340(%rbp), %rdi
leaq -0x5a8(%rbp), %rsi
callq 0x32c0
jmp 0x39d6
leaq -0x5a8(%rbp), %rdi
callq 0x3150
leaq -0x5a9(%rbp), %rdi
callq 0x3290
leaq -0x330(%rbp), %rax
movq %rax, -0x620(%rbp)
leaq -0x588(%rbp), %rdi
callq 0x3360
movq %rax, -0x618(%rbp)
jmp 0x3a11
movq -0x618(%rbp), %rsi
movq -0x620(%rbp), %rdi
callq 0x3060
jmp 0x3a26
jmp 0x3c56
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
movq -0xc0(%rbp), %rax
leaq -0xb8(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x628(%rbp)
je 0x3a88
movq -0x628(%rbp), %rdi
addq $-0x28, %rdi
movq %rdi, -0x630(%rbp)
callq 0x5230
movq -0x630(%rbp), %rax
leaq -0xb8(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x628(%rbp)
jne 0x3a57
jmp 0x3d05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0xdd(%rbp), %rdi
callq 0x52f0
leaq -0xb8(%rbp), %rax
movq %rax, -0x640(%rbp)
addq $0x78, %rax
movq %rax, -0x638(%rbp)
movq -0x638(%rbp), %rdi
addq $-0x28, %rdi
movq %rdi, -0x648(%rbp)
callq 0x5230
movq -0x640(%rbp), %rcx
movq -0x648(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x638(%rbp)
jne 0x3ac4
jmp 0x3d05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x101(%rbp), %rdi
callq 0x3290
jmp 0x3cfc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x3cf0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x3b66
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x3150
leaq -0x168(%rbp), %rdi
callq 0x3150
jmp 0x3cf0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x3ce4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x3cd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x3bd7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x3150
leaq -0x380(%rbp), %rdi
callq 0x3150
jmp 0x3cd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x3ccc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x3cc0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x3c48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x5a8(%rbp), %rdi
callq 0x3150
leaq -0x5a9(%rbp), %rdi
callq 0x3290
jmp 0x3cc0
movq -0x5c0(%rbp), %rdi
leaq -0x340(%rbp), %rsi
callq 0x3220
jmp 0x3c6b
leaq -0x588(%rbp), %rdi
callq 0x3080
leaq -0x340(%rbp), %rdi
callq 0x31a0
leaq -0x1b0(%rbp), %rdi
callq 0x3150
leaq -0x128(%rbp), %rdi
callq 0x3150
leaq -0x100(%rbp), %rdi
callq 0x3150
leaq -0x30(%rbp), %rdi
callq 0x5730
movq -0x5b8(%rbp), %rax
addq $0x650, %rsp            # imm = 0x650
popq %rbp
retq
leaq -0x588(%rbp), %rdi
callq 0x3080
leaq -0x340(%rbp), %rdi
callq 0x31a0
leaq -0x1b0(%rbp), %rdi
callq 0x3150
leaq -0x128(%rbp), %rdi
callq 0x3150
leaq -0x100(%rbp), %rdi
callq 0x3150
leaq -0x30(%rbp), %rdi
callq 0x5730
movq -0xd0(%rbp), %rdi
callq 0x33e0
nopw %cs:(%rax,%rax)