// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x18a2f0(%rip), %rax    # 0x19bdd0
movq (%rax), %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0xd6675
movq $0x0, 0x10(%r12)
cmpb $0x0, 0x2f(%r14)
je 0x11b0c
leaq 0x11b76d(%rip), %rsi    # 0x12d274
jmp 0x11e49
movq (%r15), %r12
leaq 0x180b8a(%rip), %rbp    # 0x1926a0
movl 0x180b84(%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 0x11b6f
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r12, %rdx
je 0x11b6f
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r12, %rdx
je 0x11b6f
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r12, %rdx
jne 0x11b78
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0x11b9f
movabsq $-0x1e682f89ce03d7c8, %rdi # imm = 0xE197D07631FC2838
movq %r12, %rsi
callq 0xe9bc5
movq %rax, %r13
leaq 0x180b0c(%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 0x11c71
movabsq $0x213393bef2495d15, %rax # imm = 0x213393BEF2495D15
cmpq %rax, %rsi
jne 0x11c95
movq (%r15), %r13
movl 0x180ac4(%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 0x11c2f
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x11c2f
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x11c2f
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x11c38
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0x11c5f
movabsq $-0x1e682f89ce03d7c8, %rdi # imm = 0xE197D07631FC2838
movq %r13, %rsi
callq 0xe9bc5
movq %rax, %rbp
leaq 0x180a4c(%rip), %rdi    # 0x1926a0
movq %r13, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r15, %rdi
callq *0x30(%rbp)
movq %rax, %rsi
leaq 0x180a31(%rip), %rbp    # 0x1926a0
jmp 0x11c95
leaq 0x11b677(%rip), %rdi    # 0x12d2ef
leaq 0x11b611(%rip), %rsi    # 0x12d290
leaq 0x11b619(%rip), %rcx    # 0x12d29f
movl $0x21e, %edx            # imm = 0x21E
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 %rax, %r12
movq 0x10(%r14), %rax
movabsq $0x65c9718e19e3df34, %rcx # imm = 0x65C9718E19E3DF34
cmpq %rcx, %rax
je 0x11d04
movabsq $-0x12e90733f18038df, %rcx # imm = 0xED16F8CC0E7FC721
cmpq %rcx, %rax
je 0x11cfb
movabsq $-0x2c53c3baa9910217, %rcx # imm = 0xD3AC3C45566EFDE9
cmpq %rcx, %rax
jne 0x11d15
leaq 0x11b610(%rip), %rsi    # 0x12d309
jmp 0x11d0b
leaq 0x11b60a(%rip), %rsi    # 0x12d30c
jmp 0x11d0b
leaq 0x11f1cf(%rip), %rsi    # 0x130eda
movq %rbx, %rdi
xorl %eax, %eax
callq 0xed3f
cmpb $0x1, 0x28(%r14)
jne 0x11d2d
leaq 0x11b5a8(%rip), %rsi    # 0x12d2cb
movq %rbx, %rdi
xorl %eax, %eax
callq 0xed3f
cmpb $0x1, 0x29(%r14)
jne 0x11d45
leaq 0x11b59f(%rip), %rsi    # 0x12d2da
movq %rbx, %rdi
xorl %eax, %eax
callq 0xed3f
movq 0x8(%r12), %r12
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x11e0d
movq 0x8(%rax), %rsi
movq %rbp, %rdx
movq (%r15), %rbp
movl 0x180939(%rip), %eax    # 0x1926a0
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %rbp, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %rbp, %rdx
je 0x11dba
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbp, %rdx
je 0x11dba
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbp, %rdx
je 0x11dba
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbp, %rdx
jne 0x11dc3
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0x11df2
movabsq $-0x1e682f89ce03d7c8, %rdi # imm = 0xE197D07631FC2838
movq %rsi, (%rsp)
movq %rbp, %rsi
callq 0xe9bc5
movq %rax, %r13
leaq 0x1808bd(%rip), %rdi    # 0x1926a0
movq %rbp, %rsi
movq %rax, %rdx
callq 0x115fac
movq (%rsp), %rsi
movq %r15, %rdi
callq *0x48(%r13)
leaq 0x11b50f(%rip), %rsi    # 0x12d30f
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0xed3f
leaq 0x132e61(%rip), %rsi    # 0x144c75
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0xed3f
movq 0x20(%r14), %rdx
testq %rdx, %rdx
jle 0x11e3b
leaq 0x11b4e8(%rip), %rsi    # 0x12d319
movq %rbx, %rdi
xorl %eax, %eax
callq 0xed3f
cmpb $0x1, 0x2a(%r14)
jne 0x11e53
leaq 0x11b49b(%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