// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/lib/bcore/bcore.xo.c
// Function: x_stamp_path_s_get_sr_in_t
sr_s x_stamp_path_s_get_sr_in_t( const x_stamp_path_s* o, tp_t t, const x_inst* inst )
{
    // bcore_x_stamp.h:294:1
    
    sr_s sr0 = sr_twc(t, inst );
    if( !sr0.o ) return  sr_null();
    
    const bcore_via_s* p = NULL;
    sz_t index = -1;
    
    bl_t found = true;
    
    for(sz_t i = 0; i < o->size; i++ )
    {
        const bcore_via* via = ((const 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 ) );
            const bcore_array* array = ( const 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; }
            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; }
            sr1 = bcore_via_p_iget( p, via, index );
        }
        sr_down( sr0 );
        sr0 = sr1;
        if( !sr0.o ) return  sr_null();
    }
    
    if( !found ) sr_s_clear(&(sr0));
    
    return  sr0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %r15
movq %rsi, 0x38(%rsp)
movq %rdi, %rbx
testq %rdx, %rdx
je 0x57664
movq %rdx, %rdi
callq 0x1074f1
movq %rax, %rdx
jmp 0x57666
xorl %edx, %edx
testq %r15, %r15
je 0x5797e
movq %rbx, 0x40(%rsp)
movq 0x38(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x57991
movl $0x1, %ecx
movq $-0x1, 0x48(%rsp)
movq $0x0, 0x18(%rsp)
movq %rdx, %r14
movq %r15, %r13
xorl %ebp, %ebp
xorl %r12d, %r12d
movq %rcx, 0x50(%rsp)
testq %rbp, %rbp
movq 0x48(%rsp), %rbx
je 0x576fd
testq %rbx, %rbx
js 0x576fd
movq 0x20(%rbp), %r9
cmpq %rbx, %r9
ja 0x576e7
leaq 0xe7aa1(%rip), %rdi     # 0x13f16b
leaq 0xe7a67(%rip), %rsi     # 0x13f138
movl $0x5c, %edx
leaq 0xe7a6f(%rip), %rcx     # 0x13f14c
movq %rbx, %r8
xorl %eax, %eax
callq 0xbe592
movq 0x30(%rbp), %rax
imulq $0x38, %rbx, %rcx
movq 0x20(%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0x577a0
testq %r14, %r14
je 0x57708
movq 0x8(%r14), %r15
jmp 0x5770b
xorl %r15d, %r15d
leaq 0x1459e6(%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 %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x57767
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x57767
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x57767
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x57770
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0x577a0
movabsq $0x541d0401d4dcff33, %rdi # imm = 0x541D0401D4DCFF33
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %rbp
leaq 0x14596c(%rip), %rdi    # 0x19d0f8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
testq %rbp, %rbp
je 0x57a0d
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax,%r12,8), %rdx
movabsq $-0x20efc6351cd3a688, %rax # imm = 0xDF1039CAE32C5978
cmpq %rax, %rdx
jne 0x577e5
testq %r14, %r14
movq %r13, %rbx
je 0x5782b
movq 0x8(%r14), %rsi
movabsq $-0x196aeddfdbdcdb38, %rdi # imm = 0xE6951220242324C8
callq 0xe9a82
testb %al, %al
je 0x57998
movq 0x8(%r14), %r15
jmp 0x5784a
movq %rbp, %rdi
movq %r13, %rbx
movq %r13, %rsi
callq 0x102b8b
testq %rax, %rax
js 0x57998
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %rax, 0x48(%rsp)
movq %rax, %rcx
callq 0x101e10
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rdx
movq %rbx, %rax
movq 0x30(%rsp), %rbx
jmp 0x57922
movabsq $-0x196aeddfdbdcdb38, %rdi # imm = 0xE6951220242324C8
xorl %esi, %esi
callq 0xe9a82
movl $0x0, %r15d
testb %al, %al
je 0x5799d
leaq 0x1445cf(%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 %r15, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x578a6
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x578a6
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x578a6
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x578af
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0x578d6
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r13
leaq 0x144555(%rip), %rdi    # 0x19be20
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
movq 0x38(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax,%r12,8), %r15
movq %r13, %rdi
movq %rbx, %rsi
callq 0xede4d
cmpq %rax, %r15
jae 0x57998
incq %r12
leaq 0x20(%rsp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0xede75
movq 0x20(%rsp), %r15
movq 0x28(%rsp), %rdx
movq %rbx, %rax
movq 0x30(%rsp), %rbx
xorl %ebp, %ebp
movq %rax, 0x20(%rsp)
movq %r14, 0x28(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
testb $0x2, %al
je 0x57958
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rdx, %r14
callq 0x107590
movq %r14, %rdx
testq %r15, %r15
je 0x579f8
incq %r12
movq %rbx, %rcx
movq %rdx, %r14
movq %r15, %r13
movq 0x38(%rsp), %rax
cmpq 0x10(%rax), %r12
jb 0x576a6
jmp 0x579d9
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rax
jmp 0x579e9
movl $0x1, %ebx
jmp 0x579d9
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
testb $0x2, %al
je 0x579d2
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x107590
xorl %r15d, %r15d
xorl %edx, %edx
xorl %ebx, %ebx
movq 0x40(%rsp), %rax
movq %r15, (%rax)
movq %rdx, 0x8(%rax)
movq %rbx, 0x10(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorps %xmm0, %xmm0
movq 0x40(%rsp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
jmp 0x579e9
movq %r14, 0x18(%rsp)
movq %r13, %rbx
jmp 0x5799d