#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 gridChar(int);
int /*<<< orphan*/ printf(char *, ...);
void draw(int b[9]) {
  printf(" %c | %c | %c\n", gridChar(b[0]), gridChar(b[1]), gridChar(b[2]));
  printf("---+---+---\n");
  printf(" %c | %c | %c\n", gridChar(b[3]), gridChar(b[4]), gridChar(b[5]));
  printf("---+---+---\n");
  printf(" %c | %c | %c\n", gridChar(b[6]), gridChar(b[7]), gridChar(b[8]));
}


x86 assembly (clang, -O0):
<draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <gridChar@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <gridChar@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
call   1030 <gridChar@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%edi
call   1030 <gridChar@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%edi
call   1030 <gridChar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%edi
call   1030 <gridChar@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%edi
call   1030 <gridChar@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%edi
call   1030 <gridChar@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%edi
call   1030 <gridChar@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <gridChar@plt>
mov    %eax,%r15d
mov    0x4(%rbx),%edi
call   1040 <gridChar@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%edi
call   1040 <gridChar@plt>
lea    0xea2(%rip),%r14
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe99(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0xc(%rbx),%edi
call   1040 <gridChar@plt>
mov    %eax,%r12d
mov    0x10(%rbx),%edi
call   1040 <gridChar@plt>
mov    %eax,%ebp
mov    0x14(%rbx),%edi
call   1040 <gridChar@plt>
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%edi
call   1040 <gridChar@plt>
mov    %eax,%r15d
mov    0x1c(%rbx),%edi
call   1040 <gridChar@plt>
mov    %eax,%ebp
mov    0x20(%rbx),%edi
call   1040 <gridChar@plt>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c" %c | %c | %c\0A\00"
@.str.1 = [13 x i8] c"---+---+---\0A\00"
define void @draw(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = call i32 @gridChar(i32 %5)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = call i32 @gridChar(i32 %9)
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = call i32 @gridChar(i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %10, i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 3
%19 = load i32, i32* %18
%20 = call i32 @gridChar(i32 %19)
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 4
%23 = load i32, i32* %22
%24 = call i32 @gridChar(i32 %23)
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 5
%27 = load i32, i32* %26
%28 = call i32 @gridChar(i32 %27)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %24, i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%31 = load i32*, i32** %2
%32 = getelementptr inbounds i32, i32* %31, i64 6
%33 = load i32, i32* %32
%34 = call i32 @gridChar(i32 %33)
%35 = load i32*, i32** %2
%36 = getelementptr inbounds i32, i32* %35, i64 7
%37 = load i32, i32* %36
%38 = call i32 @gridChar(i32 %37)
%39 = load i32*, i32** %2
%40 = getelementptr inbounds i32, i32* %39, i64 8
%41 = load i32, i32* %40
%42 = call i32 @gridChar(i32 %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %34, i32 %38, i32 %42)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c" %c | %c | %c\0A\00"
@str.2 = [12 x i8] c"---+---+---\00"
define void @draw(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @gridChar(i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @gridChar(i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = tail call i32 @gridChar(i32 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %6, i32 %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = tail call i32 @gridChar(i32 %13)
%15 = getelementptr inbounds i32, i32* %0, i64 4
%16 = load i32, i32* %15
%17 = tail call i32 @gridChar(i32 %16)
%18 = getelementptr inbounds i32, i32* %0, i64 5
%19 = load i32, i32* %18
%20 = tail call i32 @gridChar(i32 %19)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %17, i32 %20)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%23 = getelementptr inbounds i32, i32* %0, i64 6
%24 = load i32, i32* %23
%25 = tail call i32 @gridChar(i32 %24)
%26 = getelementptr inbounds i32, i32* %0, i64 7
%27 = load i32, i32* %26
%28 = tail call i32 @gridChar(i32 %27)
%29 = getelementptr inbounds i32, i32* %0, i64 8
%30 = load i32, i32* %29
%31 = tail call i32 @gridChar(i32 %30)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %25, i32 %28, i32 %31)
ret void
}