// File: flightaware[P]beast-splitter/beast_output.cc
// Function: beast::SocketConnector::connection_established(boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> const&)
void SocketConnector::connection_established(const tcp::endpoint &endpoint) {
        auto self(shared_from_this());

        std::cerr << host << ":" << port_or_service << ": connected to " << endpoint << " with settings " << initial_settings << std::endl;
        SocketOutput::pointer new_output = SocketOutput::create(service, std::move(socket), initial_settings);

        modes::FilterDistributor::handle h = distributor.add_client(std::bind(&SocketOutput::write, new_output, std::placeholders::_1), initial_settings.to_filter());

        new_output->set_settings_notifier([this, self, h](const Settings &newsettings) { distributor.update_client_filter(h, newsettings.to_filter()); });

        new_output->set_close_notifier([this, self, h] {
            distributor.remove_client(h);
            schedule_reconnect();
        });

        new_output->start();
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x150(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x5ae60
movq -0x150(%rbp), %rsi
addq $0x128, %rsi            # imm = 0x128
movq 0xb90ac(%rip), %rdi     # 0x10afd8
callq 0x12770
movq %rax, -0x148(%rbp)
jmp 0x51f3a
movq -0x148(%rbp), %rdi
leaq 0x610d2(%rip), %rsi     # 0xb301a
callq 0x12800
movq %rax, -0x158(%rbp)
jmp 0x51f56
movq -0x158(%rbp), %rdi
movq -0x150(%rbp), %rsi
addq $0x148, %rsi            # imm = 0x148
callq 0x12770
movq %rax, -0x160(%rbp)
jmp 0x51f79
movq -0x160(%rbp), %rdi
leaq 0x62772(%rip), %rsi     # 0xb46f9
callq 0x12800
movq %rax, -0x168(%rbp)
jmp 0x51f95
movq -0x168(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x48a20
movq %rax, -0x170(%rbp)
jmp 0x51fae
movq -0x170(%rbp), %rdi
leaq 0x63038(%rip), %rsi     # 0xb4ff4
callq 0x12800
movq %rax, -0x178(%rbp)
jmp 0x51fca
movq -0x178(%rbp), %rdi
movq -0x150(%rbp), %rsi
addq $0x170, %rsi            # imm = 0x170
callq 0x1ac40
movq %rax, -0x180(%rbp)
jmp 0x51fed
movq -0x180(%rbp), %rdi
movq 0xb8f1d(%rip), %rsi     # 0x10af18
callq 0x128b0
jmp 0x52002
movq -0x150(%rbp), %rcx
movq 0x18(%rcx), %rsi
movq %rcx, %rdx
addq $0x68, %rdx
addq $0x170, %rcx            # imm = 0x170
leaq -0x40(%rbp), %rdi
callq 0x5afa0
jmp 0x52026
movq -0x150(%rbp), %rax
movq 0x168(%rax), %rax
movq %rax, -0x188(%rbp)
leaq -0x1cf2(%rip), %rax     # 0x50350
movq %rax, -0x98(%rbp)
movq $0x0, -0x90(%rbp)
movq 0xb8f05(%rip), %rcx     # 0x10af60
leaq -0x88(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x5b030
jmp 0x52074
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x5b070
jmp 0x52086
movq -0x150(%rbp), %rsi
addq $0x170, %rsi            # imm = 0x170
leaq -0xbf(%rbp), %rdi
callq 0x1a1f0
jmp 0x520a2
movq -0x188(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0xbf(%rbp), %rdx
callq 0x16d60
movl %eax, -0x18c(%rbp)
jmp 0x520c1
leaq -0x68(%rbp), %rdi
callq 0x17ad0
leaq -0x88(%rbp), %rdi
callq 0x5b110
movl -0x18c(%rbp), %eax
movl %eax, -0x44(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x5b130
movq %rax, %rcx
movq -0x150(%rbp), %rax
movq %rcx, -0x198(%rbp)
movq %rax, -0x100(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x5ae90
movl -0x44(%rbp), %eax
movl %eax, -0xe8(%rbp)
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x522e0
jmp 0x5212e
movq -0x198(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x5b150
jmp 0x52143
leaq -0xe0(%rbp), %rdi
callq 0x5b180
leaq -0x100(%rbp), %rdi
callq 0x52380
leaq -0x40(%rbp), %rdi
callq 0x5b130
movq %rax, %rcx
movq -0x150(%rbp), %rax
movq %rcx, -0x1a0(%rbp)
movq %rax, -0x140(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x5ae90
movl -0x44(%rbp), %eax
movl %eax, -0x128(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x523a0
jmp 0x521aa
movq -0x1a0(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x5b1a0
jmp 0x521bf
leaq -0x120(%rbp), %rdi
callq 0x5b1d0
leaq -0x140(%rbp), %rdi
callq 0x52440
leaq -0x40(%rbp), %rdi
callq 0x5b130
movq %rax, %rdi
callq 0x4fe10
jmp 0x521ea
leaq -0x40(%rbp), %rdi
callq 0x5a410
leaq -0x20(%rbp), %rdi
callq 0x5aec0
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x522c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x522be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x5224a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x17ad0
leaq -0x88(%rbp), %rdi
callq 0x5b110
jmp 0x522be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x5227e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x5b180
leaq -0x100(%rbp), %rdi
callq 0x52380
jmp 0x522be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x522b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x5b1d0
leaq -0x140(%rbp), %rdi
callq 0x52440
leaq -0x40(%rbp), %rdi
callq 0x5a410
leaq -0x20(%rbp), %rdi
callq 0x5aec0
movq -0x28(%rbp), %rdi
callq 0x12f70
nopl (%rax)