// File: /workspace/github_cpp_makefile_star2_O3/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 0x185ac
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 0x10798
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 0x11494
movq 0xe0(%rbx), %rsi
movq 0x58(%rsi), %rdi
addq $0x28, %rsi
leaq 0xf8(%rbx), %rdx
movq $-0x1, %rcx
callq 0x1464a
movb $0x0, 0xf0(%rbx)
leaq 0xe0(%rbx), %rdi
cmpl $0x0, 0x54(%rbx)
jle 0x114cb
movl $0x2, 0x50(%rbx)
movq %rbx, %rdi
callq 0x1165a
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x114bf
callq 0x14590
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
js 0x11517
movl $0x0, 0x50(%rbx)
imulq $0xf4240, 0x20(%rbx), %rax # imm = 0xF4240
leaq 0x28(%rsp), %rsi
movq %rax, (%rsi)
callq 0x13140
movq %rbx, (%rsp)
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rsp)
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x11524
movq 0x5fa73(%rip), %rcx     # 0x70f80
cmpb $0x0, (%rcx)
je 0x11520
incl 0x8(%rax)
jmp 0x11524
movl $0x1, 0x50(%rbx)
jmp 0x114a8
lock
incl 0x8(%rax)
movq 0xe0(%rbx), %r14
movq %rsp, %rax
movq %rax, 0x28(%rsp)
movq %fs:-0x8, %rax
testq %rax, %rax
je 0x11547
movq 0x8(%rax), %rdi
jmp 0x11549
xorl %edi, %edi
movl $0x70, %esi
callq 0x136c4
movq %rax, %r15
leaq 0xe8(%rbx), %r12
leaq 0x120(%rbx), %rsi
movq %rax, 0x30(%rsp)
xorl %eax, %eax
movq %rax, (%r15)
leaq 0xcf5(%rip), %rcx       # 0x1226a
movq %rcx, 0x8(%r15)
movl %eax, 0x10(%r15)
movl %eax, 0x18(%r15)
movb $0x0, 0x1c(%r15)
leaq 0x5cda3(%rip), %rcx     # 0x6e330
movq %rcx, 0x20(%r15)
movaps (%rsp), %xmm0
movups %xmm0, 0x28(%r15)
movq 0x10(%rsp), %rcx
movq %rax, 0x10(%rsp)
movq %rcx, 0x38(%r15)
movq %rax, 0x8(%rsp)
movq %r15, %rdi
addq $0x40, %rdi
callq 0x140a4
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 0x13542
leaq 0x30(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x28(%rsp), %rdi
callq 0x124e6
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x114a8
callq 0x14590
jmp 0x114a8
jmp 0x11620
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x124e6
jmp 0x1162b
movq %rax, %rdi
callq 0xf7cb
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x11643
callq 0x14590
jmp 0x11643
jmp 0x11640
jmp 0x11640
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x11652
callq 0x14590
movq %rbx, %rdi
callq 0xeb40