// File: /workspace/github_cpp_makefile_star2_O2/trisolaris233[P]httpc/src/request_parser.hpp
// Function: httpc::RequestParser::ResultType httpc::RequestParser::ParseFormData<char*>(httpc::Request&, char*, char*)
ResultType ParseFormData (
            Request& request, InputIterator begin, InputIterator end
        ) {
            try {
                this->ptr_form_data_ = std::make_shared<FormDataBodyTmp_>();
            } catch(const std::bad_alloc& e) {
                throw e;
            }

            std::vector<std::string> res;
            auto itr = request.FindHeader("Content-Type");
            if (itr == request.HeaderCEnd()) {
                return kBad;
            }
            
            auto pos = itr->value.find("boundary=");
            if (pos == std::string::npos) {
                return kBad;
            }
            std::string src(begin, end),
                        start_boundary(std::string("--") + std::string(
                            itr->value.begin() + pos + 9,
                            itr->value.end()
                        )),
                        end_boundary(start_boundary + "--");
            boost::split(res, src, boost::is_any_of("\r\n"));
            std::cout   << "start_boundary => " << start_boundary << std::endl
                        << "end_boundary => " << end_boundary << std::endl << std::endl;
            bool    void_line_flag = false,
                    boundary_start_flag = false;
            for (const auto& line : res) {
                if (line.empty()) {
                    if (void_line_flag) {
                        if (boundary_start_flag) {
                            
                        }
                    }
                }
                if (line == start_boundary) {

                } else if (line == end_boundary) {

                }
                for (auto chr : line) {
                    if (chr == '\n') {
                        std::cout << "\\n";
                    } else {
                        std::cout << chr;
                    }
                    
                }  
                std::cout << std::endl;    
                
            } 


            // ResultType res = kBad;
            // for (; begin != end; ++begin) {
            //     res = this->ParseFormData_(request, *begin);
            //     if (res == kBad) {
            //         return std::make_pair(res, end);
            //     } else if (res == kGood) {
            //         break;
            //     }
            // }

            // if (!this->ptr_form_data_->filename_.empty()
            //     || this->ptr_form_data_->filetype_.empty()) {
            //     request.files_.emplace_back(
            //         this->ptr_form_data_->filename_
            //     );
            //     request.files_.back().SetType(
            //         this->ptr_form_data_->filetype_
            //     );
            //     this->ptr_form_data_->filename_.clear();
            //     this->ptr_form_data_->filetype_.clear();
            // }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
leaq -0x90(%rbp), %rdi
callq 0x1acb3
addq $0x30, %r15
leaq -0x90(%rbp), %rsi
movq %r15, %rdi
callq 0x1b048
leaq -0x88(%rbp), %rdi
callq 0xfcf6
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
andq $0x0, -0x40(%rbp)
leaq 0x73b2(%rip), %rsi      # 0x21746
movq %r12, %rdi
callq 0x14ab6
cmpq 0xa0(%r12), %rax
je 0x1a3c1
movq %rax, %r15
leaq 0x20(%rax), %rdi
leaq 0x7aba(%rip), %rsi      # 0x21e6e
xorl %edx, %edx
callq 0x8960
cmpq $-0x1, %rax
jne 0x1a3df
leaq -0x50(%rbp), %rdi
callq 0x1a7c2
pushq $0x1
popq %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
leaq -0x80(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x90(%rbp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa388
leaq 0x7a5a(%rip), %rsi      # 0x21e5d
leaq -0x70(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x9dd6
movq 0x20(%r15), %rdx
leaq (%rdx,%r12), %rsi
addq $0x9, %rsi
addq 0x28(%r15), %rdx
leaq -0xb8(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0xc8(%rbp), %rdi
callq 0x1b082
leaq -0xe8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
callq 0x1accf
leaq -0xc8(%rbp), %rdi
callq 0x8280
leaq -0x70(%rbp), %rdi
callq 0x8280
leaq 0x79f3(%rip), %rdx      # 0x21e5d
leaq -0x70(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x1540e
leaq 0x780f(%rip), %rsi      # 0x21c90
leaq -0xa8(%rbp), %rdi
callq 0x1adcc
leaq -0x50(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
pushq $0x1
popq %rcx
callq 0x1ad40
leaq -0xa8(%rbp), %rdi
callq 0x1adfe
movq 0x1cad6(%rip), %rdi     # 0x36f90
leaq 0x79b7(%rip), %rsi      # 0x21e78
callq 0x8530
leaq -0xe8(%rbp), %rsi
movq %rax, %rdi
callq 0x84c0
movq %rax, %rdi
callq 0x82c0
leaq 0x79a7(%rip), %rsi      # 0x21e8b
movq %rax, %rdi
callq 0x8530
leaq -0x70(%rbp), %rsi
movq %rax, %rdi
callq 0x84c0
movq %rax, %rdi
callq 0x82c0
movq %rax, %rdi
callq 0x82c0
movq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
movq 0x1ca79(%rip), %r15     # 0x36f90
leaq 0x7928(%rip), %r12      # 0x21e46
movq -0x38(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0xa708
testb %al, %al
jne 0x1a53f
movq -0x38(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xa708
movq -0x38(%rbp), %rax
movq (%rax), %r13
movq 0x8(%rax), %r14
xorl %ebx, %ebx
cmpq %rbx, %r14
je 0x1a577
movb (%r13,%rbx), %al
cmpb $0xa, %al
jne 0x1a567
movq %r15, %rdi
movq %r12, %rsi
callq 0x8530
jmp 0x1a572
movsbl %al, %esi
movq %r15, %rdi
callq 0x85e0
incq %rbx
jmp 0x1a54c
movq %r15, %rdi
callq 0x82c0
addq $0x20, -0x38(%rbp)
jmp 0x1a51e
jmp 0x1a59b
jmp 0x1a59b
movq %rax, %rbx
leaq -0xa8(%rbp), %rdi
callq 0x1adfe
jmp 0x1a59e
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x8280
jmp 0x1a5ac
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
jmp 0x1a5cd
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x8280
jmp 0x1a5c9
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x8280
jmp 0x1a5d7
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x8280
jmp 0x1a5e8
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x1a7c2
jmp 0x1a637
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x1a637
movq %rbx, %rdi
callq 0x8220
pushq $0x8
popq %rdi
callq 0x82d0
movq 0x1c95e(%rip), %rcx     # 0x36f70
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x1c978(%rip), %rsi     # 0x36f98
movq 0x1c929(%rip), %rdx     # 0x36f50
movq %rax, %rdi
callq 0x8830
movq %rax, %rbx
callq 0x8810
movq %rbx, %rdi
callq 0x8850
movq %rax, %rdi
callq 0x973e
nop