// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore.xo.c
// Function: x_stamp_path_s_set_sr_ret_in_t
sr_s x_stamp_path_s_set_sr_ret_in_t( const x_stamp_path_s* o, tp_t t, x_inst* inst, sr_s sr_src )
{
    // bcore_x_stamp.h:343:1
    BLM_INIT_LEVEL(0);
    sr_s sr0 = sr_twc(t, inst );
    
    sr_s src_hook;BLM_T_INIT_SPUSH(sr_s, &src_hook);;
    src_hook = sr_src;
    sr_s_set_strong(&(sr_src),false );
    
    if( !sr0.o ) BLM_RETURNV(sr_s, sr_null())
    
    if( o->size == 0 && sr_src.o ) bcore_inst_x_copy_typed( sr0, sr_s_type(&(sr_src)), sr_src.o );
    
    const bcore_via_s* p = NULL;
    sz_t index = -1;
    
    bl_t found = true;
    
    for(sz_t i = 0; i < o->size; i++ )
    {
        bcore_via* via = ((bcore_via*)(sr0.o));
        p = ( p && index >= 0 ) ? bcore_via_p_iget_via( p, via, index ) : NULL;
        if( !p ) p = bcore_via_s_get_typed( sr_s_type( &sr0 ) );
        if( !p ) { found = false; break; }
    
        sr_s sr1 = sr_null();
    
        if( o->data[ i ] == TYPEOF_x_stamp_path_s_array_index )
        {
            if( !bcore_spect_trait_supported( TYPEOF_bcore_array, sr_s_type( &sr0 ) ) ) { found = false; break; }
            const bcore_array_s* p_array = bcore_array_s_get_typed( sr_s_type( &sr0 ) );
            bcore_array* array =((bcore_array*)( via));
            i++;
            uz_t arr_index = o->data[ i ];
            uz_t arr_size = bcore_array_p_get_size( p_array, array );
            if( arr_index >= arr_size ) { found = false; break; }
    
            if( i + 1 == o->size ) bcore_array_p_set( p_array, array, arr_index, sr_src );
    
            sr1 = bcore_array_p_get( p_array, array, arr_index );
            p = NULL;
        }
        else
        {
            index = bcore_via_p_nget_index( p, via, o->data[ i ] );
            if( index < 0 ) { found = false; break; }
    
            if( i + 1 == o->size ) bcore_via_p_iset( p, via, index, sr_src );
    
            sr1 = bcore_via_p_iget( p, via, index );
        }
        sr_down( sr0 );
        sr0 = sr1;
        if( !sr0.o ) BLM_RETURNV(sr_s, sr_null())
    }
    
    if( !found ) sr_s_clear(&(sr0));
    
    BLM_RETURNV(sr_s, sr0)
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x130(%rbp)
movq %rdi, -0x128(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x120(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
leaq 0x16cd39(%rip), %rax    # 0x1b2330
movq (%rax), %rax
movq %rax, -0x20(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xbfe80
movq -0x58(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0x45340
leaq -0x88(%rbp), %rdi
callq 0xfbe40
movq -0x20(%rbp), %rdi
movabsq $0x79b76918ff0af12a, %rsi # imm = 0x79B76918FF0AF12A
leaq -0x88(%rbp), %rdx
callq 0xc0220
movq -0x120(%rbp), %rdi
movq (%rdi), %rax
movq %rax, -0x88(%rbp)
movq 0x8(%rdi), %rax
movq %rax, -0x80(%rbp)
movq 0x10(%rdi), %rax
movq %rax, -0x78(%rbp)
xorl %esi, %esi
callq 0x45b00
cmpq $0x0, -0x70(%rbp)
jne 0x456a7
movq -0x130(%rbp), %rdi
callq 0x8a380
movq -0x58(%rbp), %rdi
callq 0xc0720
jmp 0x45ae6
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x456fa
movq -0x120(%rbp), %rax
cmpq $0x0, (%rax)
je 0x456fa
movq -0x120(%rbp), %rdi
callq 0x45450
movq %rax, %rdi
movq -0x120(%rbp), %rax
movq (%rax), %rsi
leaq -0x70(%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 0x45b50
movq $0x0, -0x90(%rbp)
movq $-0x1, -0x98(%rbp)
movb $0x1, -0x99(%rbp)
movq $0x0, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x45aad
movq -0x70(%rbp), %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0x90(%rbp)
je 0x45779
cmpq $0x0, -0x98(%rbp)
jl 0x45779
movq -0x90(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movq -0x98(%rbp), %rdx
callq 0x453b0
movq %rax, -0x138(%rbp)
jmp 0x45784
xorl %eax, %eax
movq %rax, -0x138(%rbp)
jmp 0x45784
movq -0x138(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x457b4
leaq -0x70(%rbp), %rdi
callq 0x45450
movq %rax, %rdi
callq 0x453e0
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x457ca
movb $0x0, -0x99(%rbp)
jmp 0x45aad
leaq -0xc8(%rbp), %rdi
callq 0x8a380
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0xa8(%rbp), %rcx
movabsq $-0x20efc6351cd3a688, %rdx # imm = 0xDF1039CAE32C5978
cmpq %rdx, (%rax,%rcx,8)
jne 0x45956
leaq -0x70(%rbp), %rdi
callq 0x45450
movq %rax, %rsi
movabsq $-0x196aeddfdbdcdb38, %rdi # imm = 0xE6951220242324C8
callq 0xd13b0
testb $0x1, %al
jne 0x45824
movb $0x0, -0x99(%rbp)
jmp 0x45aad
leaq -0x70(%rbp), %rdi
callq 0x45450
movq %rax, %rdi
callq 0x438f0
movq %rax, -0xd0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0xa8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xe0(%rbp)
movq -0xd0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x45470
movq %rax, -0xe8(%rbp)
movq -0xe0(%rbp), %rax
cmpq -0xe8(%rbp), %rax
jb 0x458ac
movb $0x0, -0x99(%rbp)
jmp 0x45aad
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x458fb
movq -0x120(%rbp), %rax
movq -0xd0(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x44160
movq -0xd0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
movq -0xe0(%rbp), %rcx
leaq -0x100(%rbp), %rdi
callq 0x441b0
movq -0x100(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xf0(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq $0x0, -0x90(%rbp)
jmp 0x45a33
movq -0x90(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0xa8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x454a0
movq %rax, -0x98(%rbp)
cmpq $0x0, -0x98(%rbp)
jge 0x45999
movb $0x0, -0x99(%rbp)
jmp 0x45aad
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x459e8
movq -0x120(%rbp), %rax
movq -0x90(%rbp), %rdi
movq -0xb0(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x45c00
movq -0x90(%rbp), %rsi
movq -0xb0(%rbp), %rdx
movq -0x98(%rbp), %rcx
leaq -0x118(%rbp), %rdi
callq 0x454d0
movq -0x118(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x70(%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 -0xc8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x45a94
movq -0x130(%rbp), %rdi
callq 0x8a380
movq -0x58(%rbp), %rdi
callq 0xc0720
jmp 0x45ae6
jmp 0x45a96
movq -0xa8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa8(%rbp)
jmp 0x45722
testb $0x1, -0x99(%rbp)
jne 0x45abf
leaq -0x70(%rbp), %rdi
callq 0x45560
movq -0x130(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, (%rax)
movq -0x68(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x60(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x58(%rbp), %rdi
callq 0xc0720
movq -0x128(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)