#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 subsPretty(int A[126][9]) {
  int j, k, n, row, b;
  for (n = 0; n * 9 < 126; n++) {
    for (row = 0; row < 3; row++) {
      for (j = 0; j < row; j++)
        printf(" ");
      for (b = 0; b < 9; b++) {
        for (k = 0; k < 3; k++)
          if (A[n * 9 + b][row * 3 + k])
            printf(" 1");
          else
            printf(" .");
        printf("   ");
      }
      printf("\n");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<subsPretty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
imul   $0x9,-0x14(%rbp),%eax
cmp    $0x7e,%eax
jge    1237 <subsPretty+0x127>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    121d <subsPretty+0x10d>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    116e <subsPretty+0x5e>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <subsPretty+0x38>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x9,-0x1c(%rbp)
jge    1203 <subsPretty+0xf3>
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    11e9 <subsPretty+0xd9>
mov    -0x8(%rbp),%rax
imul   $0x9,-0x14(%rbp),%ecx
add    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
imul   $0x3,-0x18(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11ca <subsPretty+0xba>
lea    0xe40(%rip),%rdi
call   1030 <printf@plt>
jmp    11d6 <subsPretty+0xc6>
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <subsPretty+0xcb>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1186 <subsPretty+0x76>
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1175 <subsPretty+0x65>
lea    0xe00(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1137 <subsPretty+0x27>
lea    0xde6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <subsPretty+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subsPretty>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %r15d,%r15d
lea    0xecb(%rip),%r12
lea    0xec1(%rip),%r13
lea    0xec0(%rip),%r14
jmp    1179 <subsPretty+0x59>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
add    $0x144,%rbx
cmp    $0xe,%r15
je     12d0 <subsPretty+0x1b0>
mov    $0x8,%ebp
jmp    119a <subsPretty+0x7a>
call   1040 <printf@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x24,%rbp
cmp    $0x14c,%rbp
je     11d0 <subsPretty+0xb0>
cmpl   $0x0,-0x8(%rbx,%rbp,1)
mov    %r12,%rdi
je     11a7 <subsPretty+0x87>
mov    %r13,%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x4(%rbx,%rbp,1)
mov    %r12,%rdi
je     11b9 <subsPretty+0x99>
mov    %r13,%rdi
call   1040 <printf@plt>
cmpl   $0x0,(%rbx,%rbp,1)
mov    %r12,%rdi
je     1180 <subsPretty+0x60>
mov    %r13,%rdi
jmp    1180 <subsPretty+0x60>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebp
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11e0 <subsPretty+0xc0>
mov    $0x14,%ebp
jmp    121a <subsPretty+0xfa>
cs nopw 0x0(%rax,%rax,1)
call   1040 <printf@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x24,%rbp
cmp    $0x158,%rbp
je     1250 <subsPretty+0x130>
cmpl   $0x0,-0x8(%rbx,%rbp,1)
mov    %r12,%rdi
je     1227 <subsPretty+0x107>
mov    %r13,%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x4(%rbx,%rbp,1)
mov    %r12,%rdi
je     1239 <subsPretty+0x119>
mov    %r13,%rdi
call   1040 <printf@plt>
cmpl   $0x0,(%rbx,%rbp,1)
mov    %r12,%rdi
je     1200 <subsPretty+0xe0>
mov    %r13,%rdi
jmp    1200 <subsPretty+0xe0>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x2,%ebp
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1260 <subsPretty+0x140>
mov    $0x20,%ebp
jmp    129e <subsPretty+0x17e>
cs nopw 0x0(%rax,%rax,1)
call   1040 <printf@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x24,%rbp
cmp    $0x164,%rbp
je     1150 <subsPretty+0x30>
cmpl   $0x0,-0x8(%rbx,%rbp,1)
mov    %r12,%rdi
je     12ab <subsPretty+0x18b>
mov    %r13,%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x4(%rbx,%rbp,1)
mov    %r12,%rdi
je     12bd <subsPretty+0x19d>
mov    %r13,%rdi
call   1040 <printf@plt>
cmpl   $0x0,(%rbx,%rbp,1)
mov    %r12,%rdi
je     1280 <subsPretty+0x160>
mov    %r13,%rdi
jmp    1280 <subsPretty+0x160>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c" 1\00"
@.str.2 = [3 x i8] c" .\00"
@.str.3 = [4 x i8] c" \00"
define void @subsPretty([9 x i32]* nocapture %0) {
br label %2
2: ; preds = %1, %82
%3 = phi i64 [ 0, %1 ], [ %85, %82 ]
%4 = phi i64 [ 0, %1 ], [ %86, %82 ]
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %24, %5 ]
%7 = add nuw nsw i64 %6, %4
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %7, i64 0
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%12 = tail call i32 @printf(i8* dereferenceable(1) %11)
%13 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %7, i64 1
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
%16 = select i1 %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%17 = tail call i32 @printf(i8* dereferenceable(1) %16)
%18 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %7, i64 2
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%22 = tail call i32 @printf(i8* dereferenceable(1) %21)
%23 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%24 = add nuw nsw i64 %6, 1
%25 = icmp eq i64 %24, 9
br i1 %25, label %26, label %5
26: ; preds = %5
%27 = tail call i32 @putchar(i32 10)
br label %28
28: ; preds = %28, %26
%29 = phi i32 [ %31, %28 ], [ 0, %26 ]
%30 = tail call i32 @putchar(i32 32)
%31 = add nuw nsw i32 %29, 1
%32 = icmp eq i32 %29, 0
br i1 %32, label %33, label %28
33: ; preds = %28, %33
%34 = phi i64 [ %52, %33 ], [ 0, %28 ]
%35 = add nuw nsw i64 %34, %4
%36 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %35, i64 3
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, 0
%39 = select i1 %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%40 = tail call i32 @printf(i8* dereferenceable(1) %39)
%41 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %35, i64 4
%42 = load i32, i32* %41
%43 = icmp eq i32 %42, 0
%44 = select i1 %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%45 = tail call i32 @printf(i8* dereferenceable(1) %44)
%46 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %35, i64 5
%47 = load i32, i32* %46
%48 = icmp eq i32 %47, 0
%49 = select i1 %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%50 = tail call i32 @printf(i8* dereferenceable(1) %49)
%51 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%52 = add nuw nsw i64 %34, 1
%53 = icmp eq i64 %52, 9
br i1 %53, label %54, label %33
54: ; preds = %33
%55 = tail call i32 @putchar(i32 10)
br label %56
56: ; preds = %56, %54
%57 = phi i32 [ %59, %56 ], [ 0, %54 ]
%58 = tail call i32 @putchar(i32 32)
%59 = add nuw nsw i32 %57, 1
%60 = icmp eq i32 %59, 2
br i1 %60, label %61, label %56
61: ; preds = %56, %61
%62 = phi i64 [ %80, %61 ], [ 0, %56 ]
%63 = add nuw nsw i64 %62, %4
%64 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %63, i64 6
%65 = load i32, i32* %64
%66 = icmp eq i32 %65, 0
%67 = select i1 %66, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%68 = tail call i32 @printf(i8* dereferenceable(1) %67)
%69 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %63, i64 7
%70 = load i32, i32* %69
%71 = icmp eq i32 %70, 0
%72 = select i1 %71, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%73 = tail call i32 @printf(i8* dereferenceable(1) %72)
%74 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %63, i64 8
%75 = load i32, i32* %74
%76 = icmp eq i32 %75, 0
%77 = select i1 %76, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%78 = tail call i32 @printf(i8* dereferenceable(1) %77)
%79 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%80 = add nuw nsw i64 %62, 1
%81 = icmp eq i64 %80, 9
br i1 %81, label %82, label %61
82: ; preds = %61
%83 = tail call i32 @putchar(i32 10)
%84 = tail call i32 @putchar(i32 10)
%85 = add nuw nsw i64 %3, 1
%86 = add nuw nsw i64 %4, 9
%87 = icmp eq i64 %85, 14
br i1 %87, label %88, label %2
88: ; preds = %82
ret void
}