// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_bin_ml.c
// Function: translate
static void translate( const bcore_bin_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 );

    if( name ) push_type( sink_l, name );

    // 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 );
    }

    if( !obj_l.o ) // NULL
    {
        if( obj_l.p )
        {
            push_type( sink_l, sr_s_type( &obj_l ) );
            push_flag( &sink_l, false );
            // 'false' specifies that the object is not instantiated.
            // This is to differentiate from the case where the object was instantiated
            // without additional parameters.
        }
        else
        {
            push_type( sink_l, 0 );
        }
    }
    else
    {
        push_type( sink_l, sr_s_type( &obj_l ) );
        push_flag( &sink_l, true ); // true signals that the object is to be instantiated

        if( sr_s_type( &obj_l ) == TYPEOF_st_s ) // strings
        {
            const st_s* string = obj_l.o;
            bcore_sink_x_push_data( sink_l, string->data, string->size + 1 ); // push string including terminating 0
        }
        else if( bcore_via_x_is_leaf( obj_l ) )
        {
            switch( sr_s_type( &obj_l ) )
            {
                case TYPEOF_aware_t : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( aware_t ) ); break;
                case TYPEOF_bl_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( bl_t ) ); break;
                case TYPEOF_f2_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( f2_t ) ); break;
                case TYPEOF_f3_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( f3_t ) ); break;
                case TYPEOF_s0_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( s0_t ) ); break;
                case TYPEOF_s1_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( s1_t ) ); break;
                case TYPEOF_s2_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( s2_t ) ); break;
                case TYPEOF_s3_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( s3_t ) ); break;
                case TYPEOF_sc_t    : bcore_sink_x_push_data( sink_l, obj_l.o, bcore_strlen( obj_l.o ) ); break;
                case TYPEOF_sd_t    : bcore_sink_x_push_data( sink_l, obj_l.o, bcore_strlen( obj_l.o ) ); break;
                case TYPEOF_sz_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( sz_t ) ); break;
                case TYPEOF_uz_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( uz_t ) ); break;
                case TYPEOF_tp_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( tp_t ) ); break;
                case TYPEOF_u0_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( u0_t ) ); break;
                case TYPEOF_u1_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( u1_t ) ); break;
                case TYPEOF_u2_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( u2_t ) ); break;
                case TYPEOF_u3_t    : bcore_sink_x_push_data( sink_l, obj_l.o, sizeof( u3_t ) ); break;
                default: ERR( "Cannot convert type '%s' into a binary stream", ifnameof( sr_s_type( &obj_l ) ) );
            }
        }
        else
        {
            if( bcore_via_x_is_pure_array( obj_l ) )
            {
                sr_s arr_l = sr_cp( obj_l, TYPEOF_bcore_array_s );
                uz_t size = bcore_array_x_get_size( arr_l );
                bcore_sink_x_push_data( sink_l, &size, sizeof( uz_t ) );

                if( bcore_array_x_is_mutable_mono_typed( arr_l ) ) translate( o, 0, sr_tp( bcore_array_x_get_mono_type( arr_l ) ), sink_l, depth + 1 );

                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 );
                bcore_sink_x_push_data( sink_l, &size, sizeof( uz_t ) );
                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_life_s_discard( l );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, %r14
movq %rdi, %rbx
movabsq $0x541d0401d4dcff33, %r15 # imm = 0x541D0401D4DCFF33
xorl %eax, %eax
callq 0x717ac
movq %rax, %rbp
movq 0x198(%rsp), %r12
movq 0x1a0(%rsp), %rdi
movq 0x1a8(%rsp), %r13
movabsq $0x5ea8cabb93ff3b7e, %rsi # imm = 0x5EA8CABB93FF3B7E
callq 0x7abc8
movq %r12, 0xd0(%rsp)
movq %rax, 0xd8(%rsp)
movq %r13, 0xe0(%rsp)
movq %r13, 0x10(%rsp)
movups 0xd0(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x38(%rsp), %rdi
movq %rbp, %rsi
callq 0x8ced9
movq 0x180(%rsp), %r12
movq 0x188(%rsp), %rdi
movq 0x190(%rsp), %r13
movq %r15, %rsi
callq 0x7abc8
movq %r12, 0xb8(%rsp)
movq %rax, 0xc0(%rsp)
movq %r13, 0xc8(%rsp)
movq %r13, 0x10(%rsp)
movups 0xb8(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x50(%rsp), %rdi
movq %rbp, %rsi
callq 0x8ced9
testq %rbx, %rbx
je 0x9d541
leaq 0x70(%rsp), %rdi
movq %rbx, (%rdi)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
pushq $0x8
popq %rsi
callq 0x9f7fb
movq 0x50(%rsp), %rsi
testq %rsi, %rsi
je 0x9d605
movq 0x58(%rsp), %rdi
movq 0x8(%rdi), %rax
cmpq %r15, %rax
je 0x9d56d
movq %rax, %rdi
callq 0x9f991
movq %rax, %rdi
movq 0x50(%rsp), %rsi
callq 0x8b4d7
testb %al, %al
je 0x9d5ed
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 0x70(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %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
cmpq %r15, %rax
je 0x9d5e3
movq %rax, %rdi
callq 0x9f991
movq %rax, %rdi
movq 0x50(%rsp), %rsi
callq 0x8b4c4
cmpq $0x0, 0x50(%rsp)
je 0x9d605
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x9d668
movq 0x8(%rax), %rax
jmp 0x9d66a
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x9d647
movq 0x8(%rax), %rax
leaq 0x70(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x38(%rsp), %rbx
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
pushq $0x8
popq %rsi
callq 0x9f7fb
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9f7b6
jmp 0x9d6e0
leaq 0x70(%rsp), %rdi
andq $0x0, (%rdi)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
pushq $0x8
popq %rsi
jmp 0x9d6db
xorl %eax, %eax
leaq 0x70(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x38(%rsp), %rbx
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
pushq $0x8
popq %r12
movq %r12, %rsi
callq 0x9f7fb
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x9f7b6
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x9d6fa
movabsq $-0x503db0e6e1c2e704, %rcx # imm = 0xAFC24F191E3D18FC
cmpq %rcx, 0x8(%rax)
jne 0x9d6fa
movq 0x50(%rsp), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
incq %rsi
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x9f7fb
movq %rbp, %rdi
callq 0x717c7
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x9f852
testb %al, %al
je 0x9d875
movq 0x58(%rsp), %rax
testq %rax, %rax
je 0x9db34
movq 0x8(%rax), %rdi
movabsq $-0x73f6ae1ad309fd45, %rax # imm = 0x8C0951E52CF602BB
cmpq %rax, %rdi
je 0x9dc43
movabsq $-0x6bce971ace902370, %rax # imm = 0x943168E5316FDC90
cmpq %rax, %rdi
je 0x9dc62
movabsq $-0x6119581ac7eacd63, %rax # imm = 0x9EE6A7E53815329D
cmpq %rax, %rdi
je 0x9dc24
movabsq $-0x5fc2af85f419929b, %rax # imm = 0xA03D507A0BE66D65
cmpq %rax, %rdi
je 0x9d86b
movabsq $-0x5aa4411ac4e2880e, %rax # imm = 0xA55BBEE53B1D77F2
cmpq %rax, %rdi
je 0x9d86b
movabsq $-0x58737885f0577326, %rax # imm = 0xA78C877A0FA88CDA
cmpq %rax, %rdi
je 0x9dc24
movabsq $-0x4882601bdca6aefb, %rax # imm = 0xB77D9FE423595105
cmpq %rax, %rdi
je 0x9d86b
movabsq $-0x3f1363e6d8155aed, %rax # imm = 0xC0EC9C1927EAA513
cmpq %rax, %rdi
je 0x9d86b
movabsq $-0x3ac242643d9c35a8, %rax # imm = 0xC53DBD9BC263CA58
cmpq %rax, %rdi
je 0x9dc43
movabsq $0x6d07f9ef5b68e8a2, %rax # imm = 0x6D07F9EF5B68E8A2
cmpq %rax, %rdi
je 0x9d86b
movabsq $-0x84b14e74a9e1ff0, %rax # imm = 0xF7B4EB18B561E010
cmpq %rax, %rdi
je 0x9dc81
movabsq $0x230abe18cdeefc99, %rax # imm = 0x230ABE18CDEEFC99
cmpq %rax, %rdi
je 0x9dc81
movabsq $0x510c2417c67dabeb, %rax # imm = 0x510C2417C67DABEB
cmpq %rax, %rdi
je 0x9dc24
movabsq $0x585a3b17ca3de200, %rax # imm = 0x585A3B17CA3DE200
cmpq %rax, %rdi
je 0x9d86b
movabsq $0x62367a17d02b474d, %rax # imm = 0x62367A17D02B474D
cmpq %rax, %rdi
je 0x9dc43
movabsq $0x69849117d3eb7d62, %rax # imm = 0x69849117D3EB7D62
cmpq %rax, %rdi
je 0x9dc62
movabsq $-0x388c46b188de83fe, %rax # imm = 0xC773B94E77217C02
cmpq %rax, %rdi
jne 0x9db36
movq 0x50(%rsp), %rdi
jmp 0x9d650
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x9f8c7
testb %al, %al
je 0x9d9ee
movabsq $-0x5073d588c3beb52e, %r15 # imm = 0xAF8C2A773C414AD2
movq 0x50(%rsp), %rbx
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %r12
movq %r15, %rsi
callq 0x7abc8
movq %rbx, 0x90(%rsp)
movq %rax, 0x98(%rsp)
movq %r12, 0xa0(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x78(%rsp)
movq %r12, 0x80(%rsp)
movq 0x78(%rsp), %rdi
movq 0x8(%rdi), %rax
cmpq %r15, %rax
je 0x9d909
movq %rax, %rdi
callq 0x9fa75
movq %rax, %rdi
movq 0x70(%rsp), %rsi
callq 0x7c954
movq %rax, %rbx
testb $0x2, 0x80(%rsp)
je 0x9d93b
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
leaq 0xb0(%rsp), %rdi
movq %rbx, (%rdi)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
pushq $0x8
popq %rsi
callq 0x9f7fb
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x7e214
testb %al, %al
je 0x9db62
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 %r14
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x10(%rbx), %rax
movq %rax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
xorl %edi, %edi
movq %r14, %rsi
callq 0x9d43b
jmp 0x9db65
movq %rbp, 0xa8(%rsp)
movq 0x58(%rsp), %rax
movq 0x20(%rax), %rax
leaq 0x90(%rsp), %rdi
movq %rax, (%rdi)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rsi
callq 0x9f7fb
incq %r14
leaq 0xe8(%rsp), %r13
xorl %ebp, %ebp
cmpq 0x90(%rsp), %rbp
jae 0x9db27
movaps 0x50(%rsp), %xmm0
movaps %xmm0, 0x70(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x78(%rsp), %rbx
movq 0x8(%rbx), %rdi
cmpq %r15, %rdi
je 0x9da6d
callq 0x9f991
movq %rax, %rbx
movq 0x20(%rbx), %r9
cmpq %rbp, %r9
ja 0x9da98
leaq 0x1f36c(%rip), %rdi     # 0xbcde9
leaq 0x1f381(%rip), %rsi     # 0xbce05
pushq $0x4e
popq %rdx
leaq 0x1f38b(%rip), %rcx     # 0xbce19
movq %rbp, %r8
xorl %eax, %eax
callq 0x60031
movq 0x30(%rbx), %rax
movq (%rax,%r12), %rbx
testb $0x2, 0x80(%rsp)
je 0x9dac5
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movq %rbp, %rsi
callq 0x9f926
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0xe8(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x9d43b
incq %rbp
addq $0x38, %r12
jmp 0x9da32
movq 0xa8(%rsp), %rbp
jmp 0x9d6e0
xorl %edi, %edi
callq 0x9f8b1
leaq 0x12dae(%rip), %rdi     # 0xb08f0
leaq 0x2ead5(%rip), %rsi     # 0xcc61e
leaq 0x2eaea(%rip), %rcx     # 0xcc63a
pushq $0x67
popq %rdx
movq %rax, %r8
xorl %eax, %eax
callq 0x60031
jmp 0x9d6e0
incq %r14
xorl %ebx, %ebx
leaq 0x100(%rsp), %r12
cmpq 0xb0(%rsp), %rbx
jae 0x9d6e0
movups 0x90(%rsp), %xmm0
movaps %xmm0, 0x70(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x78(%rsp), %rsi
movq 0x8(%rsi), %rdi
cmpq %r15, %rdi
je 0x9dbb0
callq 0x9fa75
movq %rax, %rsi
movq 0x70(%rsp), %rdx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x7c97c
testb $0x2, 0x80(%rsp)
je 0x9dbe5
movq 0x80(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x70(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x8cdc1
movq 0x48(%rsp), %rax
movq %rax, 0x28(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x100(%rsp), %xmm0
movups %xmm0, (%rsp)
xorl %edi, %edi
movq %r14, %rsi
callq 0x9d43b
incq %rbx
jmp 0x9db6f
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
pushq $0x4
jmp 0x9d665
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
pushq $0x1
jmp 0x9d665
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
pushq $0x2
jmp 0x9d665
movq 0x50(%rsp), %rbx
movq %rbx, %rdi
callq 0x60379
movq 0x48(%rsp), %rcx
movq %rcx, 0x10(%rsp)
movups 0x38(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %rax, %rsi
jmp 0x9d6db