#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*/ printEscapeCode(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void showUniv(int rows, int cols, int univ[][cols]) {
  int i, j;
  printEscapeCode("H");
  for (i = 0; i != rows; i++) {
    for (j = 0; j != cols; j++) {
      if (univ[i][j]) {
        printEscapeCode("07m \033[m");
      } else {
        printf(" ");
      }
    }
    printEscapeCode("E");
  }
  fflush(stdout);
}


x86 assembly (clang, -O0):
<showUniv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x20(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <printEscapeCode@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     11ea <showUniv+0xba>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     11d0 <showUniv+0xa0>
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     11b1 <showUniv+0x81>
lea    0xe5b(%rip),%rdi
call   1030 <printEscapeCode@plt>
jmp    11bd <showUniv+0x8d>
lea    0xe52(%rip),%rdi
call   1040 <printf@plt>
jmp    11c2 <showUniv+0x92>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116f <showUniv+0x3f>
lea    0xe35(%rip),%rdi
call   1030 <printEscapeCode@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115c <showUniv+0x2c>
mov    0x2def(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showUniv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %esi,0xc(%rsp)
mov    %edi,%r14d
lea    0xeb1(%rip),%rdi
call   1040 <printEscapeCode@plt>
test   %r14d,%r14d
je     11d4 <showUniv+0xa4>
mov    0xc(%rsp),%ebp
mov    %r14d,%eax
mov    %rax,0x10(%rsp)
lea    0x0(,%rbp,4),%r14
xor    %r15d,%r15d
lea    0xe8b(%rip),%r12
jmp    119a <showUniv+0x6a>
nopl   0x0(%rax)
lea    0xe83(%rip),%rdi
call   1040 <printEscapeCode@plt>
add    $0x1,%r15
add    %r14,%rbx
cmp    0x10(%rsp),%r15
je     11d4 <showUniv+0xa4>
cmpl   $0x0,0xc(%rsp)
je     1180 <showUniv+0x50>
xor    %r13d,%r13d
jmp    11c3 <showUniv+0x93>
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%r13
cmp    %r13,%rbp
je     1180 <showUniv+0x50>
cmpl   $0x0,(%rbx,%r13,4)
je     11b0 <showUniv+0x80>
mov    %r12,%rdi
call   1040 <printEscapeCode@plt>
jmp    11ba <showUniv+0x8a>
mov    0x2e05(%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"H\00"
@.str.1 = [8 x i8] c"07m \1B[m\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"E\00"
@stdout = global i32 0
define void @showUniv(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = call i32 @printEscapeCode(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %12
12: ; preds = %42, %3
%13 = load i32, i32* %7
%14 = load i32, i32* %4
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %45
16: ; preds = %12
store i32 0, i32* %8
br label %17
17: ; preds = %37, %16
%18 = load i32, i32* %8
%19 = load i32, i32* %5
%20 = icmp ne i32 %18, %19
br i1 %20, label %21, label %40
21: ; preds = %17
%22 = load i32*, i32** %6
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = mul nsw i64 %24, %10
%26 = getelementptr inbounds i32, i32* %22, i64 %25
%27 = load i32, i32* %8
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
%30 = load i32, i32* %29
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %21
%33 = call i32 @printEscapeCode(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %36
34: ; preds = %21
%35 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
br label %37
37: ; preds = %36
%38 = load i32, i32* %8
%39 = add nsw i32 %38, 1
store i32 %39, i32* %8
br label %17
40: ; preds = %17
%41 = call i32 @printEscapeCode(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %40
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %12
45: ; preds = %12
%46 = load i32, i32* @stdout
%47 = call i32 @fflush(i32 %46)
ret void
}

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