// File: /workspace/github_cpp_makefile_star2_O1/flightaware[P]beast-splitter/beast_input.cc
// Function: beast::BeastInput::connection_established()
void BeastInput::connection_established() {
    auto self(shared_from_this());

    first_message = true;
    receiving_gps_timestamps = false;
    good_sync = false;
    good_messages_count = 0;
    bad_bytes_count = 0;
    state = ParserState::READ_1A;
    current_settings = Settings();

    autodetect_timer.cancel();
    if (fixed_settings.radarcape.on())
        receiver_type = ReceiverType::RADARCAPE;
    else if (fixed_settings.radarcape.off())
        receiver_type = ReceiverType::BEAST;
    else {
        receiver_type = ReceiverType::UNKNOWN;
        autodetect_timer.expires_from_now(radarcape_detect_interval);
        autodetect_timer.async_wait([this, self](const boost::system::error_code &ec) {
            if (!ec) {
                receiver_type = ReceiverType::BEAST;
                send_settings_message();
            }
        });
    }

    send_settings_message();
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %rsi
leaq 0x18(%rsp), %rdi
callq 0x19994
movb $0x1, 0x23c(%rbx)
xorl %eax, %eax
movb %al, 0xdb(%rbx)
movb %al, 0x230(%rbx)
movq $0x0, 0x234(%rbx)
movl $0x1, 0x278(%rbx)
leaq 0x28(%rsp), %rdi
callq 0x118c8
movups 0x28(%rsp), %xmm0
movups 0x38(%rsp), %xmm1
movups 0x48(%rsp), %xmm2
movups %xmm2, 0xa4(%rbx)
movups %xmm1, 0x94(%rbx)
movups %xmm0, 0x84(%rbx)
cmpb $0x1, 0xf0(%rbx)
jne 0x125bc
movq 0xe0(%rbx), %rsi
movq 0x58(%rsi), %rdi
addq $0x28, %rsi
leaq 0xf8(%rbx), %rdx
movq $-0x1, %rcx
callq 0x15926
movb $0x0, 0xf0(%rbx)
leaq 0xe0(%rbx), %rdi
cmpl $0x0, 0x54(%rbx)
jle 0x125f3
movl $0x2, 0x50(%rbx)
movq %rbx, %rdi
callq 0x12794
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x125e7
callq 0x1581a
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
js 0x1263f
movl $0x0, 0x50(%rbx)
imulq $0xf4240, 0x20(%rbx), %rax # imm = 0xF4240
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
callq 0x14326
movq %rbx, (%rsp)
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x1264c
movq 0x6094b(%rip), %rcx     # 0x72f80
cmpb $0x0, (%rcx)
je 0x12648
incl 0x8(%rax)
jmp 0x1264c
movl $0x1, 0x50(%rbx)
jmp 0x125d0
lock
incl 0x8(%rax)
movq 0xe0(%rbx), %r14
movq %rsp, %rax
movq %rax, 0x28(%rsp)
movq %fs:-0x8, %rax
testq %rax, %rax
je 0x1266f
movq 0x8(%rax), %rdi
jmp 0x12671
xorl %edi, %edi
movl $0x70, %esi
callq 0x148a2
movq %rax, %r15
leaq 0xe8(%rbx), %r12
leaq 0x120(%rbx), %rsi
movq %rax, 0x30(%rsp)
xorl %eax, %eax
movq %rax, 0x38(%rsp)
movq %rax, (%r15)
leaq 0xd76(%rip), %rcx       # 0x13418
movq %rcx, 0x8(%r15)
movl %eax, 0x10(%r15)
movl %eax, 0x18(%r15)
movb $0x0, 0x1c(%r15)
leaq 0x5db56(%rip), %rcx     # 0x70210
movq %rcx, 0x20(%r15)
movq (%rsp), %rcx
movq %rcx, 0x28(%r15)
movq 0x8(%rsp), %rcx
movq %rcx, 0x30(%r15)
movq %rax, 0x38(%r15)
movq 0x10(%rsp), %rcx
movq %rax, 0x10(%rsp)
movq %rcx, 0x38(%r15)
movq %rax, 0x8(%rsp)
movq %r15, %rdi
addq $0x40, %rdi
callq 0x15310
movq %r15, 0x38(%rsp)
movb $0x1, 0xf0(%rbx)
movq 0x58(%r14), %rdi
addq $0x28, %r14
leaq 0xf8(%rbx), %rcx
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %r8
callq 0x1472c
leaq 0x30(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x28(%rsp), %rdi
callq 0x1369a
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x125d0
callq 0x1581a
jmp 0x125d0
jmp 0x12759
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x1369a
jmp 0x12764
movq %rax, %rdi
callq 0x10886
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1277c
callq 0x1581a
jmp 0x1277c
jmp 0x12779
jmp 0x12779
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1278b
callq 0x1581a
movq %rbx, %rdi
callq 0xfb40
nop