#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 */
scalar_t__ log10(int);
scalar_t__ pow(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void showstatus(int *origin, long score) {
  int i;
  int j;
  int result;
  int *status;
  status = origin;
  for (i = 0; i <= 15; i++) {
    if (i % 4 == 0) {
      printf("#####################\n#    #    #    #    #\n#    #    #    #   "
             " #\n");
      printf("#");
    }
    result = (int)pow(2, *(status++));
    for (j = 0; j < 3 - (int)log10(result); j++) {
      printf(" ");
    }
    if (result != 1)
      printf("%i#", result);
    else
      printf(" #");
    if (i % 4 == 3) {
      printf("\n#    #    #    #    #\n");
    }
    if (i == 15)
      printf("#####################\n");
  }
  printf("Current Score:%ld\n", score);
}


x86 assembly (clang, -O0):
<showstatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xf,-0x14(%rbp)
jg     126a <showstatus+0x13a>
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1189 <showstatus+0x59>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <log10@plt>
mov    %rax,%rcx
mov    -0x2c(%rbp),%eax
mov    %ecx,%edx
mov    $0x3,%ecx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    11ef <showstatus+0xbf>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ae <showstatus+0x7e>
cmpl   $0x1,-0x1c(%rbp)
je     120f <showstatus+0xdf>
mov    -0x1c(%rbp),%esi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121d <showstatus+0xed>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x3,%edx
jne    123f <showstatus+0x10f>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xf,-0x14(%rbp)
jne    1257 <showstatus+0x127>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    125c <showstatus+0x12c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114f <showstatus+0x1f>
mov    -0x10(%rbp),%rsi
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showstatus>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,(%rsp)
mov    %rdi,%rbx
lea    0xe97(%rip),%rbp
xor    %r15d,%r15d
jmp    1185 <showstatus+0x35>
xchg   %ax,%ax
add    $0x4,%rbx
lea    0x1(%r15),%eax
cmp    $0xf,%r15d
mov    %eax,%r15d
je     1248 <showstatus+0xf8>
mov    %r15d,%r12d
and    $0x3,%r12d
jne    11a4 <showstatus+0x54>
lea    0xe98(%rip),%rdi
call   1040 <puts@plt>
mov    $0x23,%edi
call   1030 <putchar@plt>
mov    (%rbx),%esi
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %rax,%r14
mov    %r14d,%edi
call   1070 <log10@plt>
cmp    $0x2,%eax
jg     11f2 <showstatus+0xa2>
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%r13d
mov    %r14d,%edi
call   1070 <log10@plt>
mov    $0x3,%ecx
sub    %eax,%ecx
cmp    %ecx,%r13d
jl     11d0 <showstatus+0x80>
cmp    $0x1,%r14d
jne    1220 <showstatus+0xd0>
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x3,%r12d
jne    1170 <showstatus+0x20>
jmp    1237 <showstatus+0xe7>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x3,%r12d
jne    1170 <showstatus+0x20>
lea    0xe1a(%rip),%rdi
call   1040 <puts@plt>
jmp    1170 <showstatus+0x20>
lea    0xdc8(%rip),%rdi
call   1040 <puts@plt>
lea    0xda9(%rip),%rdi
mov    (%rsp),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"#####################\0A# # # # #\0A# # # # #\0A\00"
@.str.1 = [2 x i8] c"#\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [4 x i8] c"%i#\00"
@.str.4 = [3 x i8] c" #\00"
@.str.5 = [24 x i8] c"\0A# # # # #\0A\00"
@.str.6 = [23 x i8] c"#####################\0A\00"
@.str.7 = [19 x i8] c"Current Score:%ld\0A\00"
define void @showstatus(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32* %0, i32** %3
store i64 %1, i64* %4
%9 = load i32*, i32** %3
store i32* %9, i32** %8
store i32 0, i32* %5
br label %10
10: ; preds = %58, %2
%11 = load i32, i32* %5
%12 = icmp sle i32 %11, 15
br i1 %12, label %13, label %61
13: ; preds = %10
%14 = load i32, i32* %5
%15 = srem i32 %14, 4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %17, %13
%21 = load i32*, i32** %8
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %8
%23 = load i32, i32* %21
%24 = call i64 @pow(i32 2, i32 %23)
%25 = trunc i64 %24 to i32
store i32 %25, i32* %7
store i32 0, i32* %6
br label %26
26: ; preds = %35, %20
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = call i64 @log10(i32 %28)
%30 = trunc i64 %29 to i32
%31 = sub nsw i32 3, %30
%32 = icmp slt i32 %27, %31
br i1 %32, label %33, label %38
33: ; preds = %26
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %35
35: ; preds = %33
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %26
38: ; preds = %26
%39 = load i32, i32* %7
%40 = icmp ne i32 %39, 1
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i32, i32* %7
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %42)
br label %46
44: ; preds = %38
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %46
46: ; preds = %44, %41
%47 = load i32, i32* %5
%48 = srem i32 %47, 4
%49 = icmp eq i32 %48, 3
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %52
52: ; preds = %50, %46
%53 = load i32, i32* %5
%54 = icmp eq i32 %53, 15
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
br label %57
57: ; preds = %55, %52
br label %58
58: ; preds = %57
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 1
store i32 %60, i32* %5
br label %10
61: ; preds = %10
%62 = load i64, i64* %4
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i64 %62)
ret void
}

LLVM IR (-O2):
@.str.3 = [4 x i8] c"%i#\00"
@.str.4 = [3 x i8] c" #\00"
@.str.7 = [19 x i8] c"Current Score:%ld\0A\00"
@str = [22 x i8] c"#####################\00"
@str.8 = [23 x i8] c"\0A# # # # #\00"
@str.9 = [66 x i8] c"#####################\0A# # # # #\0A# # # # #\00"
define void @showstatus(i32* nocapture %0, i64 %1) {
br label %3
3: ; preds = %37, %2
%4 = phi i32* [ %0, %2 ], [ %12, %37 ]
%5 = phi i32 [ 0, %2 ], [ %39, %37 ]
%6 = and i32 %5, 3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.9, i64 0, i64 0))
%10 = tail call i32 @putchar(i32 35)
br label %11
11: ; preds = %8, %3
%12 = getelementptr inbounds i32, i32* %4, i64 1
%13 = load i32, i32* %4
%14 = tail call i64 @pow(i32 2, i32 %13)
%15 = trunc i64 %14 to i32
%16 = tail call i64 @log10(i32 %15)
%17 = trunc i64 %16 to i32
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %27
19: ; preds = %11, %19
%20 = phi i32 [ %22, %19 ], [ 0, %11 ]
%21 = tail call i32 @putchar(i32 32)
%22 = add nuw nsw i32 %20, 1
%23 = tail call i64 @log10(i32 %15)
%24 = trunc i64 %23 to i32
%25 = sub nsw i32 3, %24
%26 = icmp slt i32 %22, %25
br i1 %26, label %19, label %27
27: ; preds = %19, %11
%28 = icmp eq i32 %15, 1
br i1 %28, label %31, label %29
29: ; preds = %27
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %15)
br label %33
31: ; preds = %27
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
%34 = icmp eq i32 %6, 3
br i1 %34, label %35, label %37
35: ; preds = %33
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.8, i64 0, i64 0))
br label %37
37: ; preds = %35, %33
%38 = icmp eq i32 %5, 15
%39 = add nuw nsw i32 %5, 1
br i1 %38, label %40, label %3
40: ; preds = %37
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i64 %1)
ret void
}