// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x1973ae(%rip), %rax    # 0x1a8dd0
movq (%rax), %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xe0431
movq $0x0, 0x10(%r12)
cmpb $0x0, 0x2f(%r14)
je 0x11a4e
leaq 0x12682b(%rip), %rsi    # 0x138274
jmp 0x11c9f
movq (%r15), %r12
leaq 0x18dc48(%rip), %rbp    # 0x19f6a0
movl 0x18dc42(%rip), %eax    # 0x19f6a0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rbp,%rax,8), %rcx
movq 0x18(%rbp,%rax,8), %rdx
andq %r12, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r12, %rdx
je 0x11ab5
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r12, %rdx
je 0x11ab5
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r12, %rdx
je 0x11ab5
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r12, %rdx
jne 0x11cc4
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0x11ae5
movabsq $-0x1e682f89ce03d7c8, %rdi # imm = 0xE197D07631FC2838
movq %r12, %rsi
callq 0xf3f85
movq %rax, %r13
leaq 0x18dbc6(%rip), %rdi    # 0x19f6a0
movq %r12, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r15, %rdi
callq *0x20(%r13)
movq %rax, %r12
movq 0x8(%r14), %rsi
movabsq $-0x59040ffc58933ff2, %r13 # imm = 0xA6FBF003A76CC00E
cmpq %r13, %rsi
je 0x11bb4
movabsq $0x213393bef2495d15, %rax # imm = 0x213393BEF2495D15
cmpq %rax, %rsi
jne 0x11bd8
movq (%r15), %r13
movl 0x18db7e(%rip), %eax    # 0x19f6a0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rbp,%rax,8), %rcx
movq 0x18(%rbp,%rax,8), %rdx
andq %r13, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0x11b79
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x11b79
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x11b79
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x11ccc
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0x11ba9
movabsq $-0x1e682f89ce03d7c8, %rdi # imm = 0xE197D07631FC2838
movq %r13, %rsi
callq 0xf3f85
movq %rax, %rbp
leaq 0x18db02(%rip), %rdi    # 0x19f6a0
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r15, %rdi
callq *0x30(%rbp)
movq %rax, %rsi
jmp 0x11bd8
leaq 0x1266bd(%rip), %rdi    # 0x138278
leaq 0x1266ce(%rip), %rsi    # 0x138290
leaq 0x1266d6(%rip), %rcx    # 0x13829f
movl $0x1f9, %edx            # imm = 0x1F9
xorl %eax, %eax
callq 0xc825d
movq %r13, %rsi
movq %r12, %rdi
callq 0xe39f
movq %rax, %rdi
callq 0x114e47
leaq 0x8(%rsp), %rdi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
xorl %esi, %esi
movq %rax, %rcx
callq 0xe0676
movq 0x8(%rax), %r15
cmpb $0x1, 0x28(%r14)
jne 0x11c1d
leaq 0x1266b8(%rip), %rsi    # 0x1382cb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xee2a
movabsq $0x65c9718e19e3df34, %rax # imm = 0x65C9718E19E3DF34
cmpq %rax, 0x10(%r14)
jne 0x11c3e
leaq 0x12669f(%rip), %rsi    # 0x1382d3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xee2a
cmpb $0x1, 0x29(%r14)
jne 0x11c56
leaq 0x12668e(%rip), %rsi    # 0x1382da
movq %rbx, %rdi
xorl %eax, %eax
callq 0xee2a
leaq 0x13e007(%rip), %rsi    # 0x14fc64
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xee2a
cmpq $0x0, 0x20(%r14)
jle 0x11c91
leaq 0x1321e6(%rip), %r15    # 0x143e5e
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xee2a
incq %r12
cmpq 0x20(%r14), %r12
jl 0x11c7b
cmpb $0x0, 0x2a(%r14)
je 0x11ca9
leaq 0x126645(%rip), %rsi    # 0x1382e4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xee2a
leaq 0x8(%rsp), %rdi
callq 0xe0b30
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
jmp 0x11ab9
xorl %ebp, %ebp
jmp 0x11b7d