// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x15df58(%rip), %rax    # 0x1a8dd0
movq (%rax), %rsi
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0xe0431
movq $0x0, 0x10(%r12)
movb $0x1, 0xe0(%r14)
movabsq $-0x3a38467cc88352a1, %rax # imm = 0xC5C7B983377CAD5F
cmpq %rax, %rbx
jne 0x4aec5
leaq 0xf1bcc(%rip), %rsi     # 0x13ca7b
movq %r15, %rdi
xorl %eax, %eax
callq 0xda10
movq %rax, %r12
testq %rax, %rax
jne 0x4b250
movabsq $0x682e7c28bb773227, %rax # imm = 0x682E7C28BB773227
cmpq %rax, %rbx
jne 0x4af03
leaq 0xef161(%rip), %rsi     # 0x13a03c
movq %r15, %rdi
xorl %eax, %eax
callq 0xda10
movq %rax, %rbx
testq %rax, %rax
je 0x4aefa
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r12
testq %rbx, %rbx
jne 0x4b25a
movabsq $-0x7850996cdf80346a, %rbp # imm = 0x87AF6693207FCB96
callq 0x4c277
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %rax, %rcx
callq 0xe0676
movq %rax, %rbp
callq 0x10060
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0xe0676
movq 0x20(%r14), %rcx
movq %rcx, 0x10(%rsp)
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, (%rsp)
movq %rbp, %rdx
movq %rax, %rbp
movq %rax, %rcx
callq 0x3dbae
movq %rax, %rbx
testq %rax, %rax
je 0x4af7c
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r12
testq %rbx, %rbx
jne 0x4b25a
cmpq $0x0, 0x8(%rbp)
movabsq $0x3173c900e37ae1df, %rdx # imm = 0x3173C900E37AE1DF
je 0x4afb3
movq 0x20(%r14), %rax
movq 0x28(%rax), %rcx
cmpq %rdx, %rcx
je 0x4afa8
testq %rcx, %rcx
jne 0x4afb3
cmpq $0x0, 0x40(%rax)
je 0x4b20a
movq %r13, 0x8(%rsp)
movq %r15, %rsi
movq (%rsp), %rdx
callq 0x374b3
movq (%r15), %rbx
leaq 0x15ecfa(%rip), %rax    # 0x1a9cc8
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 0x4b028
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0x4b028
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0x4b028
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0x4b22b
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0x4b058
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %rbx, %rsi
callq 0xf3f85
movq %rax, %r13
leaq 0x15ec7b(%rip), %rdi    # 0x1a9cc8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x12128c
leaq 0xee0de(%rip), %rdx     # 0x13913d
movq %r13, %rdi
movq %r15, %rsi
callq 0x10aa16
testb %al, %al
je 0x4b114
callq 0x4c277
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %rax, %rcx
callq 0xe0676
movq %rax, %rbx
movq 0x20(%r14), %rax
movq 0x28(%rax), %rcx
movabsq $0x3173c900e37ae1df, %rdx # imm = 0x3173C900E37AE1DF
cmpq %rdx, %rcx
je 0x4b0af
testq %rcx, %rcx
jne 0x4b0b6
cmpq $0x0, 0x40(%rax)
je 0x4b120
cmpq $0x0, 0x8(%rbp)
je 0x4b120
movq 0x10(%rbp), %rsi
movq 0x10(%rsp), %rcx
movq 0x30(%rcx), %rax
cmpq %rax, %rsi
movq 0x8(%rsp), %r13
jne 0x4b213
addq $0x20, %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq (%rsp), %r8
movq %rbx, %r15
movq %rbx, %r9
callq 0x3a7f5
movq %rax, %rbx
testq %rax, %rax
je 0x4b109
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r12
testq %rbx, %rbx
jne 0x4b25a
jmp 0x4b144
leaq 0xf1989(%rip), %rsi     # 0x13caa4
jmp 0x4b243
movq (%rsp), %rdi
callq 0xc8348
movq %rbx, %rdi
addq $0x8, %rdi
movq 0x8(%rbx), %rsi
movq %rax, %rdx
callq 0x5b3a7
movq 0x8(%rsp), %r13
movq %rbx, %r15
callq 0x4eb47
movq %rax, %rbx
movq %r15, %rdi
callq 0xc8348
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x446a7
movq (%r13), %r14
leaq 0x157343(%rip), %rax    # 0x1a24b0
movl 0x15733d(%rip), %ecx    # 0x1a24b0
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r14, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x4b1cb
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x4b1cb
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x4b1cb
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x4b26c
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0x4b1fb
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xf3f85
movq %rax, %r15
leaq 0x1572c0(%rip), %rdi    # 0x1a24b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r13, %rdi
movq %rbx, %rsi
callq *0x38(%r15)
xorl %r12d, %r12d
jmp 0x4b250
leaq 0xf1871(%rip), %rsi     # 0x13ca82
jmp 0x4b243
movabsq $-0x12e90733f18038df, %rdx # imm = 0xED16F8CC0E7FC721
cmpq %rdx, %rsi
jne 0x4b233
leaq 0xf18a3(%rip), %rsi     # 0x13cacc
jmp 0x4b243
xorl %r13d, %r13d
jmp 0x4b02c
cmpq %rdx, %rax
jne 0x4b0d8
leaq 0xf18bd(%rip), %rsi     # 0x13cb00
movq %r15, %rdi
xorl %eax, %eax
callq 0xddb2
movq %rax, %r12
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %r12, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0x4b1cf