#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 pow2(int, int);
int getwallbit(int wall) {
  const int tarr[] = {0, 2, 0, 3, 4, 7, 8};
  return (tarr[wall] * pow2(2, 12) +
          3 * (pow2(2, 10) + pow2(2, 8) + pow2(2, 6) + 16 + 4 + 1));
}


x86 assembly (clang, -O0):
<getwallbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed6(%rip),%eax
mov    %eax,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x30(%rbp)
mov    $0x2,%edi
mov    $0xc,%esi
call   1030 <pow2@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <pow2@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x2,%edi
mov    $0x8,%esi
call   1030 <pow2@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    $0x2,%edi
mov    $0x6,%esi
call   1030 <pow2@plt>
mov    -0x28(%rbp),%ecx
mov    %eax,%edx
mov    -0x24(%rbp),%eax
add    %edx,%ecx
add    $0x10,%ecx
add    $0x4,%ecx
add    $0x1,%ecx
imul   $0x3,%ecx,%ecx
add    %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getwallbit>:
push   %rbp
push   %r14
push   %rbx
movslq %edi,%rbp
lea    0xee2(%rip),%r14
mov    $0x2,%edi
mov    $0xc,%esi
call   1030 <pow2@plt>
mov    %eax,%ebx
imul   (%r14,%rbp,4),%ebx
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <pow2@plt>
mov    %eax,%r14d
mov    $0x2,%edi
mov    $0x8,%esi
call   1030 <pow2@plt>
mov    %eax,%ebp
add    %r14d,%ebp
mov    $0x2,%edi
mov    $0x6,%esi
call   1030 <pow2@plt>
add    %ebp,%eax
lea    (%rax,%rax,2),%eax
add    %ebx,%eax
add    $0x3f,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.getwallbit.tarr = [7 x i32] [i32 0, i32 2, i32 0, i32 3, i32 4, i32 7, i32 8]
define i32 @getwallbit(i32 %0) {
%2 = alloca i32
%3 = alloca [7 x i32]
store i32 %0, i32* %2
%4 = bitcast [7 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = call i32 @pow2(i32 2, i32 12)
%10 = mul nsw i32 %8, %9
%11 = call i32 @pow2(i32 2, i32 10)
%12 = call i32 @pow2(i32 2, i32 8)
%13 = add nsw i32 %11, %12
%14 = call i32 @pow2(i32 2, i32 6)
%15 = add nsw i32 %13, %14
%16 = add nsw i32 %15, 16
%17 = add nsw i32 %16, 4
%18 = add nsw i32 %17, 1
%19 = mul nsw i32 3, %18
%20 = add nsw i32 %10, %19
ret i32 %20
}

LLVM IR (-O2):
@__const.getwallbit.tarr = [7 x i32] [i32 0, i32 2, i32 0, i32 3, i32 4, i32 7, i32 8]
define i32 @getwallbit(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [7 x i32], [7 x i32]* @__const.getwallbit.tarr, i64 0, i64 %2
%4 = load i32, i32* %3
%5 = tail call i32 @pow2(i32 2, i32 12)
%6 = mul nsw i32 %5, %4
%7 = tail call i32 @pow2(i32 2, i32 10)
%8 = tail call i32 @pow2(i32 2, i32 8)
%9 = add nsw i32 %8, %7
%10 = tail call i32 @pow2(i32 2, i32 6)
%11 = add nsw i32 %9, %10
%12 = mul i32 %11, 3
%13 = add i32 %6, 63
%14 = add i32 %13, %12
ret i32 %14
}