// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/xoico/src/xoico.xo.c
// Function: xoico_compiler_s_check_overwrite
er_t xoico_compiler_s_check_overwrite( const xoico_compiler_s* o, sc_t file, tp_t body_signature, bl_t* clear_to_overwrite )
{
    // xoico_compiler.x:416:1
    BLM_INIT_LEVEL(0);
    if( clear_to_overwrite ) (*(clear_to_overwrite)) = true;
    if( !bcore_file_exists(file ) ) BLM_RETURNV(er_t, 0)
    
    x_source* source =((x_source*)( ((bcore_source*)BLM_LEVEL_A_PUSH(0,bcore_file_open_source(file )))));
    st_s* data = ((st_s*)BLM_LEVEL_T_PUSH(0,st_s,st_s_create()));
    while( !x_source_eos(source) ) st_s_push_char(data,x_source_get_u0(source) );
    
    if( !xoico_compiler_is_correctly_signed(data ) )
    {BLM_INIT_LEVEL(1);
        st_s* s = ((st_s*)BLM_LEVEL_T_PUSH(1,st_s,st_s_create()));
        st_s_push_fa(s,"Planted file #<sc_t>: Signature check failed.\n", file );
        st_s_push_fa(s,"This file might have been created or edited outside the xoico framework.\n" );
        if( o->overwrite_unsigned_target_files )
        {
            if( clear_to_overwrite ) (*(clear_to_overwrite)) = true;
            st_s_push_fa(s,"Flag 'overwrite_unsigned_target_files' is 'true'. The file will be overwritten.\n" );
            x_sink_push_fa(x_sink_stderr(),"\nWARNING: #<sc_t>\n", s->sc );
        }
        else
        {
            if( clear_to_overwrite ) (*(clear_to_overwrite)) = false;
            st_s_push_fa(s,"Xoico has currently no permission to overwrite unsigned target files.\n" );
            st_s_push_fa(s,"You can fix it in one of following ways:\n" );
            st_s_push_fa(s,"* Rename or (re)move the file.\n" );
            st_s_push_fa(s,"* Use command line flag '-f'.\n" );
            BLM_RETURNV(er_t, bcore_error_push_fa(((tp_t)(TYPEOF_general_error)), "\nERROR: #<sc_t>\n", s->sc ))
        }
    BLM_DOWN();}
    
    if( clear_to_overwrite && body_signature && !o->always_expand )
    {
        (*(clear_to_overwrite)) = xoico_compiler_body_signature(data ) != body_signature;
    }
    
    BLM_RETURNV(er_t, 0)
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
leaq 0x191d4e(%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)
cmpq $0x0, -0x28(%rbp)
je 0x20620
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
movq -0x18(%rbp), %rdi
callq 0x9f5b0
testb $0x1, %al
jne 0x2064b
movq $0x0, -0x70(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0x70(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x208fb
movq -0x30(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9f880
movq -0xe8(%rbp), %rdi
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0xc0500
movq %rax, -0x78(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xe0(%rbp)
movb $0x0, %al
callq 0xff2e0
movq -0xe0(%rbp), %rdi
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
callq 0xc01a0
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rdi
callq 0x6730
xorb $-0x1, %al
testb $0x1, %al
jne 0x206ba
jmp 0x206df
movq -0x80(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x78(%rbp), %rdi
callq 0xa4b0
movq -0xf0(%rbp), %rdi
movsbl %al, %esi
callq 0xffba0
jmp 0x206a9
movq -0x80(%rbp), %rdi
callq 0x211f0
testb $0x1, %al
jne 0x208a8
movq -0x68(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0xb8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0xbfe80
movq -0xc0(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq $0x1, 0x10(%rax)
movq -0x88(%rbp), %rax
movq %rax, -0xf8(%rbp)
movb $0x0, %al
callq 0xff2e0
movq -0xf8(%rbp), %rdi
movq %rax, %rcx
movl $0x1, %esi
movabsq $-0x503db0e6e1c2e704, %rdx # imm = 0xAFC24F191E3D18FC
callq 0xc01a0
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x115a28(%rip), %rsi    # 0x1361ad
movb $0x0, %al
callq 0x100210
movq -0xc8(%rbp), %rdi
leaq 0x115a42(%rip), %rsi    # 0x1361dc
movb $0x0, %al
callq 0x100210
movq -0x10(%rbp), %rax
testb $0x1, 0x182(%rax)
je 0x207f7
cmpq $0x0, -0x28(%rbp)
je 0x207bc
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
movq -0xc8(%rbp), %rdi
leaq 0x115a5c(%rip), %rsi    # 0x136226
movb $0x0, %al
callq 0x100210
callq 0x21350
movq %rax, %rdi
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x115a8c(%rip), %rsi    # 0x136277
movb $0x0, %al
callq 0x56e0
jmp 0x2089c
cmpq $0x0, -0x28(%rbp)
je 0x20805
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movq -0xc8(%rbp), %rdi
leaq 0x115a77(%rip), %rsi    # 0x13628a
movb $0x0, %al
callq 0x100210
movq -0xc8(%rbp), %rdi
leaq 0x115aa9(%rip), %rsi    # 0x1362d1
movb $0x0, %al
callq 0x100210
movq -0xc8(%rbp), %rdi
leaq 0x115abe(%rip), %rsi    # 0x1362fb
movb $0x0, %al
callq 0x100210
movq -0xc8(%rbp), %rdi
leaq 0x115ac9(%rip), %rsi    # 0x13631b
movb $0x0, %al
callq 0x100210
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rdx
movabsq $0x4d9e984c5b21faea, %rdi # imm = 0x4D9E984C5B21FAEA
leaq 0x115ac5(%rip), %rsi    # 0x13633a
movb $0x0, %al
callq 0x9e090
movq %rax, -0xd0(%rbp)
movq -0xc0(%rbp), %rdi
callq 0xc0720
movq -0xd0(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x208fb
leaq -0xc0(%rbp), %rdi
callq 0xc06e0
cmpq $0x0, -0x28(%rbp)
je 0x208dc
cmpq $0x0, -0x20(%rbp)
je 0x208dc
movq -0x10(%rbp), %rax
testb $0x1, 0x183(%rax)
jne 0x208dc
movq -0x80(%rbp), %rdi
callq 0x21360
cmpq -0x20(%rbp), %rax
setne %cl
movq -0x28(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq $0x0, -0xd8(%rbp)
movq -0x68(%rbp), %rdi
callq 0xc0720
movq -0xd8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax,%rax)