// File: /workspace/github_c_makefile_star2_O3/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 $0x58, %rsp
movq %r9, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movq %rcx, %rbp
movl %edx, %r14d
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x15f995(%rip), %rax    # 0x19bdd0
movq (%rax), %rsi
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xd6675
movq $0x0, 0x10(%r15)
callq 0xffc0
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
movq %r15, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0xd68a8
movq %rax, %r12
callq 0x46f7e
movq %r15, %rdi
xorl %esi, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %rax, %rcx
callq 0xd68a8
movq %rax, %r15
movq %rbx, 0x10(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movl %r14d, %edx
movq %rbp, %r14
movq %rbp, %rcx
movq 0x18(%rsp), %r8
movq 0x20(%rsp), %r9
pushq %r12
pushq %rax
callq 0x429d3
addq $0x10, %rsp
testq %rax, %rax
jne 0x3c502
callq 0x46f7e
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %rax, %rcx
callq 0xd68a8
movq %rax, %rbp
movq 0x10(%r14), %rsi
movq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x31f9d
movq %rbp, %rdi
movq %rax, %rsi
callq 0x3c71e
testq %rax, %rax
je 0x3c521
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xd6d2c
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0xbe7e4
movq %rbp, %rdi
addq $0x8, %rdi
movq 0x8(%rbp), %rsi
movq %rax, %rdx
callq 0x55b79
movq 0x8(%r12), %rcx
movq 0x40(%r14), %rax
cmpq 0x28(%rax), %rcx
movq %r12, 0x8(%rsp)
jne 0x3c615
movq 0x20(%r12), %rcx
cmpq 0x40(%rax), %rcx
jne 0x3c615
movq %rbp, %rdi
callq 0xbe7e4
movq %rax, %r12
movq 0x90(%rsp), %r15
movq (%r15), %r13
leaq 0x158f30(%rip), %rax    # 0x1954b0
movl 0x158f2a(%rip), %ecx    # 0x1954b0
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 0x3c5da
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x3c5da
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x3c5da
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x3c5e3
movq (%rax,%rcx), %rbx
testq %rbx, %rbx
jne 0x3c60a
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r13, %rsi
callq 0xe9bc5
movq %rax, %rbx
leaq 0x158eb1(%rip), %rdi    # 0x1954b0
movq %r13, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r15, %rdi
movq %r12, %rsi
jmp 0x3c6fd
callq 0x48423
movq %r13, %r14
movq %rax, %r13
movq %r12, %rdi
callq 0x10128
movq %rax, %rbx
movq %rbp, %rdi
callq 0xbe7e4
movq %rax, %r15
movq %r14, 0x8(%r13)
movq 0x10(%r13), %rdi
callq 0x1006b
movq %rbx, 0x10(%r13)
leaq 0x18(%r13), %rdi
movq %r15, %rsi
callq 0x48bb5
movq %r13, %rdi
callq 0x380b1
movq 0x90(%rsp), %r15
movq (%r15), %r12
leaq 0x158e43(%rip), %rax    # 0x1954b0
movl 0x158e3d(%rip), %ecx    # 0x1954b0
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r12, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r12, %rdx
je 0x3c6c7
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r12, %rdx
je 0x3c6c7
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r12, %rdx
je 0x3c6c7
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r12, %rdx
jne 0x3c6d0
movq (%rax,%rcx), %rbx
testq %rbx, %rbx
jne 0x3c6f7
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r12, %rsi
callq 0xe9bc5
movq %rax, %rbx
leaq 0x158dc4(%rip), %rdi    # 0x1954b0
movq %r12, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r15, %rdi
movq %r13, %rsi
callq *0x38(%rbx)
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
movq 0x8(%rsp), %rsi
je 0x3c717
callq 0xfef3
xorl %ebx, %ebx
jmp 0x3c505