// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
leaq 0x180a46(%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)
cmpq $0x0, -0x20(%rbp)
je 0x31970
movq -0x18(%rbp), %rdi
leaq 0x10609e(%rip), %rsi    # 0x1379ca
movb $0x0, %al
callq 0x4a20
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
je 0x31962
movq -0x80(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0x88(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0x30(%rbp), %rdi
callq 0x2f780
jmp 0x31ad5
movq -0x18(%rbp), %rdi
leaq 0x105f49(%rip), %rsi    # 0x1378c4
movb $0x0, %al
callq 0x4a20
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
je 0x319ba
movq -0x90(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0x98(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0x40(%rbp), %rax
movq %rax, -0x168(%rbp)
callq 0x35ee0
movq -0x168(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
callq 0xc01a0
movq %rax, -0xa0(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x160(%rbp)
callq 0x5d20
movq -0x160(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
callq 0xc01a0
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0xa8(%rbp), %rcx
callq 0x27f50
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
je 0x31a75
movq -0xb0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0xb8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0x18(%rbp), %rdi
leaq 0x101c35(%rip), %rsi    # 0x1336b5
movb $0x0, %al
callq 0x4a20
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0xc0(%rbp)
je 0x31abf
movq -0xc0(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0xc8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0xa8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x105dec(%rip), %rsi    # 0x1378cc
callq 0x23300
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0xd0(%rbp)
je 0x31b1d
movq -0xd0(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0xd8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0x40(%rbp), %rax
movq %rax, -0x170(%rbp)
callq 0x5d20
movq -0x170(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
callq 0xc01a0
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x18(%rbp), %rdx
callq 0x5f70
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0xe8(%rbp)
je 0x31ba1
movq -0xe8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0xf0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0xe0(%rbp), %rax
movabsq $0x213393bef2495d15, %rcx # imm = 0x213393BEF2495D15
cmpq %rcx, 0x8(%rax)
jne 0x31bd5
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x6b70
movq %rax, %rcx
movq -0xe0(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x31c3e
movq -0xe0(%rbp), %rax
movabsq $-0x59040ffc58933ff2, %rcx # imm = 0xA6FBF003A76CC00E
cmpq %rcx, 0x8(%rax)
jne 0x31c3c
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x31c29
movq -0x18(%rbp), %rdi
leaq 0x105ccd(%rip), %rsi    # 0x1378cf
movb $0x0, %al
callq 0x4c80
movq %rax, -0xf8(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0xf8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0xe0(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x31c3e
movq -0x10(%rbp), %rax
testb $0x1, 0xd(%rax)
jne 0x31c92
movq -0x10(%rbp), %rdi
movq -0xe0(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x257d0
testb $0x1, %al
jne 0x31c92
movq -0x18(%rbp), %rdi
leaq 0x105ca1(%rip), %rsi    # 0x13790c
movb $0x0, %al
callq 0x4c80
movq %rax, -0x100(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0x100(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0x10(%rbp), %rdi
movq -0xe0(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x22e00
movq %rax, -0x108(%rbp)
cmpq $0x0, -0x108(%rbp)
je 0x31cde
movq -0x108(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0x110(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0x30(%rbp), %rdi
leaq 0x1023a9(%rip), %rsi    # 0x134092
callq 0x23300
movq %rax, -0x118(%rbp)
cmpq $0x0, -0x118(%rbp)
je 0x31d26
movq -0x118(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0x120(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0x28(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x31e03
movq -0x28(%rbp), %rax
movabsq $0x54de8100f7c1cbe5, %rcx # imm = 0x54DE8100F7C1CBE5
cmpq %rcx, 0x8(%rax)
je 0x31e03
movq -0x28(%rbp), %rax
movabsq $0x6f0b060106a30da4, %rcx # imm = 0x6F0B060106A30DA4
cmpq %rcx, 0x8(%rax)
je 0x31e03
movq -0x28(%rbp), %rax
movabsq $-0x84b14e74a9e1ff0, %rcx # imm = 0xF7B4EB18B561E010
cmpq %rcx, 0x8(%rax)
je 0x31e03
movq -0x28(%rbp), %rax
movabsq $0x230abe18cdeefc99, %rcx # imm = 0x230ABE18CDEEFC99
cmpq %rcx, 0x8(%rax)
je 0x31e03
movq -0x28(%rbp), %rax
movabsq $0x3173c900e37ae1df, %rcx # imm = 0x3173C900E37AE1DF
cmpq %rcx, 0x8(%rax)
je 0x31e03
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0xe0(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x20(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x24c10
movq %rax, -0x128(%rbp)
cmpq $0x0, -0x128(%rbp)
je 0x31e01
movq -0x128(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0x130(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
jmp 0x31e10
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x24e80
movq -0x18(%rbp), %rdi
leaq 0x12352f(%rip), %rsi    # 0x15534a
movb $0x0, %al
callq 0x4a20
movq %rax, -0x138(%rbp)
cmpq $0x0, -0x138(%rbp)
je 0x31e5a
movq -0x138(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0x140(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
movq -0x30(%rbp), %rdi
leaq 0x104881(%rip), %rsi    # 0x1366e6
callq 0x23300
movq %rax, -0x148(%rbp)
cmpq $0x0, -0x148(%rbp)
je 0x31e9f
movq -0x148(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0x150(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x31ef2
cmpq $0x0, -0x38(%rbp)
je 0x31eb6
movq -0x38(%rbp), %rdi
movq -0xe0(%rbp), %rsi
callq 0x5ce0
movq -0xe0(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x28(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jle 0x31ed3
movq -0x38(%rbp), %rax
movb $0x0, 0x2e(%rax)
movq $0x0, -0x158(%rbp)
movq -0x78(%rbp), %rdi
callq 0xc0720
movq -0x158(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nop