// File: /workspace/github_cpp_makefile_star2_O2/MisakiFx[P]P2PDownload/./httplib.h
// Function: bool httplib::detail::read_content<httplib::Request>(httplib::Stream&, httplib::Request&, unsigned long, bool&, std::function<bool (unsigned long, unsigned long)>)
bool read_content(Stream &strm, T &x, uint64_t payload_max_length,
                    bool &exceed_payload_max_length,
                    Progress progress = Progress()) {
                if (has_header(x.headers, "Content-Length")) {
                    auto len = get_header_value_uint64(x.headers, "Content-Length", 0);
                    if (len == 0) {
                        const auto &encoding =
                            get_header_value(x.headers, "Transfer-Encoding", 0, "");
                        if (!strcasecmp(encoding, "chunked")) {
                            return read_content_chunked(strm, x.body);
                        }
                    }

                    if ((len > payload_max_length) ||
                            // For 32-bit platform
                            (sizeof(size_t) < sizeof(uint64_t) &&
                             len > std::numeric_limits<size_t>::max())) {
                        exceed_payload_max_length = true;
                        skip_content_with_length(strm, len);
                        return false;
                    }

                    return read_content_with_length(strm, x.body, len, progress);
                } else {
                    const auto &encoding =
                        get_header_value(x.headers, "Transfer-Encoding", 0, "");
                    if (!strcasecmp(encoding, "chunked")) {
                        return read_content_chunked(strm, x.body);
                    }
                    return read_content_without_length(strm, x.body);
                }
                return true;
            }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r15
movq %rcx, -0x38(%rbp)
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x80(%rsi), %r12
leaq 0x90ec(%rip), %rsi      # 0x24c6a
movq %r12, %rdi
callq 0x14aa1
testb %al, %al
je 0x1bbf1
movq %r15, -0x30(%rbp)
leaq 0x90d5(%rip), %rsi      # 0x24c6a
movq %r12, %rdi
xorl %edx, %edx
callq 0x1f10c
movq %rax, %r15
testq %rax, %rax
jne 0x1bbd6
leaq 0x96b3(%rip), %rsi      # 0x25261
leaq 0x97f4(%rip), %rcx      # 0x253a9
movq %r12, %rdi
xorl %edx, %edx
callq 0x14b91
leaq 0x96ad(%rip), %rsi      # 0x25273
movq %rax, %rdi
callq 0x85c0
testl %eax, %eax
je 0x1bc80
cmpq %r13, %r15
jbe 0x1bc3c
movq -0x38(%rbp), %rax
movb $0x1, (%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x1f3c7
xorl %ebx, %ebx
jmp 0x1bc6f
leaq 0x9669(%rip), %rsi      # 0x25261
leaq 0x97aa(%rip), %rcx      # 0x253a9
movq %r12, %rdi
xorl %edx, %edx
callq 0x14b91
leaq 0x9663(%rip), %rsi      # 0x25273
movq %rax, %rdi
callq 0x85c0
addq $0xb0, %rbx
testl %eax, %eax
je 0x1bc87
movq %r14, %rdi
movq %rbx, %rsi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f49a
addq $0xb0, %rbx
leaq -0x58(%rbp), %r12
movq %r12, %rdi
movq -0x30(%rbp), %rsi
callq 0x16486
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x1f418
movl %eax, %ebx
leaq -0x58(%rbp), %rdi
callq 0x16248
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0xb0, %rbx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1f180
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x16248
movq %rbx, %rdi
callq 0x8990