// File: /workspace/github_c_makefile_star2_O1/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_che_s_trans_builtin_cast
er_t xoico_che_s_trans_builtin_cast( xoico_che_s* o, x_source* source, const xoico_che_result* result_expr, const xoico_typespec_s* typespec_expr, xoico_che_result* result_out, xoico_typespec_s* typespec_out )
{
    // xoico_che_builtin.x:72:1
    BLM_INIT_LEVEL(0);
    if( result_expr ) // member call
    {
        BLM_TRY(x_source_parse_fa(source," ( " ))
        xoico_che_result_a_clear(result_out);
    }
    else // direct call
    {
        BLM_TRY(x_source_parse_fa(source,"cast ( " ))
        xoico_che_result_arr_s* result = ((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 = ((xoico_typespec_s*)BLM_LEVEL_T_PUSH(0,xoico_typespec_s,xoico_typespec_s_create()));
        BLM_TRY(xoico_che_s_trans_expression(o,source,((xoico_che_result*)( result)), typespec ))
        BLM_TRY(x_source_parse_fa(source," , " ))
        typespec_expr = typespec;
        result_expr =((const xoico_che_result*)( result));
    }
    
    BLM_TRY(xoico_che_result_a_push_sc(result_out,"((" ))
    xoico_typespec_s* typespec_cast = ((xoico_typespec_s*)BLM_LEVEL_T_PUSH(0,xoico_typespec_s,xoico_typespec_s_create()));
    
    BLM_TRY(xoico_typespec_s_parse(typespec_cast,o->host, source ))
    
    if( typespec_cast->type == ((tp_t)(TYPEOF_type_object)) )
    {
        typespec_cast->type = xoico_host_a_obj_type(o->host);
    }
    else if( typespec_cast->type == ((tp_t)(TYPEOF_type_deduce)) )
    {
        if( !typespec_expr->type )
        {
            BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Cast-syntax: Deduce requested but expression is intractable." ))
        }
        typespec_cast->type = typespec_expr->type;
    }
    
    if( !o->waive_unknown_type && !xoico_che_s_is_type(o,typespec_cast->type ) )
    {
        BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Cast: Unknown type name was used." ))
    }
    
    BLM_TRY(xoico_che_s_push_typespec(o,typespec_cast, result_out ))
    BLM_TRY(xoico_che_result_a_push_sc(result_out,")(" ))
    
    if
    (
        typespec_expr->type &&
        ( typespec_expr->type != ((tp_t)(TYPEOF_vc_t)) ) &&
        ( typespec_expr->type != ((tp_t)(TYPEOF_vd_t)) ) &&
        ( typespec_expr->type != ((tp_t)(TYPEOF_sc_t)) ) &&
        ( typespec_expr->type != ((tp_t)(TYPEOF_sd_t)) ) &&
        ( typespec_expr->type != TYPEOF_void )
    )
    {
        BLM_TRY(xoico_che_s_adapt_expression_indirection(o,source, typespec_expr, typespec_cast->indirection, result_expr, result_out ))
    }
    else
    {
        xoico_che_result_a_push_result_c(result_out,result_expr );
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, %r14
movq %r8, %r15
movq %rcx, (%rsp)
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, 0x8(%rsp)
leaq 0x160dcc(%rip), %rax    # 0x1a8dd0
movq (%rax), %rsi
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
callq 0xe0431
movq $0x0, 0x10(%rbx)
testq %rbp, %rbp
je 0x480ea
leaq 0xf4693(%rip), %rsi     # 0x13c6bf
movq %r12, %rdi
xorl %eax, %eax
callq 0xda10
movq %rax, %r13
testq %rax, %rax
jne 0x48103
movq %r14, 0x10(%rsp)
movq (%r15), %r14
leaq 0x15a45f(%rip), %rax    # 0x1a24b0
movl 0x15a459(%rip), %ecx    # 0x1a24b0
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r14, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x480af
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x480af
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x480af
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x48326
movq (%rax,%rcx), %rbx
testq %rbx, %rbx
jne 0x480df
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xf3f85
movq %rax, %rbx
leaq 0x15a3dc(%rip), %rdi    # 0x1a24b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r15, %rdi
callq *0x10(%rbx)
jmp 0x481c2
leaq 0xf44c8(%rip), %rsi     # 0x13c5b9
movq %r12, %rdi
xorl %eax, %eax
callq 0xda10
movq %rax, %r13
testq %rax, %rax
je 0x48112
leaq 0x18(%rsp), %rdi
callq 0xe0b30
jmp 0x482d0
movq %r14, 0x10(%rsp)
callq 0x4c277
leaq 0x18(%rsp), %rbx
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0xe0676
movq %rax, %rbp
callq 0x10060
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0xe0676
movq %rax, %r14
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %rbp, %rdx
movq %rax, %rcx
callq 0x3dbae
movq %rax, %rbx
testq %rax, %rax
je 0x48182
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r13
testq %rbx, %rbx
jne 0x481b6
leaq 0xf01cf(%rip), %rsi     # 0x13835d
movq %r12, %rdi
xorl %eax, %eax
callq 0xda10
movq %rax, %rbx
testq %rax, %rax
je 0x481ad
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r13
testq %rbx, %rbx
je 0x48314
xorl %eax, %eax
xorl %ebp, %ebp
testb %al, %al
je 0x482d0
movq (%r15), %r14
leaq 0x15a2e4(%rip), %rax    # 0x1a24b0
movl 0x15a2de(%rip), %ecx    # 0x1a24b0
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r14, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r14, %rdx
je 0x4822a
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r14, %rdx
je 0x4822a
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r14, %rdx
je 0x4822a
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r14, %rdx
jne 0x4831f
movq (%rax,%rcx), %rbx
testq %rbx, %rbx
jne 0x4825a
movabsq $-0x3dfc7e0a250a30dc, %rdi # imm = 0xC20381F5DAF5CF24
movq %r14, %rsi
callq 0xf3f85
movq %rax, %rbx
leaq 0x15a261(%rip), %rdi    # 0x1a24b0
movq %r14, %rsi
movq %rax, %rdx
callq 0x12128c
leaq 0xf4360(%rip), %rsi     # 0x13c5c1
movq %r15, %rdi
callq *0x20(%rbx)
movq %rax, %rbx
testq %rax, %rax
je 0x4827c
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r13
testq %rbx, %rbx
jne 0x482d0
callq 0x10060
leaq 0x18(%rsp), %rdi
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
xorl %esi, %esi
movq %rax, %rcx
callq 0xe0676
movq %rax, %r14
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x10314
movq %rax, %rbx
testq %rax, %rax
je 0x482cb
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r13
testq %rbx, %rbx
je 0x482e2
movq %r13, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r14), %rax
movabsq $-0x59040ffc58933ff2, %rcx # imm = 0xA6FBF003A76CC00E
cmpq %rcx, %rax
je 0x4832d
movabsq $0x213393bef2495d15, %rcx # imm = 0x213393BEF2495D15
cmpq %rcx, %rax
movq 0x8(%rsp), %rbx
jne 0x48347
movq 0x10(%rbx), %rdi
callq 0x11cd3
jmp 0x48343
movb $0x1, %al
movq %r14, (%rsp)
jmp 0x481ba
xorl %ebx, %ebx
jmp 0x4822e
xorl %ebx, %ebx
jmp 0x480b3
movq (%rsp), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
movq 0x8(%rsp), %rbx
je 0x483fb
movq %rax, 0x8(%r14)
cmpb $0x0, 0xd(%rbx)
jne 0x48362
movq 0x8(%r14), %rsi
movq 0x18(%rbx), %rdi
callq 0x32c57
testb %al, %al
je 0x483f2
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x34734
movq %rax, %rbx
testq %rax, %rax
je 0x48385
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r13
testq %rbx, %rbx
jne 0x482d0
leaq 0xf09a5(%rip), %rsi     # 0x138d3a
movq %r15, %rdi
callq 0x34bcc
movq %rax, %rbx
testq %rax, %rax
je 0x483b2
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r13
testq %rbx, %rbx
jne 0x482d0
movq (%rsp), %rax
movq 0x8(%rax), %rax
movabsq $0x3173c900e37ae1de, %rcx # imm = 0x3173C900E37AE1DE
cmpq %rcx, %rax
jg 0x48414
movabsq $-0x84b14e74a9e1ff0, %rcx # imm = 0xF7B4EB18B561E010
cmpq %rcx, %rax
je 0x48445
testq %rax, %rax
je 0x48445
movabsq $0x230abe18cdeefc99, %rcx # imm = 0x230ABE18CDEEFC99
jmp 0x4843c
leaq 0xf4208(%rip), %rsi     # 0x13c601
jmp 0x48402
leaq 0xf41c2(%rip), %rsi     # 0x13c5c4
movq %r12, %rdi
xorl %eax, %eax
callq 0xddb2
movq %rax, %r13
jmp 0x48103
movabsq $0x3173c900e37ae1df, %rcx # imm = 0x3173C900E37AE1DF
cmpq %rcx, %rax
je 0x48445
movabsq $0x54de8100f7c1cbe5, %rcx # imm = 0x54DE8100F7C1CBE5
cmpq %rcx, %rax
je 0x48445
movabsq $0x6f0b060106a30da4, %rcx # imm = 0x6F0B060106A30DA4
cmpq %rcx, %rax
jne 0x484db
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3a736
leaq 0x10dae5(%rip), %rsi    # 0x155f3c
movq %r12, %rdi
xorl %eax, %eax
callq 0xda10
movq %rax, %rbx
testq %rax, %rax
je 0x48476
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r13
testq %rbx, %rbx
jne 0x482d0
leaq 0xf2f55(%rip), %rsi     # 0x13b3db
movq %r15, %rdi
callq 0x34bcc
movq %rax, %rbx
testq %rax, %rax
je 0x484a3
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r13
testq %rbx, %rbx
jne 0x482d0
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x484c1
movq %rbx, %rdi
movq %r14, %rsi
callq 0xff8e
movq 0x20(%r14), %rax
movq (%rsp), %rcx
cmpq 0x20(%rcx), %rax
jle 0x484d3
movb $0x0, 0x2e(%rbx)
xorl %r13d, %r13d
jmp 0x48103
movq 0x20(%r14), %rcx
movq %r12, %rsi
movq (%rsp), %rdx
movq %rbp, %r8
movq %r15, %r9
callq 0x3a0ec
movq %rax, %rbx
testq %rax, %rax
je 0x48506
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %r13
testq %rbx, %rbx
jne 0x482d0
jmp 0x48450