// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_che_s_trans_control_return
er_t xoico_che_s_trans_control_return( xoico_che_s* o, tp_t tp_control, x_source* source, xoico_che_result* result )
{
    // xoico_che_control.x:397:1
    BLM_INIT_LEVEL(0);
    o->has_completion = true;
    
    if( tp_control == TYPEOF_return ) BLM_TRY(x_source_parse_fa(source,"return" ))
    if( tp_control == TYPEOF_completion ) BLM_TRY(x_source_parse_fa(source,"=" ))
    
    xoico_che_result_arr_s* result_expr = ((xoico_che_result_arr_s*)BLM_LEVEL_T_PUSH(0,xoico_che_result_arr_s,xoico_che_result_arr_s_create()));
    
    xoico_typespec_s* typespec_expr = ((xoico_typespec_s*)BLM_LEVEL_T_PUSH(0,xoico_typespec_s,xoico_typespec_s_create() ));
    const xoico_typespec_s* typespec_ret =&( o->signature->typespec_ret);
    
    BLM_TRY(xoico_che_s_trans_expression(o,source,((xoico_che_result*)( result_expr)), typespec_expr ))
    
    if( typespec_expr->type )
    {
        if( !xoico_che_s_returns_a_value(o) )
        {
            BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Function does not return a value." ))
        }
    }
    
    BLM_TRY(xoico_che_s_trans_whitespace(o,source,((xoico_che_result*)( result_expr ))))
    
    if( !x_source_parse_bl(source,"#?';'" ) ) BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Missing ';' after completion statement." ))
    
    xoico_che_result_arr_s* result_expr_adapted = ((xoico_che_result_arr_s*)BLM_LEVEL_T_PUSH(0,xoico_che_result_arr_s,xoico_che_result_arr_s_create()));
    if( xoico_che_s_returns_a_value(o) && typespec_expr->type )
    {
        if( typespec_expr->access_class != typespec_ret->access_class )
        {
            if( typespec_expr->access_class == TYPEOF_discardable )
            {
                BLM_RETURNV(er_t, x_source_parse_error_fa(source,"return: Conversion discards typespec 'discardable'." ))
            }
    
            if( typespec_ret->access_class == TYPEOF_discardable )
            {
                BLM_RETURNV(er_t, x_source_parse_error_fa(source,"return: Conversion requires typespec 'discardable'." ))
            }
        }
    
        BLM_TRY(xoico_che_s_adapt_expression(o,source, typespec_expr, typespec_ret,((const xoico_che_result*)( result_expr)),((xoico_che_result*)( result_expr_adapted ))))
    }
    else
    {
        xoico_che_result_arr_s_push_result_d(result_expr_adapted,((xoico_che_result*)(((xoico_che_result_arr_s*)bcore_fork(result_expr)) )));
    }
    
    xoico_che_result_a_push_result_d(result,((xoico_che_result*)(xoico_che_result_return_s__(xoico_che_result_return_s_create(),o,((xoico_che_result*)( ((xoico_che_result_arr_s*)bcore_fork(result_expr_adapted)) ))) )));
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x156191(%rip), %rax    # 0x19bdd0
movq (%rax), %rsi
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0xd6675
movq $0x0, 0x10(%r12)
movb $0x1, 0xe0(%r14)
movabsq $0x682e7c28bb773227, %rax # imm = 0x682E7C28BB773227
cmpq %rax, %rbx
je 0x45c87
movabsq $-0x3a38467cc88352a1, %rax # imm = 0xC5C7B983377CAD5F
cmpq %rax, %rbx
jne 0x45ca1
leaq 0xebdf6(%rip), %rsi     # 0x131a7b
jmp 0x45c8e
leaq 0xe93ae(%rip), %rsi     # 0x12f03c
movq %r13, %rdi
xorl %eax, %eax
callq 0xda80
testq %rax, %rax
jne 0x45f92
movq %r15, (%rsp)
movabsq $-0x7850996cdf80346a, %r15 # imm = 0x87AF6693207FCB96
callq 0x46f7e
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rax, %rcx
callq 0xd68a8
movq %r13, %r15
movq %rax, %r13
callq 0xffc0
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0xd68a8
movq %rax, %rbp
movq 0x20(%r14), %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rax, %rcx
callq 0x3a94e
testq %rax, %rax
jne 0x45f92
movq %r15, %rdi
movabsq $-0x7850996cdf80346a, %r15 # imm = 0x87AF6693207FCB96
movq %r12, 0x8(%rsp)
cmpq $0x0, 0x8(%rbp)
movabsq $0x3173c900e37ae1df, %rdx # imm = 0x3173C900E37AE1DF
je 0x45d4c
movq 0x20(%r14), %rax
movq 0x28(%rax), %rcx
cmpq %rdx, %rcx
je 0x45d41
testq %rcx, %rcx
jne 0x45d4c
cmpq $0x0, 0x40(%rax)
je 0x45f84
movq %rbp, 0x10(%rsp)
movq %rdi, %rsi
movq %r13, %r12
movq %rdi, %r13
movq %r12, %rdx
callq 0x34da0
movq (%r13), %rbx
leaq 0x156f5b(%rip), %rax    # 0x19ccc8
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %rbx, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %rbx, %rdx
je 0x45dc3
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0x45dc3
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0x45dc3
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0x45dcc
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0x45df3
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %rbx, %rsi
callq 0xe9bc5
movq %rax, %rbp
leaq 0x156ee0(%rip), %rdi    # 0x19ccc8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x115fac
leaq 0xe8343(%rip), %rdx     # 0x12e13d
movq %rbp, %rdi
movq %r13, %rsi
callq 0xffe2b
testb %al, %al
je 0x45e90
callq 0x46f7e
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %rax, %rcx
callq 0xd68a8
movq %rax, %r15
movq 0x20(%r14), %rax
movq 0x28(%rax), %rcx
movabsq $0x3173c900e37ae1df, %rdx # imm = 0x3173C900E37AE1DF
cmpq %rdx, %rcx
movq 0x10(%rsp), %rdx
je 0x45e48
testq %rcx, %rcx
jne 0x45e4f
cmpq $0x0, 0x40(%rax)
je 0x45e9f
cmpq $0x0, 0x8(%rdx)
je 0x45e9f
movq 0x10(%rdx), %rsi
movq 0x8(%rsp), %rcx
movq 0x30(%rcx), %rax
cmpq %rax, %rsi
movq (%rsp), %rbp
jne 0x45fb1
addq $0x20, %rcx
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %r8
movq %r15, %r9
callq 0x37c19
testq %rax, %rax
jne 0x45f92
jmp 0x45ebe
leaq 0xebc0d(%rip), %rsi     # 0x131aa4
movq %r13, %rdi
jmp 0x45f8b
movq %r12, %rdi
callq 0xbe7e4
movq %r15, %rdi
addq $0x8, %rdi
movq 0x8(%r15), %rsi
movq %rax, %rdx
callq 0x55b79
movq (%rsp), %rbp
callq 0x497f8
movq %r15, %rdi
movq %rax, %r15
callq 0xbe7e4
movq %r14, 0x8(%r15)
movq %r15, %rdi
addq $0x10, %rdi
movq %rax, %rsi
callq 0x48bb5
movq (%rbp), %rbx
leaq 0x14f5c4(%rip), %rax    # 0x1954b0
movl 0x14f5be(%rip), %ecx    # 0x1954b0
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %rbx, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %rbx, %rdx
je 0x45f46
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0x45f46
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0x45f46
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0x45f4f
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0x45f76
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %rbx, %rsi
callq 0xe9bc5
movq %rax, %r14
leaq 0x14f545(%rip), %rdi    # 0x1954b0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x115fac
movq %rbp, %rdi
movq %r15, %rsi
callq *0x38(%r14)
xorl %ebx, %ebx
jmp 0x45f95
leaq 0xebaf7(%rip), %rsi     # 0x131a82
xorl %eax, %eax
callq 0xde10
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xd6d2c
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movabsq $-0x12e90733f18038df, %rdi # imm = 0xED16F8CC0E7FC721
cmpq %rdi, %rsi
jne 0x45fcc
leaq 0xebb05(%rip), %rsi     # 0x131acc
jmp 0x45e97
cmpq %rdi, %rax
jne 0x45e70
leaq 0xebb24(%rip), %rsi     # 0x131b00
jmp 0x45e97