#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void show(int (*arr)[22], int row, int col, FILE *fp) {
  int i = 0, j = 0;
  char c = 0;
  for (i = 0; i < row; ++i) {
    for (j = 0; j < col; ++j) {
      c = (arr[i][j] != 0) ? '*' : ' ';
      fputc(c, fp);
    }
    fputc('\n', fp);
  }
}


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    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movb   $0x0,-0x21(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c0 <show+0xb0>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11a4 <show+0x94>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x58,%rcx,%rcx
add    %rcx,%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    $0x20,%eax
mov    $0x2a,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
mov    -0x18(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1152 <show+0x42>
mov    -0x18(%rbp),%rsi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <show+0x2f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,0x4(%rsp)
test   %esi,%esi
jle    1195 <show+0x85>
mov    %rcx,%r12
mov    %rdi,%rbp
mov    %esi,%r15d
mov    0x4(%rsp),%ebx
xor    %r13d,%r13d
jmp    115a <show+0x4a>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
mov    %r12,%rsi
call   1030 <fputc@plt>
add    $0x1,%r13
add    $0x58,%rbp
cmp    %r15,%r13
je     1195 <show+0x85>
cmpl   $0x0,0x4(%rsp)
jle    1140 <show+0x30>
xor    %r14d,%r14d
jmp    1181 <show+0x71>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rsi
call   1030 <fputc@plt>
add    $0x1,%r14
cmp    %r14,%rbx
je     1140 <show+0x30>
cmpl   $0x0,0x0(%rbp,%r14,4)
mov    $0x20,%edi
je     1170 <show+0x60>
mov    $0x2a,%edi
jmp    1170 <show+0x60>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @show([22 x i32]* %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca [22 x i32]*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
store [22 x i32]* %0, [22 x i32]** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
store i32 0, i32* %9
store i32 0, i32* %10
store i8 0, i8* %11
store i32 0, i32* %9
br label %12
12: ; preds = %43, %4
%13 = load i32, i32* %9
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %46
16: ; preds = %12
store i32 0, i32* %10
br label %17
17: ; preds = %37, %16
%18 = load i32, i32* %10
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %40
21: ; preds = %17
%22 = load [22 x i32]*, [22 x i32]** %5
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [22 x i32], [22 x i32]* %22, i64 %24
%26 = load i32, i32* %10
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [22 x i32], [22 x i32]* %25, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = icmp ne i32 %29, 0
%31 = zext i1 %30 to i64
%32 = select i1 %30, i32 42, i32 32
%33 = trunc i32 %32 to i8
store i8 %33, i8* %11
%34 = load i8, i8* %11
%35 = load i32*, i32** %8
%36 = call i32 @fputc(i8 signext %34, i32* %35)
br label %37
37: ; preds = %21
%38 = load i32, i32* %10
%39 = add nsw i32 %38, 1
store i32 %39, i32* %10
br label %17
40: ; preds = %17
%41 = load i32*, i32** %8
%42 = call i32 @fputc(i8 signext 10, i32* %41)
br label %43
43: ; preds = %40
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
store i32 %45, i32* %9
br label %12
46: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @show([22 x i32]* nocapture %0, i32 %1, i32 %2, i32* nocapture %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %25
6: ; preds = %4
%7 = icmp sgt i32 %2, 0
%8 = zext i32 %1 to i64
%9 = zext i32 %2 to i64
br label %10
10: ; preds = %6, %21
%11 = phi i64 [ 0, %6 ], [ %23, %21 ]
br i1 %7, label %12, label %21
12: ; preds = %10, %12
%13 = phi i64 [ %19, %12 ], [ 0, %10 ]
%14 = getelementptr inbounds [22 x i32], [22 x i32]* %0, i64 %11, i64 %13
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
%17 = select i1 %16, i8 32, i8 42
%18 = tail call i32 @fputc(i8 signext %17, i32* %3)
%19 = add nuw nsw i64 %13, 1
%20 = icmp eq i64 %19, %9
br i1 %20, label %21, label %12
21: ; preds = %12, %10
%22 = tail call i32 @fputc(i8 signext 10, i32* %3)
%23 = add nuw nsw i64 %11, 1
%24 = icmp eq i64 %23, %8
br i1 %24, label %25, label %10
25: ; preds = %21, %4
ret void
}