// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_typespec_s_parse
er_t xoico_typespec_s_parse( xoico_typespec_s* o, const xoico_host* host, x_source* source )
{
    // xoico_typespec.x:117:1
    BLM_INIT_LEVEL(0);
    xoico_typespec_s_reset(o);
    xoico_compiler_s* compiler = xoico_host_a_compiler(host);
    
    if( x_source_parse_bl(source,"#?'...' " ) )
    {
        o->flag_variadic = true;
        BLM_RETURNV(er_t, 0)
    }
    
    tp_t access_class = 0;
    
    if(      x_source_parse_bl(source," #?w'c'" ) || x_source_parse_bl(source," #?w'const'"       ) ) access_class = TYPEOF_const;
    else if( x_source_parse_bl(source," #?w'm'" ) || x_source_parse_bl(source," #?w'mutable'"     ) ) access_class = TYPEOF_mutable;
    else if( x_source_parse_bl(source," #?w'd'" ) || x_source_parse_bl(source," #?w'discardable'" ) ) access_class = TYPEOF_discardable;
    
    while( !x_source_eos(source) )
    {
        if     ( x_source_parse_bl(source," #?w'static'"   ) && !o->flag_static ) o->flag_static = true;
        else if( x_source_parse_bl(source," #?w'volatile'" ) && !o->flag_volatile ) o->flag_volatile = true;
        else if( x_source_parse_bl(source," #?w'obliv'"    ) && !o->flag_obliv ) o->flag_obliv = true;
        else if( x_source_parse_bl(source," #?w'aware'"    ) && !o->flag_aware ) o->flag_aware = true;
        else break;
    }
    
    BLM_TRY(x_source_parse_fa(source," " ))
    
    if( x_source_parse_bl(source,"#?'(' " ) )
    {
        st_s* s = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create()));
        BLM_TRY(x_source_parse_fa(source,"#name ", s ))
        if( s->size == 0 ) BLM_TRY(x_source_parse_error_fa(source,"Transient class: Identifier expected." ))
        BCORE_PASS_CREATE(xoico_typespec_transient_s,o->transient)->class = xoico_compiler_s_entypeof(compiler,s->sc );
        BLM_TRY(x_source_parse_fa(source," ) " ))
    }
    
    if( x_source_parse_bl(source,"#=?':'" ) )
    {
        BLM_TRY(xoico_host_a_parse_name_tp(host,source, (&(o->type)) ))
        BLM_TRY(x_source_parse_fa(source," " ))
    }
    else if( x_source_parse_bl(source,"#?'@' " ) )
    {
        o->type = ((tp_t)(TYPEOF_type_object));
    }
    else if( x_source_parse_bl(source,"#?'$' " ) )
    {
        o->type = ((tp_t)(TYPEOF_type_deduce));
    }
    else
    {
        st_s* s = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create()));
        BLM_TRY(x_source_parse_fa(source,"#name ", s ))
        if( s->size == 0 ) BLM_TRY(x_source_parse_error_fa(source,"Argument: Type expected." ))
        o->type = xoico_compiler_s_entypeof( compiler,s->sc );
    }
    
    if( x_source_parse_bl(source,"#?'.' " ) )
    {
        if( !x_source_parse_bl(source,"#?([0]>='0'&&[0]<='9') " ) ) BLM_TRY(x_source_parse_error_fa(source,"Argument: Indirection literal expected." ))
        sz_t indirection = 0;
        BLM_TRY(x_source_parse_fa(source,"#<sz_t*> ", (&(indirection)) ))
        o->indirection = indirection;
    }
    else
    {
        while( x_source_parse_bl(source,"#?'*' " ) ) o->indirection++;
    }
    
    if( x_source_parse_bl(source," #?'restrict' " ) ) o->flag_restrict = true;
    
    if( o->indirection > 0 && access_class == 0 )
    {
        access_class = TYPEOF_const;
    }
    
    o->access_class = access_class;
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x109c69(%rip), %rax    # 0x117dd0
movq (%rax), %rsi
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x717f5
andq $0x0, 0x10(%r15)
movq %rbx, %rdi
callq 0xe120
movq %r12, %rdi
callq 0xdab3
movq %rax, %r15
leaq 0x9bf9b(%rip), %rsi     # 0xaa131
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
je 0xe1b8
movb $0x1, 0x2f(%rbx)
leaq 0x18(%rsp), %rdi
callq 0x71b64
xorl %r13d, %r13d
jmp 0xe2f9
movq %r15, 0x10(%rsp)
movabsq $0x65c9718e19e3df34, %r15 # imm = 0x65C9718E19E3DF34
leaq 0x9bf6c(%rip), %rsi     # 0xaa13a
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
movq %r12, 0x48(%rsp)
jne 0xe1f2
leaq 0x9bf5c(%rip), %rsi     # 0xaa142
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
je 0xe201
movl $0x0, 0x4(%rsp)
movq %r15, 0x8(%rsp)
jmp 0xe242
movabsq $-0x2c53c3baa9910217, %r15 # imm = 0xD3AC3C45566EFDE9
leaq 0x9bf3c(%rip), %rsi     # 0xaa14e
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
jne 0xe235
leaq 0x9bf31(%rip), %rsi     # 0xaa156
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
je 0xe41f
movq %r15, 0x8(%rsp)
movl $0x0, 0x4(%rsp)
leaq 0x9bf35(%rip), %r13     # 0xaa17e
leaq 0x9bf3b(%rip), %rbp     # 0xaa18b
leaq 0x9bf43(%rip), %r15     # 0xaa19a
leaq 0x9bf48(%rip), %r12     # 0xaa1a6
movq %r14, %rdi
callq 0xe626
testb %al, %al
jne 0xe2d6
movq %r14, %rdi
movq %r13, %rsi
callq 0xe5ff
testb %al, %al
je 0xe27f
cmpb $0x0, 0x28(%rbx)
je 0xe2c4
movq %r14, %rdi
movq %rbp, %rsi
callq 0xe5ff
testb %al, %al
je 0xe294
cmpb $0x0, 0x29(%rbx)
je 0xe2ca
movq %r14, %rdi
movq %r15, %rsi
callq 0xe5ff
testb %al, %al
je 0xe2a9
cmpb $0x0, 0x2b(%rbx)
je 0xe2d0
movq %r14, %rdi
movq %r12, %rsi
callq 0xe5ff
testb %al, %al
je 0xe2d6
cmpb $0x0, 0x2c(%rbx)
jne 0xe2d6
movb $0x1, 0x2c(%rbx)
jmp 0xe25e
movb $0x1, 0x28(%rbx)
jmp 0xe25e
movb $0x1, 0x29(%rbx)
jmp 0xe25e
movb $0x1, 0x2b(%rbx)
jmp 0xe25e
leaq 0xb34a0(%rip), %rsi     # 0xc177d
movq %r14, %rdi
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
je 0xe30b
movq %rax, %r13
leaq 0x18(%rsp), %rdi
callq 0x71b64
movq %r13, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9bea0(%rip), %rsi     # 0xaa1b2
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
je 0xe3b1
xorl %eax, %eax
callq 0x8eb65
leaq 0x18(%rsp), %rdi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
xorl %esi, %esi
movq %rax, %rcx
callq 0x71967
movq %rax, %r15
leaq 0x9d55f(%rip), %rsi     # 0xab8ab
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0xe2ec
cmpq $0x0, 0x10(%r15)
je 0xe47c
movq 0x8(%r15), %rsi
movq 0x10(%rsp), %rax
leaq 0x140(%rax), %rdi
callq 0x6f48c
movq %rax, %r15
movq 0x18(%rbx), %rax
testq %rax, %rax
jne 0xe393
callq 0xdff3
movq %rax, 0x18(%rbx)
movq %r15, 0x8(%rax)
leaq 0x9c6ac(%rip), %rsi     # 0xaaa4a
movq %r14, %rdi
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0xe2ec
leaq 0x9be27(%rip), %rsi     # 0xaa1df
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
je 0xe3fd
leaq 0x8(%rbx), %rdx
movq 0x48(%rsp), %rdi
movq %r14, %rsi
callq 0xdcb4
testq %rax, %rax
jne 0xe2ec
leaq 0xb3398(%rip), %rsi     # 0xc177d
movq %r14, %rdi
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0xe2ec
jmp 0xe4ff
leaq 0x9bde2(%rip), %rsi     # 0xaa1e6
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
je 0xe45d
movabsq $0x213393bef2495d15, %rax # imm = 0x213393BEF2495D15
jmp 0xe4fb
leaq 0x9bd3e(%rip), %rsi     # 0xaa164
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
jne 0xe449
leaq 0x9bd33(%rip), %rsi     # 0xaa16c
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
je 0xe5cc
movabsq $-0x12e90733f18038df, %rax # imm = 0xED16F8CC0E7FC721
movq %rax, 0x8(%rsp)
jmp 0xe23a
leaq 0x9bd89(%rip), %rsi     # 0xaa1ed
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
je 0xe49b
movabsq $-0x59040ffc58933ff2, %rax # imm = 0xA6FBF003A76CC00E
jmp 0xe4fb
leaq 0x9bd36(%rip), %rsi     # 0xaa1b9
movq %r14, %rdi
xorl %eax, %eax
callq 0xd7c4
testq %rax, %rax
jne 0xe2ec
jmp 0xe369
xorl %eax, %eax
callq 0x8eb65
leaq 0x18(%rsp), %rdi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
xorl %esi, %esi
movq %rax, %rcx
callq 0x71967
movq %rax, %r15
leaq 0x9d3e6(%rip), %rsi     # 0xab8ab
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0xe2ec
cmpq $0x0, 0x10(%r15)
je 0xe5e0
movq 0x8(%r15), %rsi
movq 0x10(%rsp), %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0x6f48c
movq %rax, 0x8(%rbx)
leaq 0x9bd07(%rip), %rsi     # 0xaa20d
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
je 0xe5b0
leaq 0x9bcf7(%rip), %rsi     # 0xaa214
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
jne 0xe543
leaq 0x9bcfc(%rip), %rsi     # 0xaa22c
movq %r14, %rdi
xorl %eax, %eax
callq 0xd7c4
testq %rax, %rax
jne 0xe2ec
leaq 0x50(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x9bd01(%rip), %rsi     # 0xaa254
movq %r14, %rdi
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0xe2ec
movq 0x50(%rsp), %rax
movq %rax, 0x20(%rbx)
leaq 0x9bcef(%rip), %rsi     # 0xaa265
movq %r14, %rdi
callq 0xe5ff
testb %al, %al
je 0xe586
movb $0x1, 0x2a(%rbx)
cmpq $0x0, 0x20(%rbx)
movabsq $0x65c9718e19e3df34, %rax # imm = 0x65C9718E19E3DF34
movq 0x8(%rsp), %rcx
cmovleq %rcx, %rax
cmpb $0x0, 0x4(%rsp)
cmoveq %rcx, %rax
movq %rax, 0x10(%rbx)
jmp 0xe1a6
leaq 0x9bca7(%rip), %r15     # 0xaa25e
movq %r14, %rdi
movq %r15, %rsi
callq 0xe5ff
testb %al, %al
je 0xe56f
incq 0x20(%rbx)
jmp 0xe5b7
movb $0x1, %al
movl %eax, 0x4(%rsp)
movq $0x0, 0x8(%rsp)
jmp 0xe242
leaq 0x9bc0d(%rip), %rsi     # 0xaa1f4
movq %r14, %rdi
xorl %eax, %eax
callq 0xd7c4
testq %rax, %rax
jne 0xe2ec
jmp 0xe4e6