#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 */
scalar_t__ a_button();
int /*<<< orphan*/ depth_close();
int depth_image_get_height();
int depth_image_get_width();
int /*<<< orphan*/ depth_open();
scalar_t__ depth_update();
int /*<<< orphan*/ display_clear();
int get_depth_value(int, int);
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (!depth_open()) {
    printf("Unable to open libkipr_link_depth_sensor\n");
    return 1;
  }
  printf("Press the 'A' button for three seconds to stop\n");
  while (a_button() == 0) {
    if (depth_update()) {
      int x;
      int width = depth_image_get_width();
      int y_center = depth_image_get_height() / 2;
      int depth;
      int max = 0;
      int bucket_size = width / 34;
      int sum = 0;
      int avg[34];
      int b = 0;
      int cnt = 0;
      for (x = 0; x < width; x++) {
        depth = get_depth_value(x, y_center);
        if (depth != 0) {
          sum += depth;
          cnt++;
        }
        if ((x % bucket_size) == (bucket_size - 1)) {
          if (cnt) {
            avg[b] = sum / cnt;
          } else {
            avg[b] = 0;
          }
          if (avg[b] > max) {
            max = avg[b];
          }
          b++;
          sum = 0;
          cnt = 0;
        }
      }
      max = 3150;
      int step_size = (max / 9) / 10;
      int l;
      int step_value;
      display_clear();
      for (l = 9; l > 0; l--) {
        if (l == 9) {
          step_value = max;
        } else {
          step_value = l * step_size * 10;
        }
        if (l & 1) {
          printf("%5d | ", step_value);
        } else {
          printf("      | ");
        }
        for (b = 0; b < 34; b++) {
          if (avg[b] >= step_value) {
            printf("#");
          } else {
            printf(" ");
          }
        }
        printf("\n");
      }
      msleep(500);
    } else {
      printf("No depth image received yet\n");
      msleep(2000);
    }
  }
  depth_close();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <depth_open@plt>
cmp    $0x0,%eax
jne    11e3 <main+0x43>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14bf <main+0x31f>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   1040 <a_button@plt>
cmp    $0x0,%rax
jne    14b1 <main+0x311>
mov    $0x0,%al
call   1030 <depth_update@plt>
cmp    $0x0,%rax
je     1494 <main+0x2f4>
mov    $0x0,%al
call   1050 <depth_image_get_width@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   10c0 <depth_image_get_height@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x22,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0xc4(%rbp)
movl   $0x0,-0xc8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1350 <main+0x1b0>
mov    -0x14(%rbp),%edi
mov    -0x1c(%rbp),%esi
call   10a0 <get_depth_value@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     12a2 <main+0x102>
mov    -0x20(%rbp),%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc8(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x28(%rbp)
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
cmp    %eax,%edx
jne    133d <main+0x19d>
cmpl   $0x0,-0xc8(%rbp)
je     12e3 <main+0x143>
mov    -0x2c(%rbp),%eax
cltd
idivl  -0xc8(%rbp)
mov    %eax,%ecx
movslq -0xc4(%rbp),%rax
mov    %ecx,-0xc0(%rbp,%rax,4)
jmp    12f5 <main+0x155>
movslq -0xc4(%rbp),%rax
movl   $0x0,-0xc0(%rbp,%rax,4)
movslq -0xc4(%rbp),%rax
mov    -0xc0(%rbp,%rax,4),%eax
cmp    -0x24(%rbp),%eax
jle    131d <main+0x17d>
movslq -0xc4(%rbp),%rax
mov    -0xc0(%rbp,%rax,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0xc8(%rbp)
jmp    1342 <main+0x1a2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1266 <main+0xc6>
movl   $0xc4e,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xcc(%rbp)
mov    $0x0,%al
call   1090 <display_clear@plt>
movl   $0x9,-0xd0(%rbp)
cmpl   $0x0,-0xd0(%rbp)
jle    1485 <main+0x2e5>
cmpl   $0x9,-0xd0(%rbp)
jne    13a9 <main+0x209>
mov    -0x24(%rbp),%eax
mov    %eax,-0xd4(%rbp)
jmp    13bf <main+0x21f>
mov    -0xd0(%rbp),%eax
imul   -0xcc(%rbp),%eax
imul   $0xa,%eax,%eax
mov    %eax,-0xd4(%rbp)
mov    -0xd0(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     13ea <main+0x24a>
mov    -0xd4(%rbp),%esi
lea    0xc7c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    13f8 <main+0x258>
lea    0xc70(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0xc4(%rbp)
cmpl   $0x22,-0xc4(%rbp)
jge    1463 <main+0x2c3>
movslq -0xc4(%rbp),%rax
mov    -0xc0(%rbp,%rax,4),%eax
cmp    -0xd4(%rbp),%eax
jl     143c <main+0x29c>
lea    0xc3a(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    144a <main+0x2aa>
lea    0xc25(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    144f <main+0x2af>
mov    -0xc4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc4(%rbp)
jmp    1402 <main+0x262>
lea    0xbee(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xd0(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xd0(%rbp)
jmp    1381 <main+0x1e1>
mov    $0x1f4,%edi
call   1070 <msleep@plt>
jmp    14ac <main+0x30c>
lea    0xbd1(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x7d0,%edi
call   1070 <msleep@plt>
jmp    11f1 <main+0x51>
mov    $0x0,%al
call   10b0 <depth_close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
xor    %eax,%eax
call   1080 <depth_open@plt>
test   %eax,%eax
je     137f <main+0x1bf>
lea    0xe52(%rip),%rdi
call   1060 <puts@plt>
jmp    1206 <main+0x46>
xchg   %ax,%ax
lea    0xe71(%rip),%rdi
call   1060 <puts@plt>
mov    $0x7d0,%edi
call   1090 <msleep@plt>
xor    %eax,%eax
call   1050 <a_button@plt>
test   %rax,%rax
jne    1374 <main+0x1b4>
xor    %eax,%eax
call   1040 <depth_update@plt>
test   %rax,%rax
je     11f0 <main+0x30>
xor    %eax,%eax
call   1070 <depth_image_get_width@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10e0 <depth_image_get_height@plt>
mov    %ebx,0x8(%rsp)
test   %ebx,%ebx
jle    12e0 <main+0x120>
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
movslq 0x8(%rsp),%rax
imul   $0x78787879,%rax,%r12
mov    %r12,%rax
shr    $0x3f,%rax
sar    $0x24,%r12
add    %eax,%r12d
lea    -0x1(%r12),%eax
mov    %eax,0xc(%rsp)
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %r15d,%r15d
xor    %r14d,%r14d
jmp    129b <main+0xdb>
nopw   0x0(%rax,%rax,1)
movslq %ebx,%rbx
mov    %eax,0x10(%rsp,%rbx,4)
add    $0x1,%ebx
xor    %r13d,%r13d
mov    %ecx,%r15d
add    $0x1,%r14d
cmp    %r14d,0x8(%rsp)
je     12e0 <main+0x120>
mov    %r14d,%edi
mov    %ebp,%esi
call   10c0 <get_depth_value@plt>
add    %eax,%r15d
cmp    $0x1,%eax
sbb    $0xffffffff,%r13d
mov    %r14d,%eax
cltd
idiv   %r12d
cmp    0xc(%rsp),%edx
jne    1290 <main+0xd0>
xor    %ecx,%ecx
mov    $0x0,%eax
test   %r13d,%r13d
je     1280 <main+0xc0>
mov    %r15d,%eax
cltd
idiv   %r13d
jmp    1280 <main+0xc0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10b0 <display_clear@plt>
mov    $0x9,%r14d
lea    0xd13(%rip),%r15
lea    0xd05(%rip),%r12
nopl   0x0(%rax,%rax,1)
imul   $0x15e,%r14d,%ebx
test   $0x1,%r14b
jne    1320 <main+0x160>
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    132c <main+0x16c>
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
xor    %ebp,%ebp
xchg   %ax,%ax
xor    %eax,%eax
cmp    %ebx,0x10(%rsp,%rbp,4)
setge  %al
lea    (%rax,%rax,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    $0x22,%rbp
jne    1330 <main+0x170>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x1(%r14),%eax
cmp    $0x1,%r14d
mov    %eax,%r14d
ja     1300 <main+0x140>
mov    $0x1f4,%edi
call   1090 <msleep@plt>
jmp    1206 <main+0x46>
xor    %eax,%eax
call   10d0 <depth_close@plt>
xor    %eax,%eax
jmp    1390 <main+0x1d0>
lea    0xc8a(%rip),%rdi
call   1060 <puts@plt>
mov    $0x1,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Unable to open libkipr_link_depth_sensor\0A\00"
@.str.1 = [48 x i8] c"Press the 'A' button for three seconds to stop\0A\00"
@.str.2 = [7 x i8] c"%5d | \00"
@.str.3 = [9 x i8] c" | \00"
@.str.4 = [2 x i8] c"#\00"
@.str.5 = [2 x i8] c" \00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [29 x i8] c"No depth image received yet\0A\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 i32
%13 = alloca [34 x i32]
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = call i32 (...) @depth_open()
%20 = icmp ne i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %152
23: ; preds = %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %149, %23
%26 = call i64 (...) @a_button()
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %150
28: ; preds = %25
%29 = call i64 (...) @depth_update()
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %146
31: ; preds = %28
%32 = call i32 (...) @depth_image_get_width()
store i32 %32, i32* %7
%33 = call i32 (...) @depth_image_get_height()
%34 = sdiv i32 %33, 2
store i32 %34, i32* %8
store i32 0, i32* %10
%35 = load i32, i32* %7
%36 = sdiv i32 %35, 34
store i32 %36, i32* %11
store i32 0, i32* %12
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %6
br label %37
37: ; preds = %90, %31
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %93
41: ; preds = %37
%42 = load i32, i32* %6
%43 = load i32, i32* %8
%44 = call i32 @get_depth_value(i32 %42, i32 %43)
store i32 %44, i32* %9
%45 = load i32, i32* %9
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %53
47: ; preds = %41
%48 = load i32, i32* %9
%49 = load i32, i32* %12
%50 = add nsw i32 %49, %48
store i32 %50, i32* %12
%51 = load i32, i32* %15
%52 = add nsw i32 %51, 1
store i32 %52, i32* %15
br label %53
53: ; preds = %47, %41
%54 = load i32, i32* %6
%55 = load i32, i32* %11
%56 = srem i32 %54, %55
%57 = load i32, i32* %11
%58 = sub nsw i32 %57, 1
%59 = icmp eq i32 %56, %58
br i1 %59, label %60, label %89
60: ; preds = %53
%61 = load i32, i32* %15
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %70
63: ; preds = %60
%64 = load i32, i32* %12
%65 = load i32, i32* %15
%66 = sdiv i32 %64, %65
%67 = load i32, i32* %14
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [34 x i32], [34 x i32]* %13, i64 0, i64 %68
store i32 %66, i32* %69
br label %74
70: ; preds = %60
%71 = load i32, i32* %14
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [34 x i32], [34 x i32]* %13, i64 0, i64 %72
store i32 0, i32* %73
br label %74
74: ; preds = %70, %63
%75 = load i32, i32* %14
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [34 x i32], [34 x i32]* %13, i64 0, i64 %76
%78 = load i32, i32* %77
%79 = load i32, i32* %10
%80 = icmp sgt i32 %78, %79
br i1 %80, label %81, label %86
81: ; preds = %74
%82 = load i32, i32* %14
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [34 x i32], [34 x i32]* %13, i64 0, i64 %83
%85 = load i32, i32* %84
store i32 %85, i32* %10
br label %86
86: ; preds = %81, %74
%87 = load i32, i32* %14
%88 = add nsw i32 %87, 1
store i32 %88, i32* %14
store i32 0, i32* %12
store i32 0, i32* %15
br label %89
89: ; preds = %86, %53
br label %90
90: ; preds = %89
%91 = load i32, i32* %6
%92 = add nsw i32 %91, 1
store i32 %92, i32* %6
br label %37
93: ; preds = %37
store i32 3150, i32* %10
%94 = load i32, i32* %10
%95 = sdiv i32 %94, 9
%96 = sdiv i32 %95, 10
store i32 %96, i32* %16
%97 = call i32 (...) @display_clear()
store i32 9, i32* %17
br label %98
98: ; preds = %141, %93
%99 = load i32, i32* %17
%100 = icmp sgt i32 %99, 0
br i1 %100, label %101, label %144
101: ; preds = %98
%102 = load i32, i32* %17
%103 = icmp eq i32 %102, 9
br i1 %103, label %104, label %106
104: ; preds = %101
%105 = load i32, i32* %10
store i32 %105, i32* %18
br label %111
106: ; preds = %101
%107 = load i32, i32* %17
%108 = load i32, i32* %16
%109 = mul nsw i32 %107, %108
%110 = mul nsw i32 %109, 10
store i32 %110, i32* %18
br label %111
111: ; preds = %106, %104
%112 = load i32, i32* %17
%113 = and i32 %112, 1
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %118
115: ; preds = %111
%116 = load i32, i32* %18
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %116)
br label %120
118: ; preds = %111
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %120
120: ; preds = %118, %115
store i32 0, i32* %14
br label %121
121: ; preds = %136, %120
%122 = load i32, i32* %14
%123 = icmp slt i32 %122, 34
br i1 %123, label %124, label %139
124: ; preds = %121
%125 = load i32, i32* %14
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [34 x i32], [34 x i32]* %13, i64 0, i64 %126
%128 = load i32, i32* %127
%129 = load i32, i32* %18
%130 = icmp sge i32 %128, %129
br i1 %130, label %131, label %133
131: ; preds = %124
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %135
133: ; preds = %124
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %135
135: ; preds = %133, %131
br label %136
136: ; preds = %135
%137 = load i32, i32* %14
%138 = add nsw i32 %137, 1
store i32 %138, i32* %14
br label %121
139: ; preds = %121
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %141
141: ; preds = %139
%142 = load i32, i32* %17
%143 = add nsw i32 %142, -1
store i32 %143, i32* %17
br label %98
144: ; preds = %98
%145 = call i32 @msleep(i32 500)
br label %149
146: ; preds = %28
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
%148 = call i32 @msleep(i32 2000)
br label %149
149: ; preds = %146, %144
br label %25
150: ; preds = %25
%151 = call i32 (...) @depth_close()
store i32 0, i32* %3
br label %152
152: ; preds = %150, %21
%153 = load i32, i32* %3
ret i32 %153
}

LLVM IR (-O2):
@.str.2 = [7 x i8] c"%5d | \00"
@.str.3 = [9 x i8] c" | \00"
@str = [41 x i8] c"Unable to open libkipr_link_depth_sensor\00"
@str.8 = [47 x i8] c"Press the 'A' button for three seconds to stop\00"
@str.9 = [28 x i8] c"No depth image received yet\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [34 x i32]
%4 = tail call i32 (...) @depth_open()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
br label %87
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.8, i64 0, i64 0))
%10 = tail call i64 (...) @a_button()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %85
12: ; preds = %8
%13 = bitcast [34 x i32]* %3 to i8*
br label %14
14: ; preds = %12, %82
%15 = tail call i64 (...) @depth_update()
%16 = icmp eq i64 %15, 0
br i1 %16, label %79, label %17
17: ; preds = %14
%18 = tail call i32 (...) @depth_image_get_width()
%19 = tail call i32 (...) @depth_image_get_height()
%20 = sdiv i32 %19, 2
%21 = sdiv i32 %18, 34
%22 = icmp sgt i32 %18, 0
br i1 %22, label %23, label %52
23: ; preds = %17
%24 = add nsw i32 %21, -1
br label %25
25: ; preds = %23, %46
%26 = phi i32 [ 0, %23 ], [ %49, %46 ]
%27 = phi i32 [ 0, %23 ], [ %48, %46 ]
%28 = phi i32 [ 0, %23 ], [ %47, %46 ]
%29 = phi i32 [ 0, %23 ], [ %50, %46 ]
%30 = tail call i32 @get_depth_value(i32 %29, i32 %20)
%31 = icmp ne i32 %30, 0
%32 = add nsw i32 %30, %28
%33 = zext i1 %31 to i32
%34 = add nsw i32 %26, %33
%35 = srem i32 %29, %21
%36 = icmp eq i32 %35, %24
br i1 %36, label %37, label %46
37: ; preds = %25
%38 = icmp eq i32 %34, 0
br i1 %38, label %41, label %39
39: ; preds = %37
%40 = sdiv i32 %32, %34
br label %41
41: ; preds = %37, %39
%42 = phi i32 [ %40, %39 ], [ 0, %37 ]
%43 = sext i32 %27 to i64
%44 = getelementptr inbounds [34 x i32], [34 x i32]* %3, i64 0, i64 %43
store i32 %42, i32* %44
%45 = add nsw i32 %27, 1
br label %46
46: ; preds = %25, %41
%47 = phi i32 [ 0, %41 ], [ %32, %25 ]
%48 = phi i32 [ %45, %41 ], [ %27, %25 ]
%49 = phi i32 [ 0, %41 ], [ %34, %25 ]
%50 = add nuw nsw i32 %29, 1
%51 = icmp eq i32 %50, %18
br i1 %51, label %52, label %25
52: ; preds = %46, %17
%53 = tail call i32 (...) @display_clear()
br label %54
54: ; preds = %52, %73
%55 = phi i32 [ 9, %52 ], [ %75, %73 ]
%56 = mul nuw nsw i32 %55, 350
%57 = and i32 %55, 1
%58 = icmp eq i32 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %54
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %56)
br label %63
61: ; preds = %54
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %63
63: ; preds = %61, %59
br label %64
64: ; preds = %63, %64
%65 = phi i64 [ %71, %64 ], [ 0, %63 ]
%66 = getelementptr inbounds [34 x i32], [34 x i32]* %3, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = icmp slt i32 %67, %56
%69 = select i1 %68, i32 32, i32 35
%70 = tail call i32 @putchar(i32 %69)
%71 = add nuw nsw i64 %65, 1
%72 = icmp eq i64 %71, 34
br i1 %72, label %73, label %64
73: ; preds = %64
%74 = tail call i32 @putchar(i32 10)
%75 = add nsw i32 %55, -1
%76 = icmp ugt i32 %55, 1
br i1 %76, label %54, label %77
77: ; preds = %73
%78 = tail call i32 @msleep(i32 500)
br label %82
79: ; preds = %14
%80 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.9, i64 0, i64 0))
%81 = tail call i32 @msleep(i32 2000)
br label %82
82: ; preds = %79, %77
%83 = tail call i64 (...) @a_button()
%84 = icmp eq i64 %83, 0
br i1 %84, label %14, label %85
85: ; preds = %82, %8
%86 = tail call i32 (...) @depth_close()
br label %87
87: ; preds = %85, %6
%88 = phi i32 [ 0, %85 ], [ 1, %6 ]
ret i32 %88
}