#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*/ display_bar();
int /*<<< orphan*/ display_color(char);
int /*<<< orphan*/ display_std(char);
int /*<<< orphan*/ my_putchar(char);
int display(char **map, char color) {
  int i;
  int j;
  i = -1;
  display_bar();
  while (++i < 9) {
    my_putchar('|');
    j = -1;
    while (++j < 9) {
      my_putchar(' ');
      if (map[i][j] == 0 || map[i][j] == 11)
        my_putchar(' ');
      else if (map[i][j] >= 1 && map[i][j] <= 9 && color == 1)
        display_color(map[i][j]);
      else
        display_std(map[i][j]);
    }
    my_putchar('|');
    my_putchar('\n');
  }
  display_bar();
  return (0);
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0xffffffff,-0x10(%rbp)
mov    $0x0,%al
call   1030 <display_bar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x9,%eax
jge    1289 <display+0x149>
mov    $0x7c,%edi
call   1050 <my_putchar@plt>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x9,%eax
jge    1270 <display+0x130>
mov    $0x20,%edi
call   1050 <my_putchar@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     11d9 <display+0x99>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xb,%eax
jne    11e8 <display+0xa8>
mov    $0x20,%edi
call   1050 <my_putchar@plt>
jmp    126b <display+0x12b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x1,%eax
jl     124d <display+0x10d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
jg     124d <display+0x10d>
movsbl -0x9(%rbp),%eax
cmp    $0x1,%eax
jne    124d <display+0x10d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <display_color@plt>
jmp    1266 <display+0x126>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1060 <display_std@plt>
jmp    126b <display+0x12b>
jmp    1183 <display+0x43>
mov    $0x7c,%edi
call   1050 <my_putchar@plt>
mov    $0xa,%edi
call   1050 <my_putchar@plt>
jmp    1160 <display+0x20>
mov    $0x0,%al
call   1030 <display_bar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r15
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <display_bar@plt>
jmp    117e <display+0x3e>
nopl   0x0(%rax,%rax,1)
mov    $0x7c,%edi
call   1050 <my_putchar@plt>
mov    $0xa,%edi
call   1050 <my_putchar@plt>
add    $0x1,%rbp
cmp    $0x9,%rbp
je     11dd <display+0x9d>
mov    $0x7c,%edi
call   1050 <my_putchar@plt>
xor    %ebx,%ebx
jmp    11a4 <display+0x64>
nopl   0x0(%rax)
mov    $0x20,%edi
call   1050 <my_putchar@plt>
add    $0x1,%rbx
cmp    $0x9,%rbx
je     1160 <display+0x20>
mov    $0x20,%edi
call   1050 <my_putchar@plt>
mov    (%r15,%rbp,8),%rax
movzbl (%rax,%rbx,1),%eax
cmp    $0xb,%al
je     1190 <display+0x50>
test   %al,%al
je     1190 <display+0x50>
lea    -0x1(%rax),%ecx
movsbl %al,%edi
cmp    $0x8,%cl
ja     11d6 <display+0x96>
cmp    $0x1,%r14b
jne    11d6 <display+0x96>
call   1040 <display_color@plt>
jmp    119a <display+0x5a>
call   1060 <display_std@plt>
jmp    119a <display+0x5a>
xor    %eax,%eax
call   1030 <display_bar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @display(i8** %0, i8 signext %1) {
%3 = alloca i8**
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8** %0, i8*** %3
store i8 %1, i8* %4
store i32 -1, i32* %5
%7 = call i32 (...) @display_bar()
br label %8
8: ; preds = %97, %2
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = icmp slt i32 %10, 9
br i1 %11, label %12, label %100
12: ; preds = %8
%13 = call i32 @my_putchar(i8 signext 124)
store i32 -1, i32* %6
br label %14
14: ; preds = %96, %12
%15 = load i32, i32* %6
%16 = add nsw i32 %15, 1
store i32 %16, i32* %6
%17 = icmp slt i32 %16, 9
br i1 %17, label %18, label %97
18: ; preds = %14
%19 = call i32 @my_putchar(i8 signext 32)
%20 = load i8**, i8*** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 0
br i1 %30, label %43, label %31
31: ; preds = %18
%32 = load i8**, i8*** %3
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 11
br i1 %42, label %43, label %45
43: ; preds = %31, %18
%44 = call i32 @my_putchar(i8 signext 32)
br label %96
45: ; preds = %31
%46 = load i8**, i8*** %3
%47 = load i32, i32* %5
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i8*, i8** %46, i64 %48
%50 = load i8*, i8** %49
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp sge i32 %55, 1
br i1 %56, label %57, label %84
57: ; preds = %45
%58 = load i8**, i8*** %3
%59 = load i32, i32* %5
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = load i32, i32* %6
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %62, i64 %64
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp sle i32 %67, 9
br i1 %68, label %69, label %84
69: ; preds = %57
%70 = load i8, i8* %4
%71 = sext i8 %70 to i32
%72 = icmp eq i32 %71, 1
br i1 %72, label %73, label %84
73: ; preds = %69
%74 = load i8**, i8*** %3
%75 = load i32, i32* %5
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i8*, i8** %74, i64 %76
%78 = load i8*, i8** %77
%79 = load i32, i32* %6
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %78, i64 %80
%82 = load i8, i8* %81
%83 = call i32 @display_color(i8 signext %82)
br label %95
84: ; preds = %69, %57, %45
%85 = load i8**, i8*** %3
%86 = load i32, i32* %5
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8*, i8** %85, i64 %87
%89 = load i8*, i8** %88
%90 = load i32, i32* %6
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i8, i8* %89, i64 %91
%93 = load i8, i8* %92
%94 = call i32 @display_std(i8 signext %93)
br label %95
95: ; preds = %84, %73
br label %96
96: ; preds = %95, %43
br label %14
97: ; preds = %14
%98 = call i32 @my_putchar(i8 signext 124)
%99 = call i32 @my_putchar(i8 signext 10)
br label %8
100: ; preds = %8
%101 = call i32 (...) @display_bar()
ret i32 0
}

LLVM IR (-O2):
define i32 @display(i8** nocapture %0, i8 signext %1) {
%3 = tail call i32 (...) @display_bar()
%4 = icmp eq i8 %1, 1
br label %5
5: ; preds = %2, %28
%6 = phi i64 [ 0, %2 ], [ %31, %28 ]
%7 = tail call i32 @my_putchar(i8 signext 124)
%8 = getelementptr inbounds i8*, i8** %0, i64 %6
br label %9
9: ; preds = %5, %25
%10 = phi i64 [ 0, %5 ], [ %26, %25 ]
%11 = tail call i32 @my_putchar(i8 signext 32)
%12 = load i8*, i8** %8
%13 = getelementptr inbounds i8, i8* %12, i64 %10
%14 = load i8, i8* %13
switch i8 %14, label %17 [
i8 0, label %15
i8 11, label %15
]
15: ; preds = %9, %9
%16 = tail call i32 @my_putchar(i8 signext 32)
br label %25
17: ; preds = %9
%18 = add i8 %14, -1
%19 = icmp ult i8 %18, 9
%20 = and i1 %19, %4
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call i32 @display_color(i8 signext %14)
br label %25
23: ; preds = %17
%24 = tail call i32 @display_std(i8 signext %14)
br label %25
25: ; preds = %21, %23, %15
%26 = add nuw nsw i64 %10, 1
%27 = icmp eq i64 %26, 9
br i1 %27, label %28, label %9
28: ; preds = %25
%29 = tail call i32 @my_putchar(i8 signext 124)
%30 = tail call i32 @my_putchar(i8 signext 10)
%31 = add nuw nsw i64 %6, 1
%32 = icmp eq i64 %31, 9
br i1 %32, label %33, label %5
33: ; preds = %28
%34 = tail call i32 (...) @display_bar()
ret i32 0
}