// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_stamp_s_expand_definition
er_t xoico_stamp_s_expand_definition( const xoico_stamp_s* o, const xoico_host* host, sz_t indent, x_sink* sink )
{
    // xoico_stamp.x:968:1
    BLM_INIT_LEVEL(0);
    st_s* embedded_string = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,xoico_stamp_create_embedded_string(o->self_source )));
    
    // Issue below was mitigated by using nasc strings; error check can be removed
    // 4095 is the C99-limit for string literals
    //    if( embedded_string.size > 4095 )
    //    {
    //        return o.source_point.parse_error_fa
    //        (
    //            "Reflection embedding failed. (Stamp is too large)\n"
    //            "The embedded code would require a string literal larger than 4095 characters.\n"
    //            "This exceeds the limit defined in C99.\n"
    //        );
    //    }
    
    sz_t idx = st_s_find_char(embedded_string,0, -1, '=' );
    sc_t self_def = "";
    if( idx < embedded_string->size )
    {
        self_def = embedded_string->sc + idx + 1;
    }
    
    x_sink_push_fa(sink,"\n" );
    
    //   old code before nasc strings
    //    sink.push_fa( "#rn{ }BCORE_DEFINE_OBJECT_INST_P( #<sc_t> )\n", indent, o.st_name.sc );
    //    m st_s* multiline_string = xoico_stamp_create_structured_multiline_string( self_def, indent )^;
    //    sink.push_fa( "#<sc_t>;\n", multiline_string.sc );
    
    x_sink_push_fa(sink,"#rn{ }BCORE_DEFINE_OBJECT_INST_P_NASC_BEGIN( #<sc_t> )\n", indent, o->st_name.sc );
    st_s* multiline_nasc_string = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,xoico_stamp_create_structured_multiline_string_nasc(self_def, indent )));
    x_sink_push_fa(sink,"#<sc_t>,\n", multiline_nasc_string->sc );
    x_sink_push_fa(sink,"#rn{ }BCORE_DEFINE_OBJECT_INST_P_NASC_END( #<sc_t> )\n", indent, o->st_name.sc );
    
    {const xoico_funcs_s* __a=&(o->funcs );if(__a)for(sz_t __i=0;__i<__a->size;__i++){xoico_func_s* func=__a->data[__i]; BLM_TRY(xoico_func_s_expand_definition(func,((const xoico_host*)(o)), indent, sink ))
    
    }}BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movq %rdx, %r14
movq %rdi, %r15
movabsq $-0x503db0e6e1c2e704, %r13 # imm = 0xAFC24F191E3D18FC
leaq 0xfeea7(%rip), %rax     # 0x117dd0
movq (%rax), %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x717f5
andq $0x0, 0x10(%r12)
movq 0x48(%r15), %rdi
callq 0x19043
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r12
pushq $-0x1
popq %rdx
pushq $0x3d
popq %rcx
movq %rax, %rdi
xorl %esi, %esi
callq 0x8f5e7
cmpq 0x10(%r12), %rax
jae 0x18f80
movq 0x8(%r12), %rcx
leaq (%rcx,%rax), %rbp
incq %rbp
jmp 0x18f87
leaq 0xad645(%rip), %rbp     # 0xc65cc
leaq 0xad63d(%rip), %rsi     # 0xc65cb
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd43
movq 0x10(%r15), %rcx
leaq 0x9316a(%rip), %rsi     # 0xac110
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xdd43
movq %rbp, %rdi
movq %r14, %rsi
callq 0x191aa
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
movq %r13, %rdx
movq %rax, %rcx
callq 0x71967
movq 0x8(%rax), %rdx
leaq 0x9316d(%rip), %rsi     # 0xac148
movq %rbx, %rdi
xorl %eax, %eax
callq 0xdd43
movq 0x10(%r15), %rcx
leaq 0x93162(%rip), %rsi     # 0xac152
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0xdd43
xorl %r13d, %r13d
cmpq 0x68(%r15), %r13
jae 0x19027
movq 0x60(%r15), %rax
movq (%rax,%r13,8), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x119c5
incq %r13
testq %rax, %rax
je 0x19000
movq %rax, %r12
leaq 0x8(%rsp), %rdi
callq 0x71b64
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq