// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/lib/bcore/bcore_sinks.c
// Function: bcore_sinks_signal_handler
vd_t bcore_sinks_signal_handler( const bcore_signal_s* o )
{
    switch( bcore_signal_s_handle_type( o, typeof( "bcore_sinks" ) ) )
    {
        case TYPEOF_init1:
        {
            bcore_flect_define_creator( typeof( "bcore_sink_buffer_s" ), buffer_s_create_self );
            bcore_flect_define_creator( typeof( "bcore_sink_file_s"   ), file_s_create_self   );
            bcore_flect_define_creator( typeof( "bcore_sink_chain_s"  ), chain_s_create_self  );

            BCORE_REGISTER_FFUNC( bcore_fp_flow_snk, bcore_sink_stdout_s_push_data );
            BCORE_REGISTER_FFUNC( bcore_sink_fp_flush, bcore_sink_stdout_s_flush );
            BCORE_REGISTER_OBJECT( bcore_sink_stdout_s );
            BCORE_REGISTER_FFUNC( bcore_fp_flow_snk, bcore_sink_stderr_s_push_data );
            BCORE_REGISTER_FFUNC( bcore_sink_fp_flush, bcore_sink_stderr_s_flush );
            BCORE_REGISTER_OBJECT( bcore_sink_stderr_s );
            BCORE_REGISTER_FFUNC( bcore_fp_flow_snk, bcore_sink_nul_s_push_data );
            BCORE_REGISTER_FFUNC( bcore_sink_fp_flush, bcore_sink_nul_s_flush );
            BCORE_REGISTER_OBJECT( bcore_sink_nul_s );

            bcore_sink_stdout_g = bcore_sink_stdout_s_create();
            bcore_sink_stderr_g = bcore_sink_stderr_s_create();
            bcore_sink_nul_g    = bcore_sink_nul_s_create();
        }
        break;

        case TYPEOF_down1:
        {
             bcore_sink_stdout_s_detach( &bcore_sink_stdout_g );
             bcore_sink_stderr_s_detach( &bcore_sink_stderr_g );
             bcore_sink_nul_s_detach( &bcore_sink_nul_g );
        }

        case TYPEOF_selftest:
        {
        }
        break;

        default: break;
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movabsq $0x11acca03f655c9fd, %rsi # imm = 0x11ACCA03F655C9FD
callq 0xdfce3
movabsq $-0x69a05654ee793a14, %rcx # imm = 0x965FA9AB1186C5EC
cmpq %rcx, %rax
je 0xe24cb
movabsq $0x6a72ce8f8250efc6, %rcx # imm = 0x6A72CE8F8250EFC6
cmpq %rcx, %rax
jne 0xe2506
leaq 0x25e(%rip), %rsi       # 0xe2514
movabsq $-0x741f65139500cd47, %rdi # imm = 0x8BE09AEC6AFF32B9
callq 0xc5545
leaq 0x2db(%rip), %rsi       # 0xe25a7
movabsq $-0x6d20f1f66d46b377, %rdi # imm = 0x92DF0E0992B94C89
callq 0xc5545
leaq 0x37d(%rip), %rsi       # 0xe265f
movabsq $-0x35e1677e729e85ac, %rdi # imm = 0xCA1E98818D617A54
callq 0xc5545
leaq 0x653d8(%rip), %r14     # 0x1476d0
movq %r14, %rdi
callq 0xd7476
movq %rax, %r15
leaq 0x653e4(%rip), %rbx     # 0x1476ee
movq %rbx, %rdi
callq 0xd7476
movq %r15, %rdi
movq %rax, %rsi
callq 0x1168a7
movq %r14, %rdi
callq 0xd7476
leaq -0x9d4(%rip), %rsi      # 0xe1958
movq %rax, %rdi
callq 0xc6e91
leaq 0x653c5(%rip), %r15     # 0x147700
movq %r15, %rdi
callq 0xd7476
movq %rax, %r12
leaq 0x653cd(%rip), %r14     # 0x14771a
movq %r14, %rdi
callq 0xd7476
movq %r12, %rdi
movq %rax, %rsi
callq 0x1168a7
movq %r15, %rdi
callq 0xd7476
leaq -0xa3a(%rip), %rsi      # 0xe1935
movq %rax, %rdi
callq 0xc6e91
leaq 0x3b6(%rip), %rsi       # 0xe2734
movabsq $0x3c1cd004d3edcacc, %rdi # imm = 0x3C1CD004D3EDCACC
callq 0xc5545
leaq 0x6539a(%rip), %r15     # 0x14772e
movq %r15, %rdi
callq 0xd7476
movq %rax, %r12
movq %rbx, %rdi
callq 0xd7476
movq %r12, %rdi
movq %rax, %rsi
callq 0x1168a7
movq %r15, %rdi
callq 0xd7476
leaq -0xd4c51(%rip), %rsi    # 0xd770
movq %rax, %rdi
callq 0xc6e91
leaq 0x6537c(%rip), %r15     # 0x14774c
movq %r15, %rdi
callq 0xd7476
movq %rax, %r12
movq %r14, %rdi
callq 0xd7476
movq %r12, %rdi
movq %rax, %rsi
callq 0x1168a7
movq %r15, %rdi
callq 0xd7476
leaq -0x610(%rip), %rsi      # 0xe1ded
movq %rax, %rdi
callq 0xc6e91
leaq 0x33e(%rip), %rsi       # 0xe274a
movabsq $0x3409fba69308505b, %rdi # imm = 0x3409FBA69308505B
callq 0xc5545
leaq 0x65344(%rip), %r15     # 0x147766
movq %r15, %rdi
callq 0xd7476
movq %rax, %r12
movq %rbx, %rdi
callq 0xd7476
movq %r12, %rdi
movq %rax, %rsi
callq 0x1168a7
movq %r15, %rdi
callq 0xd7476
leaq -0x1e1(%rip), %rsi      # 0xe226e
movq %rax, %rdi
callq 0xc6e91
leaq 0x65323(%rip), %rbx     # 0x147781
movq %rbx, %rdi
callq 0xd7476
movq %rax, %r15
movq %r14, %rdi
callq 0xd7476
movq %r15, %rdi
movq %rax, %rsi
callq 0x1168a7
movq %rbx, %rdi
callq 0xd7476
leaq -0x221(%rip), %rsi      # 0xe226a
movq %rax, %rdi
callq 0xc6e91
leaq 0x2c6(%rip), %rsi       # 0xe2760
movabsq $0x7a3a94c5ff99836, %rdi # imm = 0x7A3A94C5FF99836
callq 0xc5545
callq 0xe170e
movq %rax, 0xb9933(%rip)     # 0x19bde8
callq 0xe1bc6
movq %rax, 0xb992f(%rip)     # 0x19bdf0
callq 0xe2043
movq %rax, %rbx
jmp 0xe24ff
movq 0xb9916(%rip), %rdi     # 0x19bde8
callq 0xe17b9
xorl %ebx, %ebx
movq %rbx, 0xb9908(%rip)     # 0x19bde8
movq 0xb9909(%rip), %rdi     # 0x19bdf0
callq 0xe1c71
movq %rbx, 0xb98fd(%rip)     # 0x19bdf0
movq 0xb98fe(%rip), %rdi     # 0x19bdf8
callq 0xe20ee
movq %rbx, 0xb98f2(%rip)     # 0x19bdf8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq