#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);
int /*<<< orphan*/ putchar(char);
void print_table2(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));
      printf("%d ", (color_table & p) == p);
    }
    putchar('\n');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_table2>:
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     11bb <print_table2+0x9b>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11a3 <print_table2+0x83>
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
and    -0x20(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114c <print_table2+0x2c>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <print_table2+0x19>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_table2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,0x8(%rsp)
mov    %edx,0x4(%rsp)
test   %edx,%edx
jle    11be <print_table2+0x9e>
mov    %rdi,%rbp
mov    0x8(%rsp),%rax
lea    0x2(%rax),%ecx
mov    %ecx,(%rsp)
lea    0x1(%rax),%ecx
lea    0x3(%rax),%r13d
add    $0xffffffffffffffff,%rcx
mov    %rcx,0x10(%rsp)
mov    $0x1,%r14d
lea    0xe96(%rip),%rbx
jmp    118c <print_table2+0x6c>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%eax
add    (%rsp),%r13d
cmp    0x4(%rsp),%r14d
mov    %eax,%r14d
je     11be <print_table2+0x9e>
cmpl   $0x0,0x8(%rsp)
jle    1170 <print_table2+0x50>
mov    0x10(%rsp),%r12
mov    %r13d,%r15d
nopl   0x0(%rax,%rax,1)
xor    %esi,%esi
bt     %r15,%rbp
setb   %sil
mov    %rbx,%rdi
call   1040 <printf@plt>
add    $0x1,%r15d
add    $0xffffffffffffffff,%r12
jne    11a0 <print_table2+0x80>
jmp    1170 <print_table2+0x50>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @print_table2(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 = %40, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %43
14: ; preds = %10
store i32 1, i32* %8
br label %15
15: ; preds = %35, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %5
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %38
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 = load i64, i64* %9
%30 = and i64 %28, %29
%31 = load i64, i64* %9
%32 = icmp eq i64 %30, %31
%33 = zext i1 %32 to i32
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %19
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
store i32 %37, i32* %8
br label %15
38: ; preds = %15
%39 = call i32 @putchar(i8 signext 10)
br label %40
40: ; preds = %38
%41 = load i32, i32* %7
%42 = add nsw i32 %41, 1
store i32 %42, i32* %7
br label %10
43: ; preds = %10
%44 = call i32 @putchar(i8 signext 10)
ret void
}

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