// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_txt_ml.c
// Function: translate
static void translate( const bcore_txt_ml_translator_s* o, tp_t name, sr_s obj, sr_s sink, uz_t depth )
{
    bcore_life_s* l = bcore_life_s_create();
    sr_s sink_l = sr_cl( sr_cp( sink, TYPEOF_bcore_sink_s ), l );
    sr_s obj_l  = sr_cl( sr_cp( obj, TYPEOF_bcore_via_s ), l );
    st_s* ind = st_s_push_char_n( st_s_create_l( l ), ' ', depth * o->indent );
    st_s* buf = st_s_create_l( l );

    // shelving obj_l
    if( obj_l.o && bcore_via_r_defines_shelve( &obj_l ) )
    {
        obj_l = sr_cl( sr_clone( obj_l ), l );
        bcore_via_r_shelve( &obj_l );
    }

    bcore_sink_x_pushf( sink_l, "%s", ind->sc );
    if( name ) bcore_sink_x_pushf( sink_l, "%s:", name_of( name, buf ) );

    if( !obj_l.o ) // NULL
    {
        if( obj_l.p )
        {
            // Explicit NULL specifies that the object is not instantiated.
            // This is to differentiate from the case where the object was instantiated
            // without additional parameters.
            bcore_sink_x_pushf( sink_l, "<%s>NULL</>\n", name_of( sr_s_type( &obj_l ), buf ) );
        }
        else
        {
            bcore_sink_x_pushf( sink_l, "<></>\n" );
        }
    }
    else
    {
        bcore_sink_x_pushf( sink_l, "<%s>", name_of( sr_s_type( &obj_l ), buf ) );
        if( sr_s_type( &obj_l ) == TYPEOF_st_s ) // strings
        {
            st_s* string = st_s_clone( ( const st_s* )obj_l.o );
            st_s_replace_char_sc( string, '\"', "\\\"" );
            bcore_sink_x_pushf( sink_l, "\"%s\"", string->sc );
            st_s_discard( string );
        }
        else if( bcore_via_x_is_leaf( obj_l ) )
        {
            bcore_sink_x_push_string_d( sink_l, st_s_create_typed( sr_s_type( &obj_l ), obj_l.o ) );
        }
        else
        {
            bcore_sink_x_push_char( sink_l, '\n' );
            if( bcore_via_x_is_pure_array( obj_l ) )
            {
                sr_s arr_l = sr_cp( obj_l, TYPEOF_bcore_array_s );
                if( bcore_array_x_is_mutable_mono_typed( arr_l ) )
                {
                    translate( o, TYPEOF_type, sr_tp( bcore_array_x_get_mono_type( arr_l ) ), sink_l, depth + 1 );
                }
                uz_t size = bcore_array_x_get_size( arr_l );
                for( uz_t i = 0; i < size; i++ )
                {
                    translate( o, 0, bcore_array_x_get( arr_l, i ), sink_l, depth + 1 );
                }
            }
            else
            {
                uz_t size = bcore_via_p_get_size( obj_l.p, NULL );
                for( uz_t i = 0; i < size; i++ )
                {
                    translate( o, bcore_via_x_iget_name( obj_l, i ), bcore_via_x_iget( obj_l, i ), sink_l, depth + 1 );
                }
            }
            bcore_sink_x_pushf( sink_l, "%s", ind->sc );
        }
        bcore_sink_x_push_sc( sink_l, "</>\n" );
    }

    bcore_life_s_discard( l );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rdx, %r15
movq %rsi, 0xb0(%rsp)
movq %rdi, %r12
movabsq $0x5ea8cabb93ff3b7e, %rbp # imm = 0x5EA8CABB93FF3B7E
xorl %eax, %eax
callq 0x717ac
movq %rax, %r14
movq 0x198(%rsp), %rbx
movq 0x1a0(%rsp), %rdi
movq 0x1a8(%rsp), %r13
movq %rbp, %rsi
callq 0x7abc8
movq %rbx, 0xd0(%rsp)
movq %rax, 0xd8(%rsp)
movq %r13, 0xe0(%rsp)
movq %r13, 0x10(%rsp)
movups 0xd0(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0x8ced9
movq 0x180(%rsp), %rbx
movq 0x188(%rsp), %rdi
movq 0x190(%rsp), %r13
movabsq $0x541d0401d4dcff33, %rsi # imm = 0x541D0401D4DCFF33
callq 0x7abc8
movq %rbx, 0xb8(%rsp)
movq %rax, 0xc0(%rsp)
movq %r13, 0xc8(%rsp)
movq %r13, 0x10(%rsp)
movups 0xb8(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8ced9
movq %r14, %rdi
callq 0x8edb8
movq 0x8(%r12), %rdx
imulq %r15, %rdx
pushq $0x20
popq %rsi
movq %rax, %rdi
callq 0x8f175
movq %rax, %rbp
movq %r14, 0x88(%rsp)
movq %r14, %rdi
callq 0x8edb8
movq %rax, %r13
movq (%rbx), %rsi
testq %rsi, %rsi
je 0x9a1c9
movq 0x58(%rsp), %rdi
movq 0x8(%rdi), %rax
movabsq $0x541d0401d4dcff33, %rcx # imm = 0x541D0401D4DCFF33
cmpq %rcx, %rax
je 0x9a136
movq %rax, %rdi
callq 0x9ca6f
movq %rax, %rdi
movq 0x50(%rsp), %rsi
callq 0x8b4d7
testb %al, %al
je 0x9a1c9
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x130(%rsp), %rbx
movq %rbx, %rdi
callq 0x8cdc6
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq 0x88(%rsp), %rsi
callq 0x8ced9
movq 0x10(%rbx), %rax
movq %rax, 0x60(%rsp)
movups (%rbx), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x58(%rsp), %rdi
movq 0x8(%rdi), %rax
movabsq $0x541d0401d4dcff33, %rcx # imm = 0x541D0401D4DCFF33
cmpq %rcx, %rax
je 0x9a1bf
movq %rax, %rdi
callq 0x9ca6f
movq %rax, %rdi
movq 0x50(%rsp), %rsi
callq 0x8b4c4
movq 0x8(%rbp), %rsi
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x1cb61(%rip), %rdi     # 0xb6d4b
xorl %eax, %eax
callq 0x87d9c
movq 0xb0(%rsp), %rdi
testq %rdi, %rdi
je 0x9a22d
movq %r13, %rsi
callq 0x9c918
movq 0x80(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x31f38(%rip), %rdi     # 0xcc15b
movq %rax, %rsi
xorl %eax, %eax
callq 0x87d9c
cmpq $0x0, 0x50(%rsp)
movq 0x58(%rsp), %rax
je 0x9a245
testq %rax, %rax
je 0x9a286
movq 0x8(%rax), %rdi
jmp 0x9a288
testq %rax, %rax
je 0x9a4b2
movq 0x8(%rax), %rdi
movq %r13, %rsi
callq 0x9c918
movq 0x80(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x31ee8(%rip), %rdi     # 0xcc15f
movq %rax, %rsi
xorl %eax, %eax
callq 0x87d9c
jmp 0x9a4d6
xorl %edi, %edi
movq %r13, %rsi
callq 0x9c918
movq 0x80(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x31ebf(%rip), %rdi     # 0xcc16c
movq %rax, %rsi
xorl %eax, %eax
callq 0x87d9c
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x9a325
movabsq $-0x503db0e6e1c2e704, %rcx # imm = 0xAFC24F191E3D18FC
cmpq %rcx, 0x8(%rax)
jne 0x9a325
movq 0x50(%rsp), %rdi
callq 0x8efe4
movq %rax, %rbx
leaq 0x10b6a(%rip), %rdx     # 0xaae4f
pushq $0x22
popq %rsi
movq %rax, %rdi
callq 0x8fe10
movq 0x8(%rbx), %rsi
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x31e60(%rip), %rdi     # 0xcc171
xorl %eax, %eax
callq 0x87d9c
movq %rbx, %rdi
callq 0x8edd4
jmp 0x9a7c9
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x9c950
testb %al, %al
je 0x9a358
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x9a637
movq 0x8(%rax), %rdi
jmp 0x9a639
movups 0x70(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rdi
movq 0x8(%rdi), %rax
movabsq $0x5ea8cabb93ff3b7e, %rcx # imm = 0x5EA8CABB93FF3B7E
cmpq %rcx, %rax
je 0x9a392
movq %rax, %rdi
callq 0x9cabf
movq %rax, %rdi
movq 0x30(%rsp), %rsi
pushq $0xa
popq %rdx
callq 0x87b8d
testb $0x2, 0x40(%rsp)
je 0x9a3be
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x9c9af
testb %al, %al
movq %rbp, 0xa8(%rsp)
je 0x9a4e3
movabsq $-0x5073d588c3beb52e, %r14 # imm = 0xAF8C2A773C414AD2
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %r13
movq %r14, %rsi
callq 0x7abc8
movq %rbx, 0x90(%rsp)
movq %rax, 0x98(%rsp)
movq %r13, 0xa0(%rsp)
movq %r13, 0x10(%rsp)
movups 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x7e214
testb %al, %al
je 0x9a6bd
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x7e3aa
leaq 0x118(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8d13b
incq %r15
movq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
movabsq $-0x586bc610840563d3, %rsi # imm = 0xA79439EF7BFA9C2D
movq %r12, %rdi
movq %r15, %rdx
callq 0x99fe7
jmp 0x9a6c0
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x1ad41(%rip), %rdi     # 0xb5210
xorl %eax, %eax
callq 0x87d9c
movq 0x88(%rsp), %r14
jmp 0x9a83b
movq 0x58(%rsp), %rax
movq 0x20(%rax), %rbp
incq %r15
pushq $0x8
popq %r14
xorl %r13d, %r13d
cmpq %r13, %rbp
je 0x9a799
movaps 0x50(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rbx
movq 0x8(%rbx), %rdi
movabsq $0x541d0401d4dcff33, %rax # imm = 0x541D0401D4DCFF33
cmpq %rax, %rdi
je 0x9a533
callq 0x9ca6f
movq %rax, %rbx
movq 0x20(%rbx), %r9
cmpq %r13, %r9
ja 0x9a55e
leaq 0x228a6(%rip), %rdi     # 0xbcde9
leaq 0x228bb(%rip), %rsi     # 0xbce05
pushq $0x4e
popq %rdx
leaq 0x228c5(%rip), %rcx     # 0xbce19
movq %r13, %r8
xorl %eax, %eax
callq 0x60031
movq 0x30(%rbx), %rax
movq (%rax,%r14), %rbx
testb $0x2, 0x40(%rsp)
je 0x9a585
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
movaps 0x50(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rsi
movq 0x8(%rsi), %rdi
movabsq $0x541d0401d4dcff33, %rax # imm = 0x541D0401D4DCFF33
cmpq %rax, %rdi
je 0x9a5b9
callq 0x9ca6f
movq %rax, %rsi
movq 0x30(%rsp), %rdx
leaq 0xe8(%rsp), %rdi
movq %r13, %rcx
callq 0x8a459
testb $0x2, 0x40(%rsp)
je 0x9a5ed
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
movq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xe8(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x99fe7
incq %r13
addq $0x38, %r14
jmp 0x9a4f6
xorl %edi, %edi
movq 0x88(%rsp), %r14
movq 0x50(%rsp), %rsi
callq 0x8eeed
movq %rax, %rbx
movups 0x70(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rdi
movq 0x8(%rdi), %rax
movabsq $0x5ea8cabb93ff3b7e, %rcx # imm = 0x5EA8CABB93FF3B7E
cmpq %rcx, %rax
je 0x9a688
movq %rax, %rdi
callq 0x9cabf
movq %rax, %rdi
movq 0x30(%rsp), %rsi
movq %rbx, %rdx
callq 0x87c18
testb $0x2, 0x40(%rsp)
je 0x9a7d1
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
jmp 0x9a7d1
incq %r15
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
xorl %r13d, %r13d
callq 0x9ca0e
movq %rax, %rbp
leaq 0x100(%rsp), %rbx
cmpq %r13, %rbp
je 0x9a799
movups 0x90(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rsi
movq 0x8(%rsi), %rdi
cmpq %r14, %rdi
je 0x9a725
callq 0x9cb0f
movq %rax, %rsi
movq 0x30(%rsp), %rdx
movq %rbx, %rdi
movq %r13, %rcx
callq 0x7c97c
testb $0x2, 0x40(%rsp)
je 0x9a754
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
movq 0x80(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x100(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x99fe7
incq %r13
jmp 0x9a6ec
movq 0xa8(%rsp), %rax
movq 0x8(%rax), %rsi
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x1c589(%rip), %rdi     # 0xb6d4b
xorl %eax, %eax
callq 0x87d9c
movq 0x88(%rsp), %r14
movups 0x70(%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x38(%rsp), %rdi
movq 0x8(%rdi), %rax
movabsq $0x5ea8cabb93ff3b7e, %rcx # imm = 0x5EA8CABB93FF3B7E
cmpq %rcx, %rax
je 0x9a80b
movq %rax, %rdi
callq 0x9cabf
movq %rax, %rdi
movq 0x30(%rsp), %rsi
leaq 0x1a9fb(%rip), %rdx     # 0xb5212
callq 0x87bb1
testb $0x2, 0x40(%rsp)
je 0x9a83b
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
movq %r14, %rdi
callq 0x717c7
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq