#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ perror(char *);
int unlink(char *);
int main(int argc, char **argv) {
  char *fileName;
  int returnValue;
  while ((fileName = *++argv)) {
    returnValue = unlink(fileName);
    if (returnValue < 0) {
      perror(fileName);
      return EXIT_FAILURE;
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     118c <main+0x6c>
mov    -0x18(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1187 <main+0x67>
mov    -0x18(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1198 <main+0x78>
jmp    1136 <main+0x16>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
add    $0x8,%rbx
mov    0x2ea5(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx),%r14
test   %r14,%r14
je     1167 <main+0x47>
mov    %r14,%rdi
call   1030 <unlink@plt>
add    $0x8,%rbx
test   %eax,%eax
jns    1140 <main+0x20>
mov    %r14,%rdi
call   1040 <perror@plt>
mov    0x2e79(%rip),%r15
mov    (%r15),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %22, %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %5
%11 = load i8*, i8** %10
store i8* %11, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = load i8*, i8** %6
%15 = call i32 @unlink(i8* %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i8*, i8** %6
%20 = call i32 @perror(i8* %19)
%21 = load i32, i32* @EXIT_FAILURE
store i32 %21, i32* %3
br label %25
22: ; preds = %13
br label %8
23: ; preds = %8
%24 = load i32, i32* @EXIT_SUCCESS
store i32 %24, i32* %3
br label %25
25: ; preds = %23, %18
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8** [ %1, %2 ], [ %5, %8 ]
%5 = getelementptr inbounds i8*, i8** %4, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = tail call i32 @unlink(i8* %6)
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %8
%12 = tail call i32 @perror(i8* %6)
br label %13
13: ; preds = %3, %11
%14 = phi i32* [ @EXIT_FAILURE, %11 ], [ @EXIT_SUCCESS, %3 ]
%15 = load i32, i32* %14
ret i32 %15
}