// File: /workspace/github_c_makefile_star2_O3/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, 0x8(%rsp)
movabsq $-0x503db0e6e1c2e704, %rbp # imm = 0xAFC24F191E3D18FC
leaq 0x11cb04(%rip), %rax    # 0x19bdd0
movq (%rax), %rsi
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0xd6675
movq $0x0, 0x10(%r15)
xorl %eax, %eax
callq 0x109c82
movq %r15, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %rax, %rcx
callq 0xd68a8
movq %rax, %r12
cmpb $0x2f, (%rbx)
jne 0x7f313
movq %r12, %rdi
movq %rbx, %rsi
callq 0x109612
jmp 0x7f48a
movq %r13, (%rsp)
leaq 0x48(%rsp), %r15
movq %r15, 0x10(%rsp)
leaq 0x18(%rsp), %rsi
movq %r15, %rdi
callq 0xd6675
movq $0x1, 0x10(%r15)
movq (%r14), %r15
leaq 0x11d988(%rip), %rax    # 0x19ccc8
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r15, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0x7f396
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0x7f396
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0x7f396
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0x7f39f
movq (%rax,%rcx), %r13
testq %r13, %r13
jne 0x7f3c6
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %r15, %rsi
callq 0xe9bc5
movq %rax, %r13
leaq 0x11d90d(%rip), %rdi    # 0x19ccc8
movq %r15, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r13, %rdi
movq %r14, %rsi
callq 0xffe4a
movq %rax, %rdi
callq 0xbf2b1
leaq 0x48(%rsp), %rdi
movl $0x1, %esi
movq %rbp, %rdx
movq %rax, %rcx
callq 0xd68a8
movq %rax, %r15
cmpq $0x0, 0x10(%rax)
jne 0x7f405
movq %r15, %rdi
movl $0x2e, %esi
callq 0x10a448
movq 0x8(%r15), %rdx
leaq 0xadc68(%rip), %rsi     # 0x12d078
movq %r12, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1097fd
movq 0x8(%r12), %rdi
callq 0xbf581
testb %al, %al
jne 0x7f47c
movq 0x8(%rsp), %rax
movq 0x8(%rax), %r13
testq %r13, %r13
je 0x7f47c
cmpq $0x0, 0x10(%r13)
je 0x7f47c
leaq 0xadc31(%rip), %r15     # 0x12d078
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 0x1097fd
movq 0x8(%r12), %rdi
callq 0xbf581
testb %al, %al
jne 0x7f47c
incq %rbp
cmpq 0x10(%r13), %rbp
jb 0x7f449
leaq 0x10(%rsp), %rdi
callq 0xd6d0d
movq (%rsp), %r13
movq 0x8(%r12), %rdi
callq 0xbf581
testb %al, %al
je 0x7f4a7
movq %r13, %rdi
movq %r12, %rsi
callq 0x1094fa
xorl %ebx, %ebx
jmp 0x7f4be
leaq 0xb8ce0(%rip), %rsi     # 0x13818e
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x71189
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xd6d2c
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq