// File: /workspace/github_cpp_makefile_star2_O2/jliesch[P]ofxget/ofxhome.cc
// Function: ofxget::UploadSuccessfulRequest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string UploadSuccessfulRequest(const string& api_key, const string& url, const string& request) {
    CURL *curl = curl_easy_init();
    if (! curl) {
      throw string("Could not initialize curl");
    }

    char *api_key_output = curl_easy_escape(curl, api_key.c_str(), api_key.size());
    string anonymized_request = AnonymizeRequest(request);
    char *request_output = curl_easy_escape(curl, anonymized_request.c_str(), anonymized_request.size());
    char *url_output = curl_easy_escape(curl, url.c_str(), url.size());
    if (!api_key_output || !request_output || !url_output) {
      throw string("Could not curl_easy_escape request");
    }
    string output = string("api_key=") + api_key_output + "&url=" + url_output + "&request=" + request_output;
    string response;
#ifdef OFXHOME_DEBUG
    curl_easy_setopt(curl, CURLOPT_URL, "http://localhost/ofxhome/index.php/api/successfulRequest");
#else
    curl_easy_setopt(curl, CURLOPT_URL, "http://www.ofxhome.com/beta/index.php/api/successfulRequest");
#endif
    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteToString);
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&response);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, (long) output.size());
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, output.c_str());

    CURLcode res = curl_easy_perform(curl);
    if (res != CURLE_OK) {
        throw "Curl error: " + std::to_string(res);
    }

    curl_free(api_key_output);
    curl_free(request_output);
    curl_easy_cleanup(curl);

    return response;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %rbx
callq 0x66c0
testq %rax, %rax
je 0x9c9d
movq %rax, %r14
movq (%r15), %rsi
movl 0x8(%r15), %edx
movq %rax, %rdi
callq 0x6510
movq %rax, %r15
leaq 0xc8(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x9928
movq (%rbp), %rsi
movl 0x8(%rbp), %edx
movq %r14, %rdi
callq 0x6510
movq %rax, %r12
movq (%r13), %rsi
movl 0x8(%r13), %edx
movq %r14, %rdi
callq 0x6510
testq %r15, %r15
je 0x9cd5
testq %r12, %r12
je 0x9cd5
movq %rax, %r13
testq %rax, %rax
je 0x9cd5
leaq 0x20a90(%rip), %rsi     # 0x2a5ac
leaq 0x48(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x66e0
leaq 0x68(%rsp), %rdi
leaq 0x48(%rsp), %rsi
movq %r15, %rdx
callq 0xa192
leaq 0x20a71(%rip), %rdx     # 0x2a5b5
leaq 0x88(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xa192
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
movq %r13, %rdx
callq 0xa192
leaq 0x20a46(%rip), %rdx     # 0x2a5bb
leaq 0x8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xa192
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0xa192
leaq 0x8(%rsp), %rdi
callq 0x6890
leaq 0xa8(%rsp), %rdi
callq 0x6890
leaq 0x88(%rsp), %rdi
callq 0x6890
leaq 0x68(%rsp), %rdi
callq 0x6890
leaq 0x48(%rsp), %rdi
callq 0x6890
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x209dd(%rip), %rdx     # 0x2a5c5
movq %r14, %rdi
movl $0x2712, %esi           # imm = 0x2712
xorl %eax, %eax
callq 0x6610
leaq -0xb80(%rip), %rdx      # 0x907e
movq %r14, %rdi
movl $0x4e2b, %esi           # imm = 0x4E2B
xorl %eax, %eax
callq 0x6610
movq %r14, %rdi
movl $0x2711, %esi           # imm = 0x2711
movq %rbx, %rdx
xorl %eax, %eax
callq 0x6610
movq 0x30(%rsp), %rdx
movq %r14, %rdi
movl $0x75a8, %esi           # imm = 0x75A8
xorl %eax, %eax
callq 0x6610
movq 0x28(%rsp), %rdx
movq %r14, %rdi
movl $0x271f, %esi           # imm = 0x271F
xorl %eax, %eax
callq 0x6610
movq %r14, %rdi
callq 0x64c0
movl %eax, %ebp
testl %eax, %eax
jne 0x9d0c
movq %r15, %rdi
callq 0x6030
movq %r12, %rdi
callq 0x6030
movq %r14, %rdi
callq 0x60b0
leaq 0x28(%rsp), %rdi
callq 0x6890
leaq 0xc8(%rsp), %rdi
callq 0x6890
movq %rbx, %rax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x6250
movq %rax, %rbx
leaq 0x204a8(%rip), %rsi     # 0x2a157
leaq 0xc8(%rsp), %rdx
movq %rax, %rdi
callq 0x66e0
leaq 0x3885a(%rip), %rsi     # 0x42520
movq 0x392db(%rip), %rdx     # 0x42fa8
movq %rbx, %rdi
callq 0x6440
pushq $0x20
popq %rdi
callq 0x6250
movq %rax, %rbx
leaq 0x208a2(%rip), %rsi     # 0x2a589
leaq 0x28(%rsp), %rdx
movq %rax, %rdi
callq 0x66e0
leaq 0x38825(%rip), %rsi     # 0x42520
movq 0x392a6(%rip), %rdx     # 0x42fa8
movq %rbx, %rdi
callq 0x6440
jmp 0x9d52
pushq $0x20
popq %rdi
callq 0x6250
movq %rax, %r15
leaq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x81e2
movb $0x1, %bpl
leaq 0x20483(%rip), %rsi     # 0x2a1b0
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x8335
xorl %ebp, %ebp
leaq 0x387dd(%rip), %rsi     # 0x42520
movq 0x3925e(%rip), %rdx     # 0x42fa8
movq %r15, %rdi
callq 0x6440
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x6890
testb %bpl, %bpl
jne 0x9d6c
jmp 0x9dec
movq %rax, %r14
movq %r15, %rdi
callq 0x6630
jmp 0x9dec
jmp 0x9de2
movq %rax, %r14
movq %rbx, %rdi
callq 0x6630
jmp 0x9dfe
movq %rax, %r14
movq %rbx, %rdi
callq 0x6630
jmp 0x9e0b
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x6890
jmp 0x9da4
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0x6890
jmp 0x9db6
movq %rax, %r14
leaq 0x88(%rsp), %rdi
callq 0x6890
jmp 0x9dc8
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x6890
jmp 0x9dd7
movq %rax, %r14
leaq 0x48(%rsp), %rdi
jmp 0x9df9
jmp 0x9de2
jmp 0x9de2
movq %rax, %r14
jmp 0x9dfe
jmp 0x9de9
movq %rax, %r14
movq %rbx, %rdi
callq 0x6890
leaq 0x28(%rsp), %rdi
callq 0x6890
leaq 0xc8(%rsp), %rdi
callq 0x6890
movq %r14, %rdi
callq 0x6460