// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_che_result_return_s_to_sink
er_t xoico_che_result_return_s_to_sink( const xoico_che_result_return_s* o, x_sink* sink )
{
    // xoico_che_result.x:283:5
    
    if( !o->parent ) ERR_fa( "Parent missing." );
    
    if( xoico_che_result_block_s_is_using_blm_until_level(o->parent,0 ) )
    {
        if( xoico_che_s_returns_a_value(o->che) )
        {
            x_sink_push_sc(sink,"BLM_RETURNV(" );
            xoico_che_s_typespec_to_sink(o->che,&(o->che->signature->typespec_ret), sink );
            x_sink_push_sc(sink,"," );
            BLM_TRY(xoico_che_result_a_to_sink(o->return_expression,sink ))
            x_sink_push_sc(sink,")" );  // do not terminate BLM_RETURNV macro with a semicolon, otherwise if-else statements might not be handled correctly
        }
        else
        {
            x_sink_push_sc(sink,"BLM_RETURN()" );
            BLM_TRY(xoico_che_result_a_to_sink(o->return_expression,sink )) //probably not necessary
            x_sink_push_sc(sink,";" );
        }
    }
    else
    {
        x_sink_push_sc(sink,"return " );
        BLM_TRY(xoico_che_result_a_to_sink(o->return_expression,sink ))
        x_sink_push_sc(sink,";" );
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x36efc
leaq 0x10100b(%rip), %rdi    # 0x137eed
leaq 0xfc6ff(%rip), %rsi     # 0x1335e8
movl $0x27c6, %edx           # imm = 0x27C6
leaq 0x100fc7(%rip), %rcx    # 0x137ebc
movb $0x0, %al
callq 0x9d0f0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x362f0
testb $0x1, %al
jne 0x36f16
jmp 0x3701e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2c530
testb $0x1, %al
jne 0x36f2c
jmp 0x36fbf
movq -0x18(%rbp), %rdi
leaq 0x100fd8(%rip), %rsi    # 0x137f0f
callq 0xc460
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x20(%rax), %rsi
addq $0x20, %rsi
movq -0x18(%rbp), %rdx
callq 0x22d10
movq -0x18(%rbp), %rdi
leaq 0xfd531(%rip), %rsi     # 0x134499
callq 0xc460
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x35f70
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x36fad
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0x17b398(%rip), %rax    # 0x1b2330
movq (%rax), %rdi
callq 0xc0720
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x37083
movq -0x18(%rbp), %rdi
leaq 0x11e393(%rip), %rsi    # 0x15534b
callq 0xc460
jmp 0x3701c
movq -0x18(%rbp), %rdi
leaq 0x100f52(%rip), %rsi    # 0x137f1c
callq 0xc460
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x35f70
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x3700c
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x17b336(%rip), %rax    # 0x1b2330
movq (%rax), %rdi
callq 0xc0720
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x37083
movq -0x18(%rbp), %rdi
leaq 0x100bbc(%rip), %rsi    # 0x137bd3
callq 0xc460
jmp 0x3707b
movq -0x18(%rbp), %rdi
leaq 0xfcd3e(%rip), %rsi     # 0x133d67
callq 0xc460
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x35f70
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x3706b
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq 0x17b2d7(%rip), %rax    # 0x1b2330
movq (%rax), %rdi
callq 0xc0720
movq -0x48(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x37083
movq -0x18(%rbp), %rdi
leaq 0x100b5d(%rip), %rsi    # 0x137bd3
callq 0xc460
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)