// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
leaq 0x1580fe(%rip), %rax    # 0x1b2330
movq (%rax), %rax
movq %rax, -0x30(%rbp)
leaq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xbfe80
movq -0x68(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0xe8(%rbp)
movb $0x0, %al
callq 0xff2e0
movq -0xe8(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
callq 0xc01a0
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x5a2b3
movq -0x70(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xfea50
jmp 0x5a44c
movq -0x68(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0xa8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0xbfe80
movq -0xb0(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movq $0x1, 0x10(%rax)
movq -0x78(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x43710
movq %rax, %rdi
callq 0x9f0e0
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movl $0x1, %esi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
callq 0xc01a0
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x5a350
movq -0xb8(%rbp), %rdi
movl $0x2e, %esi
callq 0xffba0
movq -0x70(%rbp), %rdi
movq -0xb8(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x20(%rbp), %rcx
leaq 0xd9066(%rip), %rsi     # 0x1333d0
movb $0x0, %al
callq 0xfec20
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x9f5b0
testb $0x1, %al
jne 0x5a440
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x5a43e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0xc0(%rbp)
je 0x5a43c
movq $0x0, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq -0xc0(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x5a43a
movq -0xc0(%rbp), %rax
movq 0x8(%rax), %rax
movq -0xc8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0xd0(%rbp)
movq -0x70(%rbp), %rdi
movq -0xd0(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x20(%rbp), %rcx
leaq 0xd8fc8(%rip), %rsi     # 0x1333d0
movb $0x0, %al
callq 0xfec20
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x9f5b0
testb $0x1, %al
jne 0x5a422
jmp 0x5a424
jmp 0x5a43a
jmp 0x5a426
movq -0xc8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc8(%rbp)
jmp 0x5a3bd
jmp 0x5a43c
jmp 0x5a43e
jmp 0x5a440
leaq -0xb0(%rbp), %rdi
callq 0xc06e0
movq -0x70(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x9f5b0
testb $0x1, %al
jne 0x5a490
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0xe5a0e(%rip), %rsi     # 0x13fe7a
movb $0x0, %al
callq 0x53850
movq %rax, -0xd8(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0xd8(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5a4bc
movq -0x28(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0xfe850
movq $0x0, -0xe0(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0xe0(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)