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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int strtoull(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  uint64_t brd = strtoull(argv[1], NULL, 0);
  char row;
  int i, j;
  for (i = 7; i >= 0; i--) {
    row = (brd >> (i * 8)) & 0xFF;
    for (j = 0; j < 8; j++) {
      char square;
      square = ((row >> j) & 0x1) ? '#' : '.';
      printf("%c ", square);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoull@plt>
mov    %eax,-0x14(%rbp)
movl   $0x7,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     11dc <main+0xbc>
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %al,-0x15(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x8,-0x20(%rbp)
jge    11c0 <main+0xa0>
movsbl -0x15(%rbp),%edx
mov    -0x20(%rbp),%ecx
sar    %cl,%edx
and    $0x1,%edx
mov    $0x2e,%eax
mov    $0x23,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1177 <main+0x57>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1153 <main+0x33>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <strtoull@plt>
mov    %eax,%r14d
mov    $0x38,%ebp
lea    0xecc(%rip),%r12
jmp    1183 <main+0x53>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xfffffff8,%ebp
cmp    $0xfffffff8,%ebp
je     1288 <main+0x158>
mov    %r14d,%eax
mov    %ebp,%ecx
sar    %cl,%eax
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,%xmm1
pand   0xe61(%rip),%xmm1
pand   0xe69(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ebx
mov    $0x2e,%r15d
mov    $0x2e,%esi
test   $0x80,%bl
jne    11d4 <main+0xa4>
mov    $0x23,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2e,%esi
test   $0x40,%bl
jne    11ed <main+0xbd>
mov    $0x23,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2e,%esi
test   $0x20,%bl
jne    1206 <main+0xd6>
mov    $0x23,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2e,%esi
test   $0x10,%bl
jne    121f <main+0xef>
mov    $0x23,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2e,%esi
test   $0x8,%bl
jne    1238 <main+0x108>
mov    $0x23,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2e,%esi
test   $0x4,%bl
jne    1251 <main+0x121>
mov    $0x23,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2e,%esi
test   $0x2,%bl
jne    126a <main+0x13a>
mov    $0x23,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x1,%bl
jne    1160 <main+0x30>
mov    $0x23,%r15d
jmp    1160 <main+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strtoull(i8* %13, i32* null, i32 0)
store i32 %14, i32* %6
store i32 7, i32* %8
br label %15
15: ; preds = %46, %2
%16 = load i32, i32* %8
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %49
18: ; preds = %15
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = mul nsw i32 %20, 8
%22 = ashr i32 %19, %21
%23 = and i32 %22, 255
%24 = trunc i32 %23 to i8
store i8 %24, i8* %7
store i32 0, i32* %9
br label %25
25: ; preds = %41, %18
%26 = load i32, i32* %9
%27 = icmp slt i32 %26, 8
br i1 %27, label %28, label %44
28: ; preds = %25
%29 = load i8, i8* %7
%30 = sext i8 %29 to i32
%31 = load i32, i32* %9
%32 = ashr i32 %30, %31
%33 = and i32 %32, 1
%34 = icmp ne i32 %33, 0
%35 = zext i1 %34 to i64
%36 = select i1 %34, i32 35, i32 46
%37 = trunc i32 %36 to i8
store i8 %37, i8* %10
%38 = load i8, i8* %10
%39 = sext i8 %38 to i32
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %28
%42 = load i32, i32* %9
%43 = add nsw i32 %42, 1
store i32 %43, i32* %9
br label %25
44: ; preds = %25
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %46
46: ; preds = %44
%47 = load i32, i32* %8
%48 = add nsw i32 %47, -1
store i32 %48, i32* %8
br label %15
49: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strtoull(i8* nocapture %4, i32* null, i32 0)
br label %6
6: ; preds = %2, %6
%7 = phi i32 [ 7, %2 ], [ %39, %6 ]
%8 = shl nsw i32 %7, 3
%9 = ashr i32 %5, %8
%10 = insertelement <8 x i32> poison, i32 %9, i64 0
%11 = shufflevector <8 x i32> %10, <8 x i32> poison, <8 x i32> zeroinitializer
%12 = and <8 x i32> %11, <i32 128, i32 64, i32 32, i32 16, i32 8, i32 4, i32 2, i32 1>
%13 = icmp eq <8 x i32> %12, zeroinitializer
%14 = extractelement <8 x i1> %13, i64 7
%15 = select i1 %14, i32 46, i32 35
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = extractelement <8 x i1> %13, i64 6
%18 = select i1 %17, i32 46, i32 35
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = extractelement <8 x i1> %13, i64 5
%21 = select i1 %20, i32 46, i32 35
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = extractelement <8 x i1> %13, i64 4
%24 = select i1 %23, i32 46, i32 35
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = extractelement <8 x i1> %13, i64 3
%27 = select i1 %26, i32 46, i32 35
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = extractelement <8 x i1> %13, i64 2
%30 = select i1 %29, i32 46, i32 35
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = extractelement <8 x i1> %13, i64 1
%33 = select i1 %32, i32 46, i32 35
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = extractelement <8 x i1> %13, i64 0
%36 = select i1 %35, i32 46, i32 35
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = tail call i32 @putchar(i32 10)
%39 = add nsw i32 %7, -1
%40 = icmp eq i32 %7, 0
br i1 %40, label %41, label %6
41: ; preds = %6
ret i32 0
}