// File: /workspace/github_c_makefile_star2_O1/johsteffens[P]beth/lib/bcore/bcore.xo.c
// Function: x_btcl_context_s_get_embedding_file_path
er_t x_btcl_context_s_get_embedding_file_path( const x_btcl_context_s* o, x_source* source, sc_t in_path, st_s* out_path )
{
    // bcore_x_btcl.x:283:1
    BLM_INIT_LEVEL(0);
    st_s* try_path = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create()));
    
    if( in_path[ 0 ] == '/' )
    {
        st_s_copy_sc(try_path,in_path );
    }
    else
    {BLM_INIT_LEVEL(1);
        st_s* folder = ((st_s*)BLM_LEVEL_T_PUSH(1,st_s,bcore_file_folder_path(x_source_get_file(source) )));
        if( folder->size == 0 ) st_s_push_char(folder,'.' );
        st_s_copy_fa(try_path,"#<sc_t>/#<sc_t>", folder->sc, in_path );
    
        if( !bcore_file_exists(try_path->sc ) )
        {
            if( o->eval_path_arr )
            {
                {const bcore_arr_st_s* __a=o->eval_path_arr ;if(__a)for(sz_t __i=0;__i<__a->size;__i++){const st_s* st=__a->data[__i];
                {
                    st_s_copy_fa(try_path,"#<sc_t>/#<sc_t>", st->sc, in_path );
                    if( bcore_file_exists(try_path->sc ) ) break;
                }
            }}}
        }
    BLM_DOWN();}
    
    if( !bcore_file_exists(try_path->sc ) )
    {
        BLM_RETURNV(er_t, x_source_parse_error_fa(source,"embed: File '#<sc_t>' not found.", in_path ))
    }
    
    st_s_copy(out_path,try_path );
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rbp
movabsq $-0x503db0e6e1c2e704, %r12 # imm = 0xAFC24F191E3D18FC
leaq 0x122335(%rip), %rax    # 0x1a8dd0
movq (%rax), %rsi
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0xe0431
movq $0x0, 0x10(%r15)
xorl %eax, %eax
callq 0x114bbb
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rax, %rcx
callq 0xe0676
movq %rax, %r12
cmpb $0x2f, (%rbx)
jne 0x86ae2
movq %r12, %rdi
movq %rbx, %rsi
callq 0x11454b
jmp 0x86c67
movq %rbp, 0x8(%rsp)
movq %r13, 0x10(%rsp)
leaq 0x48(%rsp), %rdi
movq %rdi, (%rsp)
leaq 0x18(%rsp), %rsi
callq 0xe0431
movq (%rsp), %r15
movq $0x1, 0x10(%r15)
movq (%r14), %r13
leaq 0x1231b3(%rip), %rax    # 0x1a9cc8
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r13, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0x86b6f
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x86b6f
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x86b6f
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x86cb7
movq (%rax,%rcx), %rbp
testq %rbp, %rbp
jne 0x86b9f
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r13, %rsi
callq 0xf3f85
movq %rax, %rbp
leaq 0x123134(%rip), %rdi    # 0x1a9cc8
movq %r13, %rsi
movq %rax, %rdx
callq 0x12128c
movq %rbp, %rdi
movq %r14, %rsi
callq 0x10aa35
movq %rax, %rdi
callq 0xc8e31
movl $0x1, %esi
movq %r15, %rdi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
movq %rax, %rcx
callq 0xe0676
movq %rax, %r15
cmpq $0x0, 0x10(%rax)
jne 0x86be3
movq %r15, %rdi
movl $0x2e, %esi
callq 0x115381
movq 0x8(%r15), %rdx
leaq 0xb148a(%rip), %rsi     # 0x138078
movq %r12, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x114736
movq 0x8(%r12), %rdi
callq 0xc90fb
testb %al, %al
movq 0x8(%rsp), %rax
jne 0x86c5a
movq 0x8(%rax), %r13
testq %r13, %r13
je 0x86c5a
cmpq $0x0, 0x10(%r13)
je 0x86c5a
leaq 0xb1453(%rip), %r15     # 0x138078
xorl %ebp, %ebp
movq 0x8(%r13), %rax
movq (%rax,%rbp,8), %rax
movq 0x8(%rax), %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x114736
movq 0x8(%r12), %rdi
callq 0xc90fb
testb %al, %al
jne 0x86c5a
incq %rbp
cmpq 0x10(%r13), %rbp
jb 0x86c27
movq %rsp, %rdi
callq 0xe0b11
movq 0x10(%rsp), %r13
movq 0x8(%r12), %rdi
callq 0xc90fb
testb %al, %al
je 0x86c84
movq %r13, %rdi
movq %r12, %rsi
callq 0x114440
xorl %ebx, %ebx
jmp 0x86c9b
leaq 0xbc68b(%rip), %rsi     # 0x143316
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x77b7c
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xe0b30
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x86b73