// File: flightaware[P]beast-splitter/beast_input_net.cc
// Function: beast::NetInput::start_reading(boost::system::error_code const&)
void NetInput::start_reading(const boost::system::error_code &ec) {
    if (ec) {
        assert(ec == boost::asio::error::operation_aborted);
        return;
    }

    auto self(std::static_pointer_cast<NetInput>(shared_from_this()));
    std::shared_ptr<helpers::bytebuf> buf;

    buf.swap(readbuf);
    if (buf) {
        buf->resize(read_buffer_size);
    } else {
        buf = std::make_shared<helpers::bytebuf>(read_buffer_size);
    }

    socket.async_read_some(boost::asio::buffer(*buf), [this, self, buf](const boost::system::error_code &ec, std::size_t len) {
        if (ec) {
            readbuf = buf;
            handle_error(ec);
        } else {
            buf->resize(len);
            parse_input(*buf);
            check_framing_errors();
            readbuf = buf;

            start_reading();
        }
    });
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x262b0
testb $0x1, %al
jne 0x4276d
jmp 0x427c6
movq -0x10(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x20(%rbp), %rdi
movl $0x7d, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x3ace0
movq -0xb8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3aee0
testb $0x1, %al
jne 0x427a0
jmp 0x427a2
jmp 0x427c1
leaq 0x71c28(%rip), %rdi     # 0xb43d1
leaq 0x71f97(%rip), %rsi     # 0xb4747
movl $0x88, %edx
leaq 0x71f9e(%rip), %rcx     # 0xb475a
callq 0x125d0
jmp 0x42921
movq -0xb0(%rbp), %rsi
addq $0x8, %rsi
leaq -0x40(%rbp), %rdi
callq 0x212b0
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x48b90
leaq -0x40(%rbp), %rdi
callq 0x21430
leaq -0x50(%rbp), %rdi
callq 0x3b120
movq -0xb0(%rbp), %rsi
addq $0x3e8, %rsi            # imm = 0x3E8
leaq -0x50(%rbp), %rdi
callq 0x3b140
leaq -0x50(%rbp), %rdi
callq 0x3b180
testb $0x1, %al
jne 0x4281f
jmp 0x42853
leaq -0x50(%rbp), %rdi
callq 0x3b1a0
movq %rax, %rdi
movq -0xb0(%rbp), %rax
movq 0x280(%rax), %rsi
callq 0x3b1c0
jmp 0x42840
jmp 0x42882
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x42942
movq -0xb0(%rbp), %rsi
addq $0x280, %rsi            # imm = 0x280
leaq -0x70(%rbp), %rdi
callq 0x3a4a0
jmp 0x4286c
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3b250
leaq -0x70(%rbp), %rdi
callq 0x214f0
movq -0xb0(%rbp), %rax
addq $0x310, %rax            # imm = 0x310
movq %rax, -0xc0(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x3aeb0
movq %rax, %rdi
callq 0x3ae40
movq %rax, %rcx
movq -0xb0(%rbp), %rax
movq %rcx, -0x80(%rbp)
movq %rdx, -0x78(%rbp)
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x48be0
movq -0xc8(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x214c0
movq -0xc0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x42dd0
jmp 0x42903
leaq -0xa8(%rbp), %rdi
callq 0x42e20
leaq -0x50(%rbp), %rdi
callq 0x214f0
leaq -0x30(%rbp), %rdi
callq 0x48c10
addq $0xd0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x42e20
leaq -0x50(%rbp), %rdi
callq 0x214f0
leaq -0x30(%rbp), %rdi
callq 0x48c10
movq -0x58(%rbp), %rdi
callq 0x12f70
nopl (%rax)