#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 showAsBoard(int X[]) {
  int j, k;
  for (j = 1; j < (21 + 1); j++) {
    for (k = 1; k < j; k++)
      printf(" ");
    for (k = 1; k < (21 + 1); k++)
      printf("%2d", X[j * (21 + 2) + k]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<showAsBoard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x16,-0xc(%rbp)
jge    11b6 <showAsBoard+0xa6>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <showAsBoard+0x4c>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <showAsBoard+0x24>
movl   $0x1,-0x10(%rbp)
cmpl   $0x16,-0x10(%rbp)
jge    119a <showAsBoard+0x8a>
mov    -0x8(%rbp),%rax
imul   $0x17,-0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <showAsBoard+0x53>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <showAsBoard+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showAsBoard>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r13
mov    $0x1,%r15d
lea    0xec7(%rip),%r14
xor    %r12d,%r12d
jmp    12a7 <showAsBoard+0x187>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   $0x5c,%r15,%rbx
mov    0x4(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x24(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2c(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x34(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x3c(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x40(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x44(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x48(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4c(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x50(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x54(%rbx,%r13,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
add    $0x1,%r12
cmp    $0x16,%r15
je     12d5 <showAsBoard+0x1b5>
mov    %r12,%rbx
cmp    $0x2,%r15
jb     1150 <showAsBoard+0x30>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
jne    12c0 <showAsBoard+0x1a0>
jmp    1150 <showAsBoard+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [4 x i8] c"%2d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @showAsBoard(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
br label %5
5: ; preds = %37, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 22
br i1 %7, label %8, label %40
8: ; preds = %5
store i32 1, i32* %4
br label %9
9: ; preds = %15, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %9
18: ; preds = %9
store i32 1, i32* %4
br label %19
19: ; preds = %32, %18
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 22
br i1 %21, label %22, label %35
22: ; preds = %19
%23 = load i32*, i32** %2
%24 = load i32, i32* %3
%25 = mul nsw i32 %24, 23
%26 = load i32, i32* %4
%27 = add nsw i32 %25, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %23, i64 %28
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %22
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %19
35: ; preds = %19
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
store i32 %39, i32* %3
br label %5
40: ; preds = %5
ret void
}

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