#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*/ perror(char *);
scalar_t__ unlink(char const *);
int /*<<< orphan*/ writes(int, char const *);
int main(int argc, const char *argv[]) {
  int i;
  int err = 1;
  for (i = 1; i < argc; i++) {
    if (argv[i][0] != '-') {
      if (unlink(argv[i])) {
        writes(2, argv[0]);
        writes(2, ": cannot remove '");
        writes(2, argv[i]);
        perror("'");
      }
    }
  }
  return 0;
}


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)
movl   $0x1,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ef <main+0xbf>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     11dc <main+0xac>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     11d7 <main+0xa7>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x2,%edi
call   1040 <writes@plt>
mov    $0x2,%edi
lea    0xe50(%rip),%rsi
call   1040 <writes@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    $0x2,%edi
call   1040 <writes@plt>
lea    0xe3e(%rip),%rdi
call   1050 <perror@plt>
jmp    11dc <main+0xac>
jmp    11e1 <main+0xb1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    $0x2,%edi
jl     11b1 <main+0x81>
mov    %rsi,%r13
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xeb0(%rip),%r14
lea    0xeb9(%rip),%r15
jmp    1169 <main+0x39>
nopl   0x0(%rax)
add    $0x1,%rbx
cmp    %rbx,%r12
je     11b1 <main+0x81>
mov    0x0(%r13,%rbx,8),%rdi
cmpb   $0x2d,(%rdi)
je     1160 <main+0x30>
call   1030 <unlink@plt>
test   %rax,%rax
je     1160 <main+0x30>
mov    0x0(%r13),%rsi
mov    $0x2,%edi
call   1040 <writes@plt>
mov    $0x2,%edi
mov    %r14,%rsi
call   1040 <writes@plt>
mov    0x0(%r13,%rbx,8),%rsi
mov    $0x2,%edi
call   1040 <writes@plt>
mov    %r15,%rdi
call   1050 <perror@plt>
jmp    1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [18 x i8] c": cannot remove '\00"
@.str.1 = [2 x i8] c"'\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
store i32 1, i32* %6
br label %8
8: ; preds = %45, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %48
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 45
br i1 %21, label %22, label %44
22: ; preds = %12
%23 = load i8**, i8*** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = call i64 @unlink(i8* %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %43
30: ; preds = %22
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 0
%33 = load i8*, i8** %32
%34 = call i32 @writes(i32 2, i8* %33)
%35 = call i32 @writes(i32 2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%36 = load i8**, i8*** %5
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %36, i64 %38
%40 = load i8*, i8** %39
%41 = call i32 @writes(i32 2, i8* %40)
%42 = call i32 @perror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %43
43: ; preds = %30, %22
br label %44
44: ; preds = %43, %12
br label %45
45: ; preds = %44
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %8
48: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c": cannot remove '\00"
@.str.1 = [2 x i8] c"'\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %25
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %22
%7 = phi i64 [ 1, %4 ], [ %23, %22 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 45
br i1 %11, label %22, label %12
12: ; preds = %6
%13 = tail call i64 @unlink(i8* %9)
%14 = icmp eq i64 %13, 0
br i1 %14, label %22, label %15
15: ; preds = %12
%16 = load i8*, i8** %1
%17 = tail call i32 @writes(i32 2, i8* %16)
%18 = tail call i32 @writes(i32 2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%19 = load i8*, i8** %8
%20 = tail call i32 @writes(i32 2, i8* %19)
%21 = tail call i32 @perror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %6, %15, %12
%23 = add nuw nsw i64 %7, 1
%24 = icmp eq i64 %23, %5
br i1 %24, label %25, label %6
25: ; preds = %22, %2
ret i32 0
}