#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 */
struct immvibe_handle {
  int dummy;
};

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ immvibe_close(struct immvibe_handle *);
int immvibe_get_debug_level(struct immvibe_handle *);
int immvibe_get_num_actuators(struct immvibe_handle *);
struct immvibe_handle *immvibe_open(int *);
int immvibe_play(struct immvibe_handle *, int);
int immvibe_set_amp_enabled(struct immvibe_handle *, int);
int immvibe_stop_kernel_timer(struct immvibe_handle *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  struct immvibe_handle *fd = NULL;
  int ret = 0;
  if (argc == 1 || argc > 3) {
    goto bail_usage;
  }
  fd = immvibe_open(&ret);
  if (!fd) {
    fprintf(stderr, "%s: immvibe_open failed: errno %d\n", argv[0], ret);
    ret = 99;
    goto bail;
  }
  if (!strcmp(argv[1], "p")) {
    if (argc != 3) {
      goto bail_usage;
    }
    int force = atoi(argv[2]);
    if (force < 0 || force > 255) {
      goto bail_usage;
    }
    ret = immvibe_play(fd, force);
  } else if (!strcmp(argv[1], "s")) {
    if (argc != 2) {
      goto bail_usage;
    }
    ret = immvibe_stop_kernel_timer(fd);
  } else if (!strcmp(argv[1], "A")) {
    if (argc != 2) {
      goto bail_usage;
    }
    ret = immvibe_set_amp_enabled(fd, 1);
  } else if (!strcmp(argv[1], "a")) {
    if (argc != 2) {
      goto bail_usage;
    }
    ret = immvibe_set_amp_enabled(fd, 0);
  } else if (!strcmp(argv[1], "n")) {
    if (argc != 2) {
      goto bail_usage;
    }
    ret = immvibe_get_num_actuators(fd);
  }
  if (!strcmp(argv[1], "d")) {
    if (argc != 2) {
      goto bail_usage;
    }
    ret = immvibe_get_debug_level(fd);
  }
  if (ret < 0) {
    fprintf(stderr, "immvibe call failed: %d\n", ret);
    ret = 1;
  } else {
    printf("%d\n", ret);
    ret = 0;
  }
  immvibe_close(fd);
  return ret;
bail_usage:
  usage(argv[0]);
  ret = 127;
bail:
  immvibe_close(fd);
  return ret;
}


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)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     11f9 <main+0x39>
cmpl   $0x3,-0x8(%rbp)
jle    11fe <main+0x3e>
jmp    144b <main+0x28b>
lea    -0x1c(%rbp),%rdi
call   1030 <immvibe_open@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1243 <main+0x83>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x1c(%rbp),%ecx
lea    0xdd0(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x63,-0x1c(%rbp)
jmp    145e <main+0x29e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd1(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12af <main+0xef>
cmpl   $0x3,-0x8(%rbp)
je     126f <main+0xaf>
jmp    144b <main+0x28b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10c0 <atoi@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     1296 <main+0xd6>
cmpl   $0xff,-0x20(%rbp)
jle    129b <main+0xdb>
jmp    144b <main+0x28b>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   10d0 <immvibe_play@plt>
mov    %eax,-0x1c(%rbp)
jmp    13b9 <main+0x1f9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd67(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12ec <main+0x12c>
cmpl   $0x2,-0x8(%rbp)
je     12db <main+0x11b>
jmp    144b <main+0x28b>
mov    -0x18(%rbp),%rdi
call   10e0 <immvibe_stop_kernel_timer@plt>
mov    %eax,-0x1c(%rbp)
jmp    13b4 <main+0x1f4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd2c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    132e <main+0x16e>
cmpl   $0x2,-0x8(%rbp)
je     1318 <main+0x158>
jmp    144b <main+0x28b>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   10b0 <immvibe_set_amp_enabled@plt>
mov    %eax,-0x1c(%rbp)
jmp    13af <main+0x1ef>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcec(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    136d <main+0x1ad>
cmpl   $0x2,-0x8(%rbp)
je     135a <main+0x19a>
jmp    144b <main+0x28b>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   10b0 <immvibe_set_amp_enabled@plt>
mov    %eax,-0x1c(%rbp)
jmp    13aa <main+0x1ea>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xcaf(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13a5 <main+0x1e5>
cmpl   $0x2,-0x8(%rbp)
je     1399 <main+0x1d9>
jmp    144b <main+0x28b>
mov    -0x18(%rbp),%rdi
call   1060 <immvibe_get_num_actuators@plt>
mov    %eax,-0x1c(%rbp)
jmp    13aa <main+0x1ea>
jmp    13af <main+0x1ef>
jmp    13b4 <main+0x1f4>
jmp    13b9 <main+0x1f9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc65(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    13f1 <main+0x231>
cmpl   $0x2,-0x8(%rbp)
je     13e5 <main+0x225>
jmp    144b <main+0x28b>
mov    -0x18(%rbp),%rdi
call   1040 <immvibe_get_debug_level@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1421 <main+0x261>
mov    0x2bde(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
lea    0xc21(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x1,-0x1c(%rbp)
jmp    1437 <main+0x277>
mov    -0x1c(%rbp),%esi
lea    0xc19(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   10a0 <immvibe_close@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    146d <main+0x2ad>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1090 <usage@plt>
movl   $0x7f,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   10a0 <immvibe_close@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movl   $0x0,0x4(%rsp)
xor    %r15d,%r15d
cmp    $0x1,%edi
je     137c <main+0x1bc>
mov    %edi,%ebp
cmp    $0x3,%edi
jg     137c <main+0x1bc>
lea    0x4(%rsp),%rdi
call   1030 <immvibe_open@plt>
test   %rax,%rax
je     128c <main+0xcc>
mov    %rax,%r15
mov    0x8(%r14),%rbx
lea    0xe19(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12b7 <main+0xf7>
lea    0xe04(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12e0 <main+0x120>
lea    0xdef(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12f3 <main+0x133>
lea    0xdda(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1306 <main+0x146>
lea    0xdc5(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
jne    1319 <main+0x159>
cmp    $0x2,%ebp
jne    137c <main+0x1bc>
mov    %r15,%rdi
call   1060 <immvibe_get_num_actuators@plt>
jmp    1315 <main+0x155>
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
mov    (%r14),%rdx
mov    0x4(%rsp),%ecx
lea    0xd5d(%rip),%rsi
xor    %r15d,%r15d
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x63,%eax
jmp    1389 <main+0x1c9>
cmp    $0x3,%ebp
jne    137c <main+0x1bc>
mov    0x10(%r14),%rdi
call   10c0 <atoi@plt>
cmp    $0xff,%eax
ja     137c <main+0x1bc>
mov    %r15,%rdi
mov    %eax,%esi
call   10d0 <immvibe_play@plt>
jmp    1315 <main+0x155>
cmp    $0x2,%ebp
jne    137c <main+0x1bc>
mov    %r15,%rdi
call   10e0 <immvibe_stop_kernel_timer@plt>
jmp    1315 <main+0x155>
cmp    $0x2,%ebp
jne    137c <main+0x1bc>
mov    %r15,%rdi
mov    $0x1,%esi
jmp    1310 <main+0x150>
cmp    $0x2,%ebp
jne    137c <main+0x1bc>
mov    %r15,%rdi
xor    %esi,%esi
call   10b0 <immvibe_set_amp_enabled@plt>
mov    %eax,0x4(%rsp)
mov    0x8(%r14),%rdi
lea    0xd09(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1347 <main+0x187>
mov    0x4(%rsp),%edx
test   %edx,%edx
js     135e <main+0x19e>
lea    0xd08(%rip),%rdi
mov    %edx,%esi
call   1050 <printf@plt>
xor    %eax,%eax
jmp    1389 <main+0x1c9>
cmp    $0x2,%ebp
jne    137c <main+0x1bc>
mov    %r15,%rdi
call   1040 <immvibe_get_debug_level@plt>
mov    %eax,%edx
mov    %eax,0x4(%rsp)
test   %edx,%edx
jns    1335 <main+0x175>
mov    0x2c7b(%rip),%rax
mov    (%rax),%edi
lea    0xcc1(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0x1,%eax
jmp    1389 <main+0x1c9>
mov    (%r14),%rdi
call   1090 <usage@plt>
mov    $0x7f,%eax
mov    %eax,0x4(%rsp)
mov    %r15,%rdi
call   10a0 <immvibe_close@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.immvibe_handle = type { i32 }
@stderr = global i32 0
@.str = [35 x i8] c"%s: immvibe_open failed: errno %d\0A\00"
@.str.1 = [2 x i8] c"p\00"
@.str.2 = [2 x i8] c"s\00"
@.str.3 = [2 x i8] c"A\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [2 x i8] c"n\00"
@.str.6 = [2 x i8] c"d\00"
@.str.7 = [25 x i8] c"immvibe call failed: %d\0A\00"
@.str.8 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.immvibe_handle*
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.immvibe_handle* null, %struct.immvibe_handle** %6
store i32 0, i32* %7
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp sgt i32 %12, 3
br i1 %13, label %14, label %15
14: ; preds = %11, %2
br label %134
15: ; preds = %11
%16 = call %struct.immvibe_handle* @immvibe_open(i32* %7)
store %struct.immvibe_handle* %16, %struct.immvibe_handle** %6
%17 = load %struct.immvibe_handle*, %struct.immvibe_handle** %6
%18 = icmp ne %struct.immvibe_handle* %17, null
br i1 %18, label %26, label %19
19: ; preds = %15
%20 = load i32, i32* @stderr
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = load i32, i32* %7
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %23, i32 %24)
store i32 99, i32* %7
br label %139
26: ; preds = %15
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br i1 %31, label %51, label %32
32: ; preds = %26
%33 = load i32, i32* %4
%34 = icmp ne i32 %33, 3
br i1 %34, label %35, label %36
35: ; preds = %32
br label %134
36: ; preds = %32
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = call i32 @atoi(i8* %39)
store i32 %40, i32* %8
%41 = load i32, i32* %8
%42 = icmp slt i32 %41, 0
br i1 %42, label %46, label %43
43: ; preds = %36
%44 = load i32, i32* %8
%45 = icmp sgt i32 %44, 255
br i1 %45, label %46, label %47
46: ; preds = %43, %36
br label %134
47: ; preds = %43
%48 = load %struct.immvibe_handle*, %struct.immvibe_handle** %6
%49 = load i32, i32* %8
%50 = call i32 @immvibe_play(%struct.immvibe_handle* %48, i32 %49)
store i32 %50, i32* %7
br label %107
51: ; preds = %26
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = call i32 @strcmp(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%56 = icmp ne i32 %55, 0
br i1 %56, label %64, label %57
57: ; preds = %51
%58 = load i32, i32* %4
%59 = icmp ne i32 %58, 2
br i1 %59, label %60, label %61
60: ; preds = %57
br label %134
61: ; preds = %57
%62 = load %struct.immvibe_handle*, %struct.immvibe_handle** %6
%63 = call i32 @immvibe_stop_kernel_timer(%struct.immvibe_handle* %62)
store i32 %63, i32* %7
br label %106
64: ; preds = %51
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call i32 @strcmp(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%69 = icmp ne i32 %68, 0
br i1 %69, label %77, label %70
70: ; preds = %64
%71 = load i32, i32* %4
%72 = icmp ne i32 %71, 2
br i1 %72, label %73, label %74
73: ; preds = %70
br label %134
74: ; preds = %70
%75 = load %struct.immvibe_handle*, %struct.immvibe_handle** %6
%76 = call i32 @immvibe_set_amp_enabled(%struct.immvibe_handle* %75, i32 1)
store i32 %76, i32* %7
br label %105
77: ; preds = %64
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
%81 = call i32 @strcmp(i8* %80, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%82 = icmp ne i32 %81, 0
br i1 %82, label %90, label %83
83: ; preds = %77
%84 = load i32, i32* %4
%85 = icmp ne i32 %84, 2
br i1 %85, label %86, label %87
86: ; preds = %83
br label %134
87: ; preds = %83
%88 = load %struct.immvibe_handle*, %struct.immvibe_handle** %6
%89 = call i32 @immvibe_set_amp_enabled(%struct.immvibe_handle* %88, i32 0)
store i32 %89, i32* %7
br label %104
90: ; preds = %77
%91 = load i8**, i8*** %5
%92 = getelementptr inbounds i8*, i8** %91, i64 1
%93 = load i8*, i8** %92
%94 = call i32 @strcmp(i8* %93, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%95 = icmp ne i32 %94, 0
br i1 %95, label %103, label %96
96: ; preds = %90
%97 = load i32, i32* %4
%98 = icmp ne i32 %97, 2
br i1 %98, label %99, label %100
99: ; preds = %96
br label %134
100: ; preds = %96
%101 = load %struct.immvibe_handle*, %struct.immvibe_handle** %6
%102 = call i32 @immvibe_get_num_actuators(%struct.immvibe_handle* %101)
store i32 %102, i32* %7
br label %103
103: ; preds = %100, %90
br label %104
104: ; preds = %103, %87
br label %105
105: ; preds = %104, %74
br label %106
106: ; preds = %105, %61
br label %107
107: ; preds = %106, %47
%108 = load i8**, i8*** %5
%109 = getelementptr inbounds i8*, i8** %108, i64 1
%110 = load i8*, i8** %109
%111 = call i32 @strcmp(i8* %110, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%112 = icmp ne i32 %111, 0
br i1 %112, label %120, label %113
113: ; preds = %107
%114 = load i32, i32* %4
%115 = icmp ne i32 %114, 2
br i1 %115, label %116, label %117
116: ; preds = %113
br label %134
117: ; preds = %113
%118 = load %struct.immvibe_handle*, %struct.immvibe_handle** %6
%119 = call i32 @immvibe_get_debug_level(%struct.immvibe_handle* %118)
store i32 %119, i32* %7
br label %120
120: ; preds = %117, %107
%121 = load i32, i32* %7
%122 = icmp slt i32 %121, 0
br i1 %122, label %123, label %127
123: ; preds = %120
%124 = load i32, i32* @stderr
%125 = load i32, i32* %7
%126 = call i32 (i32, i8*, ...) @fprintf(i32 %124, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %125)
store i32 1, i32* %7
br label %130
127: ; preds = %120
%128 = load i32, i32* %7
%129 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %128)
store i32 0, i32* %7
br label %130
130: ; preds = %127, %123
%131 = load %struct.immvibe_handle*, %struct.immvibe_handle** %6
%132 = call i32 @immvibe_close(%struct.immvibe_handle* %131)
%133 = load i32, i32* %7
store i32 %133, i32* %3
br label %143
134: ; preds = %116, %99, %86, %73, %60, %46, %35, %14
%135 = load i8**, i8*** %5
%136 = getelementptr inbounds i8*, i8** %135, i64 0
%137 = load i8*, i8** %136
%138 = call i32 @usage(i8* %137)
store i32 127, i32* %7
br label %139
139: ; preds = %134, %19
%140 = load %struct.immvibe_handle*, %struct.immvibe_handle** %6
%141 = call i32 @immvibe_close(%struct.immvibe_handle* %140)
%142 = load i32, i32* %7
store i32 %142, i32* %3
br label %143
143: ; preds = %139, %130
%144 = load i32, i32* %3
ret i32 %144
}

LLVM IR (-O2):
%struct.immvibe_handle = type { i32 }
@stderr = global i32 0
@.str = [35 x i8] c"%s: immvibe_open failed: errno %d\0A\00"
@.str.1 = [2 x i8] c"p\00"
@.str.2 = [2 x i8] c"s\00"
@.str.3 = [2 x i8] c"A\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [2 x i8] c"n\00"
@.str.6 = [2 x i8] c"d\00"
@.str.7 = [25 x i8] c"immvibe call failed: %d\0A\00"
@.str.8 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = icmp eq i32 %0, 1
%6 = icmp sgt i32 %0, 3
%7 = or i1 %5, %6
br i1 %7, label %79, label %8
8: ; preds = %2
%9 = call %struct.immvibe_handle* @immvibe_open(i32* %3)
%10 = icmp eq %struct.immvibe_handle* %9, null
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %1
%14 = load i32, i32* %3
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14)
br label %83
16: ; preds = %8
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @strcmp(i8* dereferenceable(1) %18, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %16
%22 = icmp eq i32 %0, 3
br i1 %22, label %23, label %79
23: ; preds = %21
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
%27 = icmp ugt i32 %26, 255
br i1 %27, label %79, label %28
28: ; preds = %23
%29 = call i32 @immvibe_play(%struct.immvibe_handle* %9, i32 %26)
store i32 %29, i32* %3
br label %58
30: ; preds = %16
%31 = call i32 @strcmp(i8* dereferenceable(1) %18, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %30
%34 = icmp eq i32 %0, 2
br i1 %34, label %35, label %79
35: ; preds = %33
%36 = call i32 @immvibe_stop_kernel_timer(%struct.immvibe_handle* %9)
store i32 %36, i32* %3
br label %58
37: ; preds = %30
%38 = call i32 @strcmp(i8* dereferenceable(1) %18, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = icmp eq i32 %0, 2
br i1 %41, label %42, label %79
42: ; preds = %40
%43 = call i32 @immvibe_set_amp_enabled(%struct.immvibe_handle* %9, i32 1)
store i32 %43, i32* %3
br label %58
44: ; preds = %37
%45 = call i32 @strcmp(i8* dereferenceable(1) %18, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %51
47: ; preds = %44
%48 = icmp eq i32 %0, 2
br i1 %48, label %49, label %79
49: ; preds = %47
%50 = call i32 @immvibe_set_amp_enabled(%struct.immvibe_handle* %9, i32 0)
store i32 %50, i32* %3
br label %58
51: ; preds = %44
%52 = call i32 @strcmp(i8* dereferenceable(1) %18, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %58
54: ; preds = %51
%55 = icmp eq i32 %0, 2
br i1 %55, label %56, label %79
56: ; preds = %54
%57 = call i32 @immvibe_get_num_actuators(%struct.immvibe_handle* %9)
store i32 %57, i32* %3
br label %58
58: ; preds = %28, %35, %49, %56, %51, %42
%59 = load i8*, i8** %17
%60 = call i32 @strcmp(i8* dereferenceable(1) %59, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %66
62: ; preds = %58
%63 = icmp eq i32 %0, 2
br i1 %63, label %64, label %79
64: ; preds = %62
%65 = call i32 @immvibe_get_debug_level(%struct.immvibe_handle* %9)
store i32 %65, i32* %3
br label %68
66: ; preds = %58
%67 = load i32, i32* %3
br label %68
68: ; preds = %66, %64
%69 = phi i32 [ %67, %66 ], [ %65, %64 ]
%70 = icmp slt i32 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %68
%72 = load i32, i32* @stderr
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %69)
br label %76
74: ; preds = %68
%75 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %69)
br label %76
76: ; preds = %74, %71
%77 = phi i32 [ 0, %74 ], [ 1, %71 ]
store i32 %77, i32* %3
%78 = call i32 @immvibe_close(%struct.immvibe_handle* %9)
br label %87
79: ; preds = %23, %62, %54, %47, %40, %33, %21, %2
%80 = phi %struct.immvibe_handle* [ null, %2 ], [ %9, %62 ], [ %9, %54 ], [ %9, %47 ], [ %9, %40 ], [ %9, %33 ], [ %9, %21 ], [ %9, %23 ]
%81 = load i8*, i8** %1
%82 = call i32 @usage(i8* %81)
br label %83
83: ; preds = %79, %11
%84 = phi i32 [ 99, %11 ], [ 127, %79 ]
%85 = phi %struct.immvibe_handle* [ null, %11 ], [ %80, %79 ]
store i32 %84, i32* %3
%86 = call i32 @immvibe_close(%struct.immvibe_handle* %85)
br label %87
87: ; preds = %83, %76
%88 = load i32, i32* %3
ret i32 %88
}