#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 *, ...);
scalar_t__ putchar(char);
int val(int);
void show(int n, int *A) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; (j < n && (!j || putchar('|'))) || putchar('\n'); j++)
      printf(" %c ", val(A[i * n + j]));
    for (int j = 0; j < n || !putchar('\n'); j++)
      printf("----");
  }
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1258 <show+0x128>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1190 <show+0x60>
mov    $0x1,%al
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x1d(%rbp)
je     11a4 <show+0x74>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1d(%rbp)
jne    11a4 <show+0x74>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    11b4 <show+0x84>
jmp    11eb <show+0xbb>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <val@plt>
mov    %eax,%esi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1159 <show+0x29>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0x1e(%rbp)
jl     1219 <show+0xe9>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    1229 <show+0xf9>
jmp    1245 <show+0x115>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11f2 <show+0xc2>
jmp    124a <show+0x11a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <show+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %edi,%edi
jle    121a <show+0xea>
mov    %rsi,%r14
mov    %edi,%ebp
mov    %edi,%r12d
lea    0x0(,%r12,4),%rax
mov    %rax,0x8(%rsp)
lea    0xe9e(%rip),%rbx
lea    0xe9c(%rip),%r15
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    %rax,0x10(%rsp)
xor    %r13d,%r13d
jmp    11a8 <show+0x78>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %rax,%rax
je     11d0 <show+0xa0>
mov    (%r14,%r13,4),%edi
call   1050 <val@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r13
cmp    %r12,%r13
jge    1180 <show+0x50>
test   %r13,%r13
je     118f <show+0x5f>
mov    $0x7c,%edi
call   1030 <putchar@plt>
test   %rax,%rax
jne    118f <show+0x5f>
jmp    1180 <show+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%r13
xor    %ebx,%ebx
jmp    11ed <show+0xbd>
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    %ebp,%ebx
jl     11e0 <show+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %rax,%rax
je     11e0 <show+0xb0>
mov    0x10(%rsp),%rax
add    $0x1,%rax
add    0x8(%rsp),%r14
cmp    %r12,%rax
mov    %r13,%rbx
jne    1170 <show+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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