#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 main(void) {
  int i, n;
  printf(";\n");
  printf("TIADisplayToColour label byte\n");
  for (i = 0; i < 64; i++) {
    n = 0;
    if (i & 1)
      n = 1;
    if (i & 2)
      n = 4;
    if (i & 12)
      n = 2;
    if (i & 48)
      n = 3;
    if (i % 16 == 0)
      printf(" db ");
    printf("%d", n);
    if (i % 16 != 15)
      printf(",");
    else
      printf("\n");
  }
  printf(";\n");
  printf("TIADisplayToColour2 label byte\n");
  for (i = 0; i < 64; i++) {
    n = 0;
    if (i & 12)
      n = 2;
    if (i & 48)
      n = 3;
    if (i & 2)
      n = 4;
    if (i & 1)
      n = 1;
    if (i % 16 == 0)
      printf(" db ");
    printf("%d", n);
    if (i % 16 != 15)
      printf(",");
    else
      printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    121f <main+0x10f>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1162 <main+0x52>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1178 <main+0x68>
movl   $0x4,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xc,%eax
cmp    $0x0,%eax
je     118e <main+0x7e>
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x30,%eax
cmp    $0x0,%eax
je     11a4 <main+0x94>
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11c6 <main+0xb6>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0xf,%edx
je     11fe <main+0xee>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120c <main+0xfc>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1211 <main+0x101>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <main+0x2b>
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1326 <main+0x216>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xc,%eax
cmp    $0x0,%eax
je     1269 <main+0x159>
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x30,%eax
cmp    $0x0,%eax
je     127f <main+0x16f>
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1295 <main+0x185>
movl   $0x4,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     12ab <main+0x19b>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12cd <main+0x1bd>
lea    0xd5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0xf,%edx
je     1305 <main+0x1f5>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1313 <main+0x203>
lea    0xcf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1318 <main+0x208>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1242 <main+0x132>
lea    0xcd4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xee4(%rip),%rdi
call   1040 <puts@plt>
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%r12d
mov    $0x3,%r13d
lea    0xe9f(%rip),%rbx
xor    %r14d,%r14d
jmp    119c <main+0x6c>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xf,%r15d
mov    $0x2c,%edi
mov    $0xa,%eax
cmove  %eax,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    $0x40,%r14d
je     11e8 <main+0xb8>
mov    %r14d,%ebp
and    $0x1,%ebp
test   $0x2,%r14b
mov    $0x4,%eax
cmovne %eax,%ebp
test   $0xc,%r14b
cmovne %r12d,%ebp
test   $0x30,%r14b
cmovne %r13d,%ebp
mov    %r14d,%r15d
and    $0xf,%r15d
jne    1170 <main+0x40>
lea    0xe32(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
jmp    118d <main+0x5d>
lea    0xe37(%rip),%rdi
call   1040 <puts@plt>
lea    0xe2d(%rip),%rdi
call   1040 <puts@plt>
mov    $0x4,%r12d
mov    $0x1,%r13d
lea    0xdf2(%rip),%rbx
xor    %r14d,%r14d
jmp    124c <main+0x11c>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xf,%r15d
mov    $0x2c,%edi
mov    $0xa,%eax
cmove  %eax,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    $0x40,%r14d
je     129e <main+0x16e>
xor    %ebp,%ebp
test   $0xc,%r14b
setne  %bpl
add    %ebp,%ebp
test   $0x30,%r14b
mov    $0x3,%eax
cmovne %eax,%ebp
test   $0x2,%r14b
cmovne %r12d,%ebp
test   $0x1,%r14b
cmovne %r13d,%ebp
mov    %r14d,%r15d
and    $0xf,%r15d
jne    1220 <main+0xf0>
lea    0xd7c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
jmp    123d <main+0x10d>
mov    $0xa,%edi
add    $0x8,%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";\0A\00"
@.str.1 = [31 x i8] c"TIADisplayToColour label byte\0A\00"
@.str.2 = [5 x i8] c" db \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [2 x i8] c",\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [32 x i8] c"TIADisplayToColour2 label byte\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %5
5: ; preds = %45, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 64
br i1 %7, label %8, label %48
8: ; preds = %5
store i32 0, i32* %2
%9 = load i32, i32* %1
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %1
%15 = and i32 %14, 2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 4, i32* %2
br label %18
18: ; preds = %17, %13
%19 = load i32, i32* %1
%20 = and i32 %19, 12
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 2, i32* %2
br label %23
23: ; preds = %22, %18
%24 = load i32, i32* %1
%25 = and i32 %24, 48
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 3, i32* %2
br label %28
28: ; preds = %27, %23
%29 = load i32, i32* %1
%30 = srem i32 %29, 16
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %34
34: ; preds = %32, %28
%35 = load i32, i32* %2
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %1
%38 = srem i32 %37, 16
%39 = icmp ne i32 %38, 15
br i1 %39, label %40, label %42
40: ; preds = %34
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %44
42: ; preds = %34
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %44
44: ; preds = %42, %40
br label %45
45: ; preds = %44
%46 = load i32, i32* %1
%47 = add nsw i32 %46, 1
store i32 %47, i32* %1
br label %5
48: ; preds = %5
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %51
51: ; preds = %91, %48
%52 = load i32, i32* %1
%53 = icmp slt i32 %52, 64
br i1 %53, label %54, label %94
54: ; preds = %51
store i32 0, i32* %2
%55 = load i32, i32* %1
%56 = and i32 %55, 12
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %59
58: ; preds = %54
store i32 2, i32* %2
br label %59
59: ; preds = %58, %54
%60 = load i32, i32* %1
%61 = and i32 %60, 48
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %64
63: ; preds = %59
store i32 3, i32* %2
br label %64
64: ; preds = %63, %59
%65 = load i32, i32* %1
%66 = and i32 %65, 2
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %69
68: ; preds = %64
store i32 4, i32* %2
br label %69
69: ; preds = %68, %64
%70 = load i32, i32* %1
%71 = and i32 %70, 1
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %74
73: ; preds = %69
store i32 1, i32* %2
br label %74
74: ; preds = %73, %69
%75 = load i32, i32* %1
%76 = srem i32 %75, 16
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %74
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %80
80: ; preds = %78, %74
%81 = load i32, i32* %2
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %81)
%83 = load i32, i32* %1
%84 = srem i32 %83, 16
%85 = icmp ne i32 %84, 15
br i1 %85, label %86, label %88
86: ; preds = %80
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %90
88: ; preds = %80
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %90
90: ; preds = %88, %86
br label %91
91: ; preds = %90
%92 = load i32, i32* %1
%93 = add nsw i32 %92, 1
store i32 %93, i32* %1
br label %51
94: ; preds = %51
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.2 = [5 x i8] c" db \00"
@.str.3 = [3 x i8] c"%d\00"
@str.7 = [30 x i8] c"TIADisplayToColour label byte\00"
@str.8 = [2 x i8] c";\00"
@str.9 = [31 x i8] c"TIADisplayToColour2 label byte\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.7, i64 0, i64 0))
br label %3
3: ; preds = %0, %24
%4 = phi i32 [ 0, %0 ], [ %27, %24 ]
%5 = and i32 %4, 1
%6 = and i32 %4, 2
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 %5, i32 4
%9 = and i32 %4, 12
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 %8, i32 2
%12 = and i32 %4, 48
%13 = icmp eq i32 %12, 0
%14 = select i1 %13, i32 %11, i32 3
%15 = and i32 %4, 15
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %14)
br label %24
20: ; preds = %3
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%22 = icmp eq i32 %15, 15
%23 = select i1 %22, i32 10, i32 44
br label %24
24: ; preds = %20, %17
%25 = phi i32 [ 44, %17 ], [ %23, %20 ]
%26 = tail call i32 @putchar(i32 %25)
%27 = add nuw nsw i32 %4, 1
%28 = icmp eq i32 %27, 64
br i1 %28, label %29, label %3
29: ; preds = %24
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.9, i64 0, i64 0))
br label %32
32: ; preds = %29, %55
%33 = phi i32 [ 0, %29 ], [ %58, %55 ]
%34 = and i32 %33, 12
%35 = icmp eq i32 %34, 0
%36 = select i1 %35, i32 0, i32 2
%37 = and i32 %33, 48
%38 = icmp eq i32 %37, 0
%39 = select i1 %38, i32 %36, i32 3
%40 = and i32 %33, 2
%41 = icmp eq i32 %40, 0
%42 = select i1 %41, i32 %39, i32 4
%43 = and i32 %33, 1
%44 = icmp eq i32 %43, 0
%45 = select i1 %44, i32 %42, i32 1
%46 = and i32 %33, 15
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %32
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %45)
br label %55
51: ; preds = %32
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %45)
%53 = icmp eq i32 %46, 15
%54 = select i1 %53, i32 10, i32 44
br label %55
55: ; preds = %51, %48
%56 = phi i32 [ 44, %48 ], [ %54, %51 ]
%57 = tail call i32 @putchar(i32 %56)
%58 = add nuw nsw i32 %33, 1
%59 = icmp eq i32 %58, 64
br i1 %59, label %60, label %32
60: ; preds = %55
%61 = tail call i32 @putchar(i32 10)
ret void
}