// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_typespec_s_expand
er_t xoico_typespec_s_expand( const xoico_typespec_s* o, const xoico_host* host, x_sink* sink )
{
    // xoico_typespec.x:216:1
    BLM_INIT_LEVEL(0);
    if( o->flag_variadic )
    {
        x_sink_push_fa(sink,"..." );
        BLM_RETURNV(er_t, 0)
    }
    
    xoico_compiler_s* compiler = xoico_host_a_compiler(host);
    
    tp_t type = o->type;
    
    if( type == ((tp_t)(TYPEOF_type_object)) )
    {
        //if( !sc_obj_type ) ERR_fa( "Cannot resolve 'type_object' at this point." );
        type = xoico_host_a_obj_type(host); //compiler.entypeof( sc_obj_type );
    }
    else if( type == ((tp_t)(TYPEOF_type_deduce)) )
    {
        ERR_fa( "Cannot resolve 'type_deduce' at this point." );
    }
    
    st_s* st_type = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create_sc(xoico_compiler_s_nameof(compiler,type ) )));
    
    sc_t sc_type = st_type->sc;
    if( o->flag_static   ) x_sink_push_fa(sink,"static " );
    if( o->access_class == TYPEOF_const ) x_sink_push_fa(sink,"const " );
    if( o->flag_volatile ) x_sink_push_fa(sink,"volatile " );
    x_sink_push_fa(sink,"#<sc_t>", sc_type );
    
    for(sz_t i = 0; i < o->indirection; i++ ) x_sink_push_fa(sink,"*" );
    if( o->flag_restrict ) x_sink_push_fa(sink," restrict " );
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r14
leaq 0x109696(%rip), %rax    # 0x117dd0
movq (%rax), %rsi
movq %rsp, %r15
movq %r15, %rdi
callq 0x717f5
andq $0x0, 0x10(%r15)
cmpb $0x0, 0x2f(%r14)
je 0xe760
leaq 0x9bb19(%rip), %rsi     # 0xaa274
jmp 0xe87e
movq %r12, %rdi
callq 0xdab3
movq %rax, %r15
movq 0x8(%r14), %rsi
movabsq $-0x59040ffc58933ff2, %r13 # imm = 0xA6FBF003A76CC00E
cmpq %r13, %rsi
je 0xe79a
movabsq $0x213393bef2495d15, %rax # imm = 0x213393BEF2495D15
cmpq %rax, %rsi
jne 0xe7be
movq %r12, %rdi
callq 0xe8a0
movq %rax, %rsi
jmp 0xe7be
leaq 0x9bad7(%rip), %rdi     # 0xaa278
leaq 0x9bae8(%rip), %rsi     # 0xaa290
leaq 0x9baf0(%rip), %rcx     # 0xaa29f
movl $0x1f9, %edx            # imm = 0x1F9
xorl %eax, %eax
callq 0x60186
movq %r13, %rsi
movq %r15, %rdi
callq 0xdad8
movq %rax, %rdi
callq 0x8ed62
movq %rsp, %rdi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
xorl %esi, %esi
movq %rax, %rcx
callq 0x71967
movq 0x8(%rax), %r15
cmpb $0x1, 0x28(%r14)
jne 0xe801
leaq 0x9bad4(%rip), %rsi     # 0xaa2cb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd43
movabsq $0x65c9718e19e3df34, %rax # imm = 0x65C9718E19E3DF34
cmpq %rax, 0x10(%r14)
jne 0xe822
leaq 0x9babb(%rip), %rsi     # 0xaa2d3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd43
cmpb $0x1, 0x29(%r14)
jne 0xe83a
leaq 0x9baaa(%rip), %rsi     # 0xaa2da
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd43
leaq 0xb42c8(%rip), %rsi     # 0xc2b09
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xdd43
leaq 0xa78ad(%rip), %r15     # 0xb6102
xorl %r12d, %r12d
cmpq 0x20(%r14), %r12
jge 0xe870
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xdd43
incq %r12
jmp 0xe858
cmpb $0x0, 0x2a(%r14)
je 0xe888
leaq 0x9ba66(%rip), %rsi     # 0xaa2e4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd43
movq %rsp, %rdi
callq 0x71b64
xorl %eax, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq