// File: /workspace/github_c_makefile_star2_O3/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 0x18a652(%rip), %rax    # 0x19bdd0
movq (%rax), %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xd6675
movq $0x0, 0x10(%r12)
cmpb $0x0, 0x2f(%r14)
je 0x117aa
leaq 0x11bacf(%rip), %rsi    # 0x12d274
jmp 0x119f3
movq (%r15), %r12
leaq 0x180eec(%rip), %rbp    # 0x1926a0
movl 0x180ee6(%rip), %eax    # 0x1926a0
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 0x1180d
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r12, %rdx
je 0x1180d
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r12, %rdx
je 0x1180d
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r12, %rdx
jne 0x11816
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0x1183d
movabsq $-0x1e682f89ce03d7c8, %rdi # imm = 0xE197D07631FC2838
movq %r12, %rsi
callq 0xe9bc5
movq %rax, %r13
leaq 0x180e6e(%rip), %rdi    # 0x1926a0
movq %r12, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r15, %rdi
callq *0x20(%r13)
movq %rax, %r12
movq 0x8(%r14), %rsi
movabsq $-0x59040ffc58933ff2, %r13 # imm = 0xA6FBF003A76CC00E
cmpq %r13, %rsi
je 0x11908
movabsq $0x213393bef2495d15, %rax # imm = 0x213393BEF2495D15
cmpq %rax, %rsi
jne 0x1192c
movq (%r15), %r13
movl 0x180e26(%rip), %eax    # 0x1926a0
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 0x118cd
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x118cd
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x118cd
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x118d6
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0x118fd
movabsq $-0x1e682f89ce03d7c8, %rdi # imm = 0xE197D07631FC2838
movq %r13, %rsi
callq 0xe9bc5
movq %rax, %rbp
leaq 0x180dae(%rip), %rdi    # 0x1926a0
movq %r13, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r15, %rdi
callq *0x30(%rbp)
movq %rax, %rsi
jmp 0x1192c
leaq 0x11b969(%rip), %rdi    # 0x12d278
leaq 0x11b97a(%rip), %rsi    # 0x12d290
leaq 0x11b982(%rip), %rcx    # 0x12d29f
movl $0x1f9, %edx            # imm = 0x1F9
xorl %eax, %eax
callq 0xbe6f9
movq %r13, %rsi
movq %r12, %rdi
callq 0xe3d7
movq %rax, %rdi
callq 0x109f0e
leaq 0x8(%rsp), %rdi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
xorl %esi, %esi
movq %rax, %rcx
callq 0xd68a8
movq 0x8(%rax), %r15
cmpb $0x1, 0x28(%r14)
jne 0x11971
leaq 0x11b964(%rip), %rsi    # 0x12d2cb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xed3f
movabsq $0x65c9718e19e3df34, %rax # imm = 0x65C9718E19E3DF34
cmpq %rax, 0x10(%r14)
jne 0x11992
leaq 0x11b94b(%rip), %rsi    # 0x12d2d3
movq %rbx, %rdi
xorl %eax, %eax
callq 0xed3f
cmpb $0x1, 0x29(%r14)
jne 0x119aa
leaq 0x11b93a(%rip), %rsi    # 0x12d2da
movq %rbx, %rdi
xorl %eax, %eax
callq 0xed3f
leaq 0x1332c4(%rip), %rsi    # 0x144c75
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0xed3f
cmpq $0x0, 0x20(%r14)
jle 0x119e5
leaq 0x12730a(%rip), %r15    # 0x138cd6
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0xed3f
incq %r12
cmpq 0x20(%r14), %r12
jl 0x119cf
cmpb $0x0, 0x2a(%r14)
je 0x119fd
leaq 0x11b8f1(%rip), %rsi    # 0x12d2e4
movq %rbx, %rdi
xorl %eax, %eax
callq 0xed3f
leaq 0x8(%rsp), %rdi
callq 0xd6d2c
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq