#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*/ OledClearBuffer();
int /*<<< orphan*/ OledDrawRect(int, int);
int /*<<< orphan*/ OledLineTo(int const, int);
int /*<<< orphan*/ OledMoveTo(int const, int);
int /*<<< orphan*/ OledUpdate();
void drawMaze() {
  OledClearBuffer();
  const int grid[] = {27, 30, 44, 47,  70, 73, 107, 110, 127, 50,  53, 79,
                      82, 90, 93, 127, 20, 23, 67,  70,  106, 109, 127};
  OledMoveTo(0, 0);
  OledDrawRect(127, 31);
  int xc = 0;
  int yc = 7;
  int ind = 0;
  OledMoveTo(xc, yc);
  while (1) {
    OledLineTo(grid[ind], yc);
    if (grid[ind++] == 127) {
      yc += 8;
      OledMoveTo(0, yc);
      if (yc > 30)
        break;
    } else
      OledMoveTo(grid[ind++], yc);
  }
  OledMoveTo(64, 0);
  OledLineTo(64, 23);
  OledMoveTo(40, 7);
  OledLineTo(40, 15);
  OledMoveTo(85, 7);
  OledLineTo(85, 23);
  OledMoveTo(96, 23);
  OledLineTo(96, 31);
  OledUpdate();
}


x86 assembly (clang, -O0):
<drawMaze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    $0x0,%al
call   1080 <OledClearBuffer@plt>
lea    -0x60(%rbp),%rdi
lea    0xe86(%rip),%rsi
mov    $0x5c,%edx
call   1040 <memcpy@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <OledMoveTo@plt>
mov    $0x7f,%edi
mov    $0x1f,%esi
call   1030 <OledDrawRect@plt>
movl   $0x0,-0x64(%rbp)
movl   $0x7,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x64(%rbp),%edi
mov    -0x68(%rbp),%esi
call   1050 <OledMoveTo@plt>
movslq -0x6c(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%edi
mov    -0x68(%rbp),%esi
call   1060 <OledLineTo@plt>
mov    -0x6c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x6c(%rbp)
cltq
cmpl   $0x7f,-0x60(%rbp,%rax,4)
jne    120b <drawMaze+0xab>
mov    -0x68(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x68(%rbp)
mov    -0x68(%rbp),%esi
xor    %edi,%edi
call   1050 <OledMoveTo@plt>
cmpl   $0x1e,-0x68(%rbp)
jle    1206 <drawMaze+0xa6>
jmp    1229 <drawMaze+0xc9>
jmp    1224 <drawMaze+0xc4>
mov    -0x6c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x6c(%rbp)
cltq
mov    -0x60(%rbp,%rax,4),%edi
mov    -0x68(%rbp),%esi
call   1050 <OledMoveTo@plt>
jmp    11bc <drawMaze+0x5c>
mov    $0x40,%edi
xor    %esi,%esi
call   1050 <OledMoveTo@plt>
mov    $0x40,%edi
mov    $0x17,%esi
call   1060 <OledLineTo@plt>
mov    $0x28,%edi
mov    $0x7,%esi
call   1050 <OledMoveTo@plt>
mov    $0x28,%edi
mov    $0xf,%esi
call   1060 <OledLineTo@plt>
mov    $0x55,%edi
mov    $0x7,%esi
call   1050 <OledMoveTo@plt>
mov    $0x55,%edi
mov    $0x17,%esi
call   1060 <OledLineTo@plt>
mov    $0x60,%edi
mov    $0x17,%esi
call   1050 <OledMoveTo@plt>
mov    $0x60,%edi
mov    $0x1f,%esi
call   1060 <OledLineTo@plt>
mov    $0x0,%al
call   1070 <OledUpdate@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawMaze>:
push   %r15
push   %r14
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1070 <OledClearBuffer@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <OledMoveTo@plt>
mov    $0x7f,%edi
mov    $0x1f,%esi
call   1030 <OledDrawRect@plt>
xor    %edi,%edi
mov    $0x7,%esi
call   1040 <OledMoveTo@plt>
lea    0xe77(%rip),%r14
mov    $0x408100,%r15d
nop
mov    (%r14,%rbx,4),%edi
mov    $0x7,%esi
call   1050 <OledLineTo@plt>
bt     %rbx,%r15
jb     11b9 <drawMaze+0x69>
mov    0x4(%r14,%rbx,4),%edi
mov    $0x7,%esi
call   1040 <OledMoveTo@plt>
add    $0x2,%rbx
jmp    1190 <drawMaze+0x40>
xor    %edi,%edi
mov    $0xf,%esi
call   1040 <OledMoveTo@plt>
add    $0x2,%rbx
mov    $0x408100,%r15d
nop
mov    -0x4(%r14,%rbx,4),%edi
mov    $0xf,%esi
call   1050 <OledLineTo@plt>
lea    -0x1(%rbx),%eax
movzbl %al,%eax
bt     %rax,%r15
jb     11ff <drawMaze+0xaf>
mov    (%r14,%rbx,4),%edi
mov    $0xf,%esi
call   1040 <OledMoveTo@plt>
add    $0x2,%rbx
jmp    11d0 <drawMaze+0x80>
xor    %edi,%edi
mov    $0x17,%esi
call   1040 <OledMoveTo@plt>
mov    $0x408100,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
mov    $0x17,%esi
call   1050 <OledLineTo@plt>
bt     %rbx,%r15
jb     1249 <drawMaze+0xf9>
mov    0x4(%r14,%rbx,4),%edi
mov    $0x17,%esi
call   1040 <OledMoveTo@plt>
add    $0x2,%rbx
jmp    1220 <drawMaze+0xd0>
xor    %edi,%edi
mov    $0x1f,%esi
call   1040 <OledMoveTo@plt>
mov    $0x40,%edi
xor    %esi,%esi
call   1040 <OledMoveTo@plt>
mov    $0x40,%edi
mov    $0x17,%esi
call   1050 <OledLineTo@plt>
mov    $0x28,%edi
mov    $0x7,%esi
call   1040 <OledMoveTo@plt>
mov    $0x28,%edi
mov    $0xf,%esi
call   1050 <OledLineTo@plt>
mov    $0x55,%edi
mov    $0x7,%esi
call   1040 <OledMoveTo@plt>
mov    $0x55,%edi
mov    $0x17,%esi
call   1050 <OledLineTo@plt>
mov    $0x60,%edi
mov    $0x17,%esi
call   1040 <OledMoveTo@plt>
mov    $0x60,%edi
mov    $0x1f,%esi
call   1050 <OledLineTo@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <OledUpdate@plt>

LLVM IR (-O0):
@__const.drawMaze.grid = [23 x i32] [i32 27, i32 30, i32 44, i32 47, i32 70, i32 73, i32 107, i32 110, i32 127, i32 50, i32 53, i32 79, i32 82, i32 90, i32 93, i32 127, i32 20, i32 23, i32 67, i32 70, i32 106, i32 109, i32 127]
define void @drawMaze() {
%1 = alloca [23 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @OledClearBuffer()
%6 = bitcast [23 x i32]* %1 to i8*
%7 = call i32 @OledMoveTo(i32 0, i32 0)
%8 = call i32 @OledDrawRect(i32 127, i32 31)
store i32 0, i32* %2
store i32 7, i32* %3
store i32 0, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @OledMoveTo(i32 %9, i32 %10)
br label %12
12: ; preds = %0, %42
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [23 x i32], [23 x i32]* %1, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = load i32, i32* %3
%18 = call i32 @OledLineTo(i32 %16, i32 %17)
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds [23 x i32], [23 x i32]* %1, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 127
br i1 %24, label %25, label %34
25: ; preds = %12
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 8
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = call i32 @OledMoveTo(i32 0, i32 %28)
%30 = load i32, i32* %3
%31 = icmp sgt i32 %30, 30
br i1 %31, label %32, label %33
32: ; preds = %25
br label %43
33: ; preds = %25
br label %42
34: ; preds = %12
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
%37 = sext i32 %35 to i64
%38 = getelementptr inbounds [23 x i32], [23 x i32]* %1, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = load i32, i32* %3
%41 = call i32 @OledMoveTo(i32 %39, i32 %40)
br label %42
42: ; preds = %34, %33
br label %12
43: ; preds = %32
%44 = call i32 @OledMoveTo(i32 64, i32 0)
%45 = call i32 @OledLineTo(i32 64, i32 23)
%46 = call i32 @OledMoveTo(i32 40, i32 7)
%47 = call i32 @OledLineTo(i32 40, i32 15)
%48 = call i32 @OledMoveTo(i32 85, i32 7)
%49 = call i32 @OledLineTo(i32 85, i32 23)
%50 = call i32 @OledMoveTo(i32 96, i32 23)
%51 = call i32 @OledLineTo(i32 96, i32 31)
%52 = call i32 (...) @OledUpdate()
ret void
}

LLVM IR (-O2):
@__const.drawMaze.grid = [23 x i32] [i32 27, i32 30, i32 44, i32 47, i32 70, i32 73, i32 107, i32 110, i32 127, i32 50, i32 53, i32 79, i32 82, i32 90, i32 93, i32 127, i32 20, i32 23, i32 67, i32 70, i32 106, i32 109, i32 127]
define void @drawMaze() {
%1 = tail call i32 (...) @OledClearBuffer()
%2 = tail call i32 @OledMoveTo(i32 0, i32 0)
%3 = tail call i32 @OledDrawRect(i32 127, i32 31)
%4 = tail call i32 @OledMoveTo(i32 0, i32 7)
br label %5
5: ; preds = %0, %62
%6 = phi i32 [ %63, %62 ], [ 0, %0 ]
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [23 x i32], [23 x i32]* @__const.drawMaze.grid, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @OledLineTo(i32 %9, i32 7)
%11 = or i32 %6, 1
%12 = lshr i64 4227328, %7
%13 = and i64 %12, 1
%14 = icmp eq i64 %13, 0
br i1 %14, label %62, label %15
15: ; preds = %5
%16 = tail call i32 @OledMoveTo(i32 0, i32 15)
br label %17
17: ; preds = %29, %15
%18 = phi i32 [ %30, %29 ], [ %11, %15 ]
%19 = zext i32 %18 to i64
%20 = getelementptr inbounds [23 x i32], [23 x i32]* @__const.drawMaze.grid, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = tail call i32 @OledLineTo(i32 %21, i32 15)
%23 = add nuw nsw i32 %18, 1
%24 = lshr i64 4227328, %19
%25 = and i64 %24, 1
%26 = icmp eq i64 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %17
%28 = tail call i32 @OledMoveTo(i32 0, i32 23)
br label %35
29: ; preds = %17
%30 = add nuw nsw i32 %18, 2
%31 = zext i32 %23 to i64
%32 = getelementptr inbounds [23 x i32], [23 x i32]* @__const.drawMaze.grid, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = tail call i32 @OledMoveTo(i32 %33, i32 15)
br label %17
35: ; preds = %55, %27
%36 = phi i32 [ %57, %55 ], [ %23, %27 ]
%37 = zext i32 %36 to i64
%38 = getelementptr inbounds [23 x i32], [23 x i32]* @__const.drawMaze.grid, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = tail call i32 @OledLineTo(i32 %39, i32 23)
%41 = lshr i64 4227328, %37
%42 = and i64 %41, 1
%43 = icmp eq i64 %42, 0
br i1 %43, label %55, label %44
44: ; preds = %35
%45 = tail call i32 @OledMoveTo(i32 0, i32 31)
%46 = tail call i32 @OledMoveTo(i32 64, i32 0)
%47 = tail call i32 @OledLineTo(i32 64, i32 23)
%48 = tail call i32 @OledMoveTo(i32 40, i32 7)
%49 = tail call i32 @OledLineTo(i32 40, i32 15)
%50 = tail call i32 @OledMoveTo(i32 85, i32 7)
%51 = tail call i32 @OledLineTo(i32 85, i32 23)
%52 = tail call i32 @OledMoveTo(i32 96, i32 23)
%53 = tail call i32 @OledLineTo(i32 96, i32 31)
%54 = tail call i32 (...) @OledUpdate()
ret void
55: ; preds = %35
%56 = add nuw nsw i32 %36, 1
%57 = add nuw nsw i32 %36, 2
%58 = zext i32 %56 to i64
%59 = getelementptr inbounds [23 x i32], [23 x i32]* @__const.drawMaze.grid, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = tail call i32 @OledMoveTo(i32 %60, i32 23)
br label %35
62: ; preds = %5
%63 = add nuw nsw i32 %6, 2
%64 = zext i32 %11 to i64
%65 = getelementptr inbounds [23 x i32], [23 x i32]* @__const.drawMaze.grid, i64 0, i64 %64
%66 = load i32, i32* %65
%67 = tail call i32 @OledMoveTo(i32 %66, i32 7)
br label %5
}