// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_che_s_trans_typespec_expression
er_t xoico_che_s_trans_typespec_expression( xoico_che_s* o, x_source* source, xoico_che_result* result, const xoico_typespec_s* in_typespec, xoico_typespec_s* out_typespec )
{
    // xoico_che_trans_typespec.x:518:1
    BLM_INIT_LEVEL(0);
    if( out_typespec ) out_typespec->type = 0;
    BLM_TRY(xoico_che_s_trans_whitespace(o,source, result ))
    
    u0_t c[ 2 ];
    x_source_inspect_data(source,((x_inst*)(c)), sizeof( c ) );
    
    if( ( c[0] == '.' && c[1] != '.' ) || ( c[0] == '-' && c[1] == '>' ) )
    {
        BLM_TRY(xoico_che_s_trans_typespec_member(o,source, result, in_typespec, out_typespec ))
    }
    else if( c[0] == '[' )
    {
        BLM_TRY(xoico_che_s_trans_typespec_array_subscript(o,source, result, in_typespec, out_typespec ))
    }
    else if( c[0] == '(' )
    {BLM_INIT_LEVEL(2);
        xoico_compiler_element_info_s* info = ((xoico_compiler_element_info_s*)BLM_LEVEL_T_PUSH(2,xoico_compiler_element_info_s,xoico_compiler_element_info_s_create()));
        if( xoico_compiler_s_get_type_member_function_info(o->compiler,in_typespec->type, xoico_che_s_entypeof(o,"_" ), info ) )
        {BLM_INIT_LEVEL(3);
            xoico_typespec_s* typespec_ret = ((xoico_typespec_s*)BLM_LEVEL_T_PUSH(3,xoico_typespec_s,xoico_typespec_s_create()));
            xoico_che_result* result_object_expr = ((xoico_che_result*)BLM_LEVEL_A_PUSH(3,xoico_che_result_a_clone(result)));
            xoico_che_result_a_clear(result);
            BLM_TRY(xoico_che_s_trans_function(o,source, false, info->func, result_object_expr, in_typespec, result, typespec_ret ))
            BLM_TRY(xoico_che_s_trans_typespec_expression(o,source, result, typespec_ret, out_typespec ))
        BLM_DOWN();}
        else
        {
            BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Object has no compact function.\n" ))
        }
    BLM_DOWN();}
    // create if not present
    else if( c[0] =='!' && c[1] != '=' )
    {
        BLM_TRY(xoico_che_s_trans_typespec_create(o,source, result, in_typespec, out_typespec ))
    }
    // test for presence
    else if( c[0] == '?' && c[1] == '.' )
    {
        BLM_TRY(xoico_che_s_trans_typespec_test_presence(o,source, result, in_typespec, out_typespec ))
    }
    // attach (detach)
    else if( c[0] == '=' && c[1] == '<' )
    {
        BLM_TRY(xoico_che_s_trans_typespec_attach(o,source, result, in_typespec, out_typespec ))
    }
    // assign
    else if( c[0] == '=' && c[1] != '=' )
    {
        BLM_TRY(xoico_che_s_trans_typespec_assign(o,source, result, in_typespec, out_typespec ))
    }
    // ternary branch operator
    else if( c[0] == '?' )
    {
        BLM_TRY(xoico_che_s_trans_ternary_branch(o,source, result, out_typespec ))
    }
    // scope
    else if( c[0] == '^' && in_typespec->indirection != 0 ) // for indirection 0 '^' is the xor operator
    {BLM_INIT_LEVEL(2);
        xoico_che_result* result_local = ((xoico_che_result*)BLM_LEVEL_A_PUSH(0,xoico_che_result_a_clone(result)));
        xoico_che_result_a_clear(result);
        xoico_typespec_s* typespec_scope = ((xoico_typespec_s*)BLM_LEVEL_T_PUSH(2,xoico_typespec_s,xoico_typespec_s_create()));
        BLM_TRY(xoico_che_s_trans_builtin_scope(o,source, result_local, in_typespec, result, typespec_scope ))
        BLM_TRY(xoico_che_s_trans_typespec_expression(o,source, result, typespec_scope, out_typespec ))
    BLM_DOWN();}
    else if( out_typespec )
    {
        xoico_typespec_s_copy(out_typespec,in_typespec );
    }
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
leaq 0xf8854(%rip), %rax     # 0x117dd0
movq (%rax), %rsi
leaq 0x28(%rsp), %rbp
movq %rbp, %rdi
callq 0x717f5
andq $0x0, 0x10(%rbp)
testq %rbx, %rbx
je 0x1f59b
andq $0x0, 0x8(%rbx)
movq %r15, %rsi
movq %r14, %rdx
callq 0x1dc6b
movq (%r15), %rdi
callq 0x2d5db
leaq 0x16(%rsp), %rbp
pushq $0x2
popq %rcx
movq %rax, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x88730
movzbl (%rbp), %eax
cmpl $0x2e, %eax
sete %dl
movb 0x1(%rbp), %cl
cmpb $0x2e, %cl
setne %sil
testb %sil, %dl
jne 0x1f5ed
movl %eax, %edx
xorb $0x2d, %dl
movl %ecx, %esi
xorb $0x3e, %sil
orb %dl, %sil
jne 0x1f61c
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x22a2f
testq %rax, %rax
je 0x1f861
movq %rax, %r12
leaq 0x28(%rsp), %rdi
callq 0x71b64
jmp 0x1f86e
cmpl $0x28, %eax
je 0x1f640
cmpl $0x5b, %eax
jne 0x1f782
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x236b2
jmp 0x1f601
leaq 0x58(%rsp), %rbp
movq %rbp, 0x20(%rsp)
leaq 0x28(%rsp), %rsi
movq %rbp, %rdi
callq 0x717f5
movq $0x2, 0x10(%rbp)
callq 0x1c0df
pushq $0x2
popq %rsi
movabsq $0x2b083548d3276fd7, %rdx # imm = 0x2B083548D3276FD7
movq %rbp, %rdi
movq %rax, %rcx
callq 0x71967
movq %rax, %rbp
movq 0x18(%r13), %rax
movq %rax, (%rsp)
movq 0x8(%r12), %rax
movq %rax, 0x8(%rsp)
leaq 0xb0(%r13), %rdi
leaq 0x8e4d5(%rip), %rsi     # 0xadb74
callq 0x6f48c
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rdx
movq %rbp, (%rsp)
movq %rbp, %rcx
callq 0x1c8b0
testb %al, %al
je 0x1f7b1
leaq 0x88(%rsp), %rbp
movq %rbp, 0x18(%rsp)
leaq 0x58(%rsp), %rsi
movq %rbp, %rdi
callq 0x717f5
movq $0x3, 0x10(%rbp)
callq 0xe090
pushq $0x3
popq %rsi
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
movq %rbp, %rdi
movq %rax, %rcx
callq 0x71967
movq %rax, 0x8(%rsp)
movq %r14, %rdi
callq 0x23604
movq %rbp, %rdi
pushq $0x3
popq %rsi
movq %rax, %rdx
callq 0x71a90
movq %rax, %rbp
movq %r14, %rdi
callq 0x235f4
movq (%rsp), %rax
movq 0x48(%rax), %rcx
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %rbp, %r8
movq 0x8(%rsp), %rbp
movq %r12, %r9
pushq %rbp
pushq %r14
callq 0x20854
addq $0x10, %rsp
testq %rax, %rax
jne 0x1f772
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %rbx, %r8
callq 0x1f555
testq %rax, %rax
je 0x1f84d
movq %rax, %r12
leaq 0x88(%rsp), %rdi
jmp 0x1f612
cmpl $0x21, %eax
sete %dl
cmpb $0x3d, %cl
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x1f7cf
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x2380d
jmp 0x1f601
leaq 0x8ed33(%rip), %rsi     # 0xae4eb
movq %r15, %rdi
xorl %eax, %eax
callq 0xd7c4
movq %rax, %r12
leaq 0x58(%rsp), %rdi
jmp 0x1f612
movl %eax, %edx
xorb $0x3f, %dl
movl %ecx, %esi
xorb $0x2e, %sil
orb %dl, %sil
jne 0x1f7f8
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x2394c
jmp 0x1f601
movl %eax, %edx
xorb $0x3d, %dl
movl %ecx, %esi
xorb $0x3c, %sil
orb %dl, %sil
jne 0x1f821
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x23a68
jmp 0x1f601
cmpl $0x3d, %eax
sete %dl
cmpb $0x3d, %cl
setne %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x1f883
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r12, %rcx
movq %rbx, %r8
callq 0x23cfd
jmp 0x1f601
leaq 0x18(%rsp), %rdi
callq 0x71b48
leaq 0x20(%rsp), %rdi
callq 0x71b48
leaq 0x28(%rsp), %rdi
callq 0x71b64
xorl %r12d, %r12d
movq %r12, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3f, %eax
jne 0x1f89e
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1fac6
jmp 0x1f601
cmpl $0x5e, %eax
jne 0x1f961
cmpq $0x0, 0x20(%r12)
je 0x1f961
leaq 0x58(%rsp), %rbp
movq %rbp, 0x88(%rsp)
leaq 0x28(%rsp), %rsi
movq %rbp, %rdi
callq 0x717f5
movq $0x2, 0x10(%rbp)
movq %r14, %rdi
callq 0x23604
movq %rbp, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x71a90
movq %rax, (%rsp)
movq %r14, %rdi
callq 0x235f4
callq 0xe090
pushq $0x2
popq %rsi
movabsq $-0x641110359430e9c5, %rdx # imm = 0x9BEEEFCA6BCF163B
movq %rbp, %rdi
movq %rax, %rcx
callq 0x71967
movq %rax, %rbp
movq %r13, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
movq %r12, %rcx
movq %r14, %r8
movq %rax, %r9
callq 0x1f100
testq %rax, %rax
jne 0x1f7c2
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %rbx, %r8
callq 0x1f555
testq %rax, %rax
jne 0x1f7c2
leaq 0x88(%rsp), %rdi
jmp 0x1f85c
testq %rbx, %rbx
je 0x1f861
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe075
jmp 0x1f861