// File: flightaware[P]beast-splitter/beast_input_serial.cc
// Function: beast::SerialInput::SerialInput(boost::asio::io_context&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned int, beast::Settings const&, modes::Filter const&)
SerialInput::SerialInput(boost::asio::io_service &service_, const std::string &path_, unsigned int fixed_baud_rate_, const Settings &fixed_settings_, const modes::Filter &filter_) : BeastInput(service_, fixed_settings_, filter_), path(path_), port(service_), autobaud_interval(autobaud_base_interval), autobaud_timer(service_), read_timer(service_), readbuf(std::make_shared<helpers::bytebuf>(read_buffer_size)), warned_about_rate(false) {
    // set up autobaud
    if (fixed_baud_rate_ == 0) {
        autobauding = true;
        autobaud_rates.assign(autobaud_standard_rates.begin(), autobaud_standard_rates.end());
        autobaud_rate = autobaud_rates.begin();
        baud_rate = *autobaud_rate;
    } else {
        autobauding = false;
        baud_rate = fixed_baud_rate_;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x60(%rbp)
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x1ca30
movq -0x60(%rbp), %rdi
leaq 0xd3092(%rip), %rax     # 0x108908
movq %rax, (%rdi)
movl $0x2dc6c0, 0x27c(%rdi)  # imm = 0x2DC6C0
movl $0xf4240, 0x280(%rdi)   # imm = 0xF4240
addq $0x288, %rdi            # imm = 0x288
movl $0x3e8, -0x34(%rbp)     # imm = 0x3E8
leaq -0x34(%rbp), %rsi
callq 0x3a3f0
jmp 0x358a6
movq -0x60(%rbp), %rdi
addq $0x290, %rdi            # imm = 0x290
movl $0x3e80, -0x48(%rbp)    # imm = 0x3E80
leaq -0x48(%rbp), %rsi
callq 0x3a3f0
jmp 0x358c3
movq -0x60(%rbp), %rdi
movl $0x4, 0x298(%rdi)
movl $0x3e8, 0x29c(%rdi)     # imm = 0x3E8
movq $0x1000, 0x2a0(%rdi) # imm = 0x1000
addq $0x2a8, %rdi            # imm = 0x2A8
movl $0x32, -0x4c(%rbp)
leaq -0x4c(%rbp), %rsi
callq 0x3a3f0
jmp 0x358ff
movq -0x60(%rbp), %rdi
addq $0x2b0, %rdi            # imm = 0x2B0
movq %rdi, -0x68(%rbp)
movq -0x18(%rbp), %rsi
callq 0x123c0
jmp 0x35919
movq -0x60(%rbp), %rdi
addq $0x2d0, %rdi            # imm = 0x2D0
movq %rdi, -0x70(%rbp)
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x3a410
jmp 0x35937
movq -0x60(%rbp), %rdi
addq $0x320, %rdi            # imm = 0x320
movq %rdi, -0x80(%rbp)
callq 0x3a460
movq -0x60(%rbp), %rdi
addq $0x338, %rdi            # imm = 0x338
callq 0x3a480
movq -0x60(%rbp), %rdi
movq 0x288(%rdi), %rax
movq %rax, 0x348(%rdi)
addq $0x350, %rdi            # imm = 0x350
movq %rdi, -0x78(%rbp)
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x21240
jmp 0x35987
movq -0x60(%rbp), %rdi
addq $0x3c0, %rdi            # imm = 0x3C0
movq %rdi, -0x88(%rbp)
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x21240
jmp 0x359a8
movq -0x60(%rbp), %rsi
movq %rsi, %rdi
addq $0x430, %rdi            # imm = 0x430
movq %rdi, -0x90(%rbp)
addq $0x2a0, %rsi            # imm = 0x2A0
callq 0x3a4a0
jmp 0x359cb
movq -0x60(%rbp), %rax
movb $0x0, 0x440(%rax)
cmpl $0x0, -0x1c(%rbp)
jne 0x35adf
movq -0x60(%rbp), %rdi
movb $0x1, 0x318(%rdi)
movq %rdi, %rax
addq $0x320, %rax            # imm = 0x320
movq %rax, -0xa0(%rbp)
addq $0x27c, %rdi            # imm = 0x27C
movq %rdi, -0xa8(%rbp)
callq 0x3a540
movq -0xa8(%rbp), %rdi
movq %rax, -0x98(%rbp)
callq 0x3a560
movq -0xa0(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq %rax, %rdx
callq 0x3a510
jmp 0x35a39
movq -0x60(%rbp), %rdi
addq $0x320, %rdi            # imm = 0x320
callq 0x3a580
movq -0x60(%rbp), %rdi
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, 0x338(%rdi)
addq $0x338, %rdi            # imm = 0x338
callq 0x3a5b0
movq %rax, %rcx
movq -0x60(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x340(%rax)
jmp 0x35af3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35b2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35b23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35b11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35b08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x35afc
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x214f0
jmp 0x35afc
movq -0x60(%rbp), %rax
movb $0x0, 0x318(%rax)
movl -0x1c(%rbp), %ecx
movl %ecx, 0x340(%rax)
addq $0xb0, %rsp
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x21270
movq -0x78(%rbp), %rdi
callq 0x21270
movq -0x80(%rbp), %rdi
callq 0x3a5d0
movq -0x70(%rbp), %rdi
callq 0x3a630
movq -0x68(%rbp), %rdi
callq 0x13198
movq -0x60(%rbp), %rdi
callq 0x21fc0
movq -0x40(%rbp), %rdi
callq 0x12f70
nop