// File: /workspace/github_c_makefile_star2_O1/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, (%rsp)
movq %r8, 0x10(%rsp)
movq %rcx, %rbx
movl %edx, %r15d
movq %rsi, %r13
movq %rdi, %rbp
leaq 0x1691bf(%rip), %rax    # 0x1a8dd0
movq (%rax), %rsi
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0xe0431
movq $0x0, 0x10(%r14)
callq 0x10060
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0xe0676
movq %rax, %r12
callq 0x4c277
movq %r14, %rdi
xorl %esi, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %rax, %rcx
callq 0xe0676
movq %rax, %r14
movq %rbp, 0x8(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movl %r15d, %edx
movq %rbx, %r15
movq %rbx, %rcx
movq 0x10(%rsp), %r8
movq (%rsp), %r9
pushq %r12
pushq %rax
callq 0x4706c
addq $0x10, %rsp
movq %rax, %rbx
testq %rax, %rax
je 0x3fca4
leaq 0x18(%rsp), %rdi
callq 0xe0b30
jmp 0x3fd02
movq %r12, (%rsp)
callq 0x4c277
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %rax, %rcx
callq 0xe0676
movq %rax, %rbp
movq %r15, %r12
movq 0x10(%r15), %rsi
movq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x3417e
movq %rbp, %rdi
movq %rax, %rsi
callq 0x3fe52
movq %rax, %r15
testq %rax, %rax
je 0x3fcfd
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %r15, %rbx
testq %r15, %r15
je 0x3fd14
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x80(%rsp), %r15
movq %r14, %rdi
callq 0xc8348
movq %rbp, %rdi
addq $0x8, %rdi
movq 0x8(%rbp), %rsi
movq %rax, %rdx
callq 0x5b3a7
movq (%rsp), %r14
movq 0x8(%r14), %rcx
movq 0x40(%r12), %rax
cmpq 0x28(%rax), %rcx
jne 0x3fd61
movq 0x20(%r14), %rcx
cmpq 0x40(%rax), %rcx
jne 0x3fd61
movq %rbp, %rdi
callq 0xc8348
movq %rax, %r12
jmp 0x3fd95
callq 0x4d7c2
movq %rax, %r12
movq %r14, %rdi
callq 0x101d1
movq %rax, %rbx
movq %rbp, %rdi
callq 0xc8348
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x3ad7d
movq %r12, %rdi
callq 0x3ac97
movq (%r15), %r13
leaq 0x162711(%rip), %rax    # 0x1a24b0
movl 0x16270b(%rip), %ecx    # 0x1a24b0
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r13, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0x3fdf9
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x3fdf9
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x3fdf9
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x3fe4e
movq (%rax,%rcx), %rbx
testq %rbx, %rbx
jne 0x3fe29
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r13, %rsi
callq 0xf3f85
movq %rax, %rbx
leaq 0x162692(%rip), %rdi    # 0x1a24b0
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r15, %rdi
movq %r12, %rsi
callq *0x38(%rbx)
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x3fe47
movq %r14, %rsi
callq 0xff8e
xorl %ebx, %ebx
jmp 0x3fc98
xorl %ebx, %ebx
jmp 0x3fdfd