#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*/ Usage();
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ exit(int);
scalar_t__ gpio_direction_input(unsigned int);
scalar_t__ gpio_direction_output(unsigned int, int /*<<< orphan*/);
int /*<<< orphan*/ gpio_free(unsigned int);
int gpio_get_value(unsigned int);
scalar_t__ gpio_init();
int gpio_is_requested(int, char *);
scalar_t__ gpio_request(unsigned int, char *);
int /*<<< orphan*/ gpio_set_value(unsigned int, int /*<<< orphan*/);
int /*<<< orphan*/ gpio_term();
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ strcmp(char *, char *);
scalar_t__ strtoul(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  char *cmdStr;
  unsigned int gpio;
  if (gpio_init() < 0) {
    perror("gpio_init failed");
    exit(1);
  }
  if ((argc > 4) || (argc < 3)) {
    Usage();
    exit(1);
  }
  cmdStr = argv[1];
  gpio = (unsigned int)strtoul(argv[2], NULL, 0);
  if (argc == 4) {
    char *argStr = argv[3];
    if (strcmp(cmdStr, "request") == 0) {
      if (gpio_request(gpio, argStr) < 0) {
        perror("Request failed");
        exit(1);
      }
    } else if (strcmp(cmdStr, "output") == 0) {
      if (gpio_direction_output(gpio, atoi(argStr)) < 0) {
        perror("gpio_direction_output failed");
        exit(1);
      }
    } else if (strcmp(cmdStr, "set") == 0) {
      gpio_set_value(gpio, atoi(argStr));
    } else {
      Usage();
      exit(1);
    }
  } else if (argc == 3) {
    if (strcmp(cmdStr, "free") == 0) {
      gpio_free(gpio);
    } else if (strcmp(cmdStr, "input") == 0) {
      if (gpio_direction_input(gpio) < 0) {
        perror("gpio_direction_input failed");
        exit(1);
      }
    } else if (strcmp(cmdStr, "get") == 0) {
      int rc = gpio_get_value(gpio);
      if (rc < 0) {
        perror("gpio_get_value failed");
        exit(1);
      }
      printf("%d\n", rc != 0);
    } else if (strcmp(cmdStr, "dump") == 0) {
      int rc = gpio_is_requested(1, "dump");
      if (rc < 0) {
        perror("gpio_is_requested failed");
        exit(1);
      }
      printf("%d\n", rc != 0);
    } else {
      Usage();
      exit(1);
    }
  }
  gpio_term();
  exit(0);
  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)
mov    $0x0,%al
call   1110 <gpio_init@plt>
cmp    $0x0,%rax
jge    123d <main+0x3d>
lea    0xdd2(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
cmpl   $0x4,-0x8(%rbp)
jg     1251 <main+0x51>
cmpl   $0x3,-0x8(%rbp)
jge    1262 <main+0x62>
mov    $0x0,%al
call   1090 <Usage@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   10e0 <strtoul@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    1395 <main+0x195>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xd6c(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    12e5 <main+0xe5>
mov    -0x1c(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1050 <gpio_request@plt>
cmp    $0x0,%rax
jge    12e0 <main+0xe0>
lea    0xd48(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    1390 <main+0x190>
mov    -0x18(%rbp),%rdi
lea    0xd38(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    133d <main+0x13d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rdi
call   10f0 <atoi@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%esi
call   1040 <gpio_direction_output@plt>
cmp    $0x0,%rax
jge    1338 <main+0x138>
lea    0xd06(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    138b <main+0x18b>
mov    -0x18(%rbp),%rdi
lea    0xd04(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    1375 <main+0x175>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
call   10f0 <atoi@plt>
mov    -0x38(%rbp),%edi
mov    %eax,%esi
call   10b0 <gpio_set_value@plt>
jmp    1386 <main+0x186>
mov    $0x0,%al
call   1090 <Usage@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    138b <main+0x18b>
jmp    1390 <main+0x190>
jmp    1504 <main+0x304>
cmpl   $0x3,-0x8(%rbp)
jne    14ff <main+0x2ff>
mov    -0x18(%rbp),%rdi
lea    0xca6(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    13c6 <main+0x1c6>
mov    -0x1c(%rbp),%edi
call   1030 <gpio_free@plt>
jmp    14fa <main+0x2fa>
mov    -0x18(%rbp),%rdi
lea    0xc84(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    140d <main+0x20d>
mov    -0x1c(%rbp),%edi
call   1120 <gpio_direction_input@plt>
cmp    $0x0,%rax
jge    1408 <main+0x208>
lea    0xc62(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    14f5 <main+0x2f5>
mov    -0x18(%rbp),%rdi
lea    0xc5f(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    146f <main+0x26f>
mov    -0x1c(%rbp),%edi
call   1070 <gpio_get_value@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    1452 <main+0x252>
lea    0xc38(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
cmpl   $0x0,-0x2c(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xc2c(%rip),%rdi
call   1060 <printf@plt>
jmp    14f0 <main+0x2f0>
mov    -0x18(%rbp),%rdi
lea    0xc1b(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
jne    14da <main+0x2da>
mov    $0x1,%edi
lea    0xc00(%rip),%rsi
call   10c0 <gpio_is_requested@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
jge    14bd <main+0x2bd>
lea    0xbec(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
cmpl   $0x0,-0x30(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xbc1(%rip),%rdi
call   1060 <printf@plt>
jmp    14eb <main+0x2eb>
mov    $0x0,%al
call   1090 <Usage@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
jmp    14f0 <main+0x2f0>
jmp    14f5 <main+0x2f5>
jmp    14fa <main+0x2fa>
jmp    14ff <main+0x2ff>
jmp    1504 <main+0x304>
mov    $0x0,%al
call   1080 <gpio_term@plt>
xor    %edi,%edi
call   1100 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%ebx
xor    %eax,%eax
call   1110 <gpio_init@plt>
test   %rax,%rax
jns    122f <main+0x2f>
lea    0xde0(%rip),%rdi
call   10d0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
lea    -0x5(%rbx),%eax
cmp    $0xfffffffd,%eax
ja     1248 <main+0x48>
xor    %eax,%eax
call   1090 <Usage@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    0x8(%r15),%r12
mov    0x10(%r15),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10e0 <strtoul@plt>
mov    %rax,%r14
cmp    $0x4,%ebx
jne    1296 <main+0x96>
mov    0x18(%r15),%r15
lea    0xda5(%rip),%rsi
mov    %r12,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    12b7 <main+0xb7>
mov    %r14d,%edi
mov    %r15,%rsi
call   1050 <gpio_request@plt>
test   %rax,%rax
jns    13c6 <main+0x1c6>
lea    0xd85(%rip),%rdi
jmp    1220 <main+0x20>
lea    0xdb3(%rip),%rsi
mov    %r12,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    12f2 <main+0xf2>
mov    %r14d,%edi
call   1030 <gpio_free@plt>
jmp    13c6 <main+0x1c6>
lea    0xd6a(%rip),%rsi
mov    %r12,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    1323 <main+0x123>
mov    %r15,%rdi
call   10f0 <atoi@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   1040 <gpio_direction_output@plt>
test   %rax,%rax
jns    13c6 <main+0x1c6>
lea    0xd42(%rip),%rdi
jmp    1220 <main+0x20>
lea    0xd5c(%rip),%rsi
mov    %r12,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    134f <main+0x14f>
mov    %r14d,%edi
call   1120 <gpio_direction_input@plt>
test   %rax,%rax
jns    13c6 <main+0x1c6>
lea    0xd3d(%rip),%rdi
jmp    1220 <main+0x20>
lea    0xd22(%rip),%rsi
mov    %r12,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    1237 <main+0x37>
mov    %r15,%rdi
call   10f0 <atoi@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   10b0 <gpio_set_value@plt>
jmp    13c6 <main+0x1c6>
lea    0xd21(%rip),%rsi
mov    %r12,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    137b <main+0x17b>
mov    %r14d,%edi
call   1070 <gpio_get_value@plt>
test   %eax,%eax
jns    13b4 <main+0x1b4>
lea    0xd05(%rip),%rdi
jmp    1220 <main+0x20>
lea    0xd13(%rip),%rsi
mov    %r12,%rdi
call   10a0 <strcmp@plt>
test   %rax,%rax
jne    1237 <main+0x37>
lea    0xcfb(%rip),%rsi
mov    $0x1,%edi
call   10c0 <gpio_is_requested@plt>
test   %eax,%eax
jns    13b4 <main+0x1b4>
lea    0xceb(%rip),%rdi
jmp    1220 <main+0x20>
setne  %al
movzbl %al,%esi
lea    0xcd0(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
call   1080 <gpio_term@plt>
xor    %edi,%edi
call   1100 <exit@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"gpio_init failed\00"
@.str.1 = [8 x i8] c"request\00"
@.str.2 = [15 x i8] c"Request failed\00"
@.str.3 = [7 x i8] c"output\00"
@.str.4 = [29 x i8] c"gpio_direction_output failed\00"
@.str.5 = [4 x i8] c"set\00"
@.str.6 = [5 x i8] c"free\00"
@.str.7 = [6 x i8] c"input\00"
@.str.8 = [28 x i8] c"gpio_direction_input failed\00"
@.str.9 = [4 x i8] c"get\00"
@.str.10 = [22 x i8] c"gpio_get_value failed\00"
@.str.11 = [4 x i8] c"%d\0A\00"
@.str.12 = [5 x i8] c"dump\00"
@.str.13 = [25 x i8] c"gpio_is_requested failed\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 (...) @gpio_init()
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = add i32 %0, -5
%10 = icmp ult i32 %9, -2
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = tail call i32 (...) @Usage()
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %8
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8*, i8** %1, i64 2
%18 = load i8*, i8** %17
%19 = tail call i64 @strtoul(i8* nocapture %18, i32* null, i32 0)
%20 = trunc i64 %19 to i32
%21 = icmp eq i32 %0, 4
br i1 %21, label %22, label %52
22: ; preds = %14
%23 = getelementptr inbounds i8*, i8** %1, i64 3
%24 = load i8*, i8** %23
%25 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %33
27: ; preds = %22
%28 = tail call i64 @gpio_request(i32 %20, i8* %24)
%29 = icmp slt i64 %28, 0
br i1 %29, label %30, label %95
30: ; preds = %27
%31 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%32 = tail call i32 @exit(i32 1)
unreachable
33: ; preds = %22
%34 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %43
36: ; preds = %33
%37 = tail call i32 @atoi(i8* %24)
%38 = tail call i64 @gpio_direction_output(i32 %20, i32 %37)
%39 = icmp slt i64 %38, 0
br i1 %39, label %40, label %95
40: ; preds = %36
%41 = tail call i32 @perror(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%42 = tail call i32 @exit(i32 1)
unreachable
43: ; preds = %33
%44 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = tail call i32 @atoi(i8* %24)
%48 = tail call i32 @gpio_set_value(i32 %20, i32 %47)
br label %95
49: ; preds = %43
%50 = tail call i32 (...) @Usage()
%51 = tail call i32 @exit(i32 1)
unreachable
52: ; preds = %14
%53 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = tail call i32 @gpio_free(i32 %20)
br label %95
57: ; preds = %52
%58 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %66
60: ; preds = %57
%61 = tail call i64 @gpio_direction_input(i32 %20)
%62 = icmp slt i64 %61, 0
br i1 %62, label %63, label %95
63: ; preds = %60
%64 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0))
%65 = tail call i32 @exit(i32 1)
unreachable
66: ; preds = %57
%67 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %79
69: ; preds = %66
%70 = tail call i32 @gpio_get_value(i32 %20)
%71 = icmp slt i32 %70, 0
br i1 %71, label %72, label %75
72: ; preds = %69
%73 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
%74 = tail call i32 @exit(i32 1)
unreachable
75: ; preds = %69
%76 = icmp ne i32 %70, 0
%77 = zext i1 %76 to i32
%78 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 %77)
br label %95
79: ; preds = %66
%80 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %92
82: ; preds = %79
%83 = tail call i32 @gpio_is_requested(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%84 = icmp slt i32 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %82
%86 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
%87 = tail call i32 @exit(i32 1)
unreachable
88: ; preds = %82
%89 = icmp ne i32 %83, 0
%90 = zext i1 %89 to i32
%91 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 %90)
br label %95
92: ; preds = %79
%93 = tail call i32 (...) @Usage()
%94 = tail call i32 @exit(i32 1)
unreachable
95: ; preds = %27, %36, %46, %60, %88, %75, %55
%96 = tail call i32 (...) @gpio_term()
%97 = tail call i32 @exit(i32 0)
unreachable
}