// File: /workspace/github_cpp_makefile_star2_O3/trisolaris233[P]httpc/src/request_parser.hpp
// Function: httpc::RequestParser::ResultType httpc::RequestParser::ParseBody<char*>(httpc::Request&, char*, char*)
ResultType ParseBody(
            Request& request_, InputIterator begin, InputIterator end
        ) {
            // debug().dg(std::string(begin, end)).lf();
            bool flag = false;
            for (auto itr = begin; itr != end; ++itr) {
                if (*itr != '\r' && *itr != '\n') {
                    std::cout << *itr;
                } else if (*itr == '\r') {
                    std::cout << "\\r";
                    flag = true;
                } else {
                    if (flag) {
                        flag = false;
                    }
                    std::cout << "\\n" << std::endl;
                }
            }

            auto itr = request_.FindHeader("Content-Type");
            if (itr != request_.HeaderCEnd()) {
                auto pos = itr->value.find_first_of(';');
                std::string content_type(std::move(itr->value.substr(0, pos)));
                
                if (content_type == "multipart/form-data") {
                    if (pos != std::string::npos) {
                        std::string boundary(
                            std::move(
                                itr->value.substr(
                                    itr->value.find_first_of('=', pos + 1) + 1
                                )
                            )
                        );
                        std::string str(begin, end), tmp;
                        // bool flag = false;
                        bool start_flag = false;
                        bool flag = false;
                        auto metadata_line = 0;
                        std::vector<std::string> metadatas;
                        // std::string content;
                        // debug().dg("boundary => ").dg(boundary).lf();
                        std::string start_boundary("--" + boundary),
                                    end_boundary("--" + boundary + "--\r");

                        for (; begin != end; ++begin) {
                            if (*begin == '\r' && !start_flag) {
                                flag = true;
                                continue;
                            }
                            if (*begin == '\n') {
                                flag = false;
                                if (tmp == start_boundary) {
                                    tmp.clear();
                                    metadata_line = 0;
                                    metadatas.clear();
                                    start_flag = true;
                                    continue;
                                } else if (tmp == end_boundary) {
                                    tmp.clear();
                                    metadata_line = 0;
                                    metadatas.clear();
                                    start_flag = false;
                                    continue;
                                } else {
                                    if (start_flag) {
                                        if (metadata_line < 2) {
                                            metadatas.emplace_back(tmp);
                                            metadata_line++;
                                        } else if (metadata_line == 2) {
                                            std::string str(metadatas[0]), token_to_find("filename=");
                                            auto pos_token = str.find(token_to_find);
                                            if (pos_token == std::string::npos 
                                                || pos_token + token_to_find.length() >= str.length()) {
                                                request_.file_recv_successfully_flag_ = false;
                                                request_.file_recv_complete_flag_ = true;
                                                return kBad;
                                            }
                                            std::string filename_with_quote_flag(
                                                std::move(
                                                    str.substr(pos_token + token_to_find.length() + 1)
                                                )
                                            );
                                            request_.files_.emplace_back(
                                                std::string(
                                                    filename_with_quote_flag.substr(
                                                        1, 
                                                        filename_with_quote_flag.find_first_of(2, '"') 
                                                    )
                                                )
                                            );
                                            // flag = true;
                                            // std::string content_type(std::move(metadatas[1].find()))
                                            auto content_type_pos = metadatas[1].find_first_of(':');
                                            if (content_type_pos == std::string::npos
                                                || content_type_pos + 1 >= metadatas[1].length()) {
                                                request_.file_recv_successfully_flag_ = false;
                                                request_.file_recv_complete_flag_ = true;
                                                return kBad;
                                            }
                                            std::string content_type_tmp(std::move(metadatas[1].substr(content_type_pos + 2)));
                                            request_.files_.back().SetType(std::move(content_type_tmp.substr(1, content_type_tmp.length() - 1)));
                                            metadata_line++;
                                            // start_flag = false;
                                        } else {
                                            tmp.push_back(*begin);
                                            request_.files_.back().AppendContent(tmp);
                                        }
                                    }
                                    tmp.clear();
                                }
                            } else {
                                // debug().dg(static_cast<int>(*begin)).lf();
                                tmp.push_back(*begin);
                            }
                        }
                    } else {
                        request_.file_recv_successfully_flag_ = false;
                        request_.file_recv_complete_flag_ = true;
                        return kBad;
                    }
                }
            }
            request_.file_recv_successfully_flag_ = 
            request_.file_recv_complete_flag_ = true;
            return kGood;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, -0x38(%rbp)
movq %rcx, -0x60(%rbp)
movq %rdx, -0x108(%rbp)
cmpq %rcx, %rdx
je 0x1c553
movq 0x18acd(%rip), %r12     # 0x34f90
leaq 0x8975(%rip), %r13      # 0x24e3f
leaq 0x896b(%rip), %rbx      # 0x24e3c
leaq -0x100(%rbp), %r15
movq -0x108(%rbp), %r14
movzbl (%r14), %eax
cmpl $0xa, %eax
je 0x1c4fa
cmpl $0xd, %eax
jne 0x1c534
movl $0x2, %edx
movq %r12, %rdi
movq %rbx, %rsi
jmp 0x1c545
movl $0x2, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x85b0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x8500
movsbl %al, %esi
movq %r12, %rdi
callq 0x8050
movq %rax, %rdi
callq 0x83b0
jmp 0x1c54a
movb %al, -0x100(%rbp)
movl $0x1, %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x85b0
incq %r14
cmpq -0x60(%rbp), %r14
jne 0x1c4df
movq -0x38(%rbp), %r14
movq 0x98(%r14), %rbx
movq 0xa0(%r14), %r12
cmpq %r12, %rbx
je 0x1c595
leaq 0x81d5(%rip), %r15      # 0x24746
movq %rbx, %rdi
movq %r15, %rsi
callq 0x81a0
movq 0xa0(%r14), %rcx
testl %eax, %eax
je 0x1c59a
addq $0x40, %rbx
cmpq %rcx, %rbx
jne 0x1c571
jmp 0x1c652
movq %rbx, %rcx
jmp 0x1c59d
movq %rbx, %r12
cmpq %rcx, %r12
je 0x1c652
addq $0x20, %r12
movq %r12, %rdi
movl $0x3b, %esi
xorl %edx, %edx
callq 0x8680
movq %rax, %rbx
leaq -0xe0(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0x8550
leaq -0xf0(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%r15), %rax
leaq -0xd0(%rbp), %rcx
cmpq %rcx, %rax
je 0x1c607
movq %rcx, %r15
movq %rax, -0x100(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0xf0(%rbp)
jmp 0x1c611
movq %rcx, %r15
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq -0xd8(%rbp), %rax
leaq -0x100(%rbp), %rdi
movq %rax, 0x8(%rdi)
leaq 0x8818(%rip), %rsi      # 0x24e42
callq 0x81a0
testl %eax, %eax
je 0x1c670
movq -0x100(%rbp), %rdi
cmpq %r14, %rdi
je 0x1c64e
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0x38(%rbp), %r14
movw $0x101, 0x121(%r14)     # imm = 0x101
xorl %eax, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $-0x1, %rbx
je 0x1c6d1
incq %rbx
movq %r12, %rdi
movl $0x3d, %esi
movq %rbx, %rdx
callq 0x8680
leaq 0x1(%rax), %rdx
leaq -0x188(%rbp), %rdi
movq %r12, %rsi
movq $-0x1, %rcx
callq 0x8550
movq %r15, -0xe0(%rbp)
leaq -0x178(%rbp), %rcx
movq -0x10(%rcx), %rax
cmpq %rcx, %rax
je 0x1c6e3
movq %rax, -0xe0(%rbp)
movq -0x178(%rbp), %rax
movq %rax, -0xd0(%rbp)
jmp 0x1c6ea
movq -0x38(%rbp), %rax
movw $0x1, 0x121(%rax)
jmp 0x1cd65
movups (%rcx), %xmm0
movups %xmm0, (%r15)
leaq -0x188(%rbp), %rdi
movq 0x8(%rdi), %rax
movq %rax, -0xd8(%rbp)
movq %rcx, (%rdi)
movq -0x108(%rbp), %r15
movq %r15, %rsi
movq -0x60(%rbp), %rdx
callq 0xb088
leaq -0x70(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb $0x0, (%rcx)
movq %rax, -0x90(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
leaq 0x871b(%rip), %rsi      # 0x24e56
leaq -0x1d0(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0x1d3af
leaq 0x8701(%rip), %rsi      # 0x24e56
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0x1d3af
leaq 0x86ea(%rip), %rsi      # 0x24e59
leaq -0xc0(%rbp), %rdi
callq 0x88d0
leaq -0x138(%rbp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1c7a8
movq %rdx, -0x148(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x138(%rbp)
jmp 0x1c7ae
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, -0x140(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq -0xb0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1c7e7
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x8520
movb $0x1, %bl
cmpq -0x60(%rbp), %r15
je 0x1ccb3
movq -0x38(%rbp), %rax
addq $0xd0, %rax
movq %rax, -0x1b0(%rbp)
leaq -0x198(%rbp), %r13
xorl %ebx, %ebx
movl $0x0, -0x2c(%rbp)
movzbl (%r15), %eax
cmpl $0xa, %eax
je 0x1c83d
cmpl $0xd, %eax
jne 0x1c82c
testb $0x1, -0x2c(%rbp)
je 0x1cc9d
movsbl %al, %esi
leaq -0x80(%rbp), %rdi
callq 0x8480
jmp 0x1cc9d
movq %rbx, %r14
movq %r15, %r12
movq -0x78(%rbp), %rbx
cmpq -0x1c8(%rbp), %rbx
jne 0x1c86f
movq -0x80(%rbp), %r15
testq %rbx, %rbx
je 0x1c8d6
movq -0x1d0(%rbp), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x8540
testl %eax, %eax
je 0x1c8d6
cmpq -0x140(%rbp), %rbx
jne 0x1c89f
movq -0x80(%rbp), %r15
testq %rbx, %rbx
je 0x1c933
movq -0x148(%rbp), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x8540
testl %eax, %eax
je 0x1c933
testb $0x1, -0x2c(%rbp)
movq %r12, %r15
movq %r14, %rbx
je 0x1cc8e
cmpl $0x1, %ebx
leaq -0x158(%rbp), %r14
jg 0x1c992
leaq -0xa0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x1d442
incl %ebx
jmp 0x1cc8e
movq $0x0, -0x78(%rbp)
movb $0x0, (%r15)
movq -0xa0(%rbp), %rbx
movq -0x98(%rbp), %r14
movb $0x1, %al
movl %eax, -0x2c(%rbp)
cmpq %rbx, %r14
je 0x1c929
leaq 0x10(%rbx), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x1c912
movq (%r15), %rsi
incq %rsi
callq 0x8520
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x1c8fe
movq %rbx, -0x98(%rbp)
movq %r12, %r15
xorl %ebx, %ebx
jmp 0x1cc9d
movq $0x0, -0x78(%rbp)
movb $0x0, (%r15)
movq -0xa0(%rbp), %rbx
movq -0x98(%rbp), %r14
cmpq %rbx, %r14
je 0x1c981
leaq 0x10(%rbx), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x1c96a
movq (%r15), %rsi
incq %rsi
callq 0x8520
leaq 0x20(%r15), %rax
addq $0x10, %r15
cmpq %r14, %r15
movq %rax, %r15
jne 0x1c956
movq %rbx, -0x98(%rbp)
movl $0x0, -0x2c(%rbp)
xorl %ebx, %ebx
movq %r12, %r15
jmp 0x1cc9d
cmpl $0x2, %ebx
jne 0x1ca69
movq -0xa0(%rbp), %rax
leaq -0xb0(%rbp), %rcx
movq %rcx, -0xc0(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0xc0(%rbp), %rdi
callq 0xb088
leaq -0x118(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x128(%rbp), %rdi
leaq 0x847b(%rip), %rsi      # 0x24e5d
leaq 0x847d(%rip), %rdx      # 0x24e66
callq 0x11e6e
movq -0x128(%rbp), %rsi
movq -0x120(%rbp), %rcx
leaq -0xc0(%rbp), %rdi
xorl %edx, %edx
callq 0x8820
cmpq $-0x1, %rax
je 0x1ca98
addq -0x120(%rbp), %rax
cmpq -0xb8(%rbp), %rax
jae 0x1ca98
incq %rax
leaq -0x58(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
movq %rax, %rdx
movq $-0x1, %rcx
callq 0x8550
movq %r14, -0x168(%rbp)
movq -0x58(%rbp), %rax
leaq -0x48(%rbp), %rcx
cmpq %rcx, %rax
je 0x1cab2
movq %rax, -0x168(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x158(%rbp)
jmp 0x1cab9
leaq -0x80(%rbp), %rdi
movl $0xa, %esi
callq 0x8480
movq -0x38(%rbp), %rax
movq 0xd8(%rax), %rdi
addq $-0x40, %rdi
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
callq 0x81b0
jmp 0x1cc8e
movq -0x38(%rbp), %rax
movw $0x1, 0x121(%rax)
movl $0x2, %r12d
xorl %ebx, %ebx
jmp 0x1cc3f
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq -0x50(%rbp), %rax
movq %rax, -0x160(%rbp)
movl $0x22, %edx
leaq -0x168(%rbp), %r12
movq %r12, %rdi
movl $0x2, %esi
callq 0x8680
movl $0x1, %edx
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rcx
callq 0x8550
movq -0x1b0(%rbp), %rdi
movq %rbx, %rsi
callq 0x1d49a
leaq -0x1a8(%rbp), %r12
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x1cb23
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0xa0(%rbp), %rdi
addq $0x20, %rdi
movl $0x3a, %esi
xorl %edx, %edx
callq 0x8680
cmpq $-0x1, %rax
je 0x1cb90
leaq 0x1(%rax), %rcx
movq -0xa0(%rbp), %rsi
cmpq 0x28(%rsi), %rcx
jae 0x1cb90
addq $0x20, %rsi
addq $0x2, %rax
movq %r12, %rdi
movq %rax, %rdx
movq $-0x1, %rcx
callq 0x8550
leaq -0x48(%rbp), %rcx
movq %rcx, -0x58(%rbp)
movq -0x1a8(%rbp), %rax
cmpq %r13, %rax
je 0x1cba7
movq %rax, -0x58(%rbp)
movq -0x198(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x1cbaf
movq -0x38(%rbp), %rax
movw $0x1, 0x121(%rax)
movl $0x2, %r12d
xorl %ebx, %ebx
jmp 0x1cc24
movups (%r13), %xmm0
movups %xmm0, (%rcx)
movq -0x1a0(%rbp), %rcx
movq %rcx, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq 0xd8(%rax), %rbx
decq %rcx
movl $0x1, %edx
movq %r12, %rdi
leaq -0x58(%rbp), %rsi
callq 0x8550
addq $-0x20, %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8310
movq -0x1a8(%rbp), %rdi
cmpq %r13, %rdi
je 0x1cc03
movq -0x198(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x1cc1c
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x8520
movb $0x1, %bl
movl $0x3, %r12d
movq -0x168(%rbp), %rdi
cmpq %r14, %rdi
je 0x1cc3f
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x1cc61
movq -0x118(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x1cc83
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x8520
testb %bl, %bl
movq %r12, %rbx
je 0x1cd8a
movq $0x0, -0x78(%rbp)
movq -0x80(%rbp), %rax
movb $0x0, (%rax)
incq %r15
cmpq -0x60(%rbp), %r15
jne 0x1c814
movb $0x1, %bl
leaq -0xf0(%rbp), %r14
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rax
cmpq %rax, %rdi
je 0x1ccd5
movq -0x138(%rbp), %rsi
incq %rsi
callq 0x8520
leaq -0x1c0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1ccf4
movq -0x1c0(%rbp), %rsi
incq %rsi
callq 0x8520
leaq -0xa0(%rbp), %rdi
callq 0x1d4e0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x1cd19
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0x188(%rbp), %rdi
leaq -0x178(%rbp), %rax
cmpq %rax, %rdi
je 0x1cd3b
movq -0x178(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x1cd5d
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x8520
testb %bl, %bl
jne 0x1c633
movq -0x100(%rbp), %rdi
cmpq %r14, %rdi
je 0x1cd80
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x8520
movl $0x1, %eax
jmp 0x1c65e
xorl %ebx, %ebx
jmp 0x1ccac
movq %rax, %rbx
movq -0x1a8(%rbp), %rdi
cmpq %r13, %rdi
je 0x1cdb8
movq -0x198(%rbp), %rsi
incq %rsi
callq 0x8520
jmp 0x1cdb8
jmp 0x1cdb5
jmp 0x1cdd3
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x1cdd6
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x8520
jmp 0x1cdd6
movq %rax, %rbx
movq -0x168(%rbp), %rdi
leaq -0x158(%rbp), %rax
cmpq %rax, %rdi
je 0x1cdfd
movq -0x158(%rbp), %rsi
incq %rsi
callq 0x8520
jmp 0x1cdfd
movq %rax, %rbx
movq -0x128(%rbp), %rdi
leaq -0x118(%rbp), %rax
cmpq %rax, %rdi
je 0x1ce24
movq -0x118(%rbp), %rsi
incq %rsi
callq 0x8520
jmp 0x1ce24
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x1ce83
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x8520
jmp 0x1ce83
jmp 0x1ce80
movq %rax, %rbx
leaq -0xb0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1cea5
movq -0xb0(%rbp), %rsi
jmp 0x1ce9d
movq %rax, %rbx
jmp 0x1cea5
movq %rax, %rbx
jmp 0x1cec4
movq %rax, %rbx
jmp 0x1cf0b
movq %rax, %rbx
jmp 0x1cf2d
movq %rax, %rbx
movq -0x148(%rbp), %rdi
leaq -0x138(%rbp), %rax
cmpq %rax, %rdi
je 0x1cea5
movq -0x138(%rbp), %rsi
incq %rsi
callq 0x8520
leaq -0x1c0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1cec4
movq -0x1c0(%rbp), %rsi
incq %rsi
callq 0x8520
leaq -0xa0(%rbp), %rdi
callq 0x1d4e0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x1cee9
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0x188(%rbp), %rdi
leaq -0x178(%rbp), %rax
cmpq %rax, %rdi
je 0x1cf0b
movq -0x178(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x1cf2d
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x1cf4f
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x8520
movq %rbx, %rdi
callq 0x8830
nop