#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*/ O_RDONLY;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ lkboot_get_reply(void **);
int lkboot_txn(char const *, char const *, int, char const *);
int open(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ printsysparam(void *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char const *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  const char *host = argv[1];
  const char *cmd = argv[2];
  const char *args = argv[3];
  const char *fn = NULL;
  int fd = -1;
  if (argc == 3) {
    if (!strcmp(cmd, "reboot")) {
      return lkboot_txn(host, cmd, fd, "");
    } else if (cmd[0] == ':') {
      return lkboot_txn(host, cmd + 1, fd, "");
    } else {
      usage();
    }
  }
  if (argc < 4)
    usage();
  if (!strcmp(cmd, "flash")) {
    if (argc < 5)
      usage();
    fn = argv[4];
  } else if (!strcmp(cmd, "fpga")) {
    fn = args;
    args = "";
  } else if (!strcmp(cmd, "boot")) {
    fn = args;
    args = "";
  } else if (!strcmp(cmd, "erase")) {
  } else if (!strcmp(cmd, "remove")) {
  } else if (!strcmp(cmd, "getsysparam")) {
    if (lkboot_txn(host, cmd, -1, args) == 0) {
      void *rbuf = NULL;
      printsysparam(rbuf, lkboot_get_reply(&rbuf));
      return 0;
    } else {
      return -1;
    }
  } else if (cmd[0] == ':') {
    return lkboot_txn(host, cmd + 1, -1, args);
  } else {
    usage();
  }
  if (fn) {
    if ((fd = open(fn, O_RDONLY)) < 0) {
      fprintf(stderr, "error; cannot open '%s'\n", fn);
      return -1;
    }
  }
  return lkboot_txn(host, cmd, fd, args);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movl   $0xffffffff,-0x34(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    123f <main+0xcf>
mov    -0x20(%rbp),%rdi
lea    0xe32(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11fb <main+0x8b>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x34(%rbp),%edx
lea    0xe55(%rip),%rcx
call   1080 <lkboot_txn@plt>
mov    %eax,-0x4(%rbp)
jmp    145e <main+0x2ee>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    122e <main+0xbe>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    -0x34(%rbp),%edx
lea    0xe22(%rip),%rcx
call   1080 <lkboot_txn@plt>
mov    %eax,-0x4(%rbp)
jmp    145e <main+0x2ee>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    123a <main+0xca>
jmp    123f <main+0xcf>
cmpl   $0x4,-0x8(%rbp)
jge    1250 <main+0xe0>
mov    $0x0,%al
call   1050 <usage@plt>
mov    -0x20(%rbp),%rdi
lea    0xdac(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    128b <main+0x11b>
cmpl   $0x5,-0x8(%rbp)
jge    127a <main+0x10a>
mov    $0x0,%al
call   1050 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    13f4 <main+0x284>
mov    -0x20(%rbp),%rdi
lea    0xd77(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    12bc <main+0x14c>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0xd90(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    13ef <main+0x27f>
mov    -0x20(%rbp),%rdi
lea    0xd3b(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    12ed <main+0x17d>
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0xd5f(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    13ea <main+0x27a>
mov    -0x20(%rbp),%rdi
lea    0xd1a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    130b <main+0x19b>
jmp    13e5 <main+0x275>
mov    -0x20(%rbp),%rdi
lea    0xd02(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1329 <main+0x1b9>
jmp    13e0 <main+0x270>
mov    -0x20(%rbp),%rdi
lea    0xceb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    139d <main+0x22d>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    $0xffffffff,%edx
call   1080 <lkboot_txn@plt>
cmp    $0x0,%eax
jne    1391 <main+0x221>
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
call   1060 <lkboot_get_reply@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%esi
call   1090 <printsysparam@plt>
movl   $0x0,-0x4(%rbp)
jmp    145e <main+0x2ee>
movl   $0xffffffff,-0x4(%rbp)
jmp    145e <main+0x2ee>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    13cf <main+0x25f>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    -0x28(%rbp),%rcx
mov    $0xffffffff,%edx
call   1080 <lkboot_txn@plt>
mov    %eax,-0x4(%rbp)
jmp    145e <main+0x2ee>
mov    $0x0,%al
call   1050 <usage@plt>
jmp    13db <main+0x26b>
jmp    13e0 <main+0x270>
jmp    13e5 <main+0x275>
jmp    13ea <main+0x27a>
jmp    13ef <main+0x27f>
jmp    13f4 <main+0x284>
cmpq   $0x0,-0x30(%rbp)
je     1447 <main+0x2d7>
mov    -0x30(%rbp),%rdi
mov    0x2bde(%rip),%rax
mov    (%rax),%esi
call   1070 <open@plt>
mov    %eax,-0x34(%rbp)
cmp    $0x0,%eax
jge    1442 <main+0x2d2>
mov    0x2bb4(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
lea    0xbfa(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    145e <main+0x2ee>
jmp    1447 <main+0x2d7>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x34(%rbp),%edx
mov    -0x28(%rbp),%rcx
call   1080 <lkboot_txn@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%r14
mov    0x10(%rsi),%r12
mov    0x18(%rsi),%r15
cmp    $0x3,%edi
jne    11c6 <main+0x56>
lea    0xe68(%rip),%rsi
mov    %r12,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     11af <main+0x3f>
cmpb   $0x3a,(%r12)
jne    11ca <main+0x5a>
add    $0x1,%r12
lea    0xe8d(%rip),%rcx
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0xffffffff,%edx
jmp    133e <main+0x1ce>
jle    11d1 <main+0x61>
jmp    11d8 <main+0x68>
xor    %eax,%eax
call   1050 <usage@plt>
xor    %eax,%eax
call   1050 <usage@plt>
lea    0xe28(%rip),%rsi
mov    %r12,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     128c <main+0x11c>
lea    0xe17(%rip),%rsi
mov    %r12,%rdi
call   1030 <strcmp@plt>
lea    0xe3e(%rip),%r13
test   %eax,%eax
je     129f <main+0x12f>
lea    0xdee(%rip),%rsi
mov    %r12,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     129f <main+0x12f>
lea    0xdeb(%rip),%rsi
mov    %r12,%rdi
call   1030 <strcmp@plt>
mov    $0xffffffff,%ebx
test   %eax,%eax
je     1330 <main+0x1c0>
lea    0xdd5(%rip),%rsi
mov    %r12,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1330 <main+0x1c0>
lea    0xdc5(%rip),%rsi
mov    %r12,%rdi
call   1030 <strcmp@plt>
test   %eax,%eax
je     12f0 <main+0x180>
cmpb   $0x3a,(%r12)
jne    1329 <main+0x1b9>
add    $0x1,%r12
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0xffffffff,%edx
mov    %r15,%rcx
jmp    133e <main+0x1ce>
cmp    $0x4,%ebp
jg     1298 <main+0x128>
xor    %eax,%eax
call   1050 <usage@plt>
mov    %r15,%r13
mov    0x20(%rbx),%r15
test   %r15,%r15
je     12e9 <main+0x179>
mov    0x2d3d(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   1070 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1333 <main+0x1c3>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
lea    0xd60(%rip),%rsi
mov    %r15,%rdx
call   1040 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffff,%ebx
jmp    1333 <main+0x1c3>
mov    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0xffffffff,%edx
mov    %r15,%rcx
call   1080 <lkboot_txn@plt>
test   %eax,%eax
jne    12d8 <main+0x168>
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1060 <lkboot_get_reply@plt>
xor    %ebx,%ebx
xor    %edi,%edi
mov    %eax,%esi
call   1090 <printsysparam@plt>
jmp    12d8 <main+0x168>
xor    %eax,%eax
call   1050 <usage@plt>
mov    %r15,%r13
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
mov    %r13,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1080 <lkboot_txn@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"reboot\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"flash\00"
@.str.3 = [5 x i8] c"fpga\00"
@.str.4 = [5 x i8] c"boot\00"
@.str.5 = [6 x i8] c"erase\00"
@.str.6 = [7 x i8] c"remove\00"
@.str.7 = [12 x i8] c"getsysparam\00"
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str.8 = [25 x i8] c"error; cannot open '%s'\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8*, i8** %1, i64 3
%9 = load i8*, i8** %8
%10 = icmp eq i32 %0, 3
br i1 %10, label %11, label %24
11: ; preds = %2
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @lkboot_txn(i8* %5, i8* %7, i32 -1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %83
16: ; preds = %11
%17 = load i8, i8* %7
%18 = icmp eq i8 %17, 58
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = getelementptr inbounds i8, i8* %7, i64 1
%21 = tail call i32 @lkboot_txn(i8* %5, i8* %20, i32 -1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %83
22: ; preds = %16
%23 = tail call i32 (...) @usage()
br label %26
24: ; preds = %2
%25 = icmp slt i32 %0, 4
br i1 %25, label %26, label %28
26: ; preds = %22, %24
%27 = tail call i32 (...) @usage()
br label %28
28: ; preds = %26, %24
%29 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %38
31: ; preds = %28
%32 = icmp slt i32 %0, 5
br i1 %32, label %33, label %35
33: ; preds = %31
%34 = tail call i32 (...) @usage()
br label %35
35: ; preds = %33, %31
%36 = getelementptr inbounds i8*, i8** %1, i64 4
%37 = load i8*, i8** %36
br label %68
38: ; preds = %28
%39 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %68, label %41
41: ; preds = %38
%42 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %68, label %44
44: ; preds = %41
%45 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %79, label %47
47: ; preds = %44
%48 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
br i1 %49, label %79, label %50
50: ; preds = %47
%51 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %60
53: ; preds = %50
%54 = tail call i32 @lkboot_txn(i8* %5, i8* %7, i32 -1, i8* %9)
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %83
56: ; preds = %53
%57 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%58 = call i32 @lkboot_get_reply(i8** %3)
%59 = call i32 @printsysparam(i8* null, i32 %58)
br label %83
60: ; preds = %50
%61 = load i8, i8* %7
%62 = icmp eq i8 %61, 58
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = getelementptr inbounds i8, i8* %7, i64 1
%65 = tail call i32 @lkboot_txn(i8* %5, i8* %64, i32 -1, i8* %9)
br label %83
66: ; preds = %60
%67 = tail call i32 (...) @usage()
br label %79
68: ; preds = %41, %38, %35
%69 = phi i8* [ %9, %35 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %38 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %41 ]
%70 = phi i8* [ %37, %35 ], [ %9, %38 ], [ %9, %41 ]
%71 = icmp eq i8* %70, null
br i1 %71, label %79, label %72
72: ; preds = %68
%73 = load i32, i32* @O_RDONLY
%74 = tail call i32 @open(i8* %70, i32 %73)
%75 = icmp slt i32 %74, 0
br i1 %75, label %76, label %79
76: ; preds = %72
%77 = load i32, i32* @stderr
%78 = tail call i32 @fprintf(i32 %77, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* %70)
br label %83
79: ; preds = %44, %47, %66, %72, %68
%80 = phi i8* [ %69, %72 ], [ %69, %68 ], [ %9, %66 ], [ %9, %47 ], [ %9, %44 ]
%81 = phi i32 [ %74, %72 ], [ -1, %68 ], [ -1, %66 ], [ -1, %47 ], [ -1, %44 ]
%82 = tail call i32 @lkboot_txn(i8* %5, i8* %7, i32 %81, i8* %80)
br label %83
83: ; preds = %53, %79, %76, %63, %56, %19, %14
%84 = phi i32 [ %21, %19 ], [ %65, %63 ], [ -1, %76 ], [ %82, %79 ], [ 0, %56 ], [ %15, %14 ], [ -1, %53 ]
ret i32 %84
}