#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*/ err(int, char *, char *);
int /*<<< orphan*/ exit(int);
int getopt(int, char **, char *);
scalar_t__ optind;
int rmdir(char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int ch, rc;
  while ((ch = getopt(argc, argv, "")) != -1)
    switch (ch) {
    case '?':
    default:
      usage();
    }
  argc -= optind;
  argv += optind;
  if (argc == 0)
    usage();
  rc = 0;
  do {
    if ((rc = rmdir(*argv)) < 0)
      break;
    ++argv;
  } while (*argv);
  if (rc < 0)
    err(1, "%s", *argv);
  exit(rc);
}


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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe8e(%rip),%rdx
call   1060 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     11a7 <main+0x57>
mov    -0x14(%rbp),%eax
sub    $0x3f,%eax
jne    119b <main+0x4b>
jmp    1196 <main+0x46>
jmp    119b <main+0x4b>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    1166 <main+0x16>
mov    0x2e3a(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2e26(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11e2 <main+0x92>
mov    $0x0,%al
call   1050 <usage@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <rmdir@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1206 <main+0xb6>
jmp    1220 <main+0xd0>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11e9 <main+0x99>
cmpl   $0x0,-0x18(%rbp)
jge    1242 <main+0xf2>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%edi
lea    0xdc3(%rip),%rsi
call   1040 <err@plt>
mov    -0x18(%rbp),%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xea2(%rip),%rdx
call   1060 <getopt@plt>
cmp    $0xffffffff,%eax
je     1199 <main+0x49>
lea    0xe91(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <usage@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <getopt@plt>
cmp    $0xffffffff,%eax
jne    1180 <main+0x30>
mov    0x2e48(%rip),%rax
mov    (%rax),%r14
cmp    %ebp,%r14d
jne    11af <main+0x5f>
xor    %eax,%eax
call   1050 <usage@plt>
mov    (%rbx,%r14,8),%rdi
lea    (%rbx,%r14,8),%rbp
add    $0x8,%rbp
nopl   0x0(%rax,%rax,1)
call   1030 <rmdir@plt>
mov    %eax,%ebx
test   %eax,%eax
js     11df <main+0x8f>
mov    0x0(%rbp),%rdi
add    $0x8,%rbp
test   %rdi,%rdi
jne    11c0 <main+0x70>
mov    %ebx,%edi
call   1070 <exit@plt>
mov    -0x8(%rbp),%rdx
lea    0xe16(%rip),%rsi
mov    $0x1,%edi
call   1040 <err@plt>
mov    %ebx,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@optind = global i64 0
@.str.1 = [3 x i8] c"%s\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
br label %8
8: ; preds = %18, %2
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @getopt(i32 %9, i8** %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 %11, i32* %6
%12 = icmp ne i32 %11, -1
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i32, i32* %6
switch i32 %14, label %16 [
i32 63, label %15
]
15: ; preds = %13
br label %16
16: ; preds = %13, %15
%17 = call i32 (...) @usage()
br label %18
18: ; preds = %16
br label %8
19: ; preds = %8
%20 = load i64, i64* @optind
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = sub nsw i64 %22, %20
%24 = trunc i64 %23 to i32
store i32 %24, i32* %4
%25 = load i64, i64* @optind
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 %25
store i8** %27, i8*** %5
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %19
%31 = call i32 (...) @usage()
br label %32
32: ; preds = %30, %19
store i32 0, i32* %7
br label %33
33: ; preds = %42, %32
%34 = load i8**, i8*** %5
%35 = load i8*, i8** %34
%36 = call i32 @rmdir(i8* %35)
store i32 %36, i32* %7
%37 = icmp slt i32 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %33
br label %46
39: ; preds = %33
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i32 1
store i8** %41, i8*** %5
br label %42
42: ; preds = %39
%43 = load i8**, i8*** %5
%44 = load i8*, i8** %43
%45 = icmp ne i8* %44, null
br i1 %45, label %33, label %46
46: ; preds = %42, %38
%47 = load i32, i32* %7
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %46
%50 = load i8**, i8*** %5
%51 = load i8*, i8** %50
%52 = call i32 @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %51)
br label %53
53: ; preds = %49, %46
%54 = load i32, i32* %7
%55 = call i32 @exit(i32 %54)
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@optind = global i64 0
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %2, %5
%6 = tail call i32 (...) @usage()
%7 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %5
9: ; preds = %5, %2
%10 = load i64, i64* @optind
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds i8*, i8** %1, i64 %10
%13 = icmp eq i32 %11, %0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 (...) @usage()
br label %16
16: ; preds = %14, %9
%17 = load i8*, i8** %12
br label %18
18: ; preds = %23, %16
%19 = phi i8* [ %17, %16 ], [ %25, %23 ]
%20 = phi i8** [ %12, %16 ], [ %24, %23 ]
%21 = tail call i32 @rmdir(i8* %19)
%22 = icmp slt i32 %21, 0
br i1 %22, label %27, label %23
23: ; preds = %18
%24 = getelementptr inbounds i8*, i8** %20, i64 1
%25 = load i8*, i8** %24
%26 = icmp eq i8* %25, null
br i1 %26, label %30, label %18
27: ; preds = %18
%28 = load i8*, i8** %20
%29 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %23, %27
%31 = tail call i32 @exit(i32 %21)
unreachable
}