#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*/ printf(char *, ...);
void draw(char board[3][3]) {
  printf("\n");
  printf("+---+---+---+\n");
  printf("| %c | %c | %c |\n", board[0][0], board[0][1], board[0][2]);
  printf("+---+---+---+\n");
  printf("| %c | %c | %c |\n", board[1][0], board[1][1], board[1][2]);
  printf("+---+---+---+\n");
  printf("| %c | %c | %c |\n", board[2][0], board[2][1], board[2][2]);
  printf("+---+---+---+\n");
}


x86 assembly (clang, -O0):
<draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%esi
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edx
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%ecx
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%esi
mov    -0x8(%rbp),%rax
movsbl 0x4(%rax),%edx
mov    -0x8(%rbp),%rax
movsbl 0x5(%rax),%ecx
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movsbl 0x6(%rax),%esi
mov    -0x8(%rbp),%rax
movsbl 0x7(%rax),%edx
mov    -0x8(%rbp),%rax
movsbl 0x8(%rax),%ecx
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec9(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
movsbl (%rbx),%esi
movsbl 0x1(%rbx),%edx
movsbl 0x2(%rbx),%ecx
lea    0xe9d(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
movsbl 0x3(%rbx),%esi
movsbl 0x4(%rbx),%edx
movsbl 0x5(%rbx),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
movsbl 0x6(%rbx),%esi
movsbl 0x7(%rbx),%edx
movsbl 0x8(%rbx),%ecx
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

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

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