#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*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void print_table(const unsigned long long *color_table, const int width,
                 const int hight) {
  int i, j;
  for (i = 1; i <= hight; i++) {
    for (j = 1; j <= width; j++) {
      unsigned long long p = (1L << ((width + 2) * i + j));
      if ((color_table[0] & p) == p)
        printf("G ");
      else if ((color_table[1] & p) == p)
        printf("Y ");
      else
        printf("? ");
    }
    putchar('\n');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11fe <print_table+0xde>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11e6 <print_table+0xc6>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
imul   -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    -0x20(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    119b <print_table+0x7b>
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
jmp    11d3 <print_table+0xb3>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
and    -0x20(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    11c2 <print_table+0xa2>
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
jmp    11ce <print_table+0xae>
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
jmp    11d3 <print_table+0xb3>
jmp    11d8 <print_table+0xb8>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114c <print_table+0x2c>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <print_table+0x19>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_table>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,0x10(%rsp)
mov    %edx,0xc(%rsp)
test   %edx,%edx
jle    11fd <print_table+0xdd>
mov    %rdi,%rbp
mov    0x10(%rsp),%rax
lea    0x2(%rax),%ecx
mov    %ecx,0x8(%rsp)
lea    0x1(%rax),%ecx
lea    0x3(%rax),%r13d
add    $0xffffffffffffffff,%rcx
mov    %rcx,0x18(%rsp)
mov    $0x1,%eax
lea    0xe96(%rip),%r12
lea    0xe92(%rip),%r15
jmp    119d <print_table+0x7d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x20(%rsp),%rcx
lea    0x1(%rcx),%eax
add    0x8(%rsp),%r13d
cmp    0xc(%rsp),%ecx
je     11fd <print_table+0xdd>
mov    %rax,0x20(%rsp)
cmpl   $0x0,0x10(%rsp)
jle    1180 <print_table+0x60>
mov    0x18(%rsp),%r14
mov    %r13d,%ebx
jmp    11ce <print_table+0xae>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1040 <printf@plt>
add    $0x1,%ebx
add    $0xffffffffffffffff,%r14
je     1180 <print_table+0x60>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%rax
mov    0x0(%rbp),%rcx
bt     %rbx,%rcx
mov    %r12,%rdi
jb     11c0 <print_table+0xa0>
mov    0x8(%rbp),%rcx
not    %rcx
mov    %r15,%rdi
test   %rcx,%rax
je     11c0 <print_table+0xa0>
lea    0xe0b(%rip),%rdi
jmp    11c0 <print_table+0xa0>
mov    $0xa,%edi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"G \00"
@.str.1 = [3 x i8] c"Y \00"
@.str.2 = [3 x i8] c"? \00"
define void @print_table(i64* %0, i32 %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i64* %0, i64** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 1, i32* %7
br label %10
10: ; preds = %56, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %59
14: ; preds = %10
store i32 1, i32* %8
br label %15
15: ; preds = %51, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %5
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %54
19: ; preds = %15
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 2
%22 = load i32, i32* %7
%23 = mul nsw i32 %21, %22
%24 = load i32, i32* %8
%25 = add nsw i32 %23, %24
%26 = zext i32 %25 to i64
%27 = shl i64 1, %26
store i64 %27, i64* %9
%28 = load i64*, i64** %4
%29 = getelementptr inbounds i64, i64* %28, i64 0
%30 = load i64, i64* %29
%31 = load i64, i64* %9
%32 = and i64 %30, %31
%33 = load i64, i64* %9
%34 = icmp eq i64 %32, %33
br i1 %34, label %35, label %37
35: ; preds = %19
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %50
37: ; preds = %19
%38 = load i64*, i64** %4
%39 = getelementptr inbounds i64, i64* %38, i64 1
%40 = load i64, i64* %39
%41 = load i64, i64* %9
%42 = and i64 %40, %41
%43 = load i64, i64* %9
%44 = icmp eq i64 %42, %43
br i1 %44, label %45, label %47
45: ; preds = %37
%46 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %49
47: ; preds = %37
%48 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %49
49: ; preds = %47, %45
br label %50
50: ; preds = %49, %35
br label %51
51: ; preds = %50
%52 = load i32, i32* %8
%53 = add nsw i32 %52, 1
store i32 %53, i32* %8
br label %15
54: ; preds = %15
%55 = call i32 @putchar(i8 signext 10)
br label %56
56: ; preds = %54
%57 = load i32, i32* %7
%58 = add nsw i32 %57, 1
store i32 %58, i32* %7
br label %10
59: ; preds = %10
%60 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"G \00"
@.str.1 = [3 x i8] c"Y \00"
@.str.2 = [3 x i8] c"? \00"
define void @print_table(i64* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 1
br i1 %4, label %38, label %5
5: ; preds = %3
%6 = icmp slt i32 %1, 1
%7 = add nsw i32 %1, 2
%8 = getelementptr inbounds i64, i64* %0, i64 1
%9 = add i32 %1, 1
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %5, %34
%12 = phi i32 [ 1, %5 ], [ %36, %34 ]
br i1 %6, label %34, label %13
13: ; preds = %11
%14 = mul nsw i32 %12, %7
br label %15
15: ; preds = %13, %29
%16 = phi i64 [ 1, %13 ], [ %32, %29 ]
%17 = trunc i64 %16 to i32
%18 = add nsw i32 %14, %17
%19 = zext i32 %18 to i64
%20 = shl nuw i64 1, %19
%21 = load i64, i64* %0
%22 = and i64 %21, %20
%23 = icmp eq i64 %22, %20
br i1 %23, label %29, label %24
24: ; preds = %15
%25 = load i64, i64* %8
%26 = and i64 %25, %20
%27 = icmp eq i64 %26, %20
%28 = select i1 %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
br label %29
29: ; preds = %24, %15
%30 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %15 ], [ %28, %24 ]
%31 = tail call i32 @printf(i8* dereferenceable(1) %30)
%32 = add nuw nsw i64 %16, 1
%33 = icmp eq i64 %32, %10
br i1 %33, label %34, label %15
34: ; preds = %29, %11
%35 = tail call i32 @putchar(i8 signext 10)
%36 = add nuw i32 %12, 1
%37 = icmp eq i32 %12, %2
br i1 %37, label %38, label %11
38: ; preds = %34, %3
%39 = tail call i32 @putchar(i8 signext 10)
ret void
}