#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 instrument {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _close_targets(struct instrument *, char *);
int /*<<< orphan*/ _get_idn(struct instrument *);
int /*<<< orphan*/ _list_targets();
int /*<<< orphan*/ _open_targets(struct instrument *, char *);
int /*<<< orphan*/ _query_targets(struct instrument *, char *);
int /*<<< orphan*/ _shell_help();
int /*<<< orphan*/ _show_config();
int /*<<< orphan*/ inst_set_verbose(struct instrument *, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int _docmd(struct instrument *gd, char **av) {
  int rc = 0;
  if (av[0]) {
    if (strcmp(av[0], "help") == 0) {
      _shell_help();
    } else if (strcmp(av[0], "quit") == 0) {
      rc = 1;
    } else if (strcmp(av[0], "on") == 0) {
      if (av[1] == NULL)
        printf("Usage: on [targets]\n");
      else
        _close_targets(gd, av[1]);
    } else if (strcmp(av[0], "off") == 0) {
      if (av[1] == NULL)
        printf("Usage: off [targets]\n");
      else
        _open_targets(gd, av[1]);
    } else if (strcmp(av[0], "query") == 0) {
      _query_targets(gd, av[1]);
    } else if (strcmp(av[0], "show") == 0) {
      _show_config();
    } else if (strcmp(av[0], "list") == 0) {
      if (av[1] != NULL)
        printf("Usage: list\n");
      else
        _list_targets();
    } else if (strcmp(av[0], "id") == 0) {
      _get_idn(gd);
    } else if (strcmp(av[0], "verbose") == 0) {
      if (av[1] == NULL || av[2] != NULL)
        printf("Usage: verbose 1|0\n");
      else {
        if (!strcmp(av[1], "1"))
          inst_set_verbose(gd, 1);
        else if (!strcmp(av[1], "0"))
          inst_set_verbose(gd, 0);
        else
          printf("Usage: verbose 1|0\n");
      }
    } else
      printf("type \"help\" for a list of commands\n");
  }
  return rc;
}


x86 assembly (clang, -O0):
<_docmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     148c <_docmd+0x2ec>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe2d(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    11ee <_docmd+0x4e>
mov    $0x0,%al
call   1050 <_shell_help@plt>
jmp    1487 <_docmd+0x2e7>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe09(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1217 <_docmd+0x77>
movl   $0x1,-0x14(%rbp)
jmp    1482 <_docmd+0x2e2>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xde5(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    126a <_docmd+0xca>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    1254 <_docmd+0xb4>
lea    0xdc3(%rip),%rdi
call   1060 <printf@plt>
jmp    1265 <_docmd+0xc5>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <_close_targets@plt>
jmp    147d <_docmd+0x2dd>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xdaa(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    12bd <_docmd+0x11d>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
jne    12a7 <_docmd+0x107>
lea    0xd89(%rip),%rdi
call   1060 <printf@plt>
jmp    12b8 <_docmd+0x118>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1080 <_open_targets@plt>
jmp    1478 <_docmd+0x2d8>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd71(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    12f0 <_docmd+0x150>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   10b0 <_query_targets@plt>
jmp    1473 <_docmd+0x2d3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd44(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1319 <_docmd+0x179>
mov    $0x0,%al
call   1070 <_show_config@plt>
jmp    146e <_docmd+0x2ce>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xd20(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1362 <_docmd+0x1c2>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     1356 <_docmd+0x1b6>
lea    0xd00(%rip),%rdi
call   1060 <printf@plt>
jmp    135d <_docmd+0x1bd>
mov    $0x0,%al
call   10c0 <_list_targets@plt>
jmp    1469 <_docmd+0x2c9>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xce9(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    138d <_docmd+0x1ed>
mov    -0x8(%rbp),%rdi
call   1090 <_get_idn@plt>
jmp    1464 <_docmd+0x2c4>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xcc1(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1453 <_docmd+0x2b3>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     13c8 <_docmd+0x228>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     13d9 <_docmd+0x239>
lea    0xc95(%rip),%rdi
call   1060 <printf@plt>
jmp    144e <_docmd+0x2ae>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc90(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    140a <_docmd+0x26a>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <inst_set_verbose@plt>
jmp    1449 <_docmd+0x2a9>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc61(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1438 <_docmd+0x298>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <inst_set_verbose@plt>
jmp    1444 <_docmd+0x2a4>
lea    0xc25(%rip),%rdi
call   1060 <printf@plt>
jmp    1449 <_docmd+0x2a9>
jmp    144e <_docmd+0x2ae>
jmp    145f <_docmd+0x2bf>
lea    0xc22(%rip),%rdi
call   1060 <printf@plt>
jmp    1464 <_docmd+0x2c4>
jmp    1469 <_docmd+0x2c9>
jmp    146e <_docmd+0x2ce>
jmp    1473 <_docmd+0x2d3>
jmp    1478 <_docmd+0x2d8>
jmp    147d <_docmd+0x2dd>
jmp    1482 <_docmd+0x2e2>
jmp    1487 <_docmd+0x2e7>
jmp    148c <_docmd+0x2ec>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_docmd>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rsi),%rdi
xor    %ebp,%ebp
test   %rdi,%rdi
je     1338 <_docmd+0x198>
mov    %rsi,%rbx
lea    0xe41(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1299 <_docmd+0xf9>
mov    (%rbx),%rdi
lea    0xe2e(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12a7 <_docmd+0x107>
mov    (%rbx),%rdi
lea    0xe1b(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12b1 <_docmd+0x111>
mov    (%rbx),%rdi
lea    0xe06(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12c4 <_docmd+0x124>
mov    (%rbx),%rdi
lea    0xdf2(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12d7 <_docmd+0x137>
mov    (%rbx),%rdi
lea    0xde0(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     12ee <_docmd+0x14e>
mov    (%rbx),%rdi
lea    0xe17(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1302 <_docmd+0x162>
mov    (%rbx),%rdi
lea    0xdb5(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     1312 <_docmd+0x172>
mov    (%rbx),%rdi
lea    0xda0(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     131c <_docmd+0x17c>
lea    0xd95(%rip),%rdi
jmp    1333 <_docmd+0x193>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <_shell_help@plt>
jmp    1338 <_docmd+0x198>
mov    $0x1,%ebp
jmp    1338 <_docmd+0x198>
mov    0x8(%rbx),%rsi
test   %rsi,%rsi
je     12e5 <_docmd+0x145>
mov    %r14,%rdi
call   1030 <_close_targets@plt>
jmp    1338 <_docmd+0x198>
mov    0x8(%rbx),%rsi
test   %rsi,%rsi
je     12f9 <_docmd+0x159>
mov    %r14,%rdi
call   1080 <_open_targets@plt>
jmp    1338 <_docmd+0x198>
mov    0x8(%rbx),%rsi
mov    %r14,%rdi
call   10b0 <_query_targets@plt>
jmp    1338 <_docmd+0x198>
lea    0xd94(%rip),%rdi
jmp    1333 <_docmd+0x193>
xor    %ebp,%ebp
xor    %eax,%eax
call   1070 <_show_config@plt>
jmp    1338 <_docmd+0x198>
lea    0xd6b(%rip),%rdi
jmp    1333 <_docmd+0x193>
cmpq   $0x0,0x8(%rbx)
je     133f <_docmd+0x19f>
lea    0xd4f(%rip),%rdi
jmp    1333 <_docmd+0x193>
mov    %r14,%rdi
call   1090 <_get_idn@plt>
jmp    1338 <_docmd+0x198>
mov    0x8(%rbx),%rdi
test   %rdi,%rdi
je     132c <_docmd+0x18c>
cmpq   $0x0,0x10(%rbx)
je     134a <_docmd+0x1aa>
lea    0xd19(%rip),%rdi
call   1060 <puts@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %ebp,%ebp
xor    %eax,%eax
call   10c0 <_list_targets@plt>
jmp    1338 <_docmd+0x198>
lea    0xcd6(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
je     137e <_docmd+0x1de>
mov    0x8(%rbx),%rdi
lea    0xcf7(%rip),%rsi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    132c <_docmd+0x18c>
xor    %ebp,%ebp
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <inst_set_verbose@plt>
jmp    1338 <_docmd+0x198>
mov    %r14,%rdi
mov    $0x1,%esi
call   1040 <inst_set_verbose@plt>
jmp    1338 <_docmd+0x198>

LLVM IR (-O0):
%struct.instrument = type { i32 }
@.str = [5 x i8] c"help\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [3 x i8] c"on\00"
@.str.3 = [21 x i8] c"Usage: on [targets]\0A\00"
@.str.4 = [4 x i8] c"off\00"
@.str.5 = [22 x i8] c"Usage: off [targets]\0A\00"
@.str.6 = [6 x i8] c"query\00"
@.str.7 = [5 x i8] c"show\00"
@.str.8 = [5 x i8] c"list\00"
@.str.9 = [13 x i8] c"Usage: list\0A\00"
@.str.10 = [3 x i8] c"id\00"
@.str.11 = [8 x i8] c"verbose\00"
@.str.12 = [20 x i8] c"Usage: verbose 1|0\0A\00"
@.str.13 = [2 x i8] c"1\00"
@.str.14 = [2 x i8] c"0\00"
@.str.15 = [36 x i8] c"type \22help\22 for a list of commands\0A\00"
define i32 @_docmd(%struct.instrument* %0, i8** %1) {
%3 = alloca %struct.instrument*
%4 = alloca i8**
%5 = alloca i32
store %struct.instrument* %0, %struct.instrument** %3
store i8** %1, i8*** %4
store i32 0, i32* %5
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %162
10: ; preds = %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 (...) @_shell_help()
br label %161
18: ; preds = %10
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %5
br label %160
25: ; preds = %18
%26 = load i8**, i8*** %4
%27 = getelementptr inbounds i8*, i8** %26, i64 0
%28 = load i8*, i8** %27
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %45
31: ; preds = %25
%32 = load i8**, i8*** %4
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = icmp eq i8* %34, null
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %44
38: ; preds = %31
%39 = load %struct.instrument*, %struct.instrument** %3
%40 = load i8**, i8*** %4
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = call i32 @_close_targets(%struct.instrument* %39, i8* %42)
br label %44
44: ; preds = %38, %36
br label %159
45: ; preds = %25
%46 = load i8**, i8*** %4
%47 = getelementptr inbounds i8*, i8** %46, i64 0
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %65
51: ; preds = %45
%52 = load i8**, i8*** %4
%53 = getelementptr inbounds i8*, i8** %52, i64 1
%54 = load i8*, i8** %53
%55 = icmp eq i8* %54, null
br i1 %55, label %56, label %58
56: ; preds = %51
%57 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
br label %64
58: ; preds = %51
%59 = load %struct.instrument*, %struct.instrument** %3
%60 = load i8**, i8*** %4
%61 = getelementptr inbounds i8*, i8** %60, i64 1
%62 = load i8*, i8** %61
%63 = call i32 @_open_targets(%struct.instrument* %59, i8* %62)
br label %64
64: ; preds = %58, %56
br label %158
65: ; preds = %45
%66 = load i8**, i8*** %4
%67 = getelementptr inbounds i8*, i8** %66, i64 0
%68 = load i8*, i8** %67
%69 = call i64 @strcmp(i8* %68, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %77
71: ; preds = %65
%72 = load %struct.instrument*, %struct.instrument** %3
%73 = load i8**, i8*** %4
%74 = getelementptr inbounds i8*, i8** %73, i64 1
%75 = load i8*, i8** %74
%76 = call i32 @_query_targets(%struct.instrument* %72, i8* %75)
br label %157
77: ; preds = %65
%78 = load i8**, i8*** %4
%79 = getelementptr inbounds i8*, i8** %78, i64 0
%80 = load i8*, i8** %79
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %85
83: ; preds = %77
%84 = call i32 (...) @_show_config()
br label %156
85: ; preds = %77
%86 = load i8**, i8*** %4
%87 = getelementptr inbounds i8*, i8** %86, i64 0
%88 = load i8*, i8** %87
%89 = call i64 @strcmp(i8* %88, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %101
91: ; preds = %85
%92 = load i8**, i8*** %4
%93 = getelementptr inbounds i8*, i8** %92, i64 1
%94 = load i8*, i8** %93
%95 = icmp ne i8* %94, null
br i1 %95, label %96, label %98
96: ; preds = %91
%97 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0))
br label %100
98: ; preds = %91
%99 = call i32 (...) @_list_targets()
br label %100
100: ; preds = %98, %96
br label %155
101: ; preds = %85
%102 = load i8**, i8*** %4
%103 = getelementptr inbounds i8*, i8** %102, i64 0
%104 = load i8*, i8** %103
%105 = call i64 @strcmp(i8* %104, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%106 = icmp eq i64 %105, 0
br i1 %106, label %107, label %110
107: ; preds = %101
%108 = load %struct.instrument*, %struct.instrument** %3
%109 = call i32 @_get_idn(%struct.instrument* %108)
br label %154
110: ; preds = %101
%111 = load i8**, i8*** %4
%112 = getelementptr inbounds i8*, i8** %111, i64 0
%113 = load i8*, i8** %112
%114 = call i64 @strcmp(i8* %113, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%115 = icmp eq i64 %114, 0
br i1 %115, label %116, label %151
116: ; preds = %110
%117 = load i8**, i8*** %4
%118 = getelementptr inbounds i8*, i8** %117, i64 1
%119 = load i8*, i8** %118
%120 = icmp eq i8* %119, null
br i1 %120, label %126, label %121
121: ; preds = %116
%122 = load i8**, i8*** %4
%123 = getelementptr inbounds i8*, i8** %122, i64 2
%124 = load i8*, i8** %123
%125 = icmp ne i8* %124, null
br i1 %125, label %126, label %128
126: ; preds = %121, %116
%127 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
br label %150
128: ; preds = %121
%129 = load i8**, i8*** %4
%130 = getelementptr inbounds i8*, i8** %129, i64 1
%131 = load i8*, i8** %130
%132 = call i64 @strcmp(i8* %131, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%133 = icmp ne i64 %132, 0
br i1 %133, label %137, label %134
134: ; preds = %128
%135 = load %struct.instrument*, %struct.instrument** %3
%136 = call i32 @inst_set_verbose(%struct.instrument* %135, i32 1)
br label %149
137: ; preds = %128
%138 = load i8**, i8*** %4
%139 = getelementptr inbounds i8*, i8** %138, i64 1
%140 = load i8*, i8** %139
%141 = call i64 @strcmp(i8* %140, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%142 = icmp ne i64 %141, 0
br i1 %142, label %146, label %143
143: ; preds = %137
%144 = load %struct.instrument*, %struct.instrument** %3
%145 = call i32 @inst_set_verbose(%struct.instrument* %144, i32 0)
br label %148
146: ; preds = %137
%147 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
br label %148
148: ; preds = %146, %143
br label %149
149: ; preds = %148, %134
br label %150
150: ; preds = %149, %126
br label %153
151: ; preds = %110
%152 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i64 0, i64 0))
br label %153
153: ; preds = %151, %150
br label %154
154: ; preds = %153, %107
br label %155
155: ; preds = %154, %100
br label %156
156: ; preds = %155, %83
br label %157
157: ; preds = %156, %71
br label %158
158: ; preds = %157, %64
br label %159
159: ; preds = %158, %44
br label %160
160: ; preds = %159, %24
br label %161
161: ; preds = %160, %16
br label %162
162: ; preds = %161, %2
%163 = load i32, i32* %5
ret i32 %163
}

LLVM IR (-O2):
%struct.instrument = type { i32 }
@.str = [5 x i8] c"help\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [3 x i8] c"on\00"
@.str.4 = [4 x i8] c"off\00"
@.str.6 = [6 x i8] c"query\00"
@.str.7 = [5 x i8] c"show\00"
@.str.8 = [5 x i8] c"list\00"
@.str.10 = [3 x i8] c"id\00"
@.str.11 = [8 x i8] c"verbose\00"
@.str.13 = [2 x i8] c"1\00"
@.str.14 = [2 x i8] c"0\00"
@str = [35 x i8] c"type \22help\22 for a list of commands\00"
@str.17 = [19 x i8] c"Usage: verbose 1|0\00"
@str.18 = [12 x i8] c"Usage: list\00"
@str.19 = [21 x i8] c"Usage: off [targets]\00"
@str.20 = [20 x i8] c"Usage: on [targets]\00"
define i32 @_docmd(%struct.instrument* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %99, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @_shell_help()
br label %99
10: ; preds = %5
%11 = load i8*, i8** %1
%12 = tail call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %99, label %14
14: ; preds = %10
%15 = load i8*, i8** %1
%16 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = getelementptr inbounds i8*, i8** %1, i64 1
%20 = load i8*, i8** %19
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.20, i64 0, i64 0))
br label %99
24: ; preds = %18
%25 = tail call i32 @_close_targets(%struct.instrument* %0, i8* %20)
br label %99
26: ; preds = %14
%27 = load i8*, i8** %1
%28 = tail call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %38
30: ; preds = %26
%31 = getelementptr inbounds i8*, i8** %1, i64 1
%32 = load i8*, i8** %31
%33 = icmp eq i8* %32, null
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.19, i64 0, i64 0))
br label %99
36: ; preds = %30
%37 = tail call i32 @_open_targets(%struct.instrument* %0, i8* %32)
br label %99
38: ; preds = %26
%39 = load i8*, i8** %1
%40 = tail call i64 @strcmp(i8* %39, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %46
42: ; preds = %38
%43 = getelementptr inbounds i8*, i8** %1, i64 1
%44 = load i8*, i8** %43
%45 = tail call i32 @_query_targets(%struct.instrument* %0, i8* %44)
br label %99
46: ; preds = %38
%47 = load i8*, i8** %1
%48 = tail call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = tail call i32 (...) @_show_config()
br label %99
52: ; preds = %46
%53 = load i8*, i8** %1
%54 = tail call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %64
56: ; preds = %52
%57 = getelementptr inbounds i8*, i8** %1, i64 1
%58 = load i8*, i8** %57
%59 = icmp eq i8* %58, null
br i1 %59, label %62, label %60
60: ; preds = %56
%61 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.18, i64 0, i64 0))
br label %99
62: ; preds = %56
%63 = tail call i32 (...) @_list_targets()
br label %99
64: ; preds = %52
%65 = load i8*, i8** %1
%66 = tail call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = tail call i32 @_get_idn(%struct.instrument* %0)
br label %99
70: ; preds = %64
%71 = load i8*, i8** %1
%72 = tail call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %97
74: ; preds = %70
%75 = getelementptr inbounds i8*, i8** %1, i64 1
%76 = load i8*, i8** %75
%77 = icmp eq i8* %76, null
br i1 %77, label %82, label %78
78: ; preds = %74
%79 = getelementptr inbounds i8*, i8** %1, i64 2
%80 = load i8*, i8** %79
%81 = icmp eq i8* %80, null
br i1 %81, label %84, label %82
82: ; preds = %78, %74
%83 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.17, i64 0, i64 0))
br label %99
84: ; preds = %78
%85 = tail call i64 @strcmp(i8* %76, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %84
%88 = tail call i32 @inst_set_verbose(%struct.instrument* %0, i32 1)
br label %99
89: ; preds = %84
%90 = load i8*, i8** %75
%91 = tail call i64 @strcmp(i8* %90, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %89
%94 = tail call i32 @inst_set_verbose(%struct.instrument* %0, i32 0)
br label %99
95: ; preds = %89
%96 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.17, i64 0, i64 0))
br label %99
97: ; preds = %70
%98 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %99
99: ; preds = %10, %8, %24, %22, %42, %62, %60, %97, %87, %95, %93, %82, %68, %50, %34, %36, %2
%100 = phi i32 [ 0, %8 ], [ 0, %22 ], [ 0, %24 ], [ 0, %34 ], [ 0, %36 ], [ 0, %42 ], [ 0, %50 ], [ 0, %60 ], [ 0, %62 ], [ 0, %68 ], [ 0, %82 ], [ 0, %95 ], [ 0, %93 ], [ 0, %87 ], [ 0, %97 ], [ 0, %2 ], [ 1, %10 ]
ret i32 %100
}