#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ dbz(char *, char *, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  int ret = EXIT_FAILURE;
  bool query = true;
  if (argc < 3 || argc > 4)
    goto usage;
  if (strcmp(argv[1], "-q") != 0) {
    if (strcmp(argv[1], "-d") != 0)
      goto usage;
    query = false;
  }
  if (!dbz(argv[2], argv[3], query))
    goto fail;
  ret = EXIT_SUCCESS;
fail:
  return ret;
usage:
  fprintf(stderr, "%s [ -q | -d ] /dev/mmcblkX [ /mount/point/dir/file.rm ]\n",
          argv[0]);
  goto fail;
}


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    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     116d <main+0x3d>
cmpl   $0x4,-0x8(%rbp)
jle    1172 <main+0x42>
jmp    11f5 <main+0xc5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11ba <main+0x8a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe64(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11b3 <main+0x83>
jmp    11f5 <main+0xc5>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
mov    -0x18(%rbp),%edx
call   1050 <dbz@plt>
cmp    $0x0,%eax
jne    11e0 <main+0xb0>
jmp    11ec <main+0xbc>
mov    0x2de9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdfa(%rip),%rsi
call   1040 <fprintf@plt>
jmp    11ec <main+0xbc>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e9b(%rip),%rax
mov    (%rax),%ebp
add    $0xfffffffb,%edi
cmp    $0xfffffffe,%edi
jb     1171 <main+0x41>
mov    0x8(%rbx),%rdi
lea    0xeae(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1192 <main+0x62>
mov    0x8(%rbx),%rdi
lea    0xe9c(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1199 <main+0x69>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe82(%rip),%rsi
call   1040 <fprintf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x1,%edx
jmp    119b <main+0x6b>
xor    %edx,%edx
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
call   1050 <dbz@plt>
test   %eax,%eax
je     1189 <main+0x59>
mov    0x2e1d(%rip),%rax
mov    (%rax),%ebp
jmp    1189 <main+0x59>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"-q\00"
@.str.1 = [3 x i8] c"-d\00"
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str.2 = [58 x i8] c"%s [ -q | -d ] /dev/mmcblkX [ /mount/point/dir/file.rm ]\0A\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
%8 = load i32, i32* @EXIT_FAILURE
store i32 %8, i32* %6
store i32 1, i32* %7
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 3
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 4
br i1 %13, label %14, label %15
14: ; preds = %11, %2
br label %44
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %29
21: ; preds = %15
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %21
br label %44
28: ; preds = %21
store i32 0, i32* %7
br label %29
29: ; preds = %28, %15
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 3
%35 = load i8*, i8** %34
%36 = load i32, i32* %7
%37 = call i32 @dbz(i8* %32, i8* %35, i32 %36)
%38 = icmp ne i32 %37, 0
br i1 %38, label %40, label %39
39: ; preds = %29
br label %42
40: ; preds = %29
%41 = load i32, i32* @EXIT_SUCCESS
store i32 %41, i32* %6
br label %42
42: ; preds = %44, %40, %39
%43 = load i32, i32* %6
ret i32 %43
44: ; preds = %27, %14
%45 = load i32, i32* @stderr
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 0
%48 = load i8*, i8** %47
%49 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), i8* %48)
br label %42
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"-q\00"
@.str.1 = [3 x i8] c"-d\00"
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str.2 = [58 x i8] c"%s [ -q | -d ] /dev/mmcblkX [ /mount/point/dir/file.rm ]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @EXIT_FAILURE
%4 = add i32 %0, -5
%5 = icmp ult i32 %4, -2
br i1 %5, label %27, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = load i8*, i8** %7
%13 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %11, %6
%16 = phi i32 [ 1, %6 ], [ 0, %11 ]
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8*, i8** %1, i64 3
%20 = load i8*, i8** %19
%21 = tail call i32 @dbz(i8* %18, i8* %20, i32 %16)
%22 = icmp eq i32 %21, 0
%23 = load i32, i32* @EXIT_SUCCESS
%24 = select i1 %22, i32 %3, i32 %23
br label %25
25: ; preds = %15, %27
%26 = phi i32 [ %3, %27 ], [ %24, %15 ]
ret i32 %26
27: ; preds = %11, %2
%28 = load i32, i32* @stderr
%29 = load i8*, i8** %1
%30 = tail call i32 @fprintf(i32 %28, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), i8* %29)
br label %25
}