#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ elg_cntl_msg(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ elg_warning(char *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ epk_archive_filetype(char *);
scalar_t__ unlink(char *);
void epk_archive_remove_file(char *filename) {
  if (unlink(filename) == 0)
    elg_cntl_msg("Removed %s file %s", epk_archive_filetype(filename),
                 filename);
  else
    elg_warning("Cannot remove %s file %s", epk_archive_filetype(filename),
                filename);
}


x86 assembly (clang, -O0):
<epk_archive_remove_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <unlink@plt>
cmp    $0x0,%rax
jne    117f <epk_archive_remove_file+0x3f>
mov    -0x8(%rbp),%rdi
call   1030 <epk_archive_filetype@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
lea    0xe8b(%rip),%rdi
call   1050 <elg_cntl_msg@plt>
jmp    119a <epk_archive_remove_file+0x5a>
mov    -0x8(%rbp),%rdi
call   1030 <epk_archive_filetype@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%rdx
lea    0xe7e(%rip),%rdi
call   1060 <elg_warning@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epk_archive_remove_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <unlink@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <epk_archive_filetype@plt>
test   %r14,%r14
je     1174 <epk_archive_remove_file+0x34>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <elg_warning@plt>
lea    0xe85(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <elg_cntl_msg@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Removed %s file %s\00"
@.str.1 = [25 x i8] c"Cannot remove %s file %s\00"
define void @epk_archive_remove_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @unlink(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @epk_archive_filetype(i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @elg_cntl_msg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9)
br label %16
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @epk_archive_filetype(i8* %12)
%14 = load i8*, i8** %2
%15 = call i32 @elg_warning(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %13, i8* %14)
br label %16
16: ; preds = %11, %6
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Removed %s file %s\00"
@.str.1 = [25 x i8] c"Cannot remove %s file %s\00"
define void @epk_archive_remove_file(i8* %0) {
%2 = tail call i64 @unlink(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = tail call i32 @epk_archive_filetype(i8* %0)
br i1 %3, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @elg_cntl_msg(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %0)
br label %9
7: ; preds = %1
%8 = tail call i32 @elg_warning(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %4, i8* %0)
br label %9
9: ; preds = %7, %5
ret void
}