// File: /workspace/github_cpp_makefile_star2_O3/king1600[P]cordpp/src/http.cc
// Function: cordpp::RestClient::to_string[abi:cxx11](cordpp::Request const&)
const std::string RestClient::to_string(const Request &req) {
  std::ostringstream output;

  // add method and endpoint
  output << req.method << " " << base_endpoint << req.endpoint << " HTTP/1.1\r\n";

  // add default headers
  output << "Accept: */*\r\n";
  //output << "Accept-Encoding: gzip\r\n";
  output << "Connection: keep-alive\r\n";
  output << "Host: " << base_host << ":443\r\n";
  output << "Authorization: Bot " << token << "\r\n";
  output << "User-Agent: DiscordBot (" << lib << ", " << version << ")\r\n";

  // add variable headers
  if (!req.audit_reason.empty())
    output << "X-Audit-Log-Reason: " << req.audit_reason << CLRF;
  if (!cookies.empty()) {
    output << "Cookie: ";
    for (const std::string &cookie : cookies)
      output << cookie << "; ";
    output << CLRF;
  }

  // add conditional body headers & create content
  if (!req.body.empty() && req.body.is_object()) {
    std::string content = req.body.dump();
    //output << "Content-Encoding: gzip\r\n";
    output << "Content-Type: application/json; charset=UTF-8\r\n";
    output << "Content-Length: " << std::to_string(content.size()) << CLRF;
    output << CLRF << content;
  } else output << CLRF;

  // return built http request
  return output.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x40(%rsp), %r12
movq %r12, %rdi
callq 0xa7e0
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
movq %r12, %rdi
callq 0xa6a0
movq %rax, %r12
leaq 0x1cd43(%rip), %rsi     # 0x3e588
movl $0x1, %edx
movq %rax, %rdi
callq 0xa6a0
movq 0x353bf(%rip), %rsi     # 0x56c18
movq 0x353c0(%rip), %rdx     # 0x56c20
movq %r12, %rdi
callq 0xa6a0
movq 0x30(%r14), %rsi
movq 0x38(%r14), %rdx
movq %rax, %rdi
callq 0xa6a0
leaq 0x1deb0(%rip), %rsi     # 0x3f72f
movl $0xb, %edx
movq %rax, %rdi
callq 0xa6a0
leaq 0x1cc92(%rip), %rsi     # 0x3e525
leaq 0x40(%rsp), %rdi
movl $0xd, %edx
callq 0xa6a0
leaq 0x1cc8a(%rip), %rsi     # 0x3e533
leaq 0x40(%rsp), %rdi
movl $0x18, %edx
callq 0xa6a0
leaq 0x1cc8d(%rip), %rsi     # 0x3e54c
leaq 0x40(%rsp), %rdi
movl $0x6, %edx
callq 0xa6a0
movq 0x35323(%rip), %rsi     # 0x56bf8
movq 0x35324(%rip), %rdx     # 0x56c00
leaq 0x40(%rsp), %rdi
callq 0xa6a0
leaq 0x1cc66(%rip), %rsi     # 0x3e553
movl $0x6, %edx
movq %rax, %rdi
callq 0xa6a0
leaq 0x1cc59(%rip), %rsi     # 0x3e55a
leaq 0x40(%rsp), %rdi
movl $0x13, %edx
callq 0xa6a0
movq 0x8(%r15), %rsi
movq 0x10(%r15), %rdx
leaq 0x40(%rsp), %rdi
callq 0xa6a0
leaq 0x1ce9e(%rip), %rsi     # 0x3e7c7
movl $0x2, %edx
movq %rax, %rdi
callq 0xa6a0
leaq 0x1cc31(%rip), %rsi     # 0x3e56e
leaq 0x40(%rsp), %rdi
movl $0x18, %edx
callq 0xa6a0
movq 0x35225(%rip), %rsi     # 0x56b78
movq 0x35226(%rip), %rdx     # 0x56b80
leaq 0x40(%rsp), %rdi
callq 0xa6a0
movq %rax, %r12
leaq 0x1cc19(%rip), %rsi     # 0x3e587
movl $0x2, %edx
movq %rax, %rdi
callq 0xa6a0
movq 0x35236(%rip), %rsi     # 0x56bb8
movq 0x35237(%rip), %rdx     # 0x56bc0
movq %r12, %rdi
callq 0xa6a0
leaq 0x1cbf2(%rip), %rsi     # 0x3e58a
movl $0x3, %edx
movq %rax, %rdi
callq 0xa6a0
cmpq $0x0, 0x58(%r14)
je 0x219ea
leaq 0x1cbdb(%rip), %rsi     # 0x3e58e
leaq 0x40(%rsp), %rdi
movl $0x14, %edx
callq 0xa6a0
movq 0x50(%r14), %rsi
movq 0x58(%r14), %rdx
leaq 0x40(%rsp), %rdi
callq 0xa6a0
movq 0x3527d(%rip), %rsi     # 0x56c58
movq 0x3527e(%rip), %rdx     # 0x56c60
movq %rax, %rdi
callq 0xa6a0
movq 0x130(%r15), %rax
cmpq 0x138(%r15), %rax
je 0x21a70
leaq 0x1cba2(%rip), %rsi     # 0x3e5a3
leaq 0x40(%rsp), %rdi
movl $0x8, %edx
callq 0xa6a0
movq 0x130(%r15), %r13
movq 0x138(%r15), %rbp
cmpq %rbp, %r13
je 0x21a58
leaq 0x40(%rsp), %r15
leaq 0x1cb7d(%rip), %r12     # 0x3e5ac
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq %r15, %rdi
callq 0xa6a0
movl $0x2, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0xa6a0
addq $0x20, %r13
cmpq %rbp, %r13
jne 0x21a2f
movq 0x351f9(%rip), %rsi     # 0x56c58
movq 0x351fa(%rip), %rdx     # 0x56c60
leaq 0x40(%rsp), %rdi
callq 0xa6a0
cmpb $0x1, (%r14)
jne 0x21b27
movq 0x8(%r14), %rax
cmpq $0x0, 0x28(%rax)
je 0x21b27
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x20, %ecx
xorl %r8d, %r8d
callq 0x1426e
leaq 0x1cb05(%rip), %rsi     # 0x3e5af
leaq 0x40(%rsp), %rdi
movl $0x2f, %edx
callq 0xa6a0
leaq 0x1cb1f(%rip), %rsi     # 0x3e5df
leaq 0x40(%rsp), %rdi
movl $0x10, %edx
callq 0xa6a0
movq 0x28(%rsp), %r14
movl $0x1, %esi
cmpq $0xa, %r14
jb 0x21b4b
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r14, %rcx
cmpq $0x63, %rcx
jbe 0x21b44
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x21b49
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x21b4b
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x21af1
addl $-0x3, %esi
jmp 0x21b4b
movq 0x3512a(%rip), %rsi     # 0x56c58
movq 0x3512b(%rip), %rdx     # 0x56c60
leaq 0x40(%rsp), %rdi
callq 0xa6a0
jmp 0x21bf4
addl $-0x2, %esi
jmp 0x21b4b
decl %esi
movl %esi, %esi
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rsp, %rdi
xorl %edx, %edx
callq 0xa6c0
movq (%rsp), %rdi
movl 0x8(%rsp), %esi
movq %r14, %rdx
callq 0x1f87b
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0xa6a0
movq 0x350ce(%rip), %rsi     # 0x56c58
movq 0x350cf(%rip), %rdx     # 0x56c60
movq %rax, %rdi
callq 0xa6a0
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x21baf
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xa5d0
movq 0x350a2(%rip), %rsi     # 0x56c58
movq 0x350a3(%rip), %rdx     # 0x56c60
leaq 0x40(%rsp), %rdi
callq 0xa6a0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rax, %rdi
callq 0xa6a0
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21bf4
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xa5d0
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0xa960
movq 0x343b0(%rip), %rsi     # 0x55fb8
leaq 0x40(%rsp), %rdi
callq 0xa330
leaq 0xb0(%rsp), %rdi
callq 0xa1f0
movq %rbx, %rax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x21c53
jmp 0x21c75
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x21c56
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xa5d0
jmp 0x21c56
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x21c78
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xa5d0
jmp 0x21c78
jmp 0x21c75
movq %rax, %rbx
movq 0x34339(%rip), %rsi     # 0x55fb8
leaq 0x40(%rsp), %rdi
callq 0xa330
leaq 0xb0(%rsp), %rdi
callq 0xa1f0
movq %rbx, %rdi
callq 0xaa30