// File: /workspace/github_cpp_makefile_star2_O1/kztomita[P]http-dump/httpv2.cc
// Function: httpv2::get(boost::asio::ip::address const&, unsigned short, http_scheme, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::list<std::unique_ptr<http_header, std::default_delete<http_header>>, std::allocator<std::unique_ptr<http_header, std::default_delete<http_header>>>> const&)
http_response httpv2::get(const boost::asio::ip::address& ip, uint16_t port, http_scheme scheme, const std::string& host, const std::string& path, const http_header_list& req_headers) {
  if (scheme != http_scheme::https) {
    throw std::invalid_argument("http scheme not supported on http/2.");
  }

  ssl_stream ssl_stream_wrapper(g_verify_cert, true);
  ssl_stream_wrapper.set_host(host);
  ssl_stream_wrapper.connect(ip, port);

  asio::ssl::stream<asio::ip::tcp::socket>& stream = ssl_stream_wrapper.inner_stream();

  const unsigned char* alpn_data = nullptr;
  unsigned int alpn_len = 0;
  SSL_get0_alpn_selected(stream.native_handle(), &alpn_data, &alpn_len);
  if (alpn_len == 0) {
    throw std::runtime_error("http/2 is not selected.");
  }
  if (std::string_view(reinterpret_cast<const char*>(alpn_data), alpn_len) != "h2") {
    throw std::runtime_error("http/2 is not selected.");
  }

  std::ostringstream request_stream;
  request_stream << "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n";
  asio::write(stream, asio::buffer(request_stream.str()));

  // SETTINGS送信
#if 1
  send_http2_settings(stream);
#else
  // パラメータを指定する場合
  std::vector<settings_parameter> params{
    {SETTINGS_MAX_CONCURRENT_STREAMS, 10},
    {SETTINGS_MAX_FRAME_SIZE, 16384},
  };
  send_http2_settings(stream, params);
#endif

  // SETTINGS受信
  bool rcv_settings = false;
  bool rcv_settings_ack = false;
  while (!rcv_settings || !rcv_settings_ack) {
    auto frame = read_http2_frame(stream);
    if (frame.type() == http2_frame_header::TYPE_SETTINGS) {
      if (frame.flags() & HTTP2_SETTINGS_ACK_FLAG) {
        rcv_settings_ack = true;
      } else {
        rcv_settings = true;
        // SETTINGS ACK送信
        send_http2_settings_ack(stream);
      }
    }
  }

  uint32_t stream_id = 1;

  // HEADERS送信
  send_http2_headers(stream, stream_id, host, path, req_headers);

  // HEADERS受信
  // Header Block FragmentからHeader Blockを構築
  http2_frame::payload_type header_block;
  auto headers_frame = read_http2_frame(stream);
  if (headers_frame.type() != http2_frame_header::TYPE_HEADERS) {
    throw std::runtime_error("The frame which isn't a HEADERS frame was received.");
  }
  std::size_t fragment_offset = 0;
  std::size_t pad_length = 0;
  if (headers_frame.flags() & HTTP2_HEADERS_PADDED_FLAG) {
    pad_length = headers_frame.payload()[fragment_offset];
    fragment_offset += 1;
  }
  if (headers_frame.flags() & HTTP2_HEADERS_PRIORITY_FLAG) {
    fragment_offset += 5;
  }
  header_block.insert(header_block.end(),
                      headers_frame.payload().begin() + fragment_offset,
                      headers_frame.payload().end() - pad_length);

  if (!(headers_frame.flags() & HTTP2_HEADERS_END_HEADERS_FLAG)) {
    // CONTINUATIONが続く
    while (true) {
      auto continuation_frame = read_http2_frame(stream);
      if (continuation_frame.type() != http2_frame_header::TYPE_CONTINUATION) {
        throw std::runtime_error("The frame which isn't a CONTINUATION frame was received.");
      }

      header_block.insert(header_block.end(),
                          continuation_frame.payload().begin(),
                          continuation_frame.payload().end());

      if (continuation_frame.flags() & HTTP2_CONTINUATION_END_HEADERS_FLAG) {
        break;
      }
    }
  }

  hpack::hpack_decoder decoder(&header_block[0], header_block.size());
  hpack::decoding_context context;
  auto header_list = decoder.decode(context);

  debug_message("HPACK Dynamic Table");
  debug_dump(*context.dynamic_table);
  debug_message("");

  debug_message("HPACK Decoded header list");
  for (const auto& h : header_list) {
    debug_message(h.first + " " + h.second);
  }
  debug_message("");

  // DATA受信
  http_response::payload_type response_body;

  while (true) {
    auto data_frame = read_http2_frame(stream);
    if (data_frame.type() != http2_frame_header::TYPE_DATA) {
      throw std::runtime_error("The frame which isn't a DATA frame was received.");
    }
    if (data_frame.flags() & HTTP2_DATA_PADDED_FLAG) {
      throw std::runtime_error("padding flag not supported.");
    }
    response_body.insert(response_body.end(), data_frame.payload().begin(), data_frame.payload().end());
    if (data_frame.flags() & HTTP2_DATA_END_STREAM_FLAG) {
      break;
    }

    // WINDOW UPDATE送信
    send_http2_window_update(stream, stream_id, data_frame.length());
    send_http2_window_update(stream, 0, data_frame.length());         // connection level
  }

  // GOAWAY送信
  send_http2_goaway(stream, stream_id);

  http_response r;

  auto status_header = std::find_if(header_list.begin(), header_list.end(),
                                    [] (const hpack::header_type& h) {
                                      return h.first == ":status";
                                    });
  if (status_header != header_list.end()) {
    r.code_ = std::stoi(status_header->second);
  } else {
    std::runtime_error("status header not found.");
  }

  for (const auto& h : header_list) {
    if (h.first == ":status") {
      continue;
    }
    r.headers_.push_back(std::make_unique<http_header>(convert_header_name(h.first), h.second));
  }

  swap(r.payload_, response_body);

  return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %rdi, 0x38(%rsp)
cmpl $0x1, %r8d
jne 0x257db
movq %r9, %r15
movl %ecx, %ebp
movq %rdx, %rbx
movzbl 0x23ae5(%rip), %esi     # 0x48748
leaq 0x130(%rsp), %r14
movq %r14, %rdi
movl $0x1, %edx
callq 0x2b742
movq %r14, %rdi
movq %r15, %rsi
callq 0x2bafc
movzwl %bp, %edx
leaq 0x130(%rsp), %rdi
movq %rbx, %rsi
callq 0x2bb06
leaq 0x130(%rsp), %rdi
callq 0x2bc54
movq %rax, %r14
leaq 0x100(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0x94(%rsp), %rdx
movl $0x0, (%rdx)
movq 0x50(%rax), %rdi
callq 0xb3b0
movl 0x94(%rsp), %edx
cmpq $0x2, %rdx
jne 0x25787
movq 0x100(%rsp), %rdi
leaq 0x10793(%rip), %rsi     # 0x3547f
callq 0xb650
testl %eax, %eax
jne 0x257a9
leaq 0x190(%rsp), %rdi
callq 0xb8c0
leaq 0xf58b(%rip), %rsi      # 0x34298
leaq 0x190(%rsp), %rdi
movl $0x18, %edx
callq 0xb730
leaq 0x198(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0xba80
movups 0x8(%rsp), %xmm0
leaq 0x70(%rsp), %rsi
movups %xmm0, (%rsi)
leaq 0x40(%rsp), %rcx
movl $0x0, (%rcx)
movb $0x0, 0x4(%rcx)
leaq 0x2151c(%rip), %rax     # 0x46270
movq %rax, 0x8(%rcx)
leaq 0xb0(%rsp), %rdx
movq %rsi, (%rdx)
movq %r14, %rdi
callq 0x26645
cmpb $0x1, 0x44(%rsp)
je 0x2580d
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x24d91
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq %r14, %rdi
callq 0x25ba7
xorl %ebx, %ebx
leaq 0xb0(%rsp), %rbp
xorl %r12d, %r12d
movq %rbp, %rdi
movq %r14, %rsi
callq 0x25bff
cmpb $0x4, 0xb3(%rsp)
jne 0x24dd7
movb $0x1, %r13b
testb $0x1, 0xb4(%rsp)
jne 0x24dda
movb $0x1, %bl
movq %r14, %rdi
callq 0x25f27
movl %r12d, %r13d
jmp 0x24dda
movl %r12d, %r13d
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x24df7
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
movl %ebx, %eax
andb %r13b, %al
movl %r13d, %r12d
testb $0x1, %al
je 0x24da6
movl $0x4000, %r9d           # imm = 0x4000
movq %r14, %rdi
movl $0x1, %esi
movq %r15, %rdx
movq 0x340(%rsp), %rcx
movq 0x348(%rsp), %r8
callq 0x25f9a
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
leaq 0xb0(%rsp), %rdi
movq %r14, %rsi
callq 0x25bff
leaq 0x18(%rsp), %r12
cmpb $0x1, 0xb3(%rsp)
jne 0x25862
movzbl 0xb4(%rsp), %ecx
testb $0x8, %cl
jne 0x24e73
xorl %eax, %eax
xorl %esi, %esi
jmp 0x24e83
movq 0xc0(%rsp), %rax
movzbl (%rax), %eax
movl $0x1, %esi
leaq 0x5(%rsi), %rdx
testb $0x20, %cl
cmoveq %rsi, %rdx
leaq 0x70(%rsp), %rdi
movq 0x8(%rdi), %rsi
addq 0xc0(%rsp), %rdx
movq 0xc8(%rsp), %rcx
subq %rax, %rcx
callq 0x28550
testb $0x4, 0xb4(%rsp)
jne 0x24f12
leaq 0x8(%rsp), %rbx
leaq 0x70(%rsp), %r15
movq %rbx, %rdi
movq %r14, %rsi
callq 0x25bff
cmpb $0x9, 0xb(%rsp)
jne 0x25750
movq 0x78(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq %r15, %rdi
callq 0x28550
movb 0xc(%rsp), %bpl
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x24f0c
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
testb $0x4, %bpl
je 0x24ec3
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
subq %rsi, %rdx
leaq 0x118(%rsp), %rdi
callq 0x298d4
leaq 0x68(%rsp), %rdi
callq 0x298a0
leaq 0x98(%rsp), %rdi
leaq 0x118(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x298dc
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0xf3bf(%rip), %rsi      # 0x3431e
leaq 0xf3cb(%rip), %rdx      # 0x34331
callq 0x10322
cmpb $0x1, 0x23c56(%rip)     # 0x48bc8
jne 0x24fb4
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x23003(%rip), %rdi     # 0x47f88
callq 0xb730
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb5b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb450
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x24fcb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
cmpb $0x1, 0x23bf6(%rip)     # 0x48bc8
jne 0x24fde
movq 0x68(%rsp), %rdi
callq 0x2a729
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0xf2c3(%rip), %rdx      # 0x342b0
movq %rdx, %rsi
callq 0x10322
cmpb $0x1, 0x23bcc(%rip)     # 0x48bc8
jne 0x2503e
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x22f79(%rip), %rdi     # 0x47f88
callq 0xb730
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb5b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb450
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x25055
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0xf2ce(%rip), %rsi      # 0x34332
leaq 0xf2e0(%rip), %rdx      # 0x3434b
callq 0x10322
cmpb $0x1, 0x23b51(%rip)     # 0x48bc8
jne 0x250b9
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x22efe(%rip), %rdi     # 0x47f88
callq 0xb730
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb5b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb450
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x250d0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x98(%rsp), %r13
movq 0xa0(%rsp), %r12
cmpq %r12, %r13
je 0x251f9
leaq 0x50(%rsp), %rbp
leaq 0x40(%rsp), %r15
movq %rbp, 0x40(%rsp)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0xe53c
movq %r15, %rdi
leaq 0xf67d(%rip), %rsi      # 0x34792
callq 0xbcf0
movq 0x20(%r13), %rsi
movq 0x28(%r13), %rdx
movq %r15, %rdi
callq 0xb1b0
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x25152
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x25158
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
cmpb $0x1, 0x23a51(%rip)     # 0x48bc8
jne 0x251b9
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x22dfe(%rip), %rdi     # 0x47f88
callq 0xb730
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb5b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb450
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x251d5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x251ec
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xb600
addq $0x40, %r13
cmpq %r12, %r13
jne 0x250f3
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r15
movq %r15, (%rdi)
leaq 0xf0a3(%rip), %rdx      # 0x342b0
movq %rdx, %rsi
callq 0x10322
cmpb $0x1, 0x239ac(%rip)     # 0x48bc8
jne 0x2525e
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq 0x22d59(%rip), %rdi     # 0x47f88
callq 0xb730
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb5b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb450
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x25275
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %r15
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x25bff
cmpb $0x0, 0xb(%rsp)
jne 0x2571e
testb $0x8, 0xc(%rsp)
jne 0x25700
movq 0x48(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq %r15, %rdi
callq 0x28550
movb 0xc(%rsp), %bl
testb $0x1, %bl
jne 0x2530e
movzbl 0xa(%rsp), %eax
shll $0x10, %eax
movzwl 0x8(%rsp), %edx
orl %eax, %edx
bswapl %edx
shrl $0x8, %edx
movq %r14, %rdi
movl $0x1, %esi
callq 0x26408
movzbl 0xa(%rsp), %eax
shll $0x10, %eax
movzwl 0x8(%rsp), %edx
orl %eax, %edx
bswapl %edx
shrl $0x8, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x26408
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x25325
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
testb $0x1, %bl
je 0x2528e
movq %r14, %rdi
movl $0x1, %esi
callq 0x264ea
xorps %xmm0, %xmm0
movq 0x38(%rsp), %rax
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movq 0x98(%rsp), %r14
movq 0xa0(%rsp), %rbx
movq %rbx, %r13
subq %r14, %r13
sarq $0x8, %r13
testq %r13, %r13
jle 0x253e2
incq %r13
leaq 0xf03a(%rip), %r15      # 0x343b2
movq %r14, %rdi
movq %r15, %rsi
callq 0xb190
testl %eax, %eax
je 0x25446
leaq 0x40(%r14), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xb190
testl %eax, %eax
je 0x25449
leaq 0x80(%r14), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xb190
testl %eax, %eax
je 0x25449
leaq 0xc0(%r14), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xb190
testl %eax, %eax
je 0x25449
addq $0x100, %r14            # imm = 0x100
decq %r13
cmpq $0x1, %r13
jg 0x25378
movq %rbx, %rax
subq %r14, %rax
sarq $0x6, %rax
cmpq $0x1, %rax
je 0x2542c
cmpq $0x2, %rax
je 0x25415
cmpq $0x3, %rax
jne 0x25441
leaq 0xefad(%rip), %rsi      # 0x343b2
movq %r14, %rdi
callq 0xb190
testl %eax, %eax
je 0x25446
addq $0x40, %r14
leaq 0xef96(%rip), %rsi      # 0x343b2
movq %r14, %rdi
callq 0xb190
testl %eax, %eax
je 0x25446
addq $0x40, %r14
leaq 0xef7f(%rip), %rsi      # 0x343b2
movq %r14, %rdi
callq 0xb190
testl %eax, %eax
cmoveq %r14, %rbx
movq %rbx, %r12
jmp 0x25449
movq %r14, %r12
cmpq 0xa0(%rsp), %r12
je 0x254b3
movq 0x20(%r12), %rbx
callq 0xb090
movq %rax, %r15
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0xb920
cmpq %rbx, (%r14)
je 0x25894
movslq %eax, %rcx
cmpq %rax, %rcx
leaq 0x18(%rsp), %rbx
jne 0x258a0
movl (%r15), %ecx
cmpl $0x22, %ecx
je 0x258a0
testl %ecx, %ecx
jne 0x254aa
movl %ebp, (%r15)
movq 0x38(%rsp), %rcx
movl %eax, (%rcx)
jmp 0x254d9
leaq 0xeedf(%rip), %rsi      # 0x34399
leaq 0x108(%rsp), %rdi
callq 0xb270
leaq 0x108(%rsp), %rdi
callq 0xbd98
leaq 0x18(%rsp), %rbx
movq 0x98(%rsp), %r14
movq 0xa0(%rsp), %rax
movq %rax, 0xf8(%rsp)
cmpq %rax, %r14
je 0x25625
movq 0x38(%rsp), %rax
addq $0x8, %rax
movq %rax, 0xf0(%rsp)
leaq 0x8(%rsp), %r13
movl $0x1, %ebp
movq %r14, %rdi
leaq 0xee93(%rip), %rsi      # 0x343b2
callq 0xb190
testl %eax, %eax
je 0x25613
movq %rbx, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq (%r14), %rax
xorl %r15d, %r15d
cmpb $0x3a, (%rax)
sete %r15b
cmpq %r15, 0x8(%r14)
jbe 0x255a7
movb $0x1, %r12b
movq (%r14), %rax
movsbl (%rax,%r15), %ebx
testb $0x1, %r12b
je 0x25581
leal -0x61(%rbx), %eax
cmpb $0x19, %al
ja 0x25581
movl %ebx, %edi
callq 0xbc40
movsbl %al, %esi
movq %r13, %rdi
callq 0xb540
xorl %r12d, %r12d
jmp 0x25593
movl %ebx, %edi
callq 0xb9b0
movsbl %al, %esi
movq %r13, %rdi
callq 0xb540
cmpb $0x2d, %bl
movzbl %r12b, %r12d
cmovel %ebp, %r12d
incq %r15
cmpq 0x8(%r14), %r15
jb 0x25555
movl $0x40, %edi
callq 0xb5e0
movq %rax, %rbx
leaq 0x20(%r14), %rdx
movq %rax, %rdi
movq %r13, %rsi
callq 0x20ecc
movq %rbx, 0x30(%rsp)
movq 0xf0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x18(%rsp), %rbx
callq 0x24782
movq 0x30(%rsp), %rsi
testq %rsi, %rsi
je 0x255f3
leaq 0x30(%rsp), %rdi
callq 0x10490
movq $0x0, 0x30(%rsp)
movq 0x8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x25613
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
addq $0x40, %r14
cmpq 0xf8(%rsp), %r14
jne 0x25515
movq 0x38(%rsp), %rdx
movq 0x20(%rdx), %rdi
movq 0x28(%rdx), %rax
movq 0x30(%rdx), %rsi
movq 0x40(%rsp), %rcx
movq %rcx, 0x20(%rdx)
movq 0x48(%rsp), %rcx
movq %rcx, 0x28(%rdx)
movq 0x50(%rsp), %rcx
movq %rcx, 0x30(%rdx)
movq %rdi, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movq %rsi, 0x50(%rsp)
testq %rdi, %rdi
je 0x2566d
subq %rdi, %rsi
callq 0xb600
leaq 0x98(%rsp), %rdi
callq 0x19bbc
leaq 0x68(%rsp), %rdi
callq 0x298ce
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x256a1
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x256bb
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
movq 0x228a6(%rip), %rsi     # 0x47f68
leaq 0x190(%rsp), %rdi
callq 0xb380
leaq 0x200(%rsp), %rdi
callq 0xb1f0
leaq 0x130(%rsp), %rdi
callq 0x226bc
movq 0x38(%rsp), %rax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0xb300
movq %rax, %rbx
leaq 0xec69(%rip), %rsi      # 0x3437d
movq %rax, %rdi
callq 0xb270
jmp 0x2573a
movl $0x10, %edi
callq 0xb300
movq %rax, %rbx
leaq 0xec1a(%rip), %rsi      # 0x3434c
movq %rax, %rdi
callq 0xb270
movq 0x228af(%rip), %rsi     # 0x47ff0
movq 0x22808(%rip), %rdx     # 0x47f50
movq %rbx, %rdi
callq 0xbb60
movl $0x10, %edi
callq 0xb300
movq %rax, %rbx
leaq 0xeb81(%rip), %rsi      # 0x342e5
movq %rax, %rdi
callq 0xb270
movq 0x2287d(%rip), %rsi     # 0x47ff0
movq 0x227d6(%rip), %rdx     # 0x47f50
movq %rbx, %rdi
callq 0xbb60
jmp 0x25894
testl %edx, %edx
jne 0x257a9
movl $0x10, %edi
callq 0xb300
movq %rax, %rbx
leaq 0xeae1(%rip), %rsi      # 0x34280
movq %rax, %rdi
callq 0xb270
jmp 0x257c5
movl $0x10, %edi
callq 0xb300
movq %rax, %rbx
leaq 0xeac3(%rip), %rsi      # 0x34280
movq %rax, %rdi
callq 0xb270
movq 0x22824(%rip), %rsi     # 0x47ff0
movq 0x2277d(%rip), %rdx     # 0x47f50
movq %rbx, %rdi
callq 0xbb60
movl $0x10, %edi
callq 0xb300
movq %rax, %rbx
leaq 0xea6c(%rip), %rsi      # 0x3425b
movq %rax, %rdi
callq 0xbcd0
movq 0x227c2(%rip), %rsi     # 0x47fc0
movq 0x22793(%rip), %rdx     # 0x47f98
movq %rbx, %rdi
callq 0xbb60
movq 0x40(%rsp), %rbx
movq 0x48(%rsp), %r14
leaq 0xe6ed(%rip), %rsi      # 0x33f0b
leaq 0xb0(%rsp), %rdi
callq 0xbc90
leaq 0x20a0e(%rip), %rax     # 0x46240
leaq 0xe0(%rsp), %rcx
movq %rax, -0x30(%rcx)
movq %rbx, -0x20(%rcx)
movq %r14, -0x18(%rcx)
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
leaq 0xb0(%rsp), %rdi
callq 0xe1ef
movl $0x10, %edi
callq 0xb300
movq %rax, %rbx
leaq 0xea3b(%rip), %rsi      # 0x342b1
movq %rax, %rdi
callq 0xb270
movq 0x2276b(%rip), %rsi     # 0x47ff0
movq 0x226c4(%rip), %rdx     # 0x47f50
movq %rbx, %rdi
callq 0xbb60
leaq 0xd7c2(%rip), %rdi      # 0x3305d
callq 0xb3e0
leaq 0xd7b6(%rip), %rdi      # 0x3305d
callq 0xb9a0
movq %rax, %r14
jmp 0x25b02
jmp 0x25a71
jmp 0x25a46
movq %rax, %r14
movq %rbx, %rdi
callq 0xb4b0
jmp 0x25b3a
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0xde76
jmp 0x25966
jmp 0x2593c
movq %rax, %r14
movq %rbx, %rdi
callq 0xb4b0
jmp 0x25b9f
jmp 0x25a80
jmp 0x25a71
jmp 0x25a71
jmp 0x25a71
jmp 0x25a71
movq %rax, %r14
jmp 0x25b30
jmp 0x25a46
jmp 0x25a46
jmp 0x25a46
movq %rax, %r14
jmp 0x25b57
jmp 0x25aa8
jmp 0x25aa8
jmp 0x259bd
movq %rax, %r14
movq %rbx, %rdi
callq 0xb4b0
jmp 0x25b92
jmp 0x259bd
movq %rax, %r14
cmpl $0x0, (%r15)
jne 0x25b02
movl %ebp, (%r15)
jmp 0x25b02
movq %rax, %r14
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25b71
movq 0x18(%rsp), %rsi
incq %rsi
jmp 0x25b6c
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
jne 0x259ac
jmp 0x25b23
jmp 0x2599b
jmp 0x2599b
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x25b23
movq 0x18(%rsp), %rsi
jmp 0x25ade
jmp 0x25aa8
jmp 0x259bd
movq %rax, %r14
jmp 0x25b92
jmp 0x25a4e
movq %rax, %r14
movq %rbx, %rdi
callq 0xb4b0
jmp 0x25a51
movq %rax, %r14
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x25b71
movq 0xd0(%rsp), %rsi
jmp 0x25b69
jmp 0x25ae3
movq %rax, %r14
movl $0x40, %esi
movq %rbx, %rdi
callq 0xb600
jmp 0x25ae6
movq %rax, %r14
movq 0x30(%rsp), %rsi
testq %rsi, %rsi
je 0x25a29
leaq 0x30(%rsp), %rdi
callq 0x10490
movq $0x0, 0x30(%rsp)
jmp 0x25ae6
jmp 0x25a39
movq %rax, %r14
movq %rbx, %rdi
callq 0xb4b0
jmp 0x25a8f
movq %rax, %r14
jmp 0x25b3a
movq %rax, %r14
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x25b3a
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
jmp 0x25b3a
movq %rax, %r14
jmp 0x25b23
jmp 0x25a7b
movq %rax, %r14
jmp 0x25acf
movq %rax, %r14
jmp 0x25b0c
jmp 0x25a8c
jmp 0x25a8c
movq %rax, %r14
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x25b0c
movq 0x28(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
jmp 0x25b0c
movq %rax, %r14
jmp 0x25b71
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x25acf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x25b23
movq 0x50(%rsp), %rsi
incq %rsi
jmp 0x25b1e
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x25b02
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb600
movq 0x38(%rsp), %rdi
callq 0xdbf6
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x25b23
movq 0x50(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
leaq 0x98(%rsp), %rdi
callq 0x19bbc
leaq 0x68(%rsp), %rdi
callq 0x298ce
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x25b57
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x25b71
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0xb600
movq 0x223f0(%rip), %rsi     # 0x47f68
leaq 0x190(%rsp), %rdi
callq 0xb380
leaq 0x200(%rsp), %rdi
callq 0xb1f0
leaq 0x130(%rsp), %rdi
callq 0x226bc
movq %r14, %rdi
callq 0xbbb0