#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 *, ...);
int print_puzzle(int pzl[][9]) {
  int r;
  int c;
  char b;
  for (r = 0; r < 9; r++) {
    if (r % 3 == 0) {
      printf("-------------------\n");
    }
    for (c = 0; c < 9; c++) {
      if (c % 3 == 0) {
        b = '|';
      } else {
        b = ' ';
      }
      if (pzl[r][c] == 0) {
        printf("%c_", b);
      } else {
        printf("%c%d", b, pzl[r][c]);
      }
    }
    printf("|\n");
  }
  printf("-------------------\n");
  return 0;
}


x86 assembly (clang, -O0):
<print_puzzle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    120c <print_puzzle+0xfc>
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <print_puzzle+0x3f>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    11f0 <print_puzzle+0xe0>
mov    -0x10(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117d <print_puzzle+0x6d>
movb   $0x7c,-0x11(%rbp)
jmp    1181 <print_puzzle+0x71>
movb   $0x20,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    11b5 <print_puzzle+0xa5>
movsbl -0x11(%rbp),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dd <print_puzzle+0xcd>
movsbl -0x11(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e2 <print_puzzle+0xd2>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <print_puzzle+0x46>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_puzzle+0x13>
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_puzzle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xecb(%rip),%r15
lea    0xec8(%rip),%r13
xor    %ebp,%ebp
jmp    115e <print_puzzle+0x3e>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
add    $0x1,%rbp
add    $0x24,%rbx
cmp    $0x9,%rbp
je     11dc <print_puzzle+0xbc>
imul   $0xffffffab,%ebp,%eax
cmp    $0x55,%al
ja     1171 <print_puzzle+0x51>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
xor    %r14d,%r14d
xor    %r12d,%r12d
jmp    11a0 <print_puzzle+0x80>
nopl   0x0(%rax)
mov    (%rbx,%r12,4),%edx
test   %edx,%edx
je     11d0 <print_puzzle+0xb0>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r12
add    $0xff,%r14b
cmp    $0x9,%r12
je     1140 <print_puzzle+0x20>
movzbl %r12b,%eax
imul   $0xab,%eax,%eax
shr    $0x9,%eax
lea    (%rax,%rax,2),%eax
mov    $0x7c,%esi
add    %r14b,%al
je     1180 <print_puzzle+0x60>
mov    $0x20,%esi
jmp    1180 <print_puzzle+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1192 <print_puzzle+0x72>
lea    0xe28(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"-------------------\0A\00"
@.str.1 = [4 x i8] c"%c_\00"
@.str.2 = [5 x i8] c"%c%d\00"
@.str.3 = [3 x i8] c"|\0A\00"
define i32 @print_puzzle([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store [9 x i32]* %0, [9 x i32]** %2
store i32 0, i32* %3
br label %6
6: ; preds = %57, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 9
br i1 %8, label %9, label %60
9: ; preds = %6
%10 = load i32, i32* %3
%11 = srem i32 %10, 3
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
store i32 0, i32* %4
br label %16
16: ; preds = %52, %15
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 9
br i1 %18, label %19, label %55
19: ; preds = %16
%20 = load i32, i32* %4
%21 = srem i32 %20, 3
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %19
store i8 124, i8* %5
br label %25
24: ; preds = %19
store i8 32, i8* %5
br label %25
25: ; preds = %24, %23
%26 = load [9 x i32]*, [9 x i32]** %2
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [9 x i32], [9 x i32]* %26, i64 %28
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [9 x i32], [9 x i32]* %29, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %25
%36 = load i8, i8* %5
%37 = sext i8 %36 to i32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %37)
br label %51
39: ; preds = %25
%40 = load i8, i8* %5
%41 = sext i8 %40 to i32
%42 = load [9 x i32]*, [9 x i32]** %2
%43 = load i32, i32* %3
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [9 x i32], [9 x i32]* %42, i64 %44
%46 = load i32, i32* %4
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [9 x i32], [9 x i32]* %45, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %41, i32 %49)
br label %51
51: ; preds = %39, %35
br label %52
52: ; preds = %51
%53 = load i32, i32* %4
%54 = add nsw i32 %53, 1
store i32 %54, i32* %4
br label %16
55: ; preds = %16
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %57
57: ; preds = %55
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
store i32 %59, i32* %3
br label %6
60: ; preds = %6
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%c_\00"
@.str.2 = [5 x i8] c"%c%d\00"
@str.4 = [2 x i8] c"|\00"
@str.5 = [20 x i8] c"-------------------\00"
define i32 @print_puzzle([9 x i32]* nocapture %0) {
br label %2
2: ; preds = %1, %26
%3 = phi i64 [ 0, %1 ], [ %28, %26 ]
%4 = trunc i64 %3 to i8
%5 = urem i8 %4, 3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
br label %10
10: ; preds = %9, %23
%11 = phi i64 [ %24, %23 ], [ 0, %9 ]
%12 = trunc i64 %11 to i8
%13 = urem i8 %12, 3
%14 = icmp eq i8 %13, 0
%15 = select i1 %14, i32 124, i32 32
%16 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %3, i64 %11
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %23
21: ; preds = %10
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %17)
br label %23
23: ; preds = %19, %21
%24 = add nuw nsw i64 %11, 1
%25 = icmp eq i64 %24, 9
br i1 %25, label %26, label %10
26: ; preds = %23
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0))
%28 = add nuw nsw i64 %3, 1
%29 = icmp eq i64 %28, 9
br i1 %29, label %30, label %2
30: ; preds = %26
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}