#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 init(int n, int *arr) {
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      printf(" %c ", arr[i * n + j]);
      while (j != n - 1) {
        printf("|");
        break;
      }
    }
    printf("\n");
    while (i != n - 1) {
      for (j = 0; j < n; j++) {
        printf("----");
      }
      break;
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<init>:
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    1208 <init+0xf8>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1199 <init+0x89>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1186 <init+0x76>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118b <init+0x7b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1139 <init+0x29>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     11ec <init+0xdc>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11e7 <init+0xd7>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11bf <init+0xaf>
jmp    11ec <init+0xdc>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <init+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
test   %edi,%edi
jle    1204 <init+0xe4>
mov    %rsi,%rbx
mov    0x8(%rsp),%rax
lea    -0x1(%rax),%r13d
mov    %eax,%r14d
lea    0x0(,%r14,4),%rax
mov    %rax,0x10(%rsp)
lea    0xea2(%rip),%r15
lea    0xea0(%rip),%r12
xor    %eax,%eax
mov    %rax,(%rsp)
jmp    1193 <init+0x73>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rsp),%rcx
add    $0x1,%rcx
add    0x10(%rsp),%rbx
mov    %rcx,%rax
mov    %rcx,(%rsp)
cmp    %r14,%rcx
je     1204 <init+0xe4>
mov    %r12,%rbp
xor    %r12d,%r12d
jmp    11a9 <init+0x89>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %r12,%r14
je     11d0 <init+0xb0>
mov    (%rbx,%r12,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %r12,%r13
je     11a0 <init+0x80>
mov    $0x7c,%edi
call   1030 <putchar@plt>
jmp    11a0 <init+0x80>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    %r13,(%rsp)
mov    %rbp,%r12
je     1170 <init+0x50>
mov    0x8(%rsp),%rax
mov    %eax,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    11f0 <init+0xd0>
jmp    1170 <init+0x50>
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 = [2 x i8] c"|\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [5 x i8] c"----\00"
define void @init(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %7
7: ; preds = %58, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %61
11: ; preds = %7
store i32 0, i32* %6
br label %12
12: ; preds = %35, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %3
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %38
16: ; preds = %12
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %3
%20 = mul nsw i32 %18, %19
%21 = load i32, i32* %6
%22 = add nsw i32 %20, %21
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %17, i64 %23
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %16
%28 = load i32, i32* %6
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 1
%31 = icmp ne i32 %28, %30
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %32, %27
br label %35
35: ; preds = %34
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %12
38: ; preds = %12
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38
%41 = load i32, i32* %5
%42 = load i32, i32* %3
%43 = sub nsw i32 %42, 1
%44 = icmp ne i32 %41, %43
br i1 %44, label %45, label %56
45: ; preds = %40
store i32 0, i32* %6
br label %46
46: ; preds = %52, %45
%47 = load i32, i32* %6
%48 = load i32, i32* %3
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %55
50: ; preds = %46
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %52
52: ; preds = %50
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
br label %46
55: ; preds = %46
br label %56
56: ; preds = %55, %40
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %58
58: ; preds = %56
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 1
store i32 %60, i32* %5
br label %7
61: ; preds = %7
ret void
}

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