#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*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
scalar_t__ unlink(char *);
void remove_files(char **names, unsigned int num) {
  int i;
  for (i = 0; i < num; i++) {
    if (NULL == names[i])
      continue;
    if (0 != unlink(names[i])) {
      fprintf(stderr, "Warning: Couldn't remove %s : %s\n", names[i],
              strerror(errno));
    }
  }
}


x86 assembly (clang, -O0):
<remove_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    11dd <remove_files+0xad>
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    (%rcx,%rdx,8),%rax
jne    116b <remove_files+0x3b>
jmp    11cf <remove_files+0x9f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <unlink@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     11ca <remove_files+0x9a>
mov    0x2e4f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe3b(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11cf <remove_files+0x9f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <remove_files+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_files>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1199 <remove_files+0x69>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xeb2(%rip),%r14
jmp    1159 <remove_files+0x29>
add    $0x1,%rbx
cmp    %rbx,%r12
je     1199 <remove_files+0x69>
mov    (%r15,%rbx,8),%rdi
test   %rdi,%rdi
je     1150 <remove_files+0x20>
call   1030 <unlink@plt>
test   %rax,%rax
je     1150 <remove_files+0x20>
mov    0x2e6d(%rip),%rax
mov    (%rax),%ebp
mov    (%r15,%rbx,8),%r13
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
jmp    1150 <remove_files+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Warning: Couldn't remove %s : %s\0A\00"
@errno = global i32 0
define void @remove_files(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %37, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %40
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = icmp eq i8* null, %15
br i1 %16, label %17, label %18
17: ; preds = %10
br label %37
18: ; preds = %10
%19 = load i8**, i8*** %3
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = call i64 @unlink(i8* %23)
%25 = icmp ne i64 0, %24
br i1 %25, label %26, label %36
26: ; preds = %18
%27 = load i32, i32* @stderr
%28 = load i8**, i8*** %3
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %28, i64 %30
%32 = load i8*, i8** %31
%33 = load i32, i32* @errno
%34 = call i8* @strerror(i32 %33)
%35 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %32, i8* %34)
br label %36
36: ; preds = %26, %18
br label %37
37: ; preds = %36, %17
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %6
40: ; preds = %6
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Warning: Couldn't remove %s : %s\0A\00"
@errno = global i32 0
define void @remove_files(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %23, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %20
%7 = phi i64 [ 0, %4 ], [ %21, %20 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %20, label %11
11: ; preds = %6
%12 = tail call i64 @unlink(i8* %9)
%13 = icmp eq i64 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %8
%17 = load i32, i32* @errno
%18 = tail call i8* @strerror(i32 %17)
%19 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %18)
br label %20
20: ; preds = %11, %14, %6
%21 = add nuw nsw i64 %7, 1
%22 = icmp eq i64 %21, %5
br i1 %22, label %23, label %6
23: ; preds = %20, %2
ret void
}