// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_body_code_s_parse_single_statement
er_t xoico_body_code_s_parse_single_statement( xoico_body_code_s* o, const xoico_host* host, x_source* source )
{
    // xoico_body.x:190:1
    
    tp_t hash = bcore_tp_init();
    
    x_source_point_s_setup_from_source(&(o->source_point),source );
    
    sz_t nest_count = 0;
    bl_t exit_loop = false;
    o->single_line = true;
    
    while( x_source_parse_bl(source,"#?' '" ) ); // skip leading spaces
    
    while( !x_source_eos(source) && !exit_loop )
    {
        u0_t c =  x_source_get_u0(source);
        switch( c )
        {
            case '{':
            case '}':
                return  x_source_parse_error_fa(source,"Braces are not allowed in single statement." );
            break;
    
            case '(':
            {
                nest_count++;
            }
            break;
    
            case ')':
            {
                if( nest_count == 0 )
                {
                    return  x_source_parse_error_fa(source,"Unmatched closing bracket ')'." );
                }
                nest_count--;
            }
            break;
    
            case ';':
            {
                if( nest_count == 0 ) exit_loop = true;
            }
            break;
    
            case '"': // string literal
            {
                hash = bcore_tp_fold_u0( hash, c );
                while( !x_source_eos(source) && ((c = x_source_get_char(source)) != '"') )
                {
                    hash = bcore_tp_fold_u0( hash, c );
                    if( c == '\\' ) hash = bcore_tp_fold_u0( hash, x_source_get_u0(source) );
                    if( c == '\n' ) return  x_source_parse_error_fa(source,"Newline in string literal." );
                }
                c = 0;
            }
            break;
    
            case '\'': // char literal
            {
                hash = bcore_tp_fold_u0( hash, c );
                while( !x_source_eos(source) && ((c = x_source_get_char(source)) != '\'') )
                {
                    hash = bcore_tp_fold_u0( hash, c );
                    if( c == '\\' ) hash = bcore_tp_fold_u0( hash, x_source_get_u0(source) );
                    if( c == '\n' ) return  x_source_parse_error_fa(source,"Newline in char literal." );
                }
                c = 0;
            }
            break;
    
            case '/': // comment
            {
                hash = bcore_tp_fold_u0( hash, c );
                if( x_source_inspect_char(source) == '/' )
                {
                    while( !x_source_eos(source) )
                    {
                        c = x_source_get_char(source);
                        hash = bcore_tp_fold_u0( hash, c );
                        if( c == '\n' )
                        {
                            o->single_line = false;
                            break;
                        }
                    }
                }
                else if( x_source_inspect_char(source) == '*' )
                {
                    while( !x_source_eos(source) )
                    {
                        if( x_source_parse_bl(source,"#?'*/'" ) )
                        {
                            hash = bcore_tp_fold_sc( hash, "*/" );
                            break;
                        }
                        else
                        {
                            c = x_source_get_char(source);
                            if( c == '\n' ) o->single_line = false;
                            hash = bcore_tp_fold_u0( hash, c );
                        }
                    }
                }
                c = 0;
            }
            break;
    
            case '\n' :
            {
                o->single_line = false;
                break;
            }
    
            default: break;
        }
        hash = bcore_tp_fold_u0( hash, c );
    }
    
    o->hash_source = hash;
    return  0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
addq $0x18, %rdi
movq %rdx, %rsi
callq 0xdc7d
movb $0x1, 0x8(%r14)
leaq 0x99fe8(%rip), %r15     # 0xaa53c
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe5ff
testb %al, %al
jne 0x10554
movabsq $-0x340d631b7bdddcdb, %r15 # imm = 0xCBF29CE484222325
movabsq $0x100000001b3, %r13    # imm = 0x100000001B3
xorl %r12d, %r12d
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0xe626
testb %al, %al
jne 0x107b0
testb $0x1, %bpl
jne 0x107b0
movq %rbx, %rdi
callq 0x104d1
movzbl %al, %ecx
xorl %ebp, %ebp
leal -0x27(%rcx), %edx
cmpl $0x8, %edx
ja 0x10612
leaq 0x99a52(%rip), %rsi     # 0xaa004
movslq (%rsi,%rdx,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
xorq $0x27, %r15
imulq %r13, %r15
movq %rbx, %rdi
callq 0xe626
testb %al, %al
jne 0x10772
movq %rbx, %rdi
callq 0x104a2
cmpb $0x27, %al
je 0x10772
movl %eax, %ebp
movzbl %al, %eax
xorq %rax, %r15
imulq %r13, %r15
cmpb $0x5c, %bpl
jne 0x10607
movq %rbx, %rdi
callq 0x104d1
movzbl %al, %eax
xorq %rax, %r15
imulq %r13, %r15
cmpb $0xa, %bpl
jne 0x105c3
jmp 0x10788
cmpl $0xa, %ecx
je 0x106a3
cmpl $0x22, %ecx
je 0x106bf
cmpl $0x3b, %ecx
je 0x106b1
cmpl $0x7d, %ecx
je 0x107c5
cmpl $0x7b, %ecx
jne 0x10776
jmp 0x107c5
testq %r12, %r12
je 0x107ce
decq %r12
movb $0x29, %al
jmp 0x106aa
xorq $0x2f, %r15
imulq %r13, %r15
movq %rbx, %rdi
callq 0x1048a
cmpb $0x2f, %al
jne 0x10713
movq %rbx, %rdi
callq 0xe626
testb %al, %al
jne 0x10772
movq %rbx, %rdi
callq 0x104a2
movzbl %al, %eax
xorq %rax, %r15
imulq %r13, %r15
cmpb $0xa, %al
jne 0x1066c
movb $0x0, 0x8(%r14)
jmp 0x10772
incq %r12
movb $0x28, %al
jmp 0x106aa
movb $0x0, 0x8(%r14)
movb $0xa, %al
xorl %ebp, %ebp
jmp 0x10776
testq %r12, %r12
sete %bpl
movb $0x3b, %al
jmp 0x10776
xorq $0x22, %r15
imulq %r13, %r15
movq %rbx, %rdi
callq 0xe626
testb %al, %al
jne 0x10772
movq %rbx, %rdi
callq 0x104a2
cmpb $0x22, %al
je 0x10772
movl %eax, %ebp
movzbl %al, %eax
xorq %rax, %r15
imulq %r13, %r15
cmpb $0x5c, %bpl
jne 0x1070b
movq %rbx, %rdi
callq 0x104d1
movzbl %al, %eax
xorq %rax, %r15
imulq %r13, %r15
cmpb $0xa, %bpl
jne 0x106c7
jmp 0x10791
movq %rbx, %rdi
callq 0x1048a
xorl %ebp, %ebp
cmpb $0x2a, %al
jne 0x10774
leaq 0x99e4e(%rip), %rbp     # 0xaa576
movq %rbx, %rdi
callq 0xe626
testb %al, %al
jne 0x10772
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xe5ff
testb %al, %al
jne 0x10760
movq %rbx, %rdi
callq 0x104a2
cmpb $0xa, %al
jne 0x10754
movb $0x0, 0x8(%r14)
movzbl %al, %eax
xorq %rax, %r15
imulq %r13, %r15
jmp 0x10728
movq %r15, %rdi
leaq 0x99e13(%rip), %rsi     # 0xaa57d
callq 0x10500
movq %rax, %r15
xorl %ebp, %ebp
xorl %eax, %eax
movzbl %al, %eax
xorq %r15, %rax
imulq %r13, %rax
movq %rax, %r15
jmp 0x1057c
leaq 0x99dce(%rip), %rsi     # 0xaa55d
jmp 0x10798
leaq 0x99daa(%rip), %rsi     # 0xaa542
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd7c4
movq %r15, 0x10(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x99db4(%rip), %rsi     # 0xaa580
jmp 0x10798
leaq 0x99dd7(%rip), %rsi     # 0xaa5ac
jmp 0x10798