// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_che_result_return_s_to_sink
BCORE_DEFINE_OBJECT_INST_P_NASC_END( xoico_che_result_return_s )

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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
jne 0x49a5c
leaq 0xe81a4(%rip), %rdi     # 0x131be2
leaq 0xe384b(%rip), %rsi     # 0x12d290
leaq 0xe8165(%rip), %rcx     # 0x131bb1
movl $0x287b, %edx           # imm = 0x287B
xorl %eax, %eax
callq 0xbe6f9
movq 0x18(%r14), %rdi
xorl %esi, %esi
callq 0x478b5
testb %al, %al
je 0x49d2b
movq 0x8(%r14), %rax
movq 0x20(%rax), %rax
movq 0x28(%rax), %rcx
movabsq $0x3173c900e37ae1df, %rdx # imm = 0x3173C900E37AE1DF
cmpq %rdx, %rcx
je 0x49a8b
testq %rcx, %rcx
jne 0x49a96
cmpq $0x0, 0x40(%rax)
je 0x49f39
movq (%rbx), %r15
leaq 0x153010(%rip), %r13    # 0x19cab0
movl (%r13), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r13,%rax,8), %rcx
movq 0x18(%r13,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x49af7
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x49af7
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x49af7
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x49b00
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x49b27
movabsq $0x5ea8cabb93ff3b7e, %rdi # imm = 0x5EA8CABB93FF3B7E
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x152f94(%rip), %rdi    # 0x19cab0
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0xe80d6(%rip), %rdx     # 0x131c04
movq %r12, %rdi
movq %rbx, %rsi
callq 0xfe4f3
movq 0x8(%r14), %rdi
movq 0x20(%rdi), %rsi
addq $0x20, %rsi
movq %rbx, %rdx
callq 0x3246c
movq (%rbx), %r15
movl (%r13), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r13,%rax,8), %rcx
movq 0x18(%r13,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x49ba7
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x49ba7
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x49ba7
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x49bb0
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x49bd7
movabsq $0x5ea8cabb93ff3b7e, %rdi # imm = 0x5EA8CABB93FF3B7E
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x152ee4(%rip), %rdi    # 0x19cab0
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0xe4566(%rip), %rdx     # 0x12e144
movq %r12, %rdi
movq %rbx, %rsi
callq 0xfe4f3
movq 0x10(%r14), %r14
movq (%r14), %r15
leaq 0x14b8b9(%rip), %rax    # 0x1954b0
movl 0x14b8b3(%rip), %ecx    # 0x1954b0
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r15, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x49c51
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x49c51
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x49c51
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x49c5a
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x49c81
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x14b83a(%rip), %rdi    # 0x1954b0
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r14, %rdi
movq %rbx, %rsi
callq *0x50(%r12)
testq %rax, %rax
jne 0x49e76
movq (%rbx), %r14
movl (%r13), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r13,%rax,8), %rcx
movq 0x18(%r13,%rax,8), %rdx
andq %r14, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x49cef
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x49cef
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x49cef
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x49cf8
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x49d1f
movabsq $0x5ea8cabb93ff3b7e, %rdi # imm = 0x5EA8CABB93FF3B7E
movq %r14, %rsi
callq 0xe9bc5
movq %rax, %r15
leaq 0x152d9c(%rip), %rdi    # 0x19cab0
movq %r14, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0x10123f(%rip), %rdx    # 0x14af65
jmp 0x49f1e
movq (%rbx), %r15
leaq 0x152d7b(%rip), %r13    # 0x19cab0
movl (%r13), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r13,%rax,8), %rcx
movq 0x18(%r13,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x49d8c
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x49d8c
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x49d8c
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x49d95
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x49dbc
movabsq $0x5ea8cabb93ff3b7e, %rdi # imm = 0x5EA8CABB93FF3B7E
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x152cff(%rip), %rdi    # 0x19cab0
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0xe3c4c(%rip), %rdx     # 0x12da0f
movq %r12, %rdi
movq %rbx, %rsi
callq 0xfe4f3
movq 0x10(%r14), %r14
movq (%r14), %r15
leaq 0x14b6d4(%rip), %rax    # 0x1954b0
movl 0x14b6ce(%rip), %ecx    # 0x1954b0
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r15, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x49e36
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x49e36
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x49e36
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x49e3f
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x49e66
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x14b655(%rip), %rdi    # 0x1954b0
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r14, %rdi
movq %rbx, %rsi
callq *0x50(%r12)
testq %rax, %rax
je 0x49e8d
movq %rax, %r14
leaq 0x151f50(%rip), %rax    # 0x19bdd0
movq (%rax), %rdi
callq 0xd6d2c
jmp 0x49f2c
movq (%rbx), %r14
movl (%r13), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r13,%rax,8), %rcx
movq 0x18(%r13,%rax,8), %rdx
andq %r14, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x49ee7
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x49ee7
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x49ee7
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x49ef0
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x49f17
movabsq $0x5ea8cabb93ff3b7e, %rdi # imm = 0x5EA8CABB93FF3B7E
movq %r14, %rsi
callq 0xe9bc5
movq %rax, %r15
leaq 0x152ba4(%rip), %rdi    # 0x19cab0
movq %r14, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0xe79aa(%rip), %rdx     # 0x1318c8
movq %r15, %rdi
movq %rbx, %rsi
callq 0xfe4f3
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq (%rbx), %r15
leaq 0x152b6d(%rip), %r13    # 0x19cab0
movl (%r13), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%r13,%rax,8), %rcx
movq 0x18(%r13,%rax,8), %rdx
andq %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x49f9a
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x49f9a
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x49f9a
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x49fa3
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x49fca
movabsq $0x5ea8cabb93ff3b7e, %rdi # imm = 0x5EA8CABB93FF3B7E
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x152af1(%rip), %rdi    # 0x19cab0
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0xe7c40(%rip), %rdx     # 0x131c11
jmp 0x49dc3