// File: /workspace/github_cpp_makefile_star2_O3/boomanaiden154[P]HTTPClientHPP/./client.hpp
// Function: HTTPClient::getFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::multimap<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<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>>>>>)
static HTTPHeader getFile(std::string uri, std::multimap<std::string, std::string> headers = std::multimap<std::string, std::string>())
    {
        struct uri websiteURI = parseURI(uri);
        int port = websiteURI.port == -1 ? 80 : websiteURI.port;
        int sockfd = initalizeSocket(websiteURI.domain, port);
        std::string path = websiteURI.path == "" ? "/" : websiteURI.path;

        HTTPHeader request(true);
        request.headerField1 = "GET";
        request.headerField2 = websiteURI.path;
        request.headerField3 = "HTTP/1.1";

        request.headers.insert(std::pair<std::string,std::string>("Host",websiteURI.domain));
        request.headers.insert(std::pair<std::string,std::string>("User-Agent","custom/0.0.1"));
        request.headers.insert(std::pair<std::string,std::string>("Accept","*/*"));

        std::multimap<std::string,std::string>::iterator itr;
        for(itr = headers.begin(); itr != headers.end(); itr++)
        {
            request.headers.insert(std::pair<std::string,std::string>(itr->first, itr->second));
        }

        std::string headerString = request.getHeaderString();

        bool ssl = websiteURI.protocol == "https";

        //init SSL
        SSL_CTX* ssl_ctx;
        SSL* conn;
        if(ssl)
        {
            SSL_load_error_strings();
            SSL_library_init();
            ssl_ctx = SSL_CTX_new(SSLv23_client_method());

            conn = SSL_new(ssl_ctx);
            SSL_set_tlsext_host_name(conn, websiteURI.domain.c_str());
            SSL_set_fd(conn, sockfd);

            SSL_connect(conn);
        }

        if(ssl)
        {
            SSL_write(conn, headerString.c_str(), headerString.size());
        }
        else
        {
            send(sockfd, headerString.c_str(), headerString.size(), 0);
        }

        HTTPHeader response;

        char headerBuffer[8191];

        int headerRecieved;
        if(ssl)
        {
            headerRecieved = SSL_read(conn, headerBuffer, 8191);
        }
        else
        {
            headerRecieved = recv(sockfd, headerBuffer, 8191, 0);
        }

        if(headerRecieved > 0)
        {
            response.parse(std::string(headerBuffer, headerRecieved));
        }
        else
        {
            response.isDone = true;
        }

        while(!response.isDone)
        {
            char buffer[8191];
            int recieved;
            if(ssl)
            {
                recieved = SSL_read(conn, buffer, 8191);
            }
            else
            {
                recieved = recv(sockfd, buffer, 8191, 0);
            }
            response.parse(std::string(buffer, recieved));
        }

        return response;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4288, %rsp           # imm = 0x4288
movq %rdx, %r13
movq %rdi, -0x30(%rbp)
leaq -0xe8(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq -0xf8(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x4240
leaq -0x160(%rbp), %rdi
movq %r14, %rsi
callq 0x2e84
movq -0xf8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x25f4
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x21f0
movl -0x100(%rbp), %r14d
leaq -0xc8(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0x140(%rbp), %rsi
movq -0x138(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd8(%rbp), %rdi
callq 0x4240
cmpl $-0x1, %r14d
movl $0x50, %esi
cmovnel %r14d, %esi
leaq -0xd8(%rbp), %rdi
callq 0x30b0
movl %eax, -0x34(%rbp)
movq -0xd8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x265a
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x21f0
leaq -0x120(%rbp), %r12
leaq 0x2a0f(%rip), %rsi      # 0x5077
movq %r12, %rdi
callq 0x20a0
leaq -0x68(%rbp), %rcx
movq %rcx, -0x10(%rcx)
testl %eax, %eax
je 0x2698
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rdi
callq 0x4240
jmp 0x26af
leaq 0x2965(%rip), %rsi      # 0x5004
leaq 0x295f(%rip), %rdx      # 0x5005
leaq -0x78(%rbp), %rdi
callq 0x4a42
leaq -0x2a0(%rbp), %rcx
xorl %eax, %eax
movl %eax, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
leaq -0x270(%rbp), %rdi
leaq -0x260(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x240(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x220(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x200(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x1e0(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq %rax, -0x8(%rdx)
movb %al, (%rdx)
leaq -0x1b8(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq %rax, -0x8(%rdx)
movb %al, (%rdx)
leaq -0x198(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq %rax, -0x8(%rdx)
movb %al, (%rdx)
leaq -0x170(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq %rax, -0x8(%rdx)
movb %al, (%rdx)
movl %eax, -0x60(%rdx)
movb $0x1, %sil
movb %sil, -0x18(%rdx)
movb %sil, -0x78(%rcx)
movw $0x1, -0x17(%rdx)
movl %eax, -0x14(%rdx)
leaq 0x288f(%rip), %rcx      # 0x5006
movl $0x3, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x22d0
leaq -0x250(%rbp), %rdi
movq %r12, %rsi
callq 0x2120
leaq -0x230(%rbp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x2863(%rip), %rcx      # 0x500a
movl $0x8, %r8d
xorl %esi, %esi
callq 0x22d0
leaq -0x140(%rbp), %rdx
leaq 0x2851(%rip), %rsi      # 0x5013
leaq -0x22b0(%rbp), %rdi
callq 0x3326
leaq -0x2a8(%rbp), %rdi
leaq -0x22b0(%rbp), %rsi
callq 0x4350
leaq -0x2280(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2800
movq -0x2280(%rbp), %rsi
incq %rsi
callq 0x21f0
leaq -0x22a0(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x281f
movq -0x22a0(%rbp), %rsi
incq %rsi
callq 0x21f0
leaq 0x27f2(%rip), %rsi      # 0x5018
leaq 0x27f6(%rip), %rdx      # 0x5023
leaq -0x22b0(%rbp), %rdi
callq 0x33e2
leaq -0x2a8(%rbp), %rdi
leaq -0x22b0(%rbp), %rsi
callq 0x4350
movq -0x2290(%rbp), %rdi
leaq -0x2280(%rbp), %rax
cmpq %rax, %rdi
je 0x286e
movq -0x2280(%rbp), %rsi
incq %rsi
callq 0x21f0
movq -0x22b0(%rbp), %rdi
cmpq %r15, %rdi
je 0x2889
movq -0x22a0(%rbp), %rsi
incq %rsi
callq 0x21f0
leaq 0x27a0(%rip), %rsi      # 0x5030
leaq 0x27a0(%rip), %rdx      # 0x5037
leaq -0x22b0(%rbp), %rdi
callq 0x3460
leaq -0x2a8(%rbp), %rdi
leaq -0x22b0(%rbp), %rsi
callq 0x4350
movq -0x2290(%rbp), %rdi
leaq -0x2280(%rbp), %rax
cmpq %rax, %rdi
je 0x28d8
movq -0x2280(%rbp), %rsi
incq %rsi
callq 0x21f0
movq -0x22b0(%rbp), %rdi
cmpq %r15, %rdi
je 0x28f3
movq -0x22a0(%rbp), %rsi
incq %rsi
callq 0x21f0
movq 0x18(%r13), %r14
addq $0x8, %r13
cmpq %r13, %r14
je 0x2979
movq %r13, %rbx
leaq -0x22b0(%rbp), %r12
leaq -0x2a8(%rbp), %r13
leaq 0x20(%r14), %rsi
leaq 0x40(%r14), %rdx
movq %r12, %rdi
callq 0x34de
movq %r13, %rdi
movq %r12, %rsi
callq 0x4350
movq -0x2290(%rbp), %rdi
leaq -0x2280(%rbp), %rax
cmpq %rax, %rdi
je 0x294e
movq -0x2280(%rbp), %rsi
incq %rsi
callq 0x21f0
movq -0x22b0(%rbp), %rdi
cmpq %r15, %rdi
je 0x2969
movq -0x22a0(%rbp), %rsi
incq %rsi
callq 0x21f0
movq %r14, %rdi
callq 0x2160
movq %rax, %r14
cmpq %rbx, %rax
jne 0x2911
leaq -0x58(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
callq 0x354c
leaq 0x26ab(%rip), %rsi      # 0x503b
leaq -0x160(%rbp), %rdi
callq 0x20a0
movl %eax, %r15d
testl %eax, %eax
je 0x29db
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdx
movl -0x34(%rbp), %edi
xorl %ecx, %ecx
callq 0x2100
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x322a
leaq -0x22b0(%rbp), %rsi
movl $0x1fff, %edx           # imm = 0x1FFF
movl -0x34(%rbp), %edi
xorl %ecx, %ecx
callq 0x20c0
jmp 0x2a5f
movl $0x200002, %edi         # imm = 0x200002
xorl %esi, %esi
callq 0x21c0
xorl %edi, %edi
xorl %esi, %esi
callq 0x21c0
callq 0x2110
movq %rax, %rdi
callq 0x2280
movq %rax, %rdi
callq 0x2200
movq %rax, %r12
movq -0x140(%rbp), %rcx
movq %rax, %rdi
movl $0x37, %esi
xorl %edx, %edx
callq 0x20d0
movq %r12, %rdi
movl -0x34(%rbp), %esi
callq 0x2130
movq %r12, %rdi
callq 0x2270
movq -0x58(%rbp), %rsi
movl -0x50(%rbp), %edx
movq %r12, %rdi
callq 0x2320
movq -0x30(%rbp), %rdi
xorl %esi, %esi
callq 0x322a
leaq -0x22b0(%rbp), %rsi
movq %r12, %rdi
movl $0x1fff, %edx           # imm = 0x1FFF
callq 0x2060
testl %eax, %eax
jle 0x2abb
movl %eax, %eax
leaq -0xa8(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq (%rax,%rbp), %rdx
addq $-0x22b0, %rdx          # imm = 0xDD50
leaq -0xb8(%rbp), %rdi
leaq -0x22b0(%rbp), %rsi
callq 0x4a42
leaq -0xb8(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x3aa6
movq -0xb8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2ac6
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x21f0
jmp 0x2ac6
movq -0x30(%rbp), %rax
movb $0x1, 0x122(%rax)
movq -0x30(%rbp), %rax
cmpb $0x0, 0x122(%rax)
jne 0x2b68
leaq -0x88(%rbp), %rbx
leaq -0x42b0(%rbp), %r13
leaq -0x98(%rbp), %r14
testl %r15d, %r15d
je 0x2b05
movl $0x1fff, %edx           # imm = 0x1FFF
movl -0x34(%rbp), %edi
movq %r13, %rsi
xorl %ecx, %ecx
callq 0x20c0
jmp 0x2b15
movq %r12, %rdi
movq %r13, %rsi
movl $0x1fff, %edx           # imm = 0x1FFF
callq 0x2060
cltq
movq %rbx, -0x98(%rbp)
leaq (%rax,%rbp), %rdx
addq $-0x42b0, %rdx          # imm = 0xBD50
movq %r14, %rdi
movq %r13, %rsi
callq 0x4a42
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x3aa6
movq -0x98(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2b5b
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21f0
movq -0x30(%rbp), %rax
cmpb $0x0, 0x122(%rax)
je 0x2aec
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b81
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21f0
leaq -0x2a8(%rbp), %rdi
callq 0x2d8c
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x2ba6
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21f0
leaq -0x110(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2bc5
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x21f0
leaq -0x130(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2be4
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x21f0
leaq -0x150(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c03
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x21f0
movq -0x30(%rbp), %rax
addq $0x4288, %rsp           # imm = 0x4288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c82
movq %rax, %r14
movq -0xb8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2cbd
movq -0xa8(%rbp), %rsi
jmp 0x2cf7
jmp 0x2cba
jmp 0x2c82
jmp 0x2cba
jmp 0x2d01
jmp 0x2d06
jmp 0x2d01
jmp 0x2d06
jmp 0x2d01
jmp 0x2d06
jmp 0x2d01
movq %rax, %r14
movq -0xd8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2d3a
movq -0xc8(%rbp), %rsi
jmp 0x2d32
movq %rax, %r14
jmp 0x2d3a
movq %rax, %r14
movq -0xf8(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2d46
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x21f0
jmp 0x2d46
jmp 0x2d01
movq %rax, %r14
jmp 0x2cc6
jmp 0x2cba
movq %rax, %r14
movq -0x30(%rbp), %rdi
callq 0x2d8c
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d15
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x21f0
jmp 0x2d15
movq %rax, %r14
movq -0x98(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2cbd
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x21f0
jmp 0x2cbd
movq %rax, %r14
jmp 0x2d15
movq %rax, %r14
leaq -0x22b0(%rbp), %rdi
callq 0x339c
leaq -0x2a8(%rbp), %rdi
callq 0x2d8c
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x2d3a
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x21f0
leaq -0x160(%rbp), %rdi
callq 0x4134
movq %r14, %rdi
callq 0x22f0