// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbp
leaq 0xe0(%rsp), %r13
leaq 0x14433f(%rip), %rax    # 0x19bdd0
movq (%rax), %rsi
leaq 0x60(%rsp), %r12
movq %r12, %rdi
callq 0xd6675
movq $0x0, 0x10(%r12)
testq %r15, %r15
je 0x57abe
movq %r15, %rdi
callq 0x1074f1
movq %rax, 0x38(%rsp)
jmp 0x57ac7
movq $0x0, 0x38(%rsp)
leaq 0x90(%rsp), %r15
movq %r15, %rdi
callq 0x107c9f
leaq 0x60(%rsp), %rdi
movabsq $0x79b76918ff0af12a, %rsi # imm = 0x79B76918FF0AF12A
movq %r15, %rdx
callq 0xd68d9
movups (%r13), %xmm0
movaps %xmm0, (%r15)
movq 0x10(%r13), %rax
movq %rax, 0x10(%r15)
andb $-0x3, 0x10(%r13)
testq %rbx, %rbx
je 0x57b3c
movq 0x10(%r14), %rax
testq %rax, %rax
sete %cl
movq (%r13), %r15
testq %r15, %r15
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
movq 0x38(%rsp), %rsi
jne 0x57c57
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x57b44
movq 0x8(%rax), %rdx
jmp 0x57b46
xorps %xmm0, %xmm0
jmp 0x58022
xorl %edx, %edx
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %rbx, 0x20(%rsp)
movq %rsi, 0x28(%rsp)
movq $0x1, 0x30(%rsp)
movq 0x8(%rsi), %r13
movq %rsi, %r12
cmpq %rdi, %r13
je 0x57c00
leaq 0x1448ee(%rip), %rax    # 0x19c468
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rsi
movq 0x18(%rax,%rcx,8), %rcx
andq %r13, %rcx
shlq $0x4, %rcx
leaq (%rsi,%rcx), %rax
movq (%rsi,%rcx), %rsi
movl $0x8, %ecx
cmpq %r13, %rsi
je 0x57bd0
movq 0x10(%rax), %rsi
movl $0x18, %ecx
cmpq %r13, %rsi
je 0x57bd0
movq 0x20(%rax), %rsi
movl $0x28, %ecx
cmpq %r13, %rsi
je 0x57bd0
movq 0x30(%rax), %rsi
movl $0x38, %ecx
cmpq %r13, %rsi
jne 0x57bd9
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x57c00
movq %r13, %rsi
movq %rdx, 0x48(%rsp)
callq 0xe9bc5
movq %rax, %r12
leaq 0x144878(%rip), %rdi    # 0x19c468
movq %r13, %rsi
movq %rax, %rdx
callq 0x115fac
movq 0x48(%rsp), %rdx
movq 0x20(%rsp), %rsi
cmpq %r15, %rsi
je 0x57c2f
cmpq %rdx, 0x8(%r12)
jne 0x57c21
movq %r12, %rdi
movq %r15, %rdx
callq *0x90(%r12)
jmp 0x57c2f
movq %r12, %rdi
movq %r15, %rcx
callq *0x98(%r12)
testb $0x2, 0x30(%rsp)
je 0x57c4e
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x107590
movq 0x10(%r14), %rax
movq 0x38(%rsp), %rsi
movq %rbp, 0x58(%rsp)
testq %rax, %rax
je 0x57fbe
movq %r14, 0x38(%rsp)
movl $0x1, %ecx
movq $-0x1, 0x50(%rsp)
movq $0x0, 0x40(%rsp)
movq %rsi, %r12
movq %rbx, %r15
xorl %r13d, %r13d
xorl %ebp, %ebp
movq %rcx, 0x48(%rsp)
testq %r13, %r13
movq 0x38(%rsp), %r14
je 0x57ceb
cmpq $0x0, 0x50(%rsp)
js 0x57ceb
movq 0x20(%r13), %r9
movq 0x50(%rsp), %rbx
cmpq %rbx, %r9
ja 0x57cd5
leaq 0xe74b3(%rip), %rdi     # 0x13f16b
leaq 0xe7479(%rip), %rsi     # 0x13f138
movl $0x5c, %edx
leaq 0xe7481(%rip), %rcx     # 0x13f14c
movq %rbx, %r8
xorl %eax, %eax
callq 0xbe592
movq 0x30(%r13), %rax
imulq $0x38, %rbx, %rcx
movq 0x20(%rax,%rcx), %r13
testq %r13, %r13
jne 0x57d8e
testq %r12, %r12
je 0x57cf7
movq 0x8(%r12), %rbx
jmp 0x57cf9
xorl %ebx, %ebx
leaq 0x1453f8(%rip), %rdx    # 0x19d0f8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %rbx, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %rbx, %rdx
je 0x57d55
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0x57d55
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0x57d55
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0x57d5e
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0x57d8e
movabsq $0x541d0401d4dcff33, %rdi # imm = 0x541D0401D4DCFF33
movq %rbx, %rsi
callq 0xe9bc5
movq %rax, %r13
leaq 0x14537e(%rip), %rdi    # 0x19d0f8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x115fac
testq %r13, %r13
je 0x57fc6
movq 0x8(%r14), %rax
movq (%rax,%rbp,8), %rdx
movabsq $-0x20efc6351cd3a688, %rax # imm = 0xDF1039CAE32C5978
cmpq %rax, %rdx
jne 0x57dd4
testq %r12, %r12
je 0x57e47
movq 0x8(%r12), %rsi
movabsq $-0x196aeddfdbdcdb38, %rdi # imm = 0xE6951220242324C8
callq 0xe9a82
testb %al, %al
je 0x57fc6
movq 0x8(%r12), %rbx
jmp 0x57e65
movq %r13, %rdi
movq %r15, %rsi
callq 0x102b8b
testq %rax, %rax
js 0x57fc6
movq %rax, %rbx
leaq 0x1(%rbp), %rax
cmpq 0x10(%r14), %rax
jne 0x57e1b
leaq 0xe0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x101fbc
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbx, 0x50(%rsp)
movq %rbx, %rcx
callq 0x101e10
movq 0x20(%rsp), %rbx
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %r14
jmp 0x57f66
movabsq $-0x196aeddfdbdcdb38, %rdi # imm = 0xE6951220242324C8
xorl %esi, %esi
callq 0xe9a82
movl $0x0, %ebx
testb %al, %al
je 0x57fcb
leaq 0x143fb4(%rip), %rdx    # 0x19be20
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %rbx, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %rbx, %rdx
je 0x57ec1
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0x57ec1
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0x57ec1
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0x57eca
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0x57ef1
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %rbx, %rsi
callq 0xe9bc5
movq %rax, %r13
leaq 0x143f3a(%rip), %rdi    # 0x19be20
movq %rbx, %rsi
movq %rax, %rdx
callq 0x115fac
movq 0x8(%r14), %rax
movq 0x8(%rax,%rbp,8), %rbx
movq %r13, %rdi
movq %r15, %rsi
callq 0xede4d
cmpq %rax, %rbx
jae 0x57fc6
leaq 0x2(%rbp), %rax
cmpq 0x10(%r14), %rax
jne 0x57f3e
leaq 0xe0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0xede81
incq %rbp
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %rbx, %rcx
callq 0xede75
movq 0x20(%rsp), %rbx
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %r14
xorl %r13d, %r13d
movq %r15, 0x20(%rsp)
movq %r12, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
testb $0x2, %al
je 0x57f9c
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rsi, %r15
callq 0x107590
movq %r15, %rsi
testq %rbx, %rbx
je 0x5801a
incq %rbp
movq %r14, %rcx
movq %rsi, %r12
movq %rbx, %r15
movq 0x38(%rsp), %rax
cmpq 0x10(%rax), %rbp
jb 0x57c8c
jmp 0x58007
movl $0x1, %r14d
jmp 0x58007
movq %r12, 0x40(%rsp)
movq %r15, 0x20(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x30(%rsp)
testb $0x2, %al
je 0x58000
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x107590
xorl %ebx, %ebx
xorl %esi, %esi
xorl %r14d, %r14d
movq 0x58(%rsp), %rbp
movq %rbx, (%rbp)
movq %rsi, 0x8(%rbp)
movq %r14, 0x10(%rbp)
jmp 0x5802e
xorps %xmm0, %xmm0
movq 0x58(%rsp), %rbp
movups %xmm0, (%rbp)
movq $0x0, 0x10(%rbp)
leaq 0x60(%rsp), %rdi
callq 0xd6d2c
movq %rbp, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq