// File: kztomita[P]http-dump/./hpack_encoder.h
// Function: std::vector<unsigned char, std::allocator<unsigned char>> hpack::hpack_encoder::encode<std::vector<unsigned char, std::allocator<unsigned char>>>(std::vector<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&)
Container encode(const header_list& headers) {
    Container buffer;

    for (const auto& h : headers) {
      buffer.push_back(0x00);    // Literal Header Field without Indexing

      // Name Length
      encode_integer(0x00, h.first.size(), 7, buffer);

      // Name String
      std::copy(h.first.begin(), h.first.end(), std::back_inserter(buffer));

      // Value Length
      encode_integer(0x00, h.second.size(), 7, buffer);

      // Value String
      std::copy(h.second.begin(), h.second.end(), std::back_inserter(buffer));
    }

    return buffer;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0xa8(%rbp)
movq %rdi, %rax
movq %rax, -0xa0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
callq 0x53750
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x395e0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x39610
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x39640
testb $0x1, %al
jne 0x5d939
jmp 0x5da9d
leaq -0x30(%rbp), %rdi
callq 0x39680
movq -0xa8(%rbp), %rdi
movq %rax, -0x40(%rbp)
movb $0x0, -0x41(%rbp)
leaq -0x41(%rbp), %rsi
callq 0x5deb0
jmp 0x5d95c
movq -0x40(%rbp), %rdi
callq 0xd440
movq -0xa8(%rbp), %rcx
movl %eax, %esi
xorl %edi, %edi
movl $0x7, %edx
callq 0x5dee0
jmp 0x5d97c
movq -0x40(%rbp), %rdi
callq 0xd330
movq %rax, -0x60(%rbp)
movq -0x40(%rbp), %rdi
callq 0xdf30
movq -0xa8(%rbp), %rdi
movq %rax, -0x68(%rbp)
callq 0x5db40
movq %rax, -0xb0(%rbp)
jmp 0x5d9ab
movq -0xb0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rdx
callq 0x5dfb0
movq %rax, -0xb8(%rbp)
jmp 0x5d9d0
movq -0xb8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x40(%rbp), %rdi
addq $0x20, %rdi
callq 0xd440
movq -0xa8(%rbp), %rcx
movl %eax, %esi
xorl %edi, %edi
movl $0x7, %edx
callq 0x5dee0
jmp 0x5d9ff
movq -0x40(%rbp), %rdi
addq $0x20, %rdi
callq 0xd330
movq %rax, -0x80(%rbp)
movq -0x40(%rbp), %rdi
addq $0x20, %rdi
callq 0xdf30
movq -0xa8(%rbp), %rdi
movq %rax, -0x88(%rbp)
callq 0x5db40
movq %rax, -0xc0(%rbp)
jmp 0x5da39
movq -0xc0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0x5dfb0
movq %rax, -0xc8(%rbp)
jmp 0x5da67
movq -0xc8(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x396f0
jmp 0x5d923
movq -0xa8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
callq 0x18ac0
jmp 0x5dac3
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x5dab3
movq -0xa8(%rbp), %rdi
callq 0x18ac0
movq -0xa0(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0xd990
nopl (%rax)