#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 uint32_t;

/* Variables and functions */
int /*<<< orphan*/ get_frame(int *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  uint32_t frame[32];
  get_frame(frame, 0);
  int i, j;
  for (i = 0; i < 32; i++) {
    for (j = 0; j < 32; j++) {
      if ((frame[i] >> j) & 1)
        printf("#");
      else
        printf(" ");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
call   1040 <get_frame@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x20,-0x94(%rbp)
jge    11e6 <main+0xc6>
movl   $0x0,-0x98(%rbp)
cmpl   $0x20,-0x98(%rbp)
jge    11c6 <main+0xa6>
movslq -0x94(%rbp),%rax
mov    -0x90(%rbp,%rax,4),%eax
mov    -0x98(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11a1 <main+0x81>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
jmp    11ad <main+0x8d>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
jmp    11b2 <main+0x92>
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    1161 <main+0x41>
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    114a <main+0x2a>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x88,%rsp
mov    %rsp,%rdi
xor    %ebx,%ebx
xor    %esi,%esi
call   1040 <get_frame@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rsp,%rbx,4),%eax
xor    %ecx,%ecx
bt     %ebp,%eax
setb   %cl
lea    (%rcx,%rcx,2),%edi
or     $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x20,%ebp
jne    1150 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"#\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 0
%6 = call i32 @get_frame(i32* %5, i32 0)
store i32 0, i32* %3
br label %7
7: ; preds = %33, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 32
br i1 %9, label %10, label %36
10: ; preds = %7
store i32 0, i32* %4
br label %11
11: ; preds = %28, %10
%12 = load i32, i32* %4
%13 = icmp slt i32 %12, 32
br i1 %13, label %14, label %31
14: ; preds = %11
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [32 x i32], [32 x i32]* %2, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %4
%20 = ashr i32 %18, %19
%21 = and i32 %20, 1
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %14
%24 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %27
25: ; preds = %14
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
br label %28
28: ; preds = %27
%29 = load i32, i32* %4
%30 = add nsw i32 %29, 1
store i32 %30, i32* %4
br label %11
31: ; preds = %11
%32 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %7
36: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [32 x i32]
%2 = bitcast [32 x i32]* %1 to i8*
%3 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%4 = call i32 @get_frame(i32* %3, i32 0)
br label %5
5: ; preds = %0, %18
%6 = phi i64 [ 0, %0 ], [ %20, %18 ]
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 %6
br label %8
8: ; preds = %5, %8
%9 = phi i32 [ 0, %5 ], [ %16, %8 ]
%10 = load i32, i32* %7
%11 = shl nuw i32 1, %9
%12 = and i32 %10, %11
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 32, i32 35
%15 = call i32 @putchar(i32 %14)
%16 = add nuw nsw i32 %9, 1
%17 = icmp eq i32 %16, 32
br i1 %17, label %18, label %8
18: ; preds = %8
%19 = call i32 @putchar(i32 10)
%20 = add nuw nsw i64 %6, 1
%21 = icmp eq i64 %20, 32
br i1 %21, label %22, label %5
22: ; preds = %18
ret i32 0
}