// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdx, %r15
movq %rsi, 0x8(%rsp)
movq %rdi, %r14
leaq 0x137bc5(%rip), %rax    # 0x19bdd0
movq (%rax), %rsi
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0xd6675
movq $0x0, 0x10(%rbx)
testq %r15, %r15
jne 0x64249
callq 0x65140
leaq 0x48(%rsp), %rdi
movabsq $0x65568789b6f2bdaf, %rdx # imm = 0x65568789B6F2BDAF
xorl %esi, %esi
movq %rax, %rcx
callq 0xd68a8
movq %rax, %r15
leaq 0x18(%r15), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%r15)
jne 0x64277
movq 0x8(%rsp), %rax
movq 0xd0(%rax), %rdi
callq 0xbe7e4
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x6475d
cmpq $0x0, 0x10(%r15)
jne 0x6429e
leaq 0x10(%r15), %rbx
movq 0x8(%rsp), %rax
movq 0xd8(%rax), %rdi
callq 0xbe7e4
movq %rbx, %rdi
movq %rax, %rsi
callq 0x64842
leaq 0x50(%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq (%rax), %rbx
movq (%rbx), %rbp
leaq 0x138a0f(%rip), %rdx    # 0x19ccc8
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %rbp, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %rbp, %rdx
je 0x6430e
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbp, %rdx
je 0x6430e
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbp, %rdx
je 0x6430e
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbp, %rdx
jne 0x64317
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x6433e
movabsq $-0x7e8ee9b9b4bbaa8, %rdi # imm = 0xF817116464B44558
movq %rbp, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x138995(%rip), %rdi    # 0x19ccc8
movq %rbp, %rsi
movq %rax, %rdx
callq 0x115fac
movq 0x40(%r12), %rax
testq %rax, %rax
jne 0x6435c
movq %r12, %rdi
leaq 0xd5a37(%rip), %rsi     # 0x139d89
callq 0xeb49c
movq 0x40(%r12), %rax
movq %rbx, %rdi
callq *%rax
testb %al, %al
jne 0x64726
cmpb $0x0, 0x88(%r15)
jne 0x64726
movq (%r14), %rbx
movl 0x134e20(%rip), %eax    # 0x1991a0
cltq
leaq (%rax,%rax,2), %rax
leaq 0x134e13(%rip), %rdx    # 0x1991a0
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %rbx, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %rbx, %rdx
je 0x643da
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %rbx, %rdx
je 0x643da
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %rbx, %rdx
je 0x643da
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %rbx, %rdx
jne 0x643e3
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x6440a
movabsq $-0xe3c3103182b3769, %rdi # imm = 0xF1C3CEFCE7D4C897
movq %rbx, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x134da1(%rip), %rdi    # 0x1991a0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x115fac
movq %r14, %rdi
callq *0x10(%r12)
testb %al, %al
jne 0x64726
leaq 0xa8(%rsp), %rdi
movq %rdi, (%rsp)
leaq 0x48(%rsp), %rsi
callq 0xd6675
movq (%rsp), %rbx
movq $0x1, 0x10(%rbx)
cmpq $0x0, 0xc0(%r15)
movq 0x10(%r15), %rbp
je 0x64464
movq 0xb8(%r15), %rdx
movq %rbp, %rdi
leaq 0xd31b6(%rip), %rsi     # 0x137611
xorl %eax, %eax
callq 0x55790
jmp 0x644a7
movq 0x98(%r15), %r12
cmpq $0x0, 0xa0(%r15)
leaq 0xdf573(%rip), %r13     # 0x1439ed
leaq 0xe4294(%rip), %rax     # 0x148715
cmoveq %rax, %r13
movq (%r14), %rdi
callq 0xd6ec4
movq %rbp, %rdi
leaq 0xd3185(%rip), %rsi     # 0x13761c
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x55790
movq (%rbp), %r13
leaq 0x1385fe(%rip), %rdx    # 0x19cab0
movl (%rdx), %eax
cltq
leaq (%rax,%rax,2), %rax
movq 0x20(%rdx,%rax,8), %rcx
movq 0x18(%rdx,%rax,8), %rdx
andq %r13, %rdx
shlq $0x4, %rdx
leaq (%rcx,%rdx), %rax
movq (%rcx,%rdx), %rdx
movl $0x8, %ecx
cmpq %r13, %rdx
je 0x64507
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r13, %rdx
je 0x64507
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r13, %rdx
je 0x64507
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r13, %rdx
jne 0x64510
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0x64537
movabsq $0x5ea8cabb93ff3b7e, %rdi # imm = 0x5EA8CABB93FF3B7E
movq %r13, %rsi
callq 0xe9bc5
movq %rax, %r12
leaq 0x138584(%rip), %rdi    # 0x19cab0
movq %r13, %rsi
movq %rax, %rdx
callq 0x115fac
movq 0x20(%r12), %rax
testq %rax, %rax
jne 0x64555
movq %r12, %rdi
leaq 0xd5c5a(%rip), %rsi     # 0x13a1a5
callq 0xeb49c
movq 0x20(%r12), %rax
movq %rbp, %rdi
callq *%rax
movb $0x0, 0x88(%r15)
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x109030
movq %rbx, %rdi
movabsq $-0x503db0e6e1c2e704, %rsi # imm = 0xAFC24F191E3D18FC
movq %r12, %rdx
callq 0xd68d9
movq 0x18(%r15), %rdi
leaq 0xd30a8(%rip), %rsi     # 0x137637
movq %r12, %rdx
xorl %eax, %eax
callq 0x574ed
testq %rax, %rax
jne 0x6473c
cmpq $0x0, 0x38(%rsp)
je 0x64719
movq (%rsp), %rsi
leaq 0x78(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xd6675
movq 0x20(%rsp), %rbx
movq $0x2, 0x10(%rbx)
movq 0x30(%rsp), %rax
movabsq $-0x509c42b379fe4821, %r12 # imm = 0xAF63BD4C8601B7DF
testq %rax, %rax
movabsq $0x100000001b3, %rsi    # imm = 0x100000001B3
je 0x64620
movb (%rax), %cl
movabsq $-0x340d631b7bdddcdb, %r12 # imm = 0xCBF29CE484222325
testb %cl, %cl
je 0x64620
incq %rax
movabsq $-0x340d631b7bdddcdb, %rdx # imm = 0xCBF29CE484222325
movzbl %cl, %r12d
xorq %rdx, %r12
imulq %rsi, %r12
movb (%rax), %cl
incq %rax
movq %r12, %rdx
testb %cl, %cl
jne 0x64609
movq 0x10(%rsp), %rdi
callq 0x9ef36
leaq 0x8(%rax), %rdi
movq %r12, %rsi
callq 0xcc99f
testb %al, %al
je 0x646b8
movq 0x30(%rsp), %rax
movabsq $-0x509c42b379fe4821, %r12 # imm = 0xAF63BD4C8601B7DF
testq %rax, %rax
movabsq $0x100000001b3, %rsi    # imm = 0x100000001B3
je 0x6468c
movb (%rax), %cl
movabsq $-0x340d631b7bdddcdb, %r12 # imm = 0xCBF29CE484222325
testb %cl, %cl
je 0x6468c
incq %rax
movabsq $-0x340d631b7bdddcdb, %rdx # imm = 0xCBF29CE484222325
movzbl %cl, %r12d
xorq %rdx, %r12
imulq %rsi, %r12
movb (%rax), %cl
incq %rax
movq %r12, %rdx
testb %cl, %cl
jne 0x64675
movq 0x10(%rsp), %rdi
callq 0x9ef36
leaq 0x8(%rax), %rdi
movq %r12, %rsi
callq 0xcc468
testq %rax, %rax
je 0x646ac
movq (%rax), %rsi
jmp 0x646ae
xorl %esi, %esi
leaq 0x28(%rsp), %rdi
callq 0x1094fa
leaq 0x28(%rsp), %rdi
callq 0xe4653
movl $0x2, %esi
movq %rbx, %rdi
movq %rax, %rdx
callq 0xd6b17
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0x62e9f
testb %al, %al
jne 0x6470f
movq 0x10(%r15), %rdi
movq 0x30(%rsp), %rdx
leaq 0xd2f51(%rip), %rsi     # 0x13764a
xorl %eax, %eax
callq 0x55790
movq 0x10(%r15), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x623d5
leaq 0x20(%rsp), %rdi
callq 0xd6d0d
movq %rsp, %rdi
callq 0xd6d0d
jmp 0x642a7
movb $0x0, 0x88(%r15)
leaq 0x48(%rsp), %rdi
callq 0xd6d2c
xorl %ebx, %ebx
jmp 0x64748
movq %rax, %rbx
movq (%rsp), %rdi
callq 0xd6d2c
movq %rbx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq