#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ tracker_start();
int /*<<< orphan*/ tracker_stop();
int main(int argc, char **argv) {
  if (argc == 2) {
    if (strcmp(argv[1], "--stop") == 0 || strcmp(argv[1], "-s") == 0) {
      tracker_stop();
    } else {
      fprintf(stderr, "usage: minitracker [--stop]\n");
      exit(0);
    }
  } else if (argc == 1) {
    tracker_start();
  } else {
    fprintf(stderr, "usage: minitracker [--stop]\n");
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11d9 <main+0x89>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe81(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     11ac <main+0x5c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe6a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11b8 <main+0x68>
mov    $0x0,%al
call   1060 <tracker_stop@plt>
jmp    11d4 <main+0x84>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
lea    0xe42(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    1210 <main+0xc0>
cmpl   $0x1,-0x8(%rbp)
jne    11ef <main+0x9f>
mov    $0x0,%al
call   1050 <tracker_start@plt>
jmp    120b <main+0xbb>
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
lea    0xe0b(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
jmp    1210 <main+0xc0>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
je     1191 <main+0x41>
cmp    $0x2,%edi
jne    119c <main+0x4c>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe97(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1188 <main+0x38>
mov    0x8(%rbx),%rdi
lea    0xe89(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    119c <main+0x4c>
xor    %eax,%eax
call   1060 <tracker_stop@plt>
jmp    1198 <main+0x48>
xor    %eax,%eax
call   1050 <tracker_start@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
lea    0xe5e(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"--stop\00"
@.str.1 = [3 x i8] c"-s\00"
@stderr = global i32 0
@.str.2 = [29 x i8] c"usage: minitracker [--stop]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %27
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %20, label %14
14: ; preds = %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %14, %8
%21 = call i32 (...) @tracker_stop()
br label %26
22: ; preds = %14
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 @exit(i32 0)
unreachable
26: ; preds = %20
br label %37
27: ; preds = %2
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (...) @tracker_start()
br label %36
32: ; preds = %27
%33 = load i32, i32* @stderr
%34 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 @exit(i32 0)
unreachable
36: ; preds = %30
br label %37
37: ; preds = %36, %26
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"--stop\00"
@.str.1 = [3 x i8] c"-s\00"
@stderr = global i32 0
@.str.2 = [29 x i8] c"usage: minitracker [--stop]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %20 [
i32 2, label %3
i32 1, label %18
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = load i8*, i8** %4
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8, %3
%13 = tail call i32 (...) @tracker_stop()
br label %24
14: ; preds = %8
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%17 = tail call i32 @exit(i32 0)
unreachable
18: ; preds = %2
%19 = tail call i32 (...) @tracker_start()
br label %24
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%23 = tail call i32 @exit(i32 0)
unreachable
24: ; preds = %18, %12
ret i32 0
}