#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*/ graph(int, int, int);
int /*<<< orphan*/ print_2d_array(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *);
int main() {
  int width = 65;
  int height = 20;
  int power;
  printf("Enter an integer power: ");
  if (scanf("%d", &power)) {
    print_2d_array(graph(width, height, power), width, height);
    return 0;
  }
  printf("There was an error\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x41,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%rax
je     11aa <main+0x6a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1060 <graph@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <print_2d_array@plt>
movl   $0x0,-0x4(%rbp)
jmp    11bd <main+0x7d>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
test   %rax,%rax
je     119b <main+0x4b>
mov    0x4(%rsp),%edx
mov    $0x41,%edi
mov    $0x14,%esi
call   1070 <graph@plt>
mov    %eax,%edi
mov    $0x41,%esi
mov    $0x14,%edx
call   1050 <print_2d_array@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter an integer power: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"There was an error\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 65, i32* %2
store i32 20, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %0
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @graph(i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @print_2d_array(i32 %12, i32 %13, i32 %14)
store i32 0, i32* %1
br label %18
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %18
18: ; preds = %16, %8
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter an integer power: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [19 x i8] c"There was an error\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %0
%7 = load i32, i32* %1
%8 = call i32 @graph(i32 65, i32 20, i32 %7)
%9 = call i32 @print_2d_array(i32 %8, i32 65, i32 20)
br label %12
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ 0, %6 ], [ 1, %10 ]
ret i32 %13
}