// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_che_s_translate_mutable
er_t xoico_che_s_translate_mutable( xoico_che_s* o, const xoico_host* host, const xoico_body_s* body, const xoico_signature_s* signature, x_sink* sink )
{
    // xoico_che.x:2189:1
    BLM_INIT_LEVEL(0);
    BLM_TRY(xoico_che_s_setup(o,host, signature ))
    
    x_source* source = ((x_source*)BLM_LEVEL_A_PUSH(0,x_source_point_s_clone_source(&(body->code->source_point))));
    
    xoico_che_result_arr_s* result = ((xoico_che_result_arr_s*)BLM_LEVEL_T_PUSH(0,xoico_che_result_arr_s,xoico_che_result_arr_s_create()));
    
    bl_t flag_verbatim_c = false;
    bl_t flag_try = o->for_all_functions_enable_try;
    
    if( x_source_parse_bl(source," #?'('" ) )
    {
        while( !x_source_parse_bl(source," #?')'" ) )
        {
            if( x_source_parse_bl(source," #?w'try'" ) )
            {
                BLM_RETURNV(er_t, x_source_parse_error_fa(source,"prefix (try) is deprecated." ))
                //flag_try = true;
            }
            else if( x_source_parse_bl(source," #?w'verbatim_C'" ) )
            {
                BLM_TRY(x_source_parse_error_fa(source,"prefix (verbatim_C) is deprecated." ))
                flag_verbatim_c = true;
            }
            else
            {
                BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Invalid c-engine expression." ))
            }
        }
    }
    
    sz_t indentation = 0;
    
    if( x_source_parse_bl(source," #?'{'" ) )
    {
        if( !body->go_inline ) indentation = xoico_che_s_assess_indentation(source );
    
        if( flag_verbatim_c )
        {
            BLM_TRY(xoico_che_s_trans_block_inside_verbatim_c(o,source,((xoico_che_result*)( result ))))
        }
        else
        {
            o->try_block_level += flag_try;
            BLM_TRY(xoico_che_s_trans_level0_block(o,false, source,((xoico_che_result*)( result ))))
            o->try_block_level -= flag_try;
        }
        BLM_TRY(x_source_parse_fa(source," }" ))
    }
    else // single statement body
    {
        if( !body->go_inline ) indentation = xoico_che_s_assess_indentation(source );
        o->try_block_level += flag_try;
        BLM_TRY(xoico_che_s_trans_level0_block(o,true, source,((xoico_che_result*)( result ))))
        o->try_block_level -= flag_try;
    }
    
    if( xoico_che_s_returns_a_value(o) && !o->has_completion && !o->has_verbatim_code )
    {
        if( o->signature->direct_return_arg )
        {BLM_INIT_LEVEL(2);
            xoico_che_result_arr_s_push_result_d(result,((xoico_che_result*)(xoico_che_result_return_s__(xoico_che_result_return_s_create(),o,((xoico_che_result*)( xoico_che_result_plain_s__(xoico_che_result_plain_s_create(),st_s_push_sc(((st_s*)BLM_LEVEL_T_PUSH(2,st_s,st_s_create())),xoico_che_s_nameof(o,o->signature->direct_return_arg->name ) ) ) ))) )));
        BLM_DOWN();}
        else
        {
            x_btml_to_stdout(((const x_btml*)(o->signature)));
            BLM_RETURNV(er_t, x_source_parse_error_fa(source,"Function must return a value. Completion statement ('return' or '=') expected." ))
        }
    }
    
    xoico_che_result_block_s* result_block = ((xoico_che_result_block_s*)BLM_LEVEL_T_PUSH(0,xoico_che_result_block_s,xoico_che_result_block_s__(xoico_che_result_block_s_create(),o->block_level, xoico_che_s_stack_block_get_bottom_unit(o)->use_blm )));
    ((xoico_che_result_block_s*)(result_block))->is_root = true;
    xoico_che_result_block_s_push_result_d(result_block,((xoico_che_result*)(((xoico_che_result_arr_s*)bcore_fork(result)) )));
    
    st_s* buf = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create()));
    BLM_TRY(xoico_che_result_block_s_to_sink(result_block,((x_sink*)(buf ))))
    
    //remove trailing whitespaces
    for(sz_t i = buf->size - 1; i >= 0; i-- )
    {
        if( buf->data[ i ] != ' ' && buf->data[ i ] != '\t' && buf->data[ i ] != '\n' ) break;
        buf->data[ i ] = 0;
        buf->size = i;
    }
    
    if( o->insert_source_reference && !body->code->single_line )
    {
        x_sink_push_fa(sink,"// " );
        x_source_point_s_source_reference_to_sink(&(body->code->source_point),true, sink );
        x_sink_push_fa(sink,"\n" );
    }
    
    if( indentation > 0 ) xoico_che_s_remove_indentation(buf, indentation );
    
    if( o->verbose )
    {
        x_sink_push_fa(x_sink_stdout(),"##############################\n" );
        x_sink_push_fa(x_sink_stdout(),"#<st_s*>\n", buf );
    }
    
    x_sink_push_sc(sink,buf->sc );
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r8, %r13
movq %rcx, %rbx
movq %rdx, %rbp
movq %rsi, %r14
movq %rdi, %r12
leaq 0xf5902(%rip), %rax     # 0x117dd0
movq (%rax), %rsi
leaq 0x38(%rsp), %r15
movq %r15, %rdi
callq 0x717f5
andq $0x0, 0x10(%r15)
movq %r12, %r15
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x22106
testq %rax, %rax
je 0x2251b
movq %rax, %r12
leaq 0x38(%rsp), %rdi
callq 0x71b64
movq %r12, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r13, 0x28(%rsp)
movq %rbp, 0x20(%rsp)
movq 0x18(%rbp), %rdi
addq $0x18, %rdi
callq 0x2dee9
xorl %r14d, %r14d
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x71a90
movq %rax, %rbp
callq 0x2637f
movabsq $-0x7850996cdf80346a, %rdx # imm = 0x87AF6693207FCB96
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x71967
movq %rax, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movzbl 0xa(%r15), %eax
movq %rax, 0x18(%rsp)
leaq 0x87fb4(%rip), %rsi     # 0xaa535
movq %rbp, %rdi
callq 0xe5ff
testb %al, %al
je 0x225f8
xorl %r14d, %r14d
leaq 0x88af9(%rip), %rbx     # 0xab090
leaq 0x8bab0(%rip), %r13     # 0xae04e
leaq 0x8bacf(%rip), %r15     # 0xae074
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xe5ff
testb %al, %al
jne 0x225f8
movq %rbp, %rdi
movq %r13, %rsi
callq 0xe5ff
testb %al, %al
jne 0x22896
movq %rbp, %rdi
movq %r15, %rsi
callq 0xe5ff
testb %al, %al
je 0x2289f
movq %rbp, %rdi
leaq 0x8baa1(%rip), %rsi     # 0xae085
xorl %eax, %eax
callq 0xd7c4
movb $0x1, %r14b
testq %rax, %rax
je 0x225a5
jmp 0x224f9
leaq 0x87ff7(%rip), %rsi     # 0xaa5f6
movq %rbp, %rdi
callq 0xe5ff
movq 0x20(%rsp), %rcx
movb 0x20(%rcx), %cl
testb %al, %al
je 0x2261b
testb %cl, %cl
je 0x22623
xorl %ebx, %ebx
jmp 0x2262e
testb %cl, %cl
je 0x22657
xorl %ebx, %ebx
jmp 0x22662
movq %rbp, %rdi
callq 0x223a8
movq %rax, %rbx
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r13
testb $0x1, %r14b
je 0x22695
movq %r15, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x2071c
testq %rax, %rax
jne 0x224f9
jmp 0x226bb
movq %rbp, %rdi
callq 0x223a8
movq %rax, %rbx
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %r13
movq 0x18(%rsp), %r14
addq %r14, 0x30(%r15)
pushq $0x1
popq %rsi
movq %r15, %rdi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x21f3f
testq %rax, %rax
jne 0x224f9
subq %r14, 0x30(%r15)
jmp 0x226d5
movq 0x18(%rsp), %r14
addq %r14, 0x30(%r15)
movq %r15, %rdi
xorl %esi, %esi
movq %rbp, %rdx
movq %r13, %rcx
callq 0x21f3f
testq %rax, %rax
jne 0x224f9
subq %r14, 0x30(%r15)
leaq 0xa0ffd(%rip), %rsi     # 0xc36bf
movq %rbp, %rdi
xorl %eax, %eax
callq 0xd600
testq %rax, %rax
jne 0x224f9
movq %rbx, 0x8(%rsp)
movabsq $-0x503db0e6e1c2e704, %r12 # imm = 0xAFC24F191E3D18FC
movq %r15, %rdi
callq 0x21d6e
testb %al, %al
je 0x227d0
cmpb $0x0, 0xe0(%r15)
jne 0x227d0
cmpb $0x0, 0xe1(%r15)
jne 0x227d0
movq 0x20(%r15), %rdi
cmpq $0x0, 0x78(%rdi)
je 0x22954
leaq 0x68(%rsp), %r14
leaq 0x30(%rsp), %r12
movq %r14, (%r12)
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x717f5
movq $0x2, 0x10(%r14)
callq 0x26a7d
movq %rax, %rbp
callq 0x2628b
movq %rax, %rbx
xorl %eax, %eax
callq 0x8eb65
pushq $0x2
popq %rsi
movq %r14, %rdi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
movq %rax, %rcx
callq 0x71967
movq %rax, %r14
movq 0x20(%r15), %rax
movq 0x78(%rax), %rax
movq 0x50(%rax), %rsi
movq %r15, %rdi
callq 0x1cf9d
movq %r14, %rdi
movq %rax, %rsi
callq 0x8f392
leaq 0x8(%rbx), %rdi
movq %rax, %rsi
callq 0x8e4fd
movq %r15, 0x8(%rbp)
leaq 0x10(%rbp), %rdi
movq %rbx, %rsi
callq 0x268a0
movq %r13, %rdi
addq $0x8, %rdi
movq %rbp, %rsi
callq 0xf6dd
movq %r12, %rdi
movabsq $-0x503db0e6e1c2e704, %r12 # imm = 0xAFC24F191E3D18FC
callq 0x71b48
callq 0x264c4
movq 0x28(%r15), %rcx
movq 0x98(%r15), %rdx
movq (%rdx), %rdx
movb 0x10(%rdx), %dl
movq %rcx, 0x8(%rax)
movb %dl, 0x10(%rax)
leaq 0x38(%rsp), %rbx
movabsq $0x1b3ecce6627048a0, %rdx # imm = 0x1B3ECCE6627048A0
movq %rbx, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x71967
movq %rax, %r14
movb $0x1, 0x48(%rax)
movq %r13, %rdi
callq 0x6026d
movq %r14, %rdi
movq %rax, %rsi
callq 0x21d3d
xorl %eax, %eax
callq 0x8eb65
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %rax, %rcx
callq 0x71967
movq %rax, %r13
addq $0x18, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x1d4fa
testq %rax, %rax
jne 0x224f9
movq 0x10(%r13), %rax
decq %rax
movabsq $0x100000600, %rcx      # imm = 0x100000600
movq 0x28(%rsp), %r14
movq 0x20(%rsp), %rbx
testq %rax, %rax
js 0x228b5
movq 0x8(%r13), %rdx
movzbl (%rdx,%rax), %esi
cmpq $0x20, %rsi
ja 0x228b5
btq %rsi, %rcx
jae 0x228b5
movb $0x0, (%rdx,%rax)
movq %rax, 0x10(%r13)
decq %rax
jmp 0x22870
leaq 0x8b7bb(%rip), %rsi     # 0xae058
jmp 0x228a6
leaq 0x8b802(%rip), %rsi     # 0xae0a8
movq %rbp, %rdi
xorl %eax, %eax
callq 0xd7c4
jmp 0x224f9
cmpb $0x1, 0x9(%r15)
jne 0x228fb
movq 0x18(%rbx), %rax
cmpb $0x0, 0x8(%rax)
jne 0x228fb
leaq 0x8b847(%rip), %rsi     # 0xae114
movq %r14, %rdi
xorl %eax, %eax
callq 0xdd43
movq 0x18(%rbx), %rdi
addq $0x18, %rdi
pushq $0x1
popq %rsi
movq %r14, %rdx
callq 0x2e054
leaq 0xa3cda(%rip), %rsi     # 0xc65cb
movq %r14, %rdi
xorl %eax, %eax
callq 0xdd43
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
jle 0x2290d
movq %r13, %rdi
callq 0x22404
cmpb $0x1, 0x8(%r15)
jne 0x22940
leaq 0xf54cd(%rip), %rbx     # 0x117de8
movq (%rbx), %rdi
leaq 0x8b7f3(%rip), %rsi     # 0xae118
xorl %eax, %eax
callq 0xdd43
movq (%rbx), %rdi
leaq 0xa9008(%rip), %rsi     # 0xcb93e
movq %r13, %rdx
xorl %eax, %eax
callq 0xdd43
movq 0x8(%r13), %rsi
movq %r14, %rdi
callq 0x11689
xorl %r12d, %r12d
jmp 0x224fc
movq (%rdi), %rsi
leaq 0xf548a(%rip), %rax     # 0x117de8
movq (%rax), %rdx
callq 0x33336
leaq 0x8b758(%rip), %rsi     # 0xae0c5
jmp 0x228a6