// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_typespec_s_expand_x
er_t xoico_typespec_s_expand_x( const xoico_typespec_s* o, const xoico_host* host, x_sink* sink )
{
    // xoico_typespec.x:254: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)) )
    {
        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 ) )));
    
    switch( o->access_class )
    {
        case TYPEOF_const:       x_sink_push_fa(sink,"c " ); break;
        case TYPEOF_mutable:     x_sink_push_fa(sink,"m " ); break;
        case TYPEOF_discardable: x_sink_push_fa(sink,"d " ); break;
        default: break;
    }
    
    if( o->flag_static   ) x_sink_push_fa(sink,"static " );
    if( o->flag_volatile ) x_sink_push_fa(sink,"volatile " );
    sc_t sc_type = st_type->sc;
    
    if( o->transient )
    {
        x_sink_push_fa(sink,"(#<sc_t>)", xoico_host_a_nameof(host,o->transient->class ) );
    }
    
    x_sink_push_fa(sink,"#<sc_t>", sc_type );
    
    if( o->indirection > 0 ) x_sink_push_fa(sink,".#<sz_t>", o->indirection );
    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, %r15
movq %rdi, %r14
leaq 0x109503(%rip), %rax    # 0x117dd0
movq (%rax), %rsi
movq %rsp, %r12
movq %r12, %rdi
callq 0x717f5
andq $0x0, 0x10(%r12)
cmpb $0x0, 0x2f(%r14)
je 0xe8f4
leaq 0x9b985(%rip), %rsi     # 0xaa274
jmp 0xea6a
movq %r15, %rdi
callq 0xdab3
movq %rax, %r12
movq 0x8(%r14), %rsi
movabsq $-0x59040ffc58933ff2, %r13 # imm = 0xA6FBF003A76CC00E
cmpq %r13, %rsi
je 0xe92e
movabsq $0x213393bef2495d15, %rax # imm = 0x213393BEF2495D15
cmpq %rax, %rsi
jne 0xe952
movq %r15, %rdi
callq 0xe8a0
movq %rax, %rsi
jmp 0xe952
leaq 0x9b9ba(%rip), %rdi     # 0xaa2ef
leaq 0x9b954(%rip), %rsi     # 0xaa290
leaq 0x9b95c(%rip), %rcx     # 0xaa29f
movl $0x21e, %edx            # imm = 0x21E
xorl %eax, %eax
callq 0x60186
movq %r13, %rsi
movq %r12, %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 %rax, %r12
movq 0x10(%r14), %rax
movabsq $0x65c9718e19e3df34, %rcx # imm = 0x65C9718E19E3DF34
cmpq %rcx, %rax
je 0xe9bf
movabsq $-0x12e90733f18038df, %rcx # imm = 0xED16F8CC0E7FC721
cmpq %rcx, %rax
je 0xe9b6
movabsq $-0x2c53c3baa9910217, %rcx # imm = 0xD3AC3C45566EFDE9
cmpq %rcx, %rax
jne 0xe9d0
leaq 0x9b955(%rip), %rsi     # 0xaa309
jmp 0xe9c6
leaq 0x9b94f(%rip), %rsi     # 0xaa30c
jmp 0xe9c6
leaq 0x9f514(%rip), %rsi     # 0xadeda
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd43
cmpb $0x1, 0x28(%r14)
jne 0xe9e8
leaq 0x9b8ed(%rip), %rsi     # 0xaa2cb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd43
cmpb $0x1, 0x29(%r14)
jne 0xea00
leaq 0x9b8e4(%rip), %rsi     # 0xaa2da
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd43
movq 0x8(%r12), %r12
movq 0x18(%r14), %rax
testq %rax, %rax
je 0xea2e
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0xdf58
leaq 0x9b8ee(%rip), %rsi     # 0xaa30f
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xdd43
leaq 0xb40d4(%rip), %rsi     # 0xc2b09
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xdd43
movq 0x20(%r14), %rdx
testq %rdx, %rdx
jle 0xea5c
leaq 0x9b8c7(%rip), %rsi     # 0xaa319
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd43
cmpb $0x1, 0x2a(%r14)
jne 0xea74
leaq 0x9b87a(%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