// File: /workspace/github_cpp_makefile_star2_O1/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 -0x68(%rbp), %rdi
movq $0x0, -0x8(%rdi)
leaq -0x70(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
callq 0x1e220
movaps -0x70(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, -0x70(%rbp)
movq 0x38(%r15), %rdi
movups %xmm0, 0x30(%r15)
testq %rdi, %rdi
je 0x1d46c
callq 0x11b2a
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x1d47a
callq 0x11b2a
xorps %xmm0, %xmm0
movaps %xmm0, -0xb0(%rbp)
movq $0x0, -0xa0(%rbp)
leaq 0x72b0(%rip), %rsi      # 0x24746
movq %r12, %rdi
callq 0x176f6
cmpq 0xa0(%r12), %rax
je 0x1d4c8
movq %rax, %r15
leaq 0x20(%rax), %rdi
leaq 0x79b1(%rip), %rsi      # 0x24e67
movl $0x9, %ecx
xorl %edx, %edx
callq 0x8820
cmpq $-0x1, %rax
jne 0x1d4eb
leaq -0xb0(%rbp), %rdi
callq 0x1d986
movl $0x1, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xb0fe
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x7942(%rip), %rsi      # 0x24e56
leaq 0x793d(%rip), %rdx      # 0x24e58
leaq -0x50(%rbp), %rdi
callq 0x120b6
movq 0x20(%r15), %rdx
leaq (%rdx,%r12), %rsi
addq $0x9, %rsi
addq 0x28(%r15), %rdx
leaq -0x80(%rbp), %r14
movq %r14, -0x10(%r14)
leaq -0x90(%rbp), %rdi
callq 0x1e3c6
leaq -0xe8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x1dfb1
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x1d577
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x8520
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1d590
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x8520
leaq 0x78bf(%rip), %rdx      # 0x24e56
leaq -0x50(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x18145
leaq 0x76db(%rip), %rsi      # 0x24c89
leaq -0xc8(%rbp), %rdi
callq 0x1e1e5
leaq -0xb0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
movl $0x1, %ecx
callq 0x1e063
cmpq $0x11, -0xb8(%rbp)
jb 0x1d5f1
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x1d5f1
callq 0x8640
movq 0x17998(%rip), %rdi     # 0x34f90
leaq 0x7872(%rip), %rsi      # 0x24e71
movl $0x12, %edx
callq 0x85b0
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movq 0x17972(%rip), %rdi     # 0x34f90
callq 0x85b0
movq %rax, %rdi
callq 0x82b0
movq %rax, %rbx
leaq 0x784f(%rip), %rsi      # 0x24e84
movl $0x10, %edx
movq %rax, %rdi
callq 0x85b0
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0x85b0
movq %rax, %rdi
callq 0x82b0
movq %rax, %rdi
callq 0x82b0
movq -0xb0(%rbp), %rax
movq %rax, -0x30(%rbp)
movq 0x1791c(%rip), %rbx     # 0x34f90
leaq -0x90(%rbp), %r15
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r13
testq %r13, %r13
je 0x1d6ce
movq -0x30(%rbp), %rax
movq (%rax), %r12
xorl %r14d, %r14d
movb (%r12,%r14), %al
cmpb $0xa, %al
jne 0x1d6b0
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x7796(%rip), %rsi      # 0x24e3f
callq 0x85b0
jmp 0x1d6c6
movb %al, -0x90(%rbp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x85b0
incq %r14
cmpq %r14, %r13
jne 0x1d692
movq %rbx, %rdi
callq 0x82b0
addq $0x20, -0x30(%rbp)
jmp 0x1d67b
jmp 0x1d701
jmp 0x1d701
movq %rax, %rbx
cmpq $0x11, -0xb8(%rbp)
jb 0x1d704
movq -0xc8(%rbp), %rdi
testq %rdi, %rdi
je 0x1d704
callq 0x8640
jmp 0x1d704
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1d722
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x8520
jmp 0x1d722
movq %rax, %rbx
leaq -0xd8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1d779
movq -0xd8(%rbp), %rsi
jmp 0x1d76c
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x1d75b
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x8520
jmp 0x1d75b
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x1d779
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x8520
jmp 0x1d779
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x1d797
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x8520
jmp 0x1d797
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x1d986
jmp 0x1d7eb
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x1d7eb
movq %rbx, %rdi
callq 0x8230
movl $0x8, %edi
callq 0x82c0
movq 0x177aa(%rip), %rcx     # 0x34f70
addq $0x10, %rcx
movq %rcx, (%rax)
movq 0x177c4(%rip), %rsi     # 0x34f98
movq 0x17775(%rip), %rdx     # 0x34f50
movq %rax, %rdi
callq 0x8800
movq %rax, %rbx
callq 0x87e0
movq %rbx, %rdi
callq 0x8830
movq %rax, %rdi
callq 0x9e84
nop