// File: 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
subq $0x230, %rsp            # imm = 0x230
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x45630
jmp 0x43501
movq -0x1c8(%rbp), %rdi
addq $0x30, %rdi
leaq -0x38(%rbp), %rsi
callq 0x456a0
leaq -0x38(%rbp), %rdi
callq 0x2afd0
jmp 0x4359d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x43b76
movq -0x40(%rbp), %rdi
callq 0xa280
movq %rax, -0x50(%rbp)
movl $0x8, %edi
callq 0xa350
movq %rax, %rdi
movq %rdi, -0x1d0(%rbp)
movq -0x50(%rbp), %rsi
callq 0x456d0
movq -0x1d0(%rbp), %rdi
movq 0x46a1c(%rip), %rsi     # 0x89f90
movq 0x469b5(%rip), %rdx     # 0x89f30
callq 0xaad0
jmp 0x43b87
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0xaaa0
jmp 0x43598
jmp 0x43b76
leaq -0x68(%rbp), %rdi
callq 0x43c90
movq -0x18(%rbp), %rdi
leaq 0x161a0(%rip), %rsi     # 0x59751
callq 0x313c0
movq %rax, -0x70(%rbp)
movq -0x18(%rbp), %rdi
callq 0x30d50
movq %rax, -0x78(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x30d10
testb $0x1, %al
jne 0x435da
jmp 0x435ed
movl $0x1, -0x4(%rbp)
movl $0x1, -0x7c(%rbp)
jmp 0x43b58
leaq -0x70(%rbp), %rdi
callq 0x31450
movq %rax, %rdi
addq $0x20, %rdi
leaq 0x16a09(%rip), %rsi     # 0x5a00d
xorl %eax, %eax
movl %eax, %edx
callq 0xac70
movq %rax, -0x88(%rbp)
cmpq $-0x1, -0x88(%rbp)
jne 0x43631
movl $0x1, -0x4(%rbp)
movl $0x1, -0x7c(%rbp)
jmp 0x43b58
movq -0x20(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x1e0(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x1d8(%rbp)
callq 0xab40
movq -0x1e8(%rbp), %rsi
movq -0x1e0(%rbp), %rdx
movq -0x1d8(%rbp), %rcx
leaq -0xa8(%rbp), %rdi
callq 0x31550
jmp 0x4367d
leaq -0xa9(%rbp), %rdi
callq 0xa740
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0xab40
movq -0x1f0(%rbp), %rdx
leaq 0x16952(%rip), %rsi     # 0x59ffc
leaq -0xf0(%rbp), %rdi
callq 0xf9c0
jmp 0x436b8
leaq -0x70(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0x31450
movq %rax, %rdi
addq $0x20, %rdi
callq 0xa680
movq %rax, -0x130(%rbp)
movq -0x88(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x457e0
movq %rax, -0x128(%rbp)
leaq -0x128(%rbp), %rdi
movl $0x9, %esi
callq 0x457e0
movq -0x200(%rbp), %rdi
movq %rax, -0x120(%rbp)
callq 0x31450
movq %rax, %rdi
addq $0x20, %rdi
callq 0xabd0
movq %rax, -0x138(%rbp)
leaq -0x139(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0xab40
movq -0x1f8(%rbp), %rcx
movq -0x120(%rbp), %rsi
movq -0x138(%rbp), %rdx
leaq -0x118(%rbp), %rdi
callq 0x45820
jmp 0x43762
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x45710
jmp 0x4377e
leaq -0x118(%rbp), %rdi
callq 0xa450
leaq -0x139(%rbp), %rdi
callq 0xa740
leaq -0xf0(%rbp), %rdi
callq 0xa450
leaq -0xf1(%rbp), %rdi
callq 0xa740
leaq 0x16847(%rip), %rdx     # 0x59ffc
leaq -0x160(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x32f50
jmp 0x437ca
leaq 0x1656e(%rip), %rsi     # 0x59d3f
leaq -0x178(%rbp), %rdi
callq 0x45970
jmp 0x437df
leaq -0x68(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0x178(%rbp), %rdx
movl $0x1, %ecx
callq 0x458a0
jmp 0x437fd
leaq -0x178(%rbp), %rdi
callq 0x459c0
movq 0x46778(%rip), %rdi     # 0x89f88
leaq 0x16800(%rip), %rsi     # 0x5a017
callq 0xa6a0
movq %rax, -0x208(%rbp)
jmp 0x43825
movq -0x208(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xa600
movq %rax, -0x210(%rbp)
jmp 0x43841
movq -0x210(%rbp), %rdi
movq 0x466c1(%rip), %rsi     # 0x89f10
callq 0xa720
movq %rax, -0x218(%rbp)
jmp 0x4385d
movq -0x218(%rbp), %rdi
leaq 0x167bf(%rip), %rsi     # 0x5a02a
callq 0xa6a0
movq %rax, -0x220(%rbp)
jmp 0x43879
movq -0x220(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xa600
movq %rax, -0x228(%rbp)
jmp 0x43895
movq -0x228(%rbp), %rdi
movq 0x4666d(%rip), %rsi     # 0x89f10
callq 0xa720
movq %rax, -0x230(%rbp)
jmp 0x438b1
movq -0x230(%rbp), %rdi
movq 0x46651(%rip), %rsi     # 0x89f10
callq 0xa720
jmp 0x438c6
movb $0x0, -0x179(%rbp)
movb $0x0, -0x17a(%rbp)
leaq -0x68(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x188(%rbp), %rdi
callq 0x44760
movq %rax, -0x190(%rbp)
movq -0x188(%rbp), %rdi
callq 0x445a0
movq %rax, -0x198(%rbp)
leaq -0x190(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x45a10
testb $0x1, %al
jne 0x43921
jmp 0x43b30
leaq -0x190(%rbp), %rdi
callq 0x44cc0
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rdi
callq 0xaab0
testb $0x1, %al
jne 0x43949
jmp 0x43a25
testb $0x1, -0x179(%rbp)
je 0x43a23
testb $0x1, -0x17a(%rbp)
je 0x43a21
jmp 0x43a21
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xa9(%rbp), %rdi
callq 0xa740
jmp 0x43b6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x439d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x439b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x118(%rbp), %rdi
callq 0xa450
leaq -0x139(%rbp), %rdi
callq 0xa740
leaq -0xf0(%rbp), %rdi
callq 0xa450
leaq -0xf1(%rbp), %rdi
callq 0xa740
jmp 0x43b4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43b3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43b32
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x459c0
jmp 0x43b32
jmp 0x43a23
jmp 0x43a25
movq -0x1a0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x12ee0
testb $0x1, %al
jne 0x43a3e
jmp 0x43a40
jmp 0x43a5d
movq -0x1a0(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x12ee0
testb $0x1, %al
jne 0x43a59
jmp 0x43a5b
jmp 0x43a5b
jmp 0x43a5d
movq -0x1a0(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x1a8(%rbp), %rdi
callq 0xa680
movq %rax, -0x1b0(%rbp)
movq -0x1a8(%rbp), %rdi
callq 0xabd0
movq %rax, -0x1b8(%rbp)
leaq -0x1b0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x39a40
testb $0x1, %al
jne 0x43aaa
jmp 0x43b08
leaq -0x1b0(%rbp), %rdi
callq 0x39d80
movb (%rax), %al
movb %al, -0x1b9(%rbp)
movsbl -0x1b9(%rbp), %eax
cmpl $0xa, %eax
jne 0x43ae1
movq 0x464b7(%rip), %rdi     # 0x89f88
leaq 0x1650d(%rip), %rsi     # 0x59fe5
callq 0xa6a0
jmp 0x43adf
jmp 0x43af8
movsbl -0x1b9(%rbp), %esi
movq 0x46499(%rip), %rdi     # 0x89f88
callq 0xa7f0
jmp 0x43af6
jmp 0x43af8
jmp 0x43afa
leaq -0x1b0(%rbp), %rdi
callq 0x37dd0
jmp 0x43a91
movq 0x46479(%rip), %rdi     # 0x89f88
movq 0x463fa(%rip), %rsi     # 0x89f10
callq 0xa720
jmp 0x43b1d
jmp 0x43b1f
leaq -0x190(%rbp), %rdi
callq 0x45a50
jmp 0x43905
ud2
leaq -0x160(%rbp), %rdi
callq 0xa450
leaq -0xd0(%rbp), %rdi
callq 0xa450
leaq -0xa8(%rbp), %rdi
callq 0xa450
jmp 0x43b6d
leaq -0x68(%rbp), %rdi
callq 0x43ff0
movl -0x4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x43ff0
movq -0x40(%rbp), %rdi
callq 0xab10
movq %rax, %rdi
callq 0xed90
nopw (%rax,%rax)