// File: /workspace/github_c_makefile_star2_O1/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 $0xb8, %rsp
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, 0x40(%rsp)
movq %rdi, %r15
leaq 0x14b991(%rip), %rax    # 0x1a8dd0
movq (%rax), %rsi
leaq 0x70(%rsp), %r14
movq %r14, %rdi
callq 0xe0431
movq $0x0, 0x10(%r14)
testq %rbx, %rbx
je 0x5d469
movq %rbx, %rdi
callq 0x1123e1
movq %rax, %r13
jmp 0x5d46c
xorl %r13d, %r13d
leaq 0xa0(%rsp), %rbx
movq %rbx, %rdi
callq 0x112ba5
leaq 0x70(%rsp), %rdi
movabsq $0x79b76918ff0af12a, %rsi # imm = 0x79B76918FF0AF12A
movq %rbx, %rdx
callq 0xe06ab
leaq 0xf0(%rsp), %rcx
movups (%rcx), %xmm0
movaps %xmm0, (%rbx)
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rbx)
andb $-0x3, 0x10(%rcx)
testq %r12, %r12
je 0x5d4ed
movq %r12, %r14
movq 0x40(%rsp), %rax
cmpq $0x0, 0x10(%rax)
sete %al
movq (%rcx), %rbx
testq %rbx, %rbx
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x5d60f
leaq 0xf0(%rsp), %rax
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x5d501
movq 0x8(%rax), %rdx
jmp 0x5d503
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq $0x0, 0x10(%r15)
jmp 0x5dae3
xorl %edx, %edx
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %r14, 0x28(%rsp)
movq %r13, %r14
movq %r13, 0x30(%rsp)
movq $0x1, 0x38(%rsp)
movq 0x8(%r13), %rbp
cmpq %rdi, %rbp
je 0x5d5c1
leaq 0x14bf31(%rip), %rax    # 0x1a9468
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rsi
movq 0x18(%rax,%rcx,8), %rcx
andq %rbp, %rcx
shlq $0x4, %rcx
leaq (%rsi,%rcx), %rax
movq (%rsi,%rcx), %rsi
movl $0x8, %ecx
cmpq %rbp, %rsi
je 0x5d591
movq 0x10(%rax), %rsi
movl $0x18, %ecx
cmpq %rbp, %rsi
je 0x5d591
movq 0x20(%rax), %rsi
movl $0x28, %ecx
cmpq %rbp, %rsi
je 0x5d591
movq 0x30(%rax), %rsi
movl $0x38, %ecx
cmpq %rbp, %rsi
jne 0x5db02
movq (%rax,%rcx), %r14
testq %r14, %r14
jne 0x5d5c1
movq %rbp, %rsi
movq %rdx, 0x20(%rsp)
callq 0xf3f85
movq %rax, %r14
leaq 0x14beb7(%rip), %rdi    # 0x1a9468
movq %rbp, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rsi
cmpq %rbx, %rsi
je 0x5d5ed
cmpq %rdx, 0x8(%r14)
jne 0x5d5e0
movq %r14, %rdi
movq %rbx, %rdx
callq *0x90(%r14)
jmp 0x5d5ed
movq %r14, %rdi
movq %rbx, %rcx
callq *0x98(%r14)
testb $0x2, 0x38(%rsp)
je 0x5d60c
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x112485
movq %r12, %r14
movq 0x40(%rsp), %rax
cmpq $0x0, 0x10(%rax)
movq %r13, %rsi
je 0x5da75
movq %r15, 0x60(%rsp)
movl $0x1, %eax
movq %rax, 0x50(%rsp)
movb $0x1, %al
movq %rax, 0x48(%rsp)
movq $-0x1, %r8
xorl %ebx, %ebx
xorl %r15d, %r15d
testq %rbx, %rbx
je 0x5d698
movl $0x0, %eax
testq %r8, %r8
js 0x5d69a
movq 0x20(%rbx), %r9
cmpq %r8, %r9
ja 0x5d689
movq %rsi, %r12
leaq 0xecc8d(%rip), %rdi     # 0x14a2f3
leaq 0xecc53(%rip), %rsi     # 0x14a2c0
movl $0x5c, %edx
leaq 0xecc5b(%rip), %rcx     # 0x14a2d4
movq %r8, %r13
xorl %eax, %eax
callq 0xc80f6
movq %r13, %r8
movq %r12, %rsi
movq 0x30(%rbx), %rax
imulq $0x38, %r8, %rcx
movq 0x20(%rax,%rcx), %rax
jmp 0x5d69a
xorl %eax, %eax
movq %rax, %rbx
testq %rax, %rax
jne 0x5d75a
testq %rsi, %rsi
je 0x5d6b1
movq 0x8(%rsi), %r13
jmp 0x5d6b4
xorl %r13d, %r13d
leaq 0x14ca3d(%rip), %rdx    # 0x1aa0f8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r13, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0x5d714
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x5d714
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x5d714
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x5da66
movq (%rax,%rcx), %rbx
testq %rbx, %rbx
jne 0x5d75a
movq %rsi, 0x58(%rsp)
movabsq $0x541d0401d4dcff33, %rdi # imm = 0x541D0401D4DCFF33
movq %r13, %rsi
movq %r14, %rbp
movq %r8, %r14
callq 0xf3f85
movq %rax, %rbx
leaq 0x14c9b4(%rip), %rdi    # 0x1aa0f8
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq %r14, %r8
movq %rbp, %r14
movq 0x58(%rsp), %rsi
movl $0x2, %r12d
testq %rbx, %rbx
je 0x5d79b
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax,%r15,8), %rdx
movabsq $-0x20efc6351cd3a688, %rax # imm = 0xDF1039CAE32C5978
cmpq %rax, %rdx
jne 0x5d7ab
testq %rsi, %rsi
movq %r8, 0x20(%rsp)
je 0x5d831
movq %rsi, %r13
movq 0x8(%rsi), %rsi
jmp 0x5d836
movq $0x0, 0x48(%rsp)
xorl %ebx, %ebx
jmp 0x5da4d
movq %rsi, %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10d7e8
movq %rax, %r8
testq %rax, %rax
js 0x5d868
leaq 0x1(%r15), %rax
movq 0x40(%rsp), %rcx
cmpq 0x10(%rcx), %rax
movq %r8, 0x20(%rsp)
jne 0x5d804
leaq 0xf0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
movq %r8, %rdx
callq 0x10cbd2
movq 0x20(%rsp), %r8
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rbp
movq %r14, %rdx
movq %r8, %rcx
callq 0x10ca2c
movq 0x28(%rsp), %r14
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
movq %r13, %rsi
jmp 0x5d9c4
movq %rsi, %r13
xorl %esi, %esi
movabsq $-0x196aeddfdbdcdb38, %rdi # imm = 0xE6951220242324C8
callq 0xf3e2a
testb %al, %al
je 0x5d857
movq %r13, %rsi
testq %r13, %r13
je 0x5d879
movq 0x8(%rsi), %r13
jmp 0x5d87c
movq $0x0, 0x48(%rsp)
movq %r13, %rsi
jmp 0x5da48
movq $0x0, 0x48(%rsp)
movq %r13, %rsi
jmp 0x5da4d
xorl %r13d, %r13d
leaq 0x14b59d(%rip), %rdx    # 0x1a8e20
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r13, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0x5d8dc
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x5d8dc
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x5d8dc
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x5da6d
movq (%rax,%rcx), %r12
movq %rsi, 0x58(%rsp)
testq %r12, %r12
jne 0x5d911
movabsq $-0x5073d588c3beb52e, %rdi # imm = 0xAF8C2A773C414AD2
movq %r13, %rsi
callq 0xf3f85
movq %rax, %r12
leaq 0x14b51a(%rip), %rdi    # 0x1a8e20
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x40(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax,%r15,8), %r13
movq %r12, %rdi
movq %r14, %rsi
callq 0xf837b
cmpq %rax, %r13
jae 0x5d99a
movq %rax, 0x68(%rsp)
leaq 0x2(%r15), %rax
movq 0x40(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x5d969
leaq 0xf0(%rsp), %rcx
movq 0x10(%rcx), %rax
movq %rax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0xf83af
leaq 0x28(%rsp), %rdi
movq %r12, %rsi
movq %r14, %rbp
movq %r14, %rdx
movq %r13, %rcx
callq 0xf83a3
movq 0x28(%rsp), %r14
movq 0x30(%rsp), %rcx
movq 0x38(%rsp), %rdx
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x68(%rsp), %rax
jmp 0x5d9b3
movq %r14, %rbp
movl $0x2, %r12d
xorl %r14d, %r14d
xorl %ecx, %ecx
xorl %edx, %edx
movq $0x0, 0x48(%rsp)
incq %r15
cmpq %rax, %r13
movq 0x58(%rsp), %rsi
jae 0x5da45
movq %rbp, 0x28(%rsp)
movq %rsi, 0x30(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
testb $0x2, %al
je 0x5da00
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rcx, %r12
movq %rdx, %r13
callq 0x112485
movq %r13, %rdx
movq %r12, %rcx
xorl %r12d, %r12d
testq %r14, %r14
je 0x5da12
movq %rcx, %rsi
movq %rdx, 0x50(%rsp)
jmp 0x5da48
movq 0x60(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
leaq 0x70(%rsp), %rdi
movq %rcx, %r13
movq %rdx, %rbp
callq 0xe0b30
movl $0x1, %r12d
movq %r13, %rsi
movq %rbp, 0x50(%rsp)
jmp 0x5da48
movq %rbp, %r14
movq 0x20(%rsp), %r8
testl %r12d, %r12d
jne 0x5da86
incq %r15
movq 0x40(%rsp), %rax
cmpq 0x10(%rax), %r15
jb 0x5d644
jmp 0x5da80
xorl %ebx, %ebx
jmp 0x5d718
xorl %r12d, %r12d
jmp 0x5d8e0
movb $0x1, %dl
movl $0x1, %ecx
movb $0x1, %al
jmp 0x5da9c
movl $0x2, %r12d
cmpl $0x2, %r12d
sete %al
movq 0x60(%rsp), %r15
movq 0x50(%rsp), %rcx
movq 0x48(%rsp), %rdx
testb %al, %al
je 0x5daed
testb $0x1, %dl
jne 0x5dad8
movq %r14, 0x28(%rsp)
movq %rsi, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
testb $0x2, %cl
je 0x5dad1
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x28(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x112485
xorl %r14d, %r14d
xorl %esi, %esi
xorl %ecx, %ecx
movq %r14, (%r15)
movq %rsi, 0x8(%r15)
movq %rcx, 0x10(%r15)
leaq 0x70(%rsp), %rdi
callq 0xe0b30
movq %r15, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
jmp 0x5d595