#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 *);
int /*<<< orphan*/ printf(char *, char *);
int remove(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int main(int argc, char *argv[]) {
  int i;
  char *file;
  int ret;
  char sbuf[256];
  if (1 == argc) {
    printf("%s: missing operand\n", argv[0]);
    return 1;
  }
  for (i = 1; i < argc; i++) {
    file = argv[i];
    ret = remove(file);
    if (-1 == ret) {
      sprintf(sbuf, "%s: cannot remove '%s'", argv[0], file);
      perror(sbuf);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
cmp    -0x8(%rbp),%eax
jne    1186 <main+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1207 <main+0xc7>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1200 <main+0xc0>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0x24(%rbp)
mov    $0xffffffff,%eax
cmp    -0x24(%rbp),%eax
jne    11ed <main+0xad>
lea    -0x130(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe39(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x130(%rbp),%rdi
call   1050 <perror@plt>
jmp    11f2 <main+0xb2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118d <main+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
jne    1170 <main+0x30>
mov    (%rbx),%rsi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%r12d
jmp    11c9 <main+0x89>
xor    %r12d,%r12d
cmp    $0x2,%edi
jl     11c9 <main+0x89>
mov    %edi,%r13d
mov    $0x1,%r14d
mov    %rsp,%r15
jmp    1199 <main+0x59>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r14
cmp    %r14,%r13
je     11c9 <main+0x89>
mov    (%rbx,%r14,8),%rbp
mov    %rbp,%rdi
call   1030 <remove@plt>
cmp    $0xffffffff,%eax
jne    1190 <main+0x50>
mov    (%rbx),%rdx
mov    %r15,%rdi
lea    0xe5e(%rip),%rsi
mov    %rbp,%rcx
call   1060 <sprintf@plt>
mov    %r15,%rdi
call   1050 <perror@plt>
jmp    1190 <main+0x50>
mov    %r12d,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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