// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movb %dl, %al
movq 0x18(%rbp), %rdx
movq 0x10(%rbp), %rdx
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
leaq 0x18873b(%rip), %rax    # 0x1b2330
movq (%rax), %rax
movq %rax, -0x40(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xbfe80
movq -0x78(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x40(%rbp), %rax
movq %rax, -0xc8(%rbp)
callq 0x5d20
movq -0xc8(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
callq 0xc01a0
movq %rax, -0x80(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xc0(%rbp)
callq 0x35ee0
movq -0xc0(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
callq 0xc01a0
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movb -0x19(%rbp), %dl
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %r9
movq -0x88(%rbp), %r10
movq -0x80(%rbp), %rax
andb $0x1, %dl
movzbl %dl, %edx
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x30b80
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
je 0x29cf8
movq -0x90(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0x98(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x29eb4
movq -0x40(%rbp), %rax
movq %rax, -0xd8(%rbp)
callq 0x35ee0
movq -0xd8(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
callq 0xc01a0
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x22840
movq -0xd0(%rbp), %rdi
movq %rax, %rsi
callq 0x29ed0
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
je 0x29d92
movq -0xa8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0xb0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x29eb4
movq -0xa0(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x88(%rbp), %rdi
callq 0x9d3d0
movq -0xe0(%rbp), %rdi
movq %rax, %rsi
callq 0x2ada0
movq -0x80(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x40(%rcx), %rcx
cmpq 0x28(%rcx), %rax
jne 0x29de7
movq -0x80(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rcx
movq 0x40(%rcx), %rcx
cmpq 0x40(%rcx), %rax
je 0x29e5b
movq 0x10(%rbp), %rax
movq %rax, -0xe8(%rbp)
callq 0x36690
movq %rax, -0x100(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x80(%rbp), %rdi
callq 0x5d70
movq %rax, -0xf0(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x9d3d0
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
movq %rax, %rcx
callq 0x25860
movq %rax, %rdi
callq 0x25800
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
callq 0x24290
jmp 0x29e81
movq 0x10(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x9d3d0
movq -0x108(%rbp), %rdi
movq %rax, %rsi
callq 0x24290
cmpq $0x0, 0x18(%rbp)
je 0x29e95
movq 0x18(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x5ce0
movq $0x0, -0xb8(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0xb8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)