#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 ioutil_remove(char *);
int /*<<< orphan*/ lib_free(char *);
char *lib_stralloc(char const *);
char *util_concat(char const *, char *, char const *, int /*<<< orphan*/ *);
unsigned int rawfile_remove(const char *src_name, const char *path) {
  char *complete_src;
  int rc;
  if (path == NULL)
    complete_src = lib_stralloc(src_name);
  else
    complete_src = util_concat(path, "/", src_name, NULL);
  rc = ioutil_remove(complete_src);
  lib_free(complete_src);
  if (rc < 0)
    return 1;
  return 4;
}


x86 assembly (clang, -O0):
<rawfile_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <rawfile_remove+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <lib_stralloc@plt>
mov    %rax,-0x20(%rbp)
jmp    1189 <rawfile_remove+0x49>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe84(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1060 <util_concat@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <ioutil_remove@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <lib_free@plt>
cmpl   $0x0,-0x24(%rbp)
jge    11b4 <rawfile_remove+0x74>
movl   $0x1,-0x4(%rbp)
jmp    11bb <rawfile_remove+0x7b>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rawfile_remove>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rdx
test   %rsi,%rsi
je     1162 <rawfile_remove+0x22>
lea    0xead(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
xor    %ecx,%ecx
call   1060 <util_concat@plt>
jmp    116a <rawfile_remove+0x2a>
mov    %rdx,%rdi
call   1030 <lib_stralloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1050 <ioutil_remove@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <lib_free@plt>
not    %ebx
shr    $0x1f,%ebx
lea    (%rbx,%rbx,2),%eax
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i32 @rawfile_remove(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i8* @lib_stralloc(i8* %11)
store i8* %12, i8** %6
br label %17
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i8*, i8** %4
%16 = call i8* @util_concat(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %15, i32* null)
store i8* %16, i8** %6
br label %17
17: ; preds = %13, %10
%18 = load i8*, i8** %6
%19 = call i32 @ioutil_remove(i8* %18)
store i32 %19, i32* %7
%20 = load i8*, i8** %6
%21 = call i32 @lib_free(i8* %20)
%22 = load i32, i32* %7
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %17
store i32 1, i32* %3
br label %26
25: ; preds = %17
store i32 4, i32* %3
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i32 @rawfile_remove(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @lib_stralloc(i8* %0)
br label %8
6: ; preds = %2
%7 = tail call i8* @util_concat(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0, i32* null)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
%10 = tail call i32 @ioutil_remove(i8* %9)
%11 = tail call i32 @lib_free(i8* %9)
%12 = icmp slt i32 %10, 0
%13 = select i1 %12, i32 1, i32 4
ret i32 %13
}