// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore.xo.c
// Function: x_btml_t_translate_recursive
void x_btml_t_translate_recursive( const x_btml* o, tp_t t, tp_t name, bl_t shelve, x_sink* sink, sz_t depth )
{
    // bcore_x_btml.h:570:1
    BLM_INIT_LEVEL(0);
    sz_t indent = 4 * depth;
    st_s* buf = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create()));
    
    // shelving obj_l
    if( o && shelve && bcore_via_call_t_defines_shelve(t ) )
    {
        x_btml* o_clone =((x_btml*)( x_inst_t_clone(((const x_inst*)(o)),t ))); // o_clone is obliv
        x_stamp_t_shelve(((x_stamp*)(o_clone)),t );
        x_btml_t_translate_recursive(o_clone,t, name, false, sink, depth );
        x_inst_t_discard(((x_inst*)(o_clone)),t );
        BLM_RETURN();
    }
    
    x_sink_push_fa(sink,"#rn{ }", indent );
    if( name ) x_sink_push_fa(sink,"#<sc_t>:", x_btml_name_of(name, buf ) );
    
    if( !o ) // o == NULL ...
    {
        if( t )
        {
            // Explicit NULL specifies that the object is not instantiated.
            // This is to differentiate from the case where the object was instantiated
            // without additional parameters.
            x_sink_push_fa(sink,"<#<sc_t>>NULL</>\n", x_btml_name_of(t, buf ) );
        }
        else
        {
            x_sink_push_fa(sink,"<></>\n" );
        }
    }
    else // o != NULL ...
    {
        x_sink_push_fa(sink,"<#<sc_t>>", x_btml_name_of(t, buf ) );
    
        if( x_btml_t_defines_btml_body_to_sink(t ) )
        {
            x_btml_t_btml_body_to_sink(o,t, sink );
        }
        else if( t == TYPEOF_st_s ) // strings
        {BLM_INIT_LEVEL(3);
            st_s* string = ((st_s*)BLM_LEVEL_T_PUSH(3,st_s,st_s_clone(((const st_s*)(o)))));
            st_s_replace_char_sc(string,'\"', "\\\"" );
            x_sink_push_fa(sink,"\"#<sc_t>\"", string->sc );
        BLM_DOWN();}
        else if( x_stamp_t_is_leaf(t ) )
        {
            switch( t )
            {
                case ((tp_t)(TYPEOF_tp_t)):
                case ((tp_t)(TYPEOF_er_t)):
                case ((tp_t)(TYPEOF_aware_t)):
                {
                    sc_t sc_name = bnameof( *( tp_t* )o );
                    if( sc_name )
                    {
                        x_sink_push_fa(sink,"#<sc_t>", sc_name );
                    }
                    else
                    {
                        x_sink_push_st_d(sink,st_s_create_typed(t, o ) );
                    }
                }
                break;
    
                default:
                {
                    x_sink_push_st_d(sink,st_s_create_typed(t, o ) );
                }
                break;
            }
        }
        else
        {
            x_sink_push_char(sink,'\n' );
            if( x_stamp_t_is_pure_array(t ) )
            {
                const x_array* arr =((const x_array*)( o));
                if( x_array_t_is_mutable_mono_typed(t ) )
                {
                    tp_t mono_type = x_array_t_get_mono_type(arr,t );
                    x_btml_t_translate_recursive( ((const x_btml*)(&(mono_type))),((tp_t)(TYPEOF_tp_t)), TYPEOF_type, false, sink, depth + 1 );
                }
                sz_t size = x_array_t_size(arr,t );
                for(sz_t i = 0; i < size; i++ )
                {
                    sr_s sr = x_array_t_c_get_sr(arr,t, i );
                    x_btml_t_translate_recursive(((const x_btml*)( sr.o)),sr_s_o_type(&(sr)), 0, true, sink, depth + 1 );
                    sr_down( sr );
                }
            }
            else
            {
                const x_stamp* stamp =((const x_stamp*)( o));
                sz_t size = x_stamp_t_size(t );
                for(sz_t i = 0; i < size; i++ )
                {
                    sr_s sr = x_stamp_t_c_get_sr_i(stamp,t, i );
                    tp_t name = x_stamp_t_name(t, i );
                    x_btml_t_translate_recursive(((const x_btml*)( sr.o)),sr_s_o_type(&(sr)), name, true, sink, depth + 1 );
                    sr_down( sr );
                }
            }
            x_sink_push_fa(sink,"#rn{ }", indent );
        }
        x_sink_push_sc(sink,"</>\n" );
    }
    BLM_DOWN();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %r9, 0x20(%rsp)
movq %r8, 0x28(%rsp)
movl %ecx, %r12d
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
xorb $0x1, %r12b
movabsq $-0x503db0e6e1c2e704, %rbx # imm = 0xAFC24F191E3D18FC
leaq 0xe1e7b(%rip), %rax     # 0x117dd0
movq (%rax), %rsi
leaq 0x78(%rsp), %rbp
movq %rbp, 0x68(%rsp)
movq %rbp, %rdi
callq 0x717f5
andq $0x0, 0x10(%rbp)
xorl %eax, %eax
callq 0x8eb65
movq %rbp, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %rbp
testq %r15, %r15
sete %al
orb %r12b, %al
jne 0x35fed
movq %r14, %rdi
callq 0x37093
testb %al, %al
je 0x35fed
movq %r14, %rdi
movq %r15, %rsi
callq 0x2de39
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x370b1
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
movq 0x28(%rsp), %r8
movq 0x20(%rsp), %r9
callq 0x35f19
movq %r14, %rdi
movq %r15, %rsi
callq 0x2de03
leaq 0x78(%rsp), %rdi
callq 0x71b64
jmp 0x36358
movq 0x20(%rsp), %r12
leaq (,%r12,4), %rdx
leaq 0x74776(%rip), %rsi     # 0xaa777
movq 0x28(%rsp), %rbx
movq %rbx, %rdi
movq %rdx, 0x60(%rsp)
xorl %eax, %eax
callq 0x2e1bb
testq %r13, %r13
je 0x36039
movq %r13, %rdi
movq %rbp, %rsi
callq 0x363ff
leaq 0x7f1c9(%rip), %rsi     # 0xb51f5
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2e1bb
testq %r15, %r15
je 0x36082
movq %r14, %rdi
movq %rbp, %rsi
callq 0x363ff
leaq 0x7f1c7(%rip), %rsi     # 0xb5217
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2e1bb
movq %r14, %rdi
callq 0x58631
cmpq $0x0, 0x18(%rax)
je 0x360af
movq %r14, %rdi
callq 0x58631
movq %r15, %rdi
movq %rbx, %rsi
callq *0x18(%rax)
jmp 0x3633f
testq %r14, %r14
je 0x36135
movq %r14, %rdi
movq %rbp, %rsi
callq 0x363ff
leaq 0x7f161(%rip), %rsi     # 0xb51fe
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2e1bb
jmp 0x3634e
movabsq $-0x503db0e6e1c2e704, %r13 # imm = 0xAFC24F191E3D18FC
cmpq %r13, %r14
jne 0x3614b
leaq 0x30(%rsp), %r12
leaq 0x70(%rsp), %r14
movq %r12, (%r14)
leaq 0x78(%rsp), %rsi
movq %r12, %rdi
callq 0x717f5
movq $0x3, 0x10(%r12)
movq %r15, %rdi
callq 0x8efe4
pushq $0x3
popq %rsi
movq %r12, %rdi
movq %r13, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r15
leaq 0x74d47(%rip), %rdx     # 0xaae4f
pushq $0x22
popq %rsi
movq %rax, %rdi
callq 0x8fe10
movq 0x8(%r15), %rdx
leaq 0x7f103(%rip), %rsi     # 0xb5221
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2e1bb
movq %r14, %rdi
callq 0x71b48
jmp 0x3633f
leaq 0x7f0d4(%rip), %rsi     # 0xb5210
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2e1bb
jmp 0x3634e
movq %r14, %rdi
callq 0x36f05
testb %al, %al
je 0x361a7
movabsq $-0x4db4989f9014f113, %rax # imm = 0xB24B67606FEB0EED
cmpq %rax, %r14
je 0x36188
movabsq $0x6d07f9ef5b68e8a2, %rax # imm = 0x6D07F9EF5B68E8A2
cmpq %rax, %r14
je 0x36188
movabsq $-0x388c46b188de83fe, %rax # imm = 0xC773B94E77217C02
cmpq %rax, %r14
jne 0x3620a
movq (%r15), %rdi
callq 0x71db6
testq %rax, %rax
je 0x3620a
leaq 0x8c96d(%rip), %rsi     # 0xc2b09
movq %rbx, %rdi
movq %rax, %rdx
jmp 0x36338
pushq $0xa
popq %rsi
movq %rbx, %rdi
callq 0x37119
movq %r14, %rdi
callq 0x36f22
movq %r14, %rdi
testb %al, %al
je 0x36225
callq 0x36f27
testb %al, %al
je 0x362ac
movq %r15, %rdi
movq %r14, %rsi
callq 0x36f9c
leaq 0x30(%rsp), %rdi
movq %rax, (%rdi)
incq %r12
movabsq $0x6d07f9ef5b68e8a2, %rsi # imm = 0x6D07F9EF5B68E8A2
movabsq $-0x586bc610840563d3, %rdx # imm = 0xA79439EF7BFA9C2D
xorl %ecx, %ecx
movq %rbx, %r8
movq %r12, %r9
callq 0x35f19
jmp 0x362af
movq %r14, %rdi
movq %r15, %rsi
callq 0x8eeed
movq %rbx, %rdi
movq %rax, %rsi
callq 0x370f2
jmp 0x3633f
callq 0x32e3b
movq %rax, %r13
incq %r12
xorl %ebp, %ebp
testq %rax, %rax
cmovleq %rbp, %r13
cmpq %rbp, %r13
je 0x36329
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
callq 0x2f9bc
movq %r14, %rdi
movq %rbp, %rsi
callq 0x32e47
movq 0x38(%rsp), %rcx
testq %rcx, %rcx
je 0x36270
movq 0x8(%rcx), %rsi
jmp 0x36272
xorl %esi, %esi
movq 0x30(%rsp), %rdi
movq %rax, %rdx
pushq $0x1
popq %rcx
movq %rbx, %r8
movq %r12, %r9
callq 0x35f19
testb $0x2, 0x40(%rsp)
je 0x362a7
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
incq %rbp
jmp 0x36239
incq %r12
movq %r15, %rdi
movq %r14, %rsi
callq 0x36fc4
movq %rax, %r13
xorl %ebp, %ebp
testq %rax, %rax
cmovleq %rbp, %r13
cmpq %rbp, %r13
je 0x36329
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
callq 0x2ec2c
movq 0x38(%rsp), %rax
testq %rax, %rax
je 0x362ee
movq 0x8(%rax), %rsi
jmp 0x362f0
xorl %esi, %esi
movq 0x30(%rsp), %rdi
xorl %edx, %edx
pushq $0x1
popq %rcx
movq %rbx, %r8
movq %r12, %r9
callq 0x35f19
testb $0x2, 0x40(%rsp)
je 0x36324
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
incq %rbp
jmp 0x362c6
leaq 0x74447(%rip), %rsi     # 0xaa777
movq %rbx, %rdi
movq 0x60(%rsp), %rdx
xorl %eax, %eax
callq 0x2e1bb
leaq 0x7eecc(%rip), %rsi     # 0xb5212
movq %rbx, %rdi
callq 0x3713e
leaq 0x68(%rsp), %rdi
callq 0x71b48
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq