#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ debug_dump_hw();
int /*<<< orphan*/ debug_dump_samples();
int /*<<< orphan*/ fatal(char *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ release_pwm(int);
int /*<<< orphan*/ set_all_pwm(float);
int /*<<< orphan*/ set_pin(int, float);
int sscanf(char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ update_pwm();
void go_go_go(void) {
  FILE *fp;
  if ((fp = fopen("/dev/pi-blaster", "r+")) == NULL)
    fatal("pi-blaster: Failed to open %s: %m\n", "/dev/pi-blaster");
  char *lineptr = NULL, nl;
  size_t linelen;
  for (;;) {
    int bad_input = 1;
    int n, servo;
    int charcnt = 0;
    int argcnt = 0;
    float value;
    char *charptr = NULL;
    if ((n = getline(&lineptr, &linelen, fp)) < 0)
      continue;
    ;
    charptr = lineptr;
    if (!strcmp(charptr, "debug_regs\n")) {
      debug_dump_hw();
      bad_input = 0;
    } else if (!strcmp(charptr, "debug_samples\n")) {
      debug_dump_samples();
      bad_input = 0;
    } else if (sscanf(charptr, "release %d%c", &servo, &nl) == 2 &&
               nl == '\n') {
      release_pwm(servo);
      bad_input = 0;
    } else if (sscanf(charptr, "*=%f%c", &value, &nl) == 2 && nl == '\n') {
      if (value < 0 || value > 1) {
        fprintf(stderr, "Invalid value %f\n", value);
      } else {
        set_all_pwm(value);
      }
      bad_input = 0;
    } else
      do {
        argcnt = sscanf(charptr, "%d=%f%c%n", &servo, &value, &nl, &charcnt);
        if (argcnt == 3) {
          if (servo < 0) {
            fprintf(stderr, "Invalid channel number %d\n", servo);
          } else if (value < 0 || value > 1) {
            fprintf(stderr, "Invalid value %f\n", value);
          } else {
            set_pin(servo, value);
          }
          if (nl == '\n') {
            update_pwm();
          } else {
            charptr += charcnt;
          }
        }
        bad_input = argcnt < 3;
      } while (nl != '\n' && argcnt == 3);
    if (bad_input) {
      fprintf(stderr, "Bad input: %s", lineptr);
    }
    if (lineptr) {
      free(lineptr);
      lineptr = NULL;
      charptr = NULL;
      linelen = 0;
    }
  }
}


x86 assembly (clang, -O0):
<go_go_go>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xe25(%rip),%rdi
lea    0xe2e(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    120c <go_go_go+0x3c>
lea    0xe17(%rip),%rdi
lea    0xdfd(%rip),%rsi
call   10f0 <fatal@plt>
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   10e0 <getline@plt>
mov    %eax,-0x28(%rbp)
cmp    $0x0,%eax
jge    1253 <go_go_go+0x83>
jmp    1214 <go_go_go+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xdd4(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
jne    1287 <go_go_go+0xb7>
mov    $0x0,%al
call   1080 <debug_dump_hw@plt>
movl   $0x0,-0x24(%rbp)
jmp    14b5 <go_go_go+0x2e5>
mov    -0x40(%rbp),%rdi
lea    0xdb4(%rip),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
jne    12b3 <go_go_go+0xe3>
mov    $0x0,%al
call   1050 <debug_dump_samples@plt>
movl   $0x0,-0x24(%rbp)
jmp    14b0 <go_go_go+0x2e0>
mov    -0x40(%rbp),%rdi
lea    0xd97(%rip),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0x11(%rbp),%rcx
mov    $0x0,%al
call   10c0 <sscanf@plt>
cmp    $0x2,%eax
jne    12f7 <go_go_go+0x127>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    12f7 <go_go_go+0x127>
mov    -0x2c(%rbp),%edi
call   1070 <release_pwm@plt>
movl   $0x0,-0x24(%rbp)
jmp    14ab <go_go_go+0x2db>
mov    -0x40(%rbp),%rdi
lea    0xd60(%rip),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x11(%rbp),%rcx
mov    $0x0,%al
call   10c0 <sscanf@plt>
cmp    $0x2,%eax
jne    1385 <go_go_go+0x1b5>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    1385 <go_go_go+0x1b5>
xorps  %xmm0,%xmm0
ucomiss -0x38(%rbp),%xmm0
ja     134a <go_go_go+0x17a>
movss  -0x38(%rbp),%xmm0
movss  0xcbf(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    136f <go_go_go+0x19f>
mov    0x2c8f(%rip),%rax
mov    (%rax),%edi
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd06(%rip),%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
jmp    1379 <go_go_go+0x1a9>
movss  -0x38(%rbp),%xmm0
call   1060 <set_all_pwm@plt>
movl   $0x0,-0x24(%rbp)
jmp    14a6 <go_go_go+0x2d6>
jmp    138a <go_go_go+0x1ba>
mov    -0x40(%rbp),%rdi
lea    0xce6(%rip),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0x38(%rbp),%rcx
lea    -0x11(%rbp),%r8
lea    -0x30(%rbp),%r9
mov    $0x0,%al
call   10c0 <sscanf@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jne    146b <go_go_go+0x29b>
cmpl   $0x0,-0x2c(%rbp)
jge    13e2 <go_go_go+0x212>
mov    0x2c16(%rip),%rax
mov    (%rax),%edi
mov    -0x2c(%rbp),%edx
lea    0xcaf(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    143c <go_go_go+0x26c>
xorps  %xmm0,%xmm0
ucomiss -0x38(%rbp),%xmm0
ja     1405 <go_go_go+0x235>
movss  -0x38(%rbp),%xmm0
movss  0xc04(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    142a <go_go_go+0x25a>
mov    0x2bd4(%rip),%rax
mov    (%rax),%edi
movss  -0x38(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc4b(%rip),%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
jmp    1437 <go_go_go+0x267>
mov    -0x2c(%rbp),%edi
movss  -0x38(%rbp),%xmm0
call   1030 <set_pin@plt>
jmp    143c <go_go_go+0x26c>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jne    1455 <go_go_go+0x285>
mov    $0x0,%al
call   1090 <update_pwm@plt>
jmp    1466 <go_go_go+0x296>
mov    -0x30(%rbp),%ecx
mov    -0x40(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
jmp    146b <go_go_go+0x29b>
cmpl   $0x3,-0x34(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
movsbl -0x11(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x41(%rbp)
je     1496 <go_go_go+0x2c6>
cmpl   $0x3,-0x34(%rbp)
sete   %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    138a <go_go_go+0x1ba>
jmp    14a6 <go_go_go+0x2d6>
jmp    14ab <go_go_go+0x2db>
jmp    14b0 <go_go_go+0x2e0>
jmp    14b5 <go_go_go+0x2e5>
cmpl   $0x0,-0x24(%rbp)
je     14da <go_go_go+0x30a>
mov    0x2b1a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xbcd(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1506 <go_go_go+0x336>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x20(%rbp)
jmp    1214 <go_go_go+0x44>

x86 assembly (clang, -O2):
<go_go_go>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xe23(%rip),%rdi
lea    0xe2c(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    120c <go_go_go+0x3c>
lea    0xe1b(%rip),%rdi
lea    0xe01(%rip),%rsi
call   10f0 <fatal@plt>
movq   $0x0,0x8(%rsp)
lea    0x1c(%rsp),%rbp
lea    0x7(%rsp),%r13
lea    0x14(%rsp),%r12
lea    0x18(%rsp),%r15
nopl   0x0(%rax)
movl   $0x0,0x18(%rsp)
lea    0x8(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %rbx,%rdx
call   10e0 <getline@plt>
test   %eax,%eax
js     1230 <go_go_go+0x60>
mov    0x8(%rsp),%r14
mov    %r14,%rdi
lea    0xde1(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     12b0 <go_go_go+0xe0>
mov    %r14,%rdi
lea    0xdda(%rip),%rsi
call   10a0 <strcmp@plt>
test   %eax,%eax
je     12b9 <go_go_go+0xe9>
mov    %r14,%rdi
lea    0xdd6(%rip),%rsi
mov    %rbp,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   10c0 <sscanf@plt>
cmp    $0x2,%eax
jne    12ea <go_go_go+0x11a>
cmpb   $0xa,0x7(%rsp)
jne    12ea <go_go_go+0x11a>
mov    0x1c(%rsp),%edi
call   1070 <release_pwm@plt>
jmp    12c0 <go_go_go+0xf0>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <debug_dump_hw@plt>
jmp    12c0 <go_go_go+0xf0>
xor    %eax,%eax
call   1050 <debug_dump_samples@plt>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     1230 <go_go_go+0x60>
call   1040 <free@plt>
movq   $0x0,0x8(%rsp)
movq   $0x0,0x20(%rsp)
jmp    1230 <go_go_go+0x60>
mov    %r14,%rdi
lea    0xd72(%rip),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
xor    %eax,%eax
call   10c0 <sscanf@plt>
cmp    $0x2,%eax
jne    1350 <go_go_go+0x180>
cmpb   $0xa,0x7(%rsp)
jne    1350 <go_go_go+0x180>
movss  0x14(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1420 <go_go_go+0x250>
ucomiss 0xcda(%rip),%xmm0
ja     1420 <go_go_go+0x250>
call   1060 <set_all_pwm@plt>
jmp    12c0 <go_go_go+0xf0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq 0x18(%rsp),%rcx
add    %rcx,%r14
cmp    $0xa,%al
je     12c0 <go_go_go+0xf0>
mov    %r14,%rdi
lea    0xd25(%rip),%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %r15,%r9
xor    %eax,%eax
call   10c0 <sscanf@plt>
cmp    $0x3,%eax
jne    13f9 <go_go_go+0x229>
mov    0x1c(%rsp),%edx
test   %edx,%edx
js     13a0 <go_go_go+0x1d0>
movss  0x14(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     13c0 <go_go_go+0x1f0>
ucomiss 0xc6d(%rip),%xmm0
ja     13c0 <go_go_go+0x1f0>
mov    %edx,%edi
call   1030 <set_pin@plt>
jmp    13db <go_go_go+0x20b>
xchg   %ax,%ax
mov    0x2c39(%rip),%rax
mov    (%rax),%edi
lea    0xcd9(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
jmp    13db <go_go_go+0x20b>
nopl   0x0(%rax)
mov    0x2c19(%rip),%rax
mov    (%rax),%edi
cvtss2sd %xmm0,%xmm0
lea    0xc99(%rip),%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
movzbl 0x7(%rsp),%eax
cmp    $0xa,%al
jne    1340 <go_go_go+0x170>
xor    %eax,%eax
call   1090 <update_pwm@plt>
movzbl 0x7(%rsp),%eax
jmp    1348 <go_go_go+0x178>
jge    12c0 <go_go_go+0xf0>
mov    0x2bda(%rip),%rax
mov    (%rax),%edi
mov    0x8(%rsp),%rdx
lea    0xc90(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
jmp    12c0 <go_go_go+0xf0>
mov    0x2bb9(%rip),%rax
mov    (%rax),%edi
cvtss2sd %xmm0,%xmm0
lea    0xc39(%rip),%rsi
mov    $0x1,%al
call   10b0 <fprintf@plt>
jmp    12c0 <go_go_go+0xf0>

LLVM IR (-O0):
@.str = [16 x i8] c"/dev/pi-blaster\00"
@.str.1 = [3 x i8] c"r+\00"
@.str.2 = [35 x i8] c"pi-blaster: Failed to open %s: %m\0A\00"
@.str.3 = [12 x i8] c"debug_regs\0A\00"
@.str.4 = [15 x i8] c"debug_samples\0A\00"
@.str.5 = [13 x i8] c"release %d%c\00"
@.str.6 = [7 x i8] c"*=%f%c\00"
@stderr = global i32 0
@.str.7 = [18 x i8] c"Invalid value %f\0A\00"
@.str.8 = [10 x i8] c"%d=%f%c%n\00"
@.str.9 = [27 x i8] c"Invalid channel number %d\0A\00"
@.str.10 = [14 x i8] c"Bad input: %s\00"
define void @go_go_go() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca i8*
%12 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %12, i32** %1
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @fatal(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %0
store i8* null, i8** %2
br label %17
17: ; preds = %140, %21, %16
store i32 1, i32* %5
store i32 0, i32* %8
store i32 0, i32* %9
store i8* null, i8** %11
%18 = load i32*, i32** %1
%19 = call i32 @getline(i8** %2, i64* %4, i32* %18)
store i32 %19, i32* %6
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %17
br label %17
22: ; preds = %17
%23 = load i8*, i8** %2
store i8* %23, i8** %11
%24 = load i8*, i8** %11
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %22
%28 = call i32 (...) @debug_dump_hw()
store i32 0, i32* %5
br label %127
29: ; preds = %22
%30 = load i8*, i8** %11
%31 = call i32 @strcmp(i8* %30, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp ne i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %29
%34 = call i32 (...) @debug_dump_samples()
store i32 0, i32* %5
br label %126
35: ; preds = %29
%36 = load i8*, i8** %11
%37 = call i32 (i8*, i8*, ...) @sscanf(i8* %36, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32* %7, i8* %3)
%38 = icmp eq i32 %37, 2
br i1 %38, label %39, label %46
39: ; preds = %35
%40 = load i8, i8* %3
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 10
br i1 %42, label %43, label %46
43: ; preds = %39
%44 = load i32, i32* %7
%45 = call i32 @release_pwm(i32 %44)
store i32 0, i32* %5
br label %125
46: ; preds = %39, %35
%47 = load i8*, i8** %11
%48 = call i32 (i8*, i8*, ...) @sscanf(i8* %47, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), float* %10, i8* %3)
%49 = icmp eq i32 %48, 2
br i1 %49, label %50, label %69
50: ; preds = %46
%51 = load i8, i8* %3
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 10
br i1 %53, label %54, label %69
54: ; preds = %50
%55 = load float, float* %10
%56 = fcmp olt float %55, 0.000000e+00
br i1 %56, label %60, label %57
57: ; preds = %54
%58 = load float, float* %10
%59 = fcmp ogt float %58, 1.000000e+00
br i1 %59, label %60, label %65
60: ; preds = %57, %54
%61 = load i32, i32* @stderr
%62 = load float, float* %10
%63 = fpext float %62 to double
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), double %63)
br label %68
65: ; preds = %57
%66 = load float, float* %10
%67 = call i32 @set_all_pwm(float %66)
br label %68
68: ; preds = %65, %60
store i32 0, i32* %5
br label %124
69: ; preds = %50, %46
br label %70
70: ; preds = %121, %69
%71 = load i8*, i8** %11
%72 = call i32 (i8*, i8*, ...) @sscanf(i8* %71, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32* %7, float* %10, i8* %3, i32* %8)
store i32 %72, i32* %9
%73 = load i32, i32* %9
%74 = icmp eq i32 %73, 3
br i1 %74, label %75, label %110
75: ; preds = %70
%76 = load i32, i32* %7
%77 = icmp slt i32 %76, 0
br i1 %77, label %78, label %82
78: ; preds = %75
%79 = load i32, i32* @stderr
%80 = load i32, i32* %7
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i32 %80)
br label %98
82: ; preds = %75
%83 = load float, float* %10
%84 = fcmp olt float %83, 0.000000e+00
br i1 %84, label %88, label %85
85: ; preds = %82
%86 = load float, float* %10
%87 = fcmp ogt float %86, 1.000000e+00
br i1 %87, label %88, label %93
88: ; preds = %85, %82
%89 = load i32, i32* @stderr
%90 = load float, float* %10
%91 = fpext float %90 to double
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), double %91)
br label %97
93: ; preds = %85
%94 = load i32, i32* %7
%95 = load float, float* %10
%96 = call i32 @set_pin(i32 %94, float %95)
br label %97
97: ; preds = %93, %88
br label %98
98: ; preds = %97, %78
%99 = load i8, i8* %3
%100 = sext i8 %99 to i32
%101 = icmp eq i32 %100, 10
br i1 %101, label %102, label %104
102: ; preds = %98
%103 = call i32 (...) @update_pwm()
br label %109
104: ; preds = %98
%105 = load i32, i32* %8
%106 = load i8*, i8** %11
%107 = sext i32 %105 to i64
%108 = getelementptr inbounds i8, i8* %106, i64 %107
store i8* %108, i8** %11
br label %109
109: ; preds = %104, %102
br label %110
110: ; preds = %109, %70
%111 = load i32, i32* %9
%112 = icmp slt i32 %111, 3
%113 = zext i1 %112 to i32
store i32 %113, i32* %5
br label %114
114: ; preds = %110
%115 = load i8, i8* %3
%116 = sext i8 %115 to i32
%117 = icmp ne i32 %116, 10
br i1 %117, label %118, label %121
118: ; preds = %114
%119 = load i32, i32* %9
%120 = icmp eq i32 %119, 3
br label %121
121: ; preds = %118, %114
%122 = phi i1 [ false, %114 ], [ %120, %118 ]
br i1 %122, label %70, label %123
123: ; preds = %121
br label %124
124: ; preds = %123, %68
br label %125
125: ; preds = %124, %43
br label %126
126: ; preds = %125, %33
br label %127
127: ; preds = %126, %27
%128 = load i32, i32* %5
%129 = icmp ne i32 %128, 0
br i1 %129, label %130, label %134
130: ; preds = %127
%131 = load i32, i32* @stderr
%132 = load i8*, i8** %2
%133 = call i32 (i32, i8*, ...) @fprintf(i32 %131, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %132)
br label %134
134: ; preds = %130, %127
%135 = load i8*, i8** %2
%136 = icmp ne i8* %135, null
br i1 %136, label %137, label %140
137: ; preds = %134
%138 = load i8*, i8** %2
%139 = call i32 @free(i8* %138)
store i8* null, i8** %2
store i8* null, i8** %11
store i64 0, i64* %4
br label %140
140: ; preds = %137, %134
br label %17
}

LLVM IR (-O2):
@.str = [16 x i8] c"/dev/pi-blaster\00"
@.str.1 = [3 x i8] c"r+\00"
@.str.2 = [35 x i8] c"pi-blaster: Failed to open %s: %m\0A\00"
@.str.3 = [12 x i8] c"debug_regs\0A\00"
@.str.4 = [15 x i8] c"debug_samples\0A\00"
@.str.5 = [13 x i8] c"release %d%c\00"
@.str.6 = [7 x i8] c"*=%f%c\00"
@stderr = global i32 0
@.str.7 = [18 x i8] c"Invalid value %f\0A\00"
@.str.8 = [10 x i8] c"%d=%f%c%n\00"
@.str.9 = [27 x i8] c"Invalid channel number %d\0A\00"
@.str.10 = [14 x i8] c"Bad input: %s\00"
define void @go_go_go() {
%1 = alloca i8*
%2 = alloca i8
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = tail call i32 @fatal(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%13 = bitcast i64* %3 to i8*
%14 = bitcast i32* %4 to i8*
%15 = bitcast i32* %5 to i8*
%16 = bitcast float* %6 to i8*
br label %17
17: ; preds = %103, %11
store i32 0, i32* %5
%18 = call i32 @getline(i8** %1, i64* %3, i32* %7)
%19 = icmp slt i32 %18, 0
br i1 %19, label %103, label %20
20: ; preds = %17
%21 = load i8*, i8** %1
%22 = call i32 @strcmp(i8* dereferenceable(1) %21, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 (...) @debug_dump_hw()
br label %98
26: ; preds = %20
%27 = call i32 @strcmp(i8* dereferenceable(1) %21, i8* dereferenceable(15) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (...) @debug_dump_samples()
br label %98
31: ; preds = %26
%32 = call i32 (i8*, i8*, ...) @sscanf(i8* %21, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32* %4, i8* %2)
%33 = icmp eq i32 %32, 2
%34 = load i8, i8* %2
%35 = icmp eq i8 %34, 10
%36 = select i1 %33, i1 %35, i1 false
br i1 %36, label %37, label %40
37: ; preds = %31
%38 = load i32, i32* %4
%39 = call i32 @release_pwm(i32 %38)
br label %98
40: ; preds = %31
%41 = call i32 (i8*, i8*, ...) @sscanf(i8* %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), float* %6, i8* %2)
%42 = icmp eq i32 %41, 2
%43 = load i8, i8* %2
%44 = icmp eq i8 %43, 10
%45 = select i1 %42, i1 %44, i1 false
br i1 %45, label %46, label %57
46: ; preds = %40
%47 = load float, float* %6
%48 = fcmp olt float %47, 0.000000e+00
%49 = fcmp ogt float %47, 1.000000e+00
%50 = or i1 %48, %49
br i1 %50, label %51, label %55
51: ; preds = %46
%52 = load i32, i32* @stderr
%53 = fpext float %47 to double
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), double %53)
br label %98
55: ; preds = %46
%56 = call i32 @set_all_pwm(float %47)
br label %98
57: ; preds = %40, %88
%58 = phi i8* [ %90, %88 ], [ %21, %40 ]
%59 = call i32 (i8*, i8*, ...) @sscanf(i8* %58, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32* %4, float* %6, i8* %2, i32* %5)
%60 = icmp eq i32 %59, 3
br i1 %60, label %61, label %92
61: ; preds = %57
%62 = load i32, i32* %4
%63 = icmp slt i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0), i32 %62)
br label %78
67: ; preds = %61
%68 = load float, float* %6
%69 = fcmp olt float %68, 0.000000e+00
%70 = fcmp ogt float %68, 1.000000e+00
%71 = or i1 %69, %70
br i1 %71, label %72, label %76
72: ; preds = %67
%73 = load i32, i32* @stderr
%74 = fpext float %68 to double
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), double %74)
br label %78
76: ; preds = %67
%77 = call i32 @set_pin(i32 %62, float %68)
br label %78
78: ; preds = %72, %76, %64
%79 = load i8, i8* %2
%80 = icmp eq i8 %79, 10
br i1 %80, label %81, label %84
81: ; preds = %78
%82 = call i32 (...) @update_pwm()
%83 = load i8, i8* %2
br label %88
84: ; preds = %78
%85 = load i32, i32* %5
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %58, i64 %86
br label %88
88: ; preds = %81, %84
%89 = phi i8 [ %83, %81 ], [ %79, %84 ]
%90 = phi i8* [ %58, %81 ], [ %87, %84 ]
%91 = icmp eq i8 %89, 10
br i1 %91, label %98, label %57
92: ; preds = %57
%93 = icmp sgt i32 %59, 2
br i1 %93, label %98, label %94
94: ; preds = %92
%95 = load i32, i32* @stderr
%96 = load i8*, i8** %1
%97 = call i32 (i32, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i8* %96)
br label %98
98: ; preds = %88, %51, %55, %24, %29, %37, %94, %92
%99 = load i8*, i8** %1
%100 = icmp eq i8* %99, null
br i1 %100, label %103, label %101
101: ; preds = %98
%102 = call i32 @free(i8* %99)
store i8* null, i8** %1
store i64 0, i64* %3
br label %103
103: ; preds = %98, %101, %17
br label %17
}