// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore.xo.c
// Function: bcore_shell_loop
er_t bcore_shell_loop( bcore_shell* o, const bcore_main_frame_s* frame, bcore_shell_control_s* control )
{
    // bcore_shell.h:422:1
    BLM_INIT_LEVEL(0);
    if( !control        ) control = ((bcore_shell_control_s*)BLM_LEVEL_T_PUSH(0,bcore_shell_control_s,bcore_shell_control_s_create()));
    if( !control->source ) x_source_a_attach( &(control->source ), (x_source*)( ((bcore_source*)bcore_fork(frame->source))));
    if( !control->sink   ) x_sink_a_attach( &(control->sink   ), (x_sink*)( ((bcore_sink*)bcore_fork(frame->sink))));
    
    while( !x_source_eos(control->source) && !bcore_shell_control_s_exit_loop(control) && !bcore_shell_a_loop_callback(o) )
    {BLM_INIT_LEVEL(1);
        if( control->prompt.size > 0 )
        {
            x_sink_flush(x_sink_push_fa(control->sink,"\n#<sc_t>> ", control->prompt.sc ));
        }
        else
        {
            x_sink_flush(x_sink_push_fa(control->sink,"\n#<sc_t>#<sc_t>(#<sc_t>)> ", control->path.sc, control->path.size ? " " : "", bnameof( o->_ ) ));
        }
        bcore_shell_control_s_reset(control);
    
        st_s expression;BLM_T_INIT_SPUSH(st_s, &expression);;
        BLM_TRY(x_source_parse_fa(control->source," #until'\n'#skip'\n'", (&(expression)) ))
    
        if( expression.size > 0 )
        {BLM_INIT_LEVEL(2);
            if( x_hmap_tp_exists(((const x_hmap_tp*)(&(control->hmap_alias))),btypeof( expression.sc ) ) )
            {
                st_s_copy(&(expression),((const st_s*)(x_hmap_tp_c_get(((const x_hmap_tp*)(&(control->hmap_alias))),btypeof( expression.sc ) ))) );
            }
    
            if( !bcore_shell_run_expression(o,frame, control, ((x_source*)BLM_LEVEL_A_PUSH(2,x_source_create_from_st(&(expression )))) ) )
            {
                x_sink_push_fa(control->sink,"Syntax error in expression '#<sc_t>'\n", expression.sc );
                bcore_shell_help_to_sink(o,control,((bcore_sink*)( control->sink )));
            }
        BLM_DOWN();}
    BLM_DOWN();}
    
    control->exit_loop = false;
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq 0x166842(%rip), %rax    # 0x1b2330
movq (%rax), %rax
movq %rax, -0x28(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xbfe80
movq -0x60(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
cmpq $0x0, -0x20(%rbp)
jne 0x4bb56
movq -0x28(%rbp), %rax
movq %rax, -0x120(%rbp)
callq 0x4c610
movq -0x120(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $0x65568789b6f2bdaf, %rdx # imm = 0x65568789B6F2BDAF
callq 0xc01a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x4bb8f
movq -0x20(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x128(%rbp)
movq -0x18(%rbp), %rax
movq 0xd0(%rax), %rdi
callq 0x9d3d0
movq -0x128(%rbp), %rdi
movq %rax, %rsi
callq 0x4bf60
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x4bbc8
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x130(%rbp)
movq -0x18(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x9d3d0
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0x4bfc0
jmp 0x4bbca
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x44f20
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x131(%rbp)
jne 0x4bc0f
movq -0x20(%rbp), %rdi
callq 0x4c020
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x131(%rbp)
jne 0x4bc0f
movq -0x10(%rbp), %rdi
callq 0x4c040
xorb $-0x1, %al
movb %al, -0x131(%rbp)
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0x4bc1e
jmp 0x4bf23
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x98(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0xbfe80
movq -0xa0(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq $0x1, 0x10(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0xc0(%rax)
jbe 0x4bc97
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0xb8(%rax), %rdx
leaq 0xf366e(%rip), %rsi     # 0x13f2f1
movb $0x0, %al
callq 0x43590
movq %rax, %rdi
callq 0x4c070
jmp 0x4bd1a
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x150(%rbp)
movq -0x20(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x148(%rbp)
movq -0x20(%rbp), %rax
movq 0xa0(%rax), %rdx
leaq 0x106d58(%rip), %rax    # 0x152a22
leaq 0x101eb0(%rip), %rcx    # 0x14db81
cmpq $0x0, %rdx
cmovneq %rcx, %rax
movq %rax, -0x140(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x44d00
movq -0x150(%rbp), %rdi
movq -0x148(%rbp), %rdx
movq -0x140(%rbp), %rcx
movq %rax, %r8
leaq 0xf35f1(%rip), %rsi     # 0x13f2fc
movb $0x0, %al
callq 0x43590
movq %rax, %rdi
callq 0x4c070
movq -0x20(%rbp), %rdi
callq 0x4c090
leaq -0xc0(%rbp), %rdi
callq 0xfe150
movq -0x68(%rbp), %rdi
movabsq $-0x503db0e6e1c2e704, %rsi # imm = 0xAFC24F191E3D18FC
leaq -0xc0(%rbp), %rdx
callq 0xc0220
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0xf35bf(%rip), %rsi     # 0x13f317
leaq -0xc0(%rbp), %rdx
movb $0x0, %al
callq 0x44f70
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xc8(%rbp)
je 0x4bda1
movq -0xc8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xa0(%rbp), %rdi
callq 0xc0720
movq -0xd0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4bf4d
cmpq $0x0, -0xb0(%rbp)
jbe 0x4bf12
movq -0xa0(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x108(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0xbfe80
movq -0x110(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
movq $0x2, 0x10(%rax)
movq -0x20(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x158(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x45020
movq -0x158(%rbp), %rdi
movq %rax, %rsi
callq 0x4c0b0
testb $0x1, %al
jne 0x4be2b
jmp 0x4be64
movq -0x20(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x160(%rbp)
movq -0xb8(%rbp), %rdi
callq 0x45020
movq -0x160(%rbp), %rdi
movq %rax, %rsi
callq 0x4c0e0
movq %rax, %rsi
leaq -0xc0(%rbp), %rdi
callq 0xfe850
movq -0x10(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0xd8(%rbp), %rax
movq %rax, -0x180(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x4c110
movq -0x180(%rbp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0xc0500
movq -0x178(%rbp), %rdi
movq -0x170(%rbp), %rsi
movq -0x168(%rbp), %rdx
movq %rax, %rcx
callq 0x4ab30
testb $0x1, %al
jne 0x4bf06
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0xb8(%rbp), %rdx
leaq 0xf3440(%rip), %rsi     # 0x13f32a
movb $0x0, %al
callq 0x43590
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x4a250
leaq -0x110(%rbp), %rdi
callq 0xc06e0
leaq -0xa0(%rbp), %rdi
callq 0xc06e0
jmp 0x4bbca
movq -0x20(%rbp), %rax
movb $0x0, 0x88(%rax)
movq $0x0, -0x118(%rbp)
movq -0x60(%rbp), %rdi
callq 0xc0720
movq -0x118(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopw (%rax,%rax)