#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 */
typedef int /*<<< orphan*/ Display;
typedef int Bool;

/* Variables and functions */
int True;
char *XDisplayName(int /*<<< orphan*/ *);
int XNVCTRLQueryVersion(int /*<<< orphan*/ *, int *, int *);
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ do_configure(int /*<<< orphan*/ *, int, char *);
int /*<<< orphan*/ do_help();
int /*<<< orphan*/ do_listconfig(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ do_query(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  Display *dpy;
  Bool ret;
  int major, minor;
  int use_gvi = -1;
  int i;
  char *topology_str = NULL;
  dpy = XOpenDisplay(NULL);
  if (!dpy) {
    printf("Cannot open display '%s'.\n", XDisplayName(NULL));
    return 1;
  }
  ret = XNVCTRLQueryVersion(dpy, &major, &minor);
  if (ret != True) {
    printf("The NV-CONTROL X extension does not exist on '%s'.\n",
           XDisplayName(NULL));
    return 1;
  }
  printf("Using NV-CONTROL extension %d.%d on %s\n\n", major, minor,
         XDisplayName(NULL));
  for (i = 0; i < argc; i++) {
    if ((strcmp(argv[i], "-g") == 0) && ((i + 1) < argc)) {
      use_gvi = strtol(argv[i + 1], NULL, 10);
    }
    if ((strcmp(argv[i], "-c") == 0) && ((i + 1) < argc)) {
      topology_str = argv[i + 1];
    }
  }
  ret = 0;
  for (i = 0; i < argc; i++) {
    if (strcmp(argv[i], "-q") == 0) {
      do_query(dpy, use_gvi);
      ret = 1;
      break;
    } else if (strcmp(argv[i], "-c") == 0) {
      do_configure(dpy, use_gvi, topology_str);
      ret = 1;
      break;
    } else if (strcmp(argv[i], "-l") == 0) {
      do_listconfig(dpy, use_gvi);
      ret = 1;
    }
  }
  if (!ret) {
    do_help();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x28(%rbp)
movq   $0x0,-0x38(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <XOpenDisplay@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1203 <main+0x63>
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <XDisplayName@plt>
mov    %rax,%rsi
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1436 <main+0x296>
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   1080 <XNVCTRLQueryVersion@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2dc7(%rip),%rcx
cmp    (%rcx),%eax
je     124f <main+0xaf>
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <XDisplayName@plt>
mov    %rax,%rsi
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1436 <main+0x296>
mov    -0x20(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x3c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <XDisplayName@plt>
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    %rax,%rcx
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    133a <main+0x19a>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdd7(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12e1 <main+0x141>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    12e1 <main+0x141>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1090 <strtol@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd87(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1327 <main+0x187>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    1327 <main+0x187>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
jmp    132c <main+0x18c>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1282 <main+0xe2>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    141e <main+0x27e>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd17(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    138e <main+0x1ee>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%esi
call   1030 <do_query@plt>
movl   $0x1,-0x1c(%rbp)
jmp    141e <main+0x27e>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcda(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    13cc <main+0x22c>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%esi
mov    -0x38(%rbp),%rdx
call   10c0 <do_configure@plt>
movl   $0x1,-0x1c(%rbp)
jmp    141e <main+0x27e>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xca2(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1401 <main+0x261>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%esi
call   1050 <do_listconfig@plt>
movl   $0x1,-0x1c(%rbp)
jmp    1406 <main+0x266>
jmp    140b <main+0x26b>
jmp    1410 <main+0x270>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1348 <main+0x1a8>
cmpl   $0x0,-0x1c(%rbp)
jne    142f <main+0x28f>
mov    $0x0,%al
call   10b0 <do_help@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%r14d
xor    %edi,%edi
call   1070 <XOpenDisplay@plt>
test   %rax,%rax
je     12c2 <main+0x122>
mov    %rax,%rbp
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
mov    %rax,%rdi
call   1080 <XNVCTRLQueryVersion@plt>
mov    0x2e08(%rip),%rcx
cmp    (%rcx),%eax
jne    12d2 <main+0x132>
mov    %rbp,0x8(%rsp)
mov    0x1c(%rsp),%ebp
mov    0x18(%rsp),%r15d
xor    %edi,%edi
call   10a0 <XDisplayName@plt>
lea    0xe4b(%rip),%rdi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %rax,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    136d <main+0x1cd>
mov    %r14d,0x14(%rsp)
mov    %r14d,%r14d
mov    %r14,%r13
neg    %r13
movl   $0xffffffff,0x4(%rsp)
ff
mov    $0x1,%r15d
xor    %eax,%eax
mov    %rax,0x20(%rsp)
lea    0xe32(%rip),%rbp
lea    0xe2e(%rip),%r12
jmp    1266 <main+0xc6>
nop
lea    (%r15,%r13,1),%rax
add    $0x1,%rax
add    $0x1,%r15
cmp    $0x1,%rax
je     12f4 <main+0x154>
mov    -0x8(%rbx,%r15,8),%rdi
mov    %rbp,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    12a0 <main+0x100>
cmp    %r14,%r15
jae    12a0 <main+0x100>
mov    (%rbx,%r15,8),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1090 <strtol@plt>
mov    %eax,0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x8(%rbx,%r15,8),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1250 <main+0xb0>
cmp    %r14,%r15
jae    1250 <main+0xb0>
mov    (%rbx,%r15,8),%rax
mov    %rax,0x20(%rsp)
jmp    1250 <main+0xb0>
xor    %edi,%edi
call   10a0 <XDisplayName@plt>
lea    0xd30(%rip),%rdi
jmp    12e0 <main+0x140>
xor    %edi,%edi
call   10a0 <XDisplayName@plt>
lea    0xd3b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
jmp    1376 <main+0x1d6>
cmpl   $0x0,0x14(%rsp)
jle    136d <main+0x1cd>
xor    %ebp,%ebp
lea    0xd7a(%rip),%r15
lea    0xd70(%rip),%r12
xor    %r13d,%r13d
jmp    1319 <main+0x179>
add    $0x1,%rbp
cmp    %rbp,%r14
je     1366 <main+0x1c6>
mov    (%rbx,%rbp,8),%rdi
mov    %r15,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1385 <main+0x1e5>
mov    (%rbx,%rbp,8),%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1395 <main+0x1f5>
mov    (%rbx,%rbp,8),%rdi
lea    0xd3b(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1310 <main+0x170>
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%esi
call   1050 <do_listconfig@plt>
mov    $0x1,%r13d
jmp    1310 <main+0x170>
xor    %eax,%eax
test   %r13d,%r13d
jne    1376 <main+0x1d6>
xor    %eax,%eax
call   10b0 <do_help@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%esi
call   1030 <do_query@plt>
jmp    1374 <main+0x1d4>
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%esi
mov    0x20(%rsp),%rdx
call   10c0 <do_configure@plt>
jmp    1374 <main+0x1d4>

LLVM IR (-O0):
@.str = [27 x i8] c"Cannot open display '%s'.\0A\00"
@True = global i32 0
@.str.1 = [52 x i8] c"The NV-CONTROL X extension does not exist on '%s'.\0A\00"
@.str.2 = [41 x i8] c"Using NV-CONTROL extension %d.%d on %s\0A\0A\00"
@.str.3 = [3 x i8] c"-g\00"
@.str.4 = [3 x i8] c"-c\00"
@.str.5 = [3 x i8] c"-q\00"
@.str.6 = [3 x i8] c"-l\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %10
store i8* null, i8** %12
%13 = call i32* @XOpenDisplay(i32* null)
store i32* %13, i32** %6
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %19, label %16
16: ; preds = %2
%17 = call i8* @XDisplayName(i32* null)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %17)
store i32 1, i32* %3
br label %136
19: ; preds = %2
%20 = load i32*, i32** %6
%21 = call i32 @XNVCTRLQueryVersion(i32* %20, i32* %8, i32* %9)
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* @True
%24 = icmp ne i32 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = call i8* @XDisplayName(i32* null)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %26)
store i32 1, i32* %3
br label %136
28: ; preds = %19
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = call i8* @XDisplayName(i32* null)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %29, i32 %30, i8* %31)
store i32 0, i32* %11
br label %33
33: ; preds = %79, %28
%34 = load i32, i32* %11
%35 = load i32, i32* %4
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %82
37: ; preds = %33
%38 = load i8**, i8*** %5
%39 = load i32, i32* %11
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8*, i8** %38, i64 %40
%42 = load i8*, i8** %41
%43 = call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %58
45: ; preds = %37
%46 = load i32, i32* %11
%47 = add nsw i32 %46, 1
%48 = load i32, i32* %4
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %58
50: ; preds = %45
%51 = load i8**, i8*** %5
%52 = load i32, i32* %11
%53 = add nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8*, i8** %51, i64 %54
%56 = load i8*, i8** %55
%57 = call i32 @strtol(i8* %56, i32* null, i32 10)
store i32 %57, i32* %10
br label %58
58: ; preds = %50, %45, %37
%59 = load i8**, i8*** %5
%60 = load i32, i32* %11
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8*, i8** %59, i64 %61
%63 = load i8*, i8** %62
%64 = call i64 @strcmp(i8* %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %78
66: ; preds = %58
%67 = load i32, i32* %11
%68 = add nsw i32 %67, 1
%69 = load i32, i32* %4
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %78
71: ; preds = %66
%72 = load i8**, i8*** %5
%73 = load i32, i32* %11
%74 = add nsw i32 %73, 1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %72, i64 %75
%77 = load i8*, i8** %76
store i8* %77, i8** %12
br label %78
78: ; preds = %71, %66, %58
br label %79
79: ; preds = %78
%80 = load i32, i32* %11
%81 = add nsw i32 %80, 1
store i32 %81, i32* %11
br label %33
82: ; preds = %33
store i32 0, i32* %7
store i32 0, i32* %11
br label %83
83: ; preds = %127, %82
%84 = load i32, i32* %11
%85 = load i32, i32* %4
%86 = icmp slt i32 %84, %85
br i1 %86, label %87, label %130
87: ; preds = %83
%88 = load i8**, i8*** %5
%89 = load i32, i32* %11
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8*, i8** %88, i64 %90
%92 = load i8*, i8** %91
%93 = call i64 @strcmp(i8* %92, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%94 = icmp eq i64 %93, 0
br i1 %94, label %95, label %99
95: ; preds = %87
%96 = load i32*, i32** %6
%97 = load i32, i32* %10
%98 = call i32 @do_query(i32* %96, i32 %97)
store i32 1, i32* %7
br label %130
99: ; preds = %87
%100 = load i8**, i8*** %5
%101 = load i32, i32* %11
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8*, i8** %100, i64 %102
%104 = load i8*, i8** %103
%105 = call i64 @strcmp(i8* %104, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%106 = icmp eq i64 %105, 0
br i1 %106, label %107, label %112
107: ; preds = %99
%108 = load i32*, i32** %6
%109 = load i32, i32* %10
%110 = load i8*, i8** %12
%111 = call i32 @do_configure(i32* %108, i32 %109, i8* %110)
store i32 1, i32* %7
br label %130
112: ; preds = %99
%113 = load i8**, i8*** %5
%114 = load i32, i32* %11
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8*, i8** %113, i64 %115
%117 = load i8*, i8** %116
%118 = call i64 @strcmp(i8* %117, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%119 = icmp eq i64 %118, 0
br i1 %119, label %120, label %124
120: ; preds = %112
%121 = load i32*, i32** %6
%122 = load i32, i32* %10
%123 = call i32 @do_listconfig(i32* %121, i32 %122)
store i32 1, i32* %7
br label %124
124: ; preds = %120, %112
br label %125
125: ; preds = %124
br label %126
126: ; preds = %125
br label %127
127: ; preds = %126
%128 = load i32, i32* %11
%129 = add nsw i32 %128, 1
store i32 %129, i32* %11
br label %83
130: ; preds = %107, %95, %83
%131 = load i32, i32* %7
%132 = icmp ne i32 %131, 0
br i1 %132, label %135, label %133
133: ; preds = %130
%134 = call i32 (...) @do_help()
br label %135
135: ; preds = %133, %130
store i32 0, i32* %3
br label %136
136: ; preds = %135, %25, %16
%137 = load i32, i32* %3
ret i32 %137
}

LLVM IR (-O2):
@.str = [27 x i8] c"Cannot open display '%s'.\0A\00"
@True = global i32 0
@.str.1 = [52 x i8] c"The NV-CONTROL X extension does not exist on '%s'.\0A\00"
@.str.2 = [41 x i8] c"Using NV-CONTROL extension %d.%d on %s\0A\0A\00"
@.str.3 = [3 x i8] c"-g\00"
@.str.4 = [3 x i8] c"-c\00"
@.str.5 = [3 x i8] c"-q\00"
@.str.6 = [3 x i8] c"-l\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32* @XOpenDisplay(i32* null)
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = tail call i8* @XDisplayName(i32* null)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %89
12: ; preds = %2
%13 = call i32 @XNVCTRLQueryVersion(i32* %7, i32* %3, i32* %4)
%14 = load i32, i32* @True
%15 = icmp eq i32 %13, %14
br i1 %15, label %19, label %16
16: ; preds = %12
%17 = call i8* @XDisplayName(i32* null)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %89
19: ; preds = %12
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = call i8* @XDisplayName(i32* null)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 %21, i8* %22)
%24 = icmp sgt i32 %0, 0
br i1 %24, label %25, label %87
25: ; preds = %19
%26 = zext i32 %0 to i64
%27 = zext i32 %0 to i64
br label %31
28: ; preds = %57
br i1 %24, label %29, label %87
29: ; preds = %28
%30 = zext i32 %0 to i64
br label %60
31: ; preds = %25, %57
%32 = phi i64 [ 0, %25 ], [ %51, %57 ]
%33 = phi i8* [ null, %25 ], [ %58, %57 ]
%34 = phi i32 [ -1, %25 ], [ %47, %57 ]
%35 = getelementptr inbounds i8*, i8** %1, i64 %32
%36 = load i8*, i8** %35
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %46
39: ; preds = %31
%40 = add nuw nsw i64 %32, 1
%41 = icmp ult i64 %40, %26
br i1 %41, label %42, label %46
42: ; preds = %39
%43 = getelementptr inbounds i8*, i8** %1, i64 %40
%44 = load i8*, i8** %43
%45 = call i32 @strtol(i8* nocapture %44, i32* null, i32 10)
br label %46
46: ; preds = %42, %39, %31
%47 = phi i32 [ %45, %42 ], [ %34, %39 ], [ %34, %31 ]
%48 = load i8*, i8** %35
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
%51 = add nuw nsw i64 %32, 1
%52 = icmp ult i64 %51, %26
%53 = select i1 %50, i1 %52, i1 false
br i1 %53, label %54, label %57
54: ; preds = %46
%55 = getelementptr inbounds i8*, i8** %1, i64 %51
%56 = load i8*, i8** %55
br label %57
57: ; preds = %46, %54
%58 = phi i8* [ %56, %54 ], [ %33, %46 ]
%59 = icmp eq i64 %51, %27
br i1 %59, label %28, label %31
60: ; preds = %29, %81
%61 = phi i64 [ 0, %29 ], [ %83, %81 ]
%62 = phi i32 [ 0, %29 ], [ %82, %81 ]
%63 = getelementptr inbounds i8*, i8** %1, i64 %61
%64 = load i8*, i8** %63
%65 = call i64 @strcmp(i8* %64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %60
%68 = call i32 @do_query(i32* %7, i32 %47)
br label %89
69: ; preds = %60
%70 = load i8*, i8** %63
%71 = call i64 @strcmp(i8* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = call i32 @do_configure(i32* %7, i32 %47, i8* %58)
br label %89
75: ; preds = %69
%76 = load i8*, i8** %63
%77 = call i64 @strcmp(i8* %76, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = call i32 @do_listconfig(i32* %7, i32 %47)
br label %81
81: ; preds = %75, %79
%82 = phi i32 [ 1, %79 ], [ %62, %75 ]
%83 = add nuw nsw i64 %61, 1
%84 = icmp eq i64 %83, %30
br i1 %84, label %85, label %60
85: ; preds = %81
%86 = icmp eq i32 %82, 0
br i1 %86, label %87, label %89
87: ; preds = %19, %28, %85
%88 = call i32 (...) @do_help()
br label %89
89: ; preds = %73, %67, %85, %87, %16, %9
%90 = phi i32 [ 1, %16 ], [ 1, %9 ], [ 0, %87 ], [ 0, %85 ], [ 0, %67 ], [ 0, %73 ]
ret i32 %90
}