// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore.xo.c
// Function: x_bbml_t_translate_recursive
void x_bbml_t_translate_recursive( const x_bbml* o, tp_t t, tp_t name, bl_t shelve, x_sink* sink )
{
    // bcore_x_bbml.h:356:1
    
    // shelving obj_l
    if( o && shelve && bcore_via_call_t_defines_shelve(t ) )
    {
        x_bbml* o_clone =((x_bbml*)( x_inst_t_clone(((const x_inst*)(o)),t ))); // no scoping (o_clone is obliv)
        x_stamp_t_shelve(((x_stamp*)(o_clone)),t );
        x_bbml_t_translate_recursive(o_clone,t, name, false, sink );
        x_inst_discard(((x_inst*)(o_clone)));
        return ;
    }
    
    if( name ) x_bbml_push_type(sink, name );
    
    x_bbml_push_type(sink, t );
    x_bbml_push_flag(sink, o != NULL );
    
    if( o )
    {
        if( x_bbml_t_defines_bbml_body_to_sink(t ) )
        {
            x_bbml_t_bbml_body_to_sink(o,t, sink );
        }
        else if( t == TYPEOF_st_s ) // strings
        {
            const st_s* string = ((const st_s*)(o));
            x_sink_push_data(sink,( vc_t )string->data, string->size + 1 ); // push string including terminating 0
        }
        else if( x_stamp_t_is_leaf(t ) )
        {
            x_bbml_push_leaf(sink, t,((const x_inst*)( o )));
        }
        else
        {
            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 ) ) x_bbml_push_type(sink, x_array_t_get_mono_type(arr,t ) );
                sz_t size = x_array_t_size(arr,t );
                x_bbml_push_size(sink, size );
                for(sz_t i = 0; i < size; i++ )
                {
                    sr_s sr = x_array_t_c_get_sr(arr,t, i );
                    x_bbml_t_translate_recursive(((const x_bbml*)( sr.o)),sr_s_o_type(&(sr)), 0, true, sink );
                    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_bbml_t_translate_recursive(((const x_bbml*)( sr.o)),sr_s_o_type(&(sr)), name, true, sink );
                    sr_down( sr );
                }
    
                /// we push a terminating '0' to indicate the end of the parameter list
                x_bbml_push_type(sink, 0 );
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x554e1
testb $0x1, -0x19(%rbp)
je 0x554e1
movq -0x10(%rbp), %rdi
callq 0x54b20
testb $0x1, %al
jne 0x5549e
jmp 0x554e1
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x54b50
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x54b80
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x28(%rbp), %r8
xorl %ecx, %ecx
callq 0x55460
movq -0x30(%rbp), %rdi
callq 0x56920
jmp 0x5577d
cmpq $0x0, -0x18(%rbp)
je 0x554f5
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x56940
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x56940
movq -0x28(%rbp), %rdi
cmpq $0x0, -0x8(%rbp)
setne %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x56970
cmpq $0x0, -0x8(%rbp)
je 0x5577d
movq -0x10(%rbp), %rdi
callq 0x569b0
testb $0x1, %al
jne 0x55533
jmp 0x55549
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x569e0
jmp 0x5577b
movabsq $-0x503db0e6e1c2e704, %rax # imm = 0xAFC24F191E3D18FC
cmpq %rax, -0x10(%rbp)
jne 0x55583
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdx
addq $0x1, %rdx
callq 0x4fbe0
jmp 0x55779
movq -0x10(%rbp), %rdi
callq 0x54810
testb $0x1, %al
jne 0x55592
jmp 0x555a8
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rdx
callq 0x56390
jmp 0x55777
movq -0x10(%rbp), %rdi
callq 0x54870
testb $0x1, %al
jne 0x555ba
jmp 0x556a2
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x548a0
testb $0x1, %al
jne 0x555d1
jmp 0x555f8
movq -0x28(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x54960
movq -0xa8(%rbp), %rdi
movq %rax, %rsi
callq 0x56940
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x549c0
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x56a20
movq $0x0, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x48(%rbp), %rax
jge 0x5569d
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x50(%rbp), %rcx
leaq -0x68(%rbp), %rdi
callq 0x44940
movq -0x68(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x52c00
movq -0xb0(%rbp), %rdi
movq %rax, %rsi
movq -0x28(%rbp), %r8
xorl %eax, %eax
movl %eax, %edx
movl $0x1, %ecx
callq 0x55460
leaq -0x68(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x45510
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x5561e
jmp 0x55775
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4ce70
movq %rax, -0x78(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x80(%rbp), %rax
cmpq -0x78(%rbp), %rax
jge 0x55768
movq -0x70(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x80(%rbp), %rcx
leaq -0x98(%rbp), %rdi
callq 0x46220
movq -0x10(%rbp), %rdi
movq -0x80(%rbp), %rsi
callq 0x4ce90
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x52c00
movq -0xb8(%rbp), %rdi
movq %rax, %rsi
movq -0xa0(%rbp), %rdx
movq -0x28(%rbp), %r8
movl $0x1, %ecx
callq 0x55460
leaq -0x98(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x45510
movq -0x80(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x80(%rbp)
jmp 0x556bf
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x56940
jmp 0x55777
jmp 0x55779
jmp 0x5577b
jmp 0x5577d
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)