// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
leaq 0x17cdde(%rip), %rax    # 0x1b2330
movq (%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xbfe80
movq -0x68(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0xe0(%rax)
movabsq $-0x3a38467cc88352a1, %rax # imm = 0xC5C7B983377CAD5F
cmpq %rax, -0x18(%rbp)
jne 0x355da
movq -0x20(%rbp), %rdi
leaq 0x1027de(%rip), %rsi    # 0x137d86
movb $0x0, %al
callq 0x4a20
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x355d8
movq -0x70(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0x78(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x359e2
jmp 0x355da
movabsq $0x682e7c28bb773227, %rax # imm = 0x682E7C28BB773227
cmpq %rax, -0x18(%rbp)
jne 0x3562d
movq -0x20(%rbp), %rdi
leaq 0xffd17(%rip), %rsi     # 0x13530c
movb $0x0, %al
callq 0x4a20
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
je 0x3562b
movq -0x80(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0x88(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x359e2
jmp 0x3562d
movq -0x30(%rbp), %rax
movq %rax, -0x110(%rbp)
callq 0x35ee0
movq -0x110(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
callq 0xc01a0
movq %rax, -0x90(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x108(%rbp)
callq 0x5d20
movq -0x108(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
callq 0xc01a0
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
addq $0x20, %rax
movq %rax, -0xa0(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq -0x98(%rbp), %rcx
callq 0x27f50
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
je 0x356fb
movq -0xa8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0xb0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x359e2
movq -0x98(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x3574a
movq -0x10(%rbp), %rdi
callq 0x2c530
testb $0x1, %al
jne 0x35748
movq -0x20(%rbp), %rdi
leaq 0x10266c(%rip), %rsi    # 0x137d8d
movb $0x0, %al
callq 0x4c80
movq %rax, -0xb8(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0xb8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x359e2
jmp 0x3574a
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0x23fd0
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0xc0(%rbp)
je 0x35796
movq -0xc0(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0xc8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x359e2
movq -0x20(%rbp), %rdi
leaq 0xfecf1(%rip), %rsi     # 0x134492
callq 0x6700
testb $0x1, %al
jne 0x357dc
movq -0x20(%rbp), %rdi
leaq 0x1025fa(%rip), %rsi    # 0x137daf
movb $0x0, %al
callq 0x4c80
movq %rax, -0xd0(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0xd0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x359e2
movq -0x30(%rbp), %rax
movq %rax, -0x118(%rbp)
callq 0x35ee0
movq -0x118(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
callq 0xc01a0
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2c530
testb $0x1, %al
jne 0x35822
jmp 0x35947
movq -0x98(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x35947
movq -0x98(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xa0(%rbp), %rcx
cmpq 0x10(%rcx), %rax
je 0x358e4
movq -0x98(%rbp), %rax
movabsq $-0x12e90733f18038df, %rcx # imm = 0xED16F8CC0E7FC721
cmpq %rcx, 0x10(%rax)
jne 0x35899
movq -0x20(%rbp), %rdi
leaq 0x102565(%rip), %rsi    # 0x137dd7
movb $0x0, %al
callq 0x4c80
movq %rax, -0xe0(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0xe0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x359e2
movq -0xa0(%rbp), %rax
movabsq $-0x12e90733f18038df, %rcx # imm = 0xED16F8CC0E7FC721
cmpq %rcx, 0x10(%rax)
jne 0x358e2
movq -0x20(%rbp), %rdi
leaq 0x102550(%rip), %rsi    # 0x137e0b
movb $0x0, %al
callq 0x4c80
movq %rax, -0xe8(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0xe8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x359e2
jmp 0x358e4
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0xa0(%rbp), %rcx
movq -0x90(%rbp), %r8
movq -0xd8(%rbp), %r9
callq 0x24ec0
movq %rax, -0xf0(%rbp)
cmpq $0x0, -0xf0(%rbp)
je 0x35945
movq -0xf0(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0xf8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x359e2
jmp 0x35970
movq -0xd8(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x90(%rbp), %rdi
callq 0x9d3d0
movq -0x120(%rbp), %rdi
movq %rax, %rsi
callq 0x2ada0
movq -0x28(%rbp), %rax
movq %rax, -0x128(%rbp)
callq 0x36e30
movq %rax, -0x138(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x9d3d0
movq -0x138(%rbp), %rdi
movq -0x130(%rbp), %rsi
movq %rax, %rdx
callq 0x2dbf0
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x24290
movq $0x0, -0x100(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0x100(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nop