#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 EOF;
int /*<<< orphan*/ destroy_privs();
int /*<<< orphan*/ do_mclasserase(char, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getopt(int, char **, char *);
scalar_t__ helpFlag(int, char **);
int /*<<< orphan*/ printf(char *);
char toupper(char);
int /*<<< orphan*/ usage(int);
void mclasserase(int argc, char **argv, int type __attribute__((unused))) {
  int c;
  int debug = 0;
  char drive = 'a';
  int extern optind;
  destroy_privs();
  if (helpFlag(argc, argv))
    usage(0);
  if ((argc != 2) & (argc != 3) & (argc != 4)) {
    printf("mclasserase: wrong num of args\n");
    usage(1);
  } else {
    while ((c = getopt(argc, argv, "+p:dh")) != EOF) {
      switch (c) {
      case 'd':
        printf("=============\n");
        printf("Debug Mode...\n");
        printf("=============\n");
        debug = 1;
        break;
      case 'p':
        printf("option -p not implemented yet\n");
        break;
      case 'h':
        usage(0);
      case '?':
        usage(1);
      default:
        break;
      }
    }
    for (; optind < argc; optind++) {
      if (!argv[optind][0] || argv[optind][1] != ':') {
        usage(1);
      }
      drive = toupper(argv[optind][0]);
    }
  }
  do_mclasserase(drive, debug);
  exit(0);
}


x86 assembly (clang, -O0):
<mclasserase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movb   $0x61,-0x1d(%rbp)
mov    $0x0,%al
call   1060 <destroy_privs@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <helpFlag@plt>
cmp    $0x0,%rax
je     11c1 <mclasserase+0x41>
xor    %edi,%edi
call   1080 <usage@plt>
cmpl   $0x2,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x3,-0x4(%rbp)
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmpl   $0x4,-0x4(%rbp)
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     120f <mclasserase+0x8f>
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <usage@plt>
jmp    1373 <mclasserase+0x1f3>
jmp    1214 <mclasserase+0x94>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xdfe(%rip),%rdx
call   1090 <getopt@plt>
mov    %eax,-0x18(%rbp)
mov    0x2db7(%rip),%rcx
cmp    (%rcx),%eax
je     12dc <mclasserase+0x15c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x3f,%eax
je     12c8 <mclasserase+0x148>
jmp    124d <mclasserase+0xcd>
mov    -0x24(%rbp),%eax
sub    $0x64,%eax
je     1280 <mclasserase+0x100>
jmp    125e <mclasserase+0xde>
mov    -0x24(%rbp),%eax
sub    $0x68,%eax
je     12c1 <mclasserase+0x141>
jmp    126f <mclasserase+0xef>
mov    -0x24(%rbp),%eax
sub    $0x70,%eax
je     12b0 <mclasserase+0x130>
jmp    12d2 <mclasserase+0x152>
lea    0xd9f(%rip),%rdi
call   1040 <printf@plt>
lea    0xda2(%rip),%rdi
call   1040 <printf@plt>
lea    0xd87(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x1c(%rbp)
jmp    12d7 <mclasserase+0x157>
lea    0xd8d(%rip),%rdi
call   1040 <printf@plt>
jmp    12d7 <mclasserase+0x157>
xor    %edi,%edi
call   1080 <usage@plt>
mov    $0x1,%edi
call   1080 <usage@plt>
jmp    12d7 <mclasserase+0x157>
jmp    1214 <mclasserase+0x94>
jmp    12e1 <mclasserase+0x161>
mov    0x2cf0(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jge    136e <mclasserase+0x1ee>
mov    -0x10(%rbp),%rax
mov    0x2cda(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
cmpb   $0x0,(%rax)
je     132d <mclasserase+0x1ad>
mov    -0x10(%rbp),%rax
mov    0x2cbf(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
je     1337 <mclasserase+0x1b7>
mov    $0x1,%edi
call   1080 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x2c96(%rip),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,-0x1d(%rbp)
mov    0x2c7d(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    0x2c71(%rip),%rax
mov    %ecx,(%rax)
jmp    12e1 <mclasserase+0x161>
jmp    1373 <mclasserase+0x1f3>
mov    -0x1d(%rbp),%al
mov    -0x1c(%rbp),%esi
movsbl %al,%edi
call   1070 <do_mclasserase@plt>
xor    %edi,%edi
call   10a0 <exit@plt>

x86 assembly (clang, -O2):
<mclasserase>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%r14d
xor    %eax,%eax
call   1060 <destroy_privs@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1050 <helpFlag@plt>
test   %rax,%rax
je     11af <mclasserase+0x2f>
xor    %edi,%edi
call   1080 <usage@plt>
lea    -0x2(%r14),%eax
cmp    $0x2,%eax
ja     1231 <mclasserase+0xb1>
lea    0xe41(%rip),%rdx
mov    %r14d,%edi
mov    %rbx,%rsi
call   1090 <getopt@plt>
mov    0x2e17(%rip),%r12
xor    %r15d,%r15d
cmp    (%r12),%eax
jne    125e <mclasserase+0xde>
mov    0x2df3(%rip),%rbp
mov    0x0(%rbp),%ecx
mov    $0x61,%al
jmp    1216 <mclasserase+0x96>
nopl   0x0(%rax)
mov    $0x1,%edi
call   1080 <usage@plt>
movslq 0x0(%rbp),%rax
mov    (%rbx,%rax,8),%rax
movzbl (%rax),%eax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    0x0(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,0x0(%rbp)
cmp    %r14d,%ecx
jge    124c <mclasserase+0xcc>
movslq %ecx,%rax
mov    (%rbx,%rax,8),%rcx
movzbl (%rcx),%eax
test   %al,%al
je     11f0 <mclasserase+0x70>
cmpb   $0x3a,0x1(%rcx)
jne    11f0 <mclasserase+0x70>
jmp    1205 <mclasserase+0x85>
lea    0xe08(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1080 <usage@plt>
mov    $0x61,%al
xor    %r15d,%r15d
movsbl %al,%edi
mov    %r15d,%esi
call   1070 <do_mclasserase@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
xor    %r15d,%r15d
lea    0xdca(%rip),%r13
lea    0xd91(%rip),%rbp
jmp    12a9 <mclasserase+0x129>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1080 <usage@plt>
mov    $0x1,%edi
call   1080 <usage@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1090 <getopt@plt>
cmp    (%r12),%eax
je     11de <mclasserase+0x5e>
cmp    $0x67,%eax
jg     12e0 <mclasserase+0x160>
cmp    $0x3f,%eax
je     1287 <mclasserase+0x107>
cmp    $0x64,%eax
jne    1291 <mclasserase+0x111>
mov    %r13,%rdi
call   1040 <puts@plt>
lea    0xd5d(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1040 <puts@plt>
mov    $0x1,%r15d
jmp    1291 <mclasserase+0x111>
nopl   0x0(%rax)
cmp    $0x68,%eax
je     1280 <mclasserase+0x100>
cmp    $0x70,%eax
jne    1291 <mclasserase+0x111>
lea    0xd15(%rip),%rdi
call   1040 <puts@plt>
jmp    1291 <mclasserase+0x111>

LLVM IR (-O0):
@.str = [32 x i8] c"mclasserase: wrong num of args\0A\00"
@.str.1 = [6 x i8] c"+p:dh\00"
@EOF = global i32 0
@.str.2 = [15 x i8] c"=============\0A\00"
@.str.3 = [15 x i8] c"Debug Mode...\0A\00"
@.str.4 = [31 x i8] c"option -p not implemented yet\0A\00"
@optind = external global i32
define void @mclasserase(i32 %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
store i32 0, i32* %8
store i8 97, i8* %9
%10 = call i32 (...) @destroy_privs()
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i64 @helpFlag(i32 %11, i8** %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 @usage(i32 0)
br label %17
17: ; preds = %15, %3
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 2
%20 = zext i1 %19 to i32
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 3
%23 = zext i1 %22 to i32
%24 = and i32 %20, %23
%25 = load i32, i32* %4
%26 = icmp ne i32 %25, 4
%27 = zext i1 %26 to i32
%28 = and i32 %24, %27
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %17
%31 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%32 = call i32 @usage(i32 1)
br label %93
33: ; preds = %17
br label %34
34: ; preds = %53, %33
%35 = load i32, i32* %4
%36 = load i8**, i8*** %5
%37 = call i32 @getopt(i32 %35, i8** %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 %37, i32* %7
%38 = load i32, i32* @EOF
%39 = icmp ne i32 %37, %38
br i1 %39, label %40, label %54
40: ; preds = %34
%41 = load i32, i32* %7
switch i32 %41, label %52 [
i32 100, label %42
i32 112, label %46
i32 104, label %48
i32 63, label %50
]
42: ; preds = %40
%43 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%45 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %8
br label %53
46: ; preds = %40
%47 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %53
48: ; preds = %40
%49 = call i32 @usage(i32 0)
br label %50
50: ; preds = %40, %48
%51 = call i32 @usage(i32 1)
br label %52
52: ; preds = %40, %50
br label %53
53: ; preds = %52, %46, %42
br label %34
54: ; preds = %34
br label %55
55: ; preds = %89, %54
%56 = load i32, i32* @optind
%57 = load i32, i32* %4
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %92
59: ; preds = %55
%60 = load i8**, i8*** %5
%61 = load i32, i32* @optind
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8*, i8** %60, i64 %62
%64 = load i8*, i8** %63
%65 = getelementptr inbounds i8, i8* %64, i64 0
%66 = load i8, i8* %65
%67 = icmp ne i8 %66, 0
br i1 %67, label %68, label %78
68: ; preds = %59
%69 = load i8**, i8*** %5
%70 = load i32, i32* @optind
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i8*, i8** %69, i64 %71
%73 = load i8*, i8** %72
%74 = getelementptr inbounds i8, i8* %73, i64 1
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp ne i32 %76, 58
br i1 %77, label %78, label %80
78: ; preds = %68, %59
%79 = call i32 @usage(i32 1)
br label %80
80: ; preds = %78, %68
%81 = load i8**, i8*** %5
%82 = load i32, i32* @optind
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8*, i8** %81, i64 %83
%85 = load i8*, i8** %84
%86 = getelementptr inbounds i8, i8* %85, i64 0
%87 = load i8, i8* %86
%88 = call signext i8 @toupper(i8 signext %87)
store i8 %88, i8* %9
br label %89
89: ; preds = %80
%90 = load i32, i32* @optind
%91 = add nsw i32 %90, 1
store i32 %91, i32* @optind
br label %55
92: ; preds = %55
br label %93
93: ; preds = %92, %30
%94 = load i8, i8* %9
%95 = load i32, i32* %8
%96 = call i32 @do_mclasserase(i8 signext %94, i32 %95)
%97 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"+p:dh\00"
@EOF = global i32 0
@optind = external global i32
@str = [30 x i8] c"option -p not implemented yet\00"
@str.6 = [14 x i8] c"Debug Mode...\00"
@str.7 = [14 x i8] c"=============\00"
@str.8 = [31 x i8] c"mclasserase: wrong num of args\00"
define void @mclasserase(i32 %0, i8** %1, i32 %2) {
%4 = tail call i32 (...) @destroy_privs()
%5 = tail call i64 @helpFlag(i32 %0, i8** %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @usage(i32 0)
br label %9
9: ; preds = %7, %3
%10 = add i32 %0, -2
%11 = icmp ult i32 %10, 3
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %19, label %23
16: ; preds = %9
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.8, i64 0, i64 0))
%18 = tail call i32 @usage(i32 1)
br label %65
19: ; preds = %36, %12
%20 = phi i32 [ 0, %12 ], [ %37, %36 ]
%21 = load i32, i32* @optind
%22 = icmp slt i32 %21, %0
br i1 %22, label %41, label %65
23: ; preds = %12, %36
%24 = phi i32 [ %38, %36 ], [ %13, %12 ]
%25 = phi i32 [ %37, %36 ], [ 0, %12 ]
switch i32 %24, label %36 [
i32 100, label %26
i32 112, label %30
i32 104, label %32
i32 63, label %34
]
26: ; preds = %23
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.7, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.7, i64 0, i64 0))
br label %36
30: ; preds = %23
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %36
32: ; preds = %23
%33 = tail call i32 @usage(i32 0)
br label %34
34: ; preds = %23, %32
%35 = tail call i32 @usage(i32 1)
br label %36
36: ; preds = %34, %23, %30, %26
%37 = phi i32 [ %25, %23 ], [ %25, %34 ], [ %25, %30 ], [ 1, %26 ]
%38 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%39 = load i32, i32* @EOF
%40 = icmp eq i32 %38, %39
br i1 %40, label %19, label %23
41: ; preds = %19, %59
%42 = phi i32 [ %63, %59 ], [ %21, %19 ]
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %1, i64 %43
%45 = load i8*, i8** %44
%46 = load i8, i8* %45
%47 = icmp eq i8 %46, 0
br i1 %47, label %52, label %48
48: ; preds = %41
%49 = getelementptr inbounds i8, i8* %45, i64 1
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 58
br i1 %51, label %59, label %52
52: ; preds = %48, %41
%53 = tail call i32 @usage(i32 1)
%54 = load i32, i32* @optind
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %1, i64 %55
%57 = load i8*, i8** %56
%58 = load i8, i8* %57
br label %59
59: ; preds = %52, %48
%60 = phi i8 [ %58, %52 ], [ %46, %48 ]
%61 = tail call signext i8 @toupper(i8 signext %60)
%62 = load i32, i32* @optind
%63 = add nsw i32 %62, 1
store i32 %63, i32* @optind
%64 = icmp slt i32 %63, %0
br i1 %64, label %41, label %65
65: ; preds = %59, %19, %16
%66 = phi i32 [ 0, %16 ], [ %20, %19 ], [ %20, %59 ]
%67 = phi i8 [ 97, %16 ], [ 97, %19 ], [ %61, %59 ]
%68 = tail call i32 @do_mclasserase(i8 signext %67, i32 %66)
%69 = tail call i32 @exit(i32 0)
unreachable
}