#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void show(void *u, int w, int h) {
  int(*univ)[w] = u;
  for (int x = 0; x < w; x++)
    printf("-");
  printf("\n");
  for (int y = 0; y < h; y++) {
    for (int x = 0; x < w; x++)
      printf(univ[y][x] ? "[]" : "  ");
    printf("\n");
  }
  for (int x = 0; x < w; x++)
    printf("-");
  printf("\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116e <show+0x4e>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1148 <show+0x28>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1200 <show+0xe0>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e6 <show+0xc6>
mov    -0x30(%rbp),%rdx
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xe42(%rip),%rdi
lea    0xe38(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1194 <show+0x74>
lea    0xe15(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1181 <show+0x61>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    122d <show+0x10d>
lea    0xde6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1207 <show+0xe7>
lea    0xdce(%rip),%rdi
call   1030 <printf@plt>
mov    0x2da0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
test   %esi,%esi
jle    115f <show+0x2f>
mov    %r15d,%ebp
xchg   %ax,%ax
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1150 <show+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r14d,%r14d
jle    11ed <show+0xbd>
mov    %r15d,%ebp
mov    %r14d,%eax
mov    %rax,0x10(%rsp)
lea    0x0(,%rbp,4),%rax
mov    %rax,0x8(%rsp)
xor    %r13d,%r13d
lea    0xe73(%rip),%r14
lea    0xe69(%rip),%r12
mov    %r15d,0x4(%rsp)
jmp    11bf <show+0x8f>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r13
add    0x8(%rsp),%rbx
cmp    0x10(%rsp),%r13
mov    0x4(%rsp),%r15d
je     11ed <show+0xbd>
test   %r15d,%r15d
jle    11a0 <show+0x70>
xor    %r15d,%r15d
jmp    11de <show+0xae>
nopl   0x0(%rax)
call   1040 <printf@plt>
add    $0x1,%r15
cmp    %r15,%rbp
je     11a0 <show+0x70>
cmpl   $0x0,(%rbx,%r15,4)
mov    %r14,%rdi
je     11d0 <show+0xa0>
mov    %r12,%rdi
jmp    11d0 <show+0xa0>
test   %r15d,%r15d
jle    1210 <show+0xe0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r15d
jne    1200 <show+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fflush@plt>

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

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