// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_che_s_trans_function
er_t xoico_che_s_trans_function( xoico_che_s* o, x_source* source, bl_t function_without_brackets, const xoico_func_s* func, const xoico_che_result* result_object_expr, const xoico_typespec_s* typespec_object, xoico_che_result* result, xoico_typespec_s* return_typespec )
{
    // xoico_che_function.x:200:1
    BLM_INIT_LEVEL(0);
    xoico_typespec_s* typespec_ret = ((xoico_typespec_s*)BLM_LEVEL_T_PUSH(0,xoico_typespec_s,xoico_typespec_s_create()));
    xoico_che_result_arr_s* result_args = ((xoico_che_result_arr_s*)BLM_LEVEL_T_PUSH(0,xoico_che_result_arr_s,xoico_che_result_arr_s_create()));
    
    BLM_TRY(xoico_che_s_trans_function_args(o,source, function_without_brackets, func, result_object_expr, typespec_object,((xoico_che_result*)( result_args)), typespec_ret ))
    
    xoico_che_result_arr_s* result_expression = ((xoico_che_result_arr_s*)BLM_LEVEL_T_PUSH(0,xoico_che_result_arr_s,xoico_che_result_arr_s_create()));
    BLM_TRY(xoico_che_result_arr_s_push_sc(result_expression,xoico_che_s_nameof(o,func->global_name ) ))
    xoico_che_result_arr_s_push_result_d(result_expression,((xoico_che_result*)(((xoico_che_result_arr_s*)bcore_fork(result_args)) )));
    
    /** Casting can become necessary when the functions declared return typespec is less specific than
     *  the expected return type due to transient types.
     */
    if
    (
        typespec_ret->type        != func->signature->typespec_ret.type ||
        typespec_ret->indirection != func->signature->typespec_ret.indirection
    )
    {
        xoico_che_result_a_push_result_d(result,((xoico_che_result*)(xoico_che_result_cast_s_reduce(xoico_che_result_cast_s__(xoico_che_result_cast_s_create(),o, xoico_typespec_s_clone(typespec_ret),((xoico_che_result*)( ((xoico_che_result_arr_s*)bcore_fork(result_expression)) )))) )));
    }
    else
    {
        xoico_che_result_a_push_result_d(result,((xoico_che_result*)(((xoico_che_result_arr_s*)bcore_fork(result_expression)) )));
    }
    
    if( return_typespec ) xoico_typespec_s_copy(return_typespec,typespec_ret );
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x10(%rsp)
movq %r8, 0x8(%rsp)
movq %rcx, %rbp
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r12
leaq 0xf7552(%rip), %rax     # 0x117dd0
movq (%rax), %rsi
leaq 0x18(%rsp), %r13
movq %r13, %rdi
callq 0x717f5
andq $0x0, 0x10(%r13)
callq 0xe090
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
movq %r13, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x71967
movq %rax, %r15
callq 0x2637f
movq %r13, %rdi
xorl %esi, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %rax, %rcx
callq 0x71967
movq %rax, %r13
movq %r12, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
movl %ebx, %edx
movq %rbp, %r14
movq %rbp, %rcx
movq 0x8(%rsp), %r8
movq 0x10(%rsp), %r9
pushq %r15
pushq %rax
callq 0x23f12
addq $0x10, %rsp
testq %rax, %rax
jne 0x20942
movq %r15, %r12
callq 0x2637f
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %rax, %rcx
callq 0x71967
movq %rax, %rbp
movq 0x10(%r14), %rsi
movq (%rsp), %r15
movq %r15, %rdi
callq 0x1cf9d
movq %rbp, %rdi
movq %rax, %rsi
callq 0x209ff
testq %rax, %rax
je 0x20961
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x71b64
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, %rdi
callq 0x6026d
movq %rbp, %rdi
addq $0x8, %rdi
movq %rax, %rsi
callq 0xf6dd
movq 0x8(%r12), %rcx
movq 0x40(%r14), %rax
cmpq 0x28(%rax), %rcx
jne 0x2099f
movq 0x20(%r12), %rcx
cmpq 0x40(%rax), %rcx
jne 0x2099f
movq %rbp, %rdi
callq 0x6026d
movq %rax, %rbx
jmp 0x209d3
callq 0x266e0
movq %rax, %rbx
movq %r12, %rdi
callq 0xe0b1
movq %rax, %r14
movq %rbp, %rdi
callq 0x6026d
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rax, %rcx
callq 0x1e8d4
movq %rbx, %rdi
callq 0x1e893
movq 0x80(%rsp), %rdi
movq %rbx, %rsi
callq 0x1de41
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x209f8
movq %r12, %rsi
callq 0xe075
xorl %ebx, %ebx
jmp 0x20945