// File: /workspace/github_c_makefile_star2_O2/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, %r15
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r13
movabsq $-0x503db0e6e1c2e704, %rbp # imm = 0xAFC24F191E3D18FC
leaq 0xddb12(%rip), %rax     # 0x117dd0
movq (%rax), %rsi
leaq 0x18(%rsp), %r12
movq %r12, %rdi
callq 0x717f5
andq $0x0, 0x10(%r12)
xorl %eax, %eax
callq 0x8eb65
movq %r12, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r12
cmpb $0x2f, (%rbx)
jne 0x3a303
movq %r12, %rdi
movq %rbx, %rsi
callq 0x8e611
jmp 0x3a3d7
movq %r15, 0x8(%rsp)
leaq 0x48(%rsp), %r15
movq %r15, 0x10(%rsp)
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0x717f5
movq $0x1, 0x10(%r15)
movq %r14, %rdi
callq 0x2e2b1
movq %rax, %rdi
callq 0x60c15
pushq $0x1
popq %rsi
movq %r15, %rdi
movq %rbp, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %rbp
cmpq $0x0, 0x10(%rax)
jne 0x3a35d
pushq $0x2e
popq %rsi
movq %rbp, %rdi
callq 0x8f0ee
movq 0x8(%rbp), %rdx
leaq 0x6fd10(%rip), %rsi     # 0xaa078
movq %r12, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x8e7af
movq 0x8(%r12), %rdi
callq 0x60eaa
testb %al, %al
jne 0x3a3c8
movq 0x8(%r13), %r15
testq %r15, %r15
je 0x3a3c8
leaq 0x6fce5(%rip), %r13     # 0xaa078
xorl %ebp, %ebp
cmpq 0x10(%r15), %rbp
jae 0x3a3c8
movq 0x8(%r15), %rax
movq (%rax,%rbp,8), %rax
movq 0x8(%rax), %rdx
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x8e7af
movq 0x8(%r12), %rdi
callq 0x60eaa
incq %rbp
testb %al, %al
je 0x3a395
leaq 0x10(%rsp), %rdi
callq 0x71b48
movq 0x8(%rsp), %r15
movq 0x8(%r12), %rdi
callq 0x60eaa
testb %al, %al
je 0x3a3f4
movq %r15, %rdi
movq %r12, %rsi
callq 0x8e4fd
xorl %ebx, %ebx
jmp 0x3a40b
leaq 0x7b1bf(%rip), %rsi     # 0xb55ba
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x3667e
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x71b64
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq