#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*/ printf(char *, ...);
void mymain(int d, int f, int i, int r, int v, const char **files, int nfiles) {
  int j;
  if (v) {
    printf("remove directories  = %s\n", ((d) ? "YES" : "NO"));
    printf("force removal       = %s\n", ((f) ? "YES" : "NO"));
    printf("interactive mode    = %s\n", ((i) ? "YES" : "NO"));
    printf("recurse directories = %s\n", ((r) ? "YES" : "NO"));
    printf("verbose messages    = %s\n", ((v) ? "YES" : "NO"));
  }
  for (j = 0; j < nfiles; j++)
    printf("unlinking \"%s\"\n", files[j]);
  printf("%d files total\n", nfiles);
}


x86 assembly (clang, -O0):
<mymain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11f7 <mymain+0xe7>
mov    -0x4(%rbp),%ecx
lea    0xedb(%rip),%rsi
lea    0xed0(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%ecx
lea    0xeb5(%rip),%rsi
lea    0xeaa(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%ecx
lea    0xe8f(%rip),%rsi
lea    0xe84(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%ecx
lea    0xe69(%rip),%rsi
lea    0xe5e(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%ecx
lea    0xe43(%rip),%rsi
lea    0xe38(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1232 <mymain+0x122>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11fe <mymain+0xee>
mov    0x10(%rbp),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymain>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    0x40(%rsp),%r12d
test   %r8d,%r8d
je     11b6 <mymain+0xa6>
mov    %edx,%r13d
mov    %esi,%r15d
test   %edi,%edi
lea    0xee3(%rip),%rbp
lea    0xed8(%rip),%rbx
mov    %rbx,%rsi
cmove  %rbp,%rsi
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
mov    %ecx,0x4(%rsp)
call   1030 <printf@plt>
test   %r15d,%r15d
mov    %rbx,%rsi
cmove  %rbp,%rsi
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r13d,%r13d
mov    %rbx,%rsi
cmove  %rbp,%rsi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x0,0x4(%rsp)
cmovne %rbx,%rbp
lea    0xeba(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
test   %r12d,%r12d
jle    11e7 <mymain+0xd7>
mov    %r12d,%ebx
lea    0xec4(%rip),%r15
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbp,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    11d0 <mymain+0xc0>
lea    0xeab(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"remove directories = %s\0A\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
@.str.3 = [26 x i8] c"force removal = %s\0A\00"
@.str.4 = [26 x i8] c"interactive mode = %s\0A\00"
@.str.5 = [26 x i8] c"recurse directories = %s\0A\00"
@.str.6 = [26 x i8] c"verbose messages = %s\0A\00"
@.str.7 = [16 x i8] c"unlinking \22%s\22\0A\00"
@.str.8 = [16 x i8] c"%d files total\0A\00"
define void @mymain(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8** %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8**
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8** %5, i8*** %13
store i32 %6, i32* %14
%16 = load i32, i32* %12
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %44
18: ; preds = %7
%19 = load i32, i32* %8
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = load i32, i32* %9
%25 = icmp ne i32 %24, 0
%26 = zext i1 %25 to i64
%27 = select i1 %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %27)
%29 = load i32, i32* %10
%30 = icmp ne i32 %29, 0
%31 = zext i1 %30 to i64
%32 = select i1 %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %32)
%34 = load i32, i32* %11
%35 = icmp ne i32 %34, 0
%36 = zext i1 %35 to i64
%37 = select i1 %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %37)
%39 = load i32, i32* %12
%40 = icmp ne i32 %39, 0
%41 = zext i1 %40 to i64
%42 = select i1 %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* %42)
br label %44
44: ; preds = %18, %7
store i32 0, i32* %15
br label %45
45: ; preds = %56, %44
%46 = load i32, i32* %15
%47 = load i32, i32* %14
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %59
49: ; preds = %45
%50 = load i8**, i8*** %13
%51 = load i32, i32* %15
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %54)
br label %56
56: ; preds = %49
%57 = load i32, i32* %15
%58 = add nsw i32 %57, 1
store i32 %58, i32* %15
br label %45
59: ; preds = %45
%60 = load i32, i32* %14
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %60)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"remove directories = %s\0A\00"
@.str.1 = [4 x i8] c"YES\00"
@.str.2 = [3 x i8] c"NO\00"
@.str.3 = [26 x i8] c"force removal = %s\0A\00"
@.str.4 = [26 x i8] c"interactive mode = %s\0A\00"
@.str.5 = [26 x i8] c"recurse directories = %s\0A\00"
@.str.6 = [26 x i8] c"verbose messages = %s\0A\00"
@.str.7 = [16 x i8] c"unlinking \22%s\22\0A\00"
@.str.8 = [16 x i8] c"%d files total\0A\00"
define void @mymain(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8** nocapture %5, i32 %6) {
%8 = icmp eq i32 %4, 0
br i1 %8, label %23, label %9
9: ; preds = %7
%10 = icmp eq i32 %0, 0
%11 = select i1 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = icmp eq i32 %1, 0
%14 = select i1 %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i8* %14)
%16 = icmp eq i32 %2, 0
%17 = select i1 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i8* %17)
%19 = icmp eq i32 %3, 0
%20 = select i1 %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i8* %20)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %9, %7
%24 = icmp sgt i32 %6, 0
br i1 %24, label %25, label %34
25: ; preds = %23
%26 = zext i32 %6 to i64
br label %27
27: ; preds = %25, %27
%28 = phi i64 [ 0, %25 ], [ %32, %27 ]
%29 = getelementptr inbounds i8*, i8** %5, i64 %28
%30 = load i8*, i8** %29
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i8* %30)
%32 = add nuw nsw i64 %28, 1
%33 = icmp eq i64 %32, %26
br i1 %33, label %34, label %27
34: ; preds = %27, %23
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32 %6)
ret void
}