#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 *, ...);
void printCells_Binary(unsigned short int **board, int lines, int columns) {
  int i, j;
  int k;
  unsigned short a = 0x1;
  for (i = 0; i < columns; i++) {
    for (j = 0; j < lines; j++) {
      for (k = 3; k >= 0; k--) {
        a = (board[i][j] >> k) & 1;
        printf("%d", a);
      }
      printf("  ");
    }
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printCells_Binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movw   $0x1,-0x1e(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11d7 <printCells_Binary+0xc7>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11bb <printCells_Binary+0xab>
movl   $0x3,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     119f <printCells_Binary+0x8f>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x18(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
mov    -0x1c(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %ax,-0x1e(%rbp)
movzwl -0x1e(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <printCells_Binary+0x45>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1142 <printCells_Binary+0x32>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <printCells_Binary+0x1f>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCells_Binary>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
test   %edx,%edx
jle    1208 <printCells_Binary+0xe8>
mov    %rdi,%rbx
mov    %edx,%eax
mov    %rax,0x10(%rsp)
mov    0xc(%rsp),%r13d
lea    0xeb0(%rip),%rbp
lea    0xeac(%rip),%r15
xor    %r12d,%r12d
jmp    1179 <printCells_Binary+0x59>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
cmp    0x10(%rsp),%r12
je     1208 <printCells_Binary+0xe8>
cmpl   $0x0,0xc(%rsp)
jle    1160 <printCells_Binary+0x40>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx,%r12,8),%rax
movzwl (%rax,%r14,2),%esi
shr    $0x3,%esi
and    $0x1,%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx,%r12,8),%rax
movzwl (%rax,%r14,2),%esi
shr    $0x2,%esi
and    $0x1,%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx,%r12,8),%rax
movzwl (%rax,%r14,2),%esi
shr    %esi
and    $0x1,%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx,%r12,8),%rax
movzwl (%rax,%r14,2),%esi
and    $0x1,%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%r13
jne    1190 <printCells_Binary+0x70>
jmp    1160 <printCells_Binary+0x40>
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 = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c" \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @printCells_Binary(i16** %0, i32 %1, i32 %2) {
%4 = alloca i16**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i16
store i16** %0, i16*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i16 1, i16* %10
store i32 0, i32* %7
br label %11
11: ; preds = %52, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %55
15: ; preds = %11
store i32 0, i32* %8
br label %16
16: ; preds = %47, %15
%17 = load i32, i32* %8
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %50
20: ; preds = %16
store i32 3, i32* %9
br label %21
21: ; preds = %42, %20
%22 = load i32, i32* %9
%23 = icmp sge i32 %22, 0
br i1 %23, label %24, label %45
24: ; preds = %21
%25 = load i16**, i16*** %4
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i16*, i16** %25, i64 %27
%29 = load i16*, i16** %28
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i16, i16* %29, i64 %31
%33 = load i16, i16* %32
%34 = zext i16 %33 to i32
%35 = load i32, i32* %9
%36 = ashr i32 %34, %35
%37 = and i32 %36, 1
%38 = trunc i32 %37 to i16
store i16 %38, i16* %10
%39 = load i16, i16* %10
%40 = zext i16 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %24
%43 = load i32, i32* %9
%44 = add nsw i32 %43, -1
store i32 %44, i32* %9
br label %21
45: ; preds = %21
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %8
%49 = add nsw i32 %48, 1
store i32 %49, i32* %8
br label %16
50: ; preds = %16
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %52
52: ; preds = %50
%53 = load i32, i32* %7
%54 = add nsw i32 %53, 1
store i32 %54, i32* %7
br label %11
55: ; preds = %11
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c" \00"
define void @printCells_Binary(i16** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %49
5: ; preds = %3
%6 = icmp sgt i32 %1, 0
%7 = zext i32 %2 to i64
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %5, %45
%10 = phi i64 [ 0, %5 ], [ %47, %45 ]
br i1 %6, label %11, label %45
11: ; preds = %9
%12 = getelementptr inbounds i16*, i16** %0, i64 %10
br label %13
13: ; preds = %11, %13
%14 = phi i64 [ 0, %11 ], [ %43, %13 ]
%15 = load i16*, i16** %12
%16 = getelementptr inbounds i16, i16* %15, i64 %14
%17 = load i16, i16* %16
%18 = lshr i16 %17, 3
%19 = and i16 %18, 1
%20 = zext i16 %19 to i32
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i16*, i16** %12
%23 = getelementptr inbounds i16, i16* %22, i64 %14
%24 = load i16, i16* %23
%25 = lshr i16 %24, 2
%26 = and i16 %25, 1
%27 = zext i16 %26 to i32
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = load i16*, i16** %12
%30 = getelementptr inbounds i16, i16* %29, i64 %14
%31 = load i16, i16* %30
%32 = lshr i16 %31, 1
%33 = and i16 %32, 1
%34 = zext i16 %33 to i32
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = load i16*, i16** %12
%37 = getelementptr inbounds i16, i16* %36, i64 %14
%38 = load i16, i16* %37
%39 = and i16 %38, 1
%40 = zext i16 %39 to i32
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%43 = add nuw nsw i64 %14, 1
%44 = icmp eq i64 %43, %8
br i1 %44, label %45, label %13
45: ; preds = %13, %9
%46 = tail call i32 @putchar(i32 10)
%47 = add nuw nsw i64 %10, 1
%48 = icmp eq i64 %47, %7
br i1 %48, label %49, label %9
49: ; preds = %45, %3
%50 = tail call i32 @putchar(i32 10)
ret void
}