#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*/ AssertOrDie(int, char *);
int /*<<< orphan*/ delete_file(int);
int find_file(char *);
void delete_files(int argc, char *argv[]) {
  int i, lp;
  AssertOrDie(argc > 3, "delete command must specify files\n");
  for (i = 3; i < argc; i += 1) {
    lp = find_file(argv[i]);
    delete_file(lp);
  }
}


x86 assembly (clang, -O0):
<delete_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeae(%rip),%rsi
call   1040 <AssertOrDie@plt>
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1194 <delete_files+0x64>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <find_file@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <delete_file@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115e <delete_files+0x2e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_files>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x4,%ebp
setge  %dil
lea    0xeb7(%rip),%rsi
call   1040 <AssertOrDie@plt>
cmp    $0x4,%ebp
jl     1179 <delete_files+0x49>
mov    %ebp,%ebp
mov    $0x3,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1050 <find_file@plt>
mov    %eax,%edi
call   1030 <delete_file@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1160 <delete_files+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"delete command must specify files\0A\00"
define void @delete_files(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 3
%9 = zext i1 %8 to i32
%10 = call i32 @AssertOrDie(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
store i32 3, i32* %5
br label %11
11: ; preds = %24, %2
%12 = load i32, i32* %5
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %27
15: ; preds = %11
%16 = load i8**, i8*** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 @find_file(i8* %20)
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = call i32 @delete_file(i32 %22)
br label %24
24: ; preds = %15
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %11
27: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"delete command must specify files\0A\00"
define void @delete_files(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 3
%4 = zext i1 %3 to i32
%5 = tail call i32 @AssertOrDie(i32 %4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br i1 %3, label %6, label %16
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 3, %6 ], [ %14, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @find_file(i8* %11)
%13 = tail call i32 @delete_file(i32 %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %2
ret void
}