// File: /workspace/github_c_makefile_star2_O2/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
movq %rdi, %rbx
leaq 0x4f7b3(%rip), %rdi     # 0xc5543
callq 0x7598a
movq %rbx, %rdi
movq %rax, %rsi
callq 0x75141
movabsq $-0x69a05654ee793a14, %rcx # imm = 0x965FA9AB1186C5EC
cmpq %rcx, %rax
je 0x75ffd
movabsq $0x6a72ce8f8250efc6, %rcx # imm = 0x6A72CE8F8250EFC6
cmpq %rcx, %rax
jne 0x7603a
leaq 0x4f1d2(%rip), %rdi     # 0xc4f9f
callq 0x7598a
leaq 0x26f(%rip), %rsi       # 0x76048
movq %rax, %rdi
callq 0x6513b
leaq 0x4f1cb(%rip), %rdi     # 0xc4fb3
callq 0x7598a
leaq 0x2e3(%rip), %rsi       # 0x760d7
movq %rax, %rdi
callq 0x6513b
leaq 0x4f1c2(%rip), %rdi     # 0xc4fc5
callq 0x7598a
leaq 0x37c(%rip), %rsi       # 0x7618b
movq %rax, %rdi
callq 0x6513b
leaq 0x4f731(%rip), %r14     # 0xc554f
movq %r14, %rdi
callq 0x7227a
movq %rax, %r15
leaq 0x4f73d(%rip), %rbx     # 0xc556d
movq %rbx, %rdi
callq 0x7227a
movq %r15, %rdi
movq %rax, %rsi
callq 0x99410
movq %r14, %rdi
callq 0x7227a
leaq -0x320(%rip), %rsi      # 0x75b32
movq %rax, %rdi
callq 0x6656d
leaq 0x4f71e(%rip), %r15     # 0xc557f
movq %r15, %rdi
callq 0x7227a
movq %rax, %r12
leaq 0x4f726(%rip), %r14     # 0xc5599
movq %r14, %rdi
callq 0x7227a
movq %r12, %rdi
movq %rax, %rsi
callq 0x99410
movq %r15, %rdi
callq 0x7227a
leaq -0x3b3(%rip), %rsi      # 0x75ae2
movq %rax, %rdi
callq 0x6656d
leaq 0x4f638(%rip), %rdi     # 0xc54dc
callq 0x7598a
leaq 0x3ac(%rip), %rsi       # 0x7625c
movq %rax, %rdi
callq 0x6513b
leaq 0x4f6ee(%rip), %r15     # 0xc55ad
movq %r15, %rdi
callq 0x7227a
movq %rax, %r12
movq %rbx, %rdi
callq 0x7227a
movq %r12, %rdi
movq %rax, %rsi
callq 0x99410
movq %r15, %rdi
callq 0x7227a
leaq -0x270(%rip), %rsi      # 0x75c7c
movq %rax, %rdi
callq 0x6656d
leaq 0x4f6d0(%rip), %r15     # 0xc55cb
movq %r15, %rdi
callq 0x7227a
movq %rax, %r12
movq %r14, %rdi
callq 0x7227a
movq %r12, %rdi
movq %rax, %rsi
callq 0x99410
movq %r15, %rdi
callq 0x7227a
leaq -0x2fc(%rip), %rsi      # 0x75c2c
movq %rax, %rdi
callq 0x6656d
leaq 0x4f5d0(%rip), %rdi     # 0xc5507
callq 0x7598a
leaq 0x32b(%rip), %rsi       # 0x7626e
movq %rax, %rdi
callq 0x6513b
leaq 0x4f693(%rip), %r15     # 0xc55e5
movq %r15, %rdi
callq 0x7227a
movq %rax, %r12
movq %rbx, %rdi
callq 0x7227a
movq %r12, %rdi
movq %rax, %rsi
callq 0x99410
movq %r15, %rdi
callq 0x7227a
leaq -0x205(%rip), %rsi      # 0x75d7a
movq %rax, %rdi
callq 0x6656d
leaq 0x4f672(%rip), %rbx     # 0xc5600
movq %rbx, %rdi
callq 0x7227a
movq %rax, %r15
movq %r14, %rdi
callq 0x7227a
movq %r15, %rdi
movq %rax, %rsi
callq 0x99410
movq %rbx, %rdi
callq 0x7227a
leaq -0x245(%rip), %rsi      # 0x75d76
movq %rax, %rdi
callq 0x6656d
leaq 0x4f568(%rip), %rdi     # 0xc5532
callq 0x7598a
leaq 0x2aa(%rip), %rsi       # 0x76280
movq %rax, %rdi
callq 0x6513b
callq 0x75a8c
movq %rax, 0xa1dfe(%rip)     # 0x117de8
callq 0x75bd6
movq %rax, 0xa1dfa(%rip)     # 0x117df0
callq 0x75d20
jmp 0x76033
movq 0xa1de4(%rip), %rdi     # 0x117de8
callq 0x75aa2
andq $0x0, 0xa1dd7(%rip)     # 0x117de8
movq 0xa1dd8(%rip), %rdi     # 0x117df0
callq 0x75bec
andq $0x0, 0xa1dcb(%rip)     # 0x117df0
movq 0xa1dcc(%rip), %rdi     # 0x117df8
callq 0x75d36
xorl %eax, %eax
movq %rax, 0xa1dbe(%rip)     # 0x117df8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq