#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 COLOR_PAIR(int);
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ attroff(int);
int /*<<< orphan*/ attron(int);
void print_colourpart(int attr, int i) {
  addstr("    ");
  attron(attr | COLOR_PAIR(i * 6 + 1));
  addstr("FD");
  addstr("  ");
  attron(attr | COLOR_PAIR(i * 6 + 2));
  addstr("FB");
  attroff(attr | COLOR_PAIR(i * 6 + 2));
  addstr("  ");
  attron(attr | COLOR_PAIR(i * 6 + 3));
  addstr("FW");
  attroff(attr | COLOR_PAIR(i * 6 + 3));
  addstr("  ");
  attron(attr | COLOR_PAIR(i * 6 + 4));
  addstr("BG");
  attroff(attr | COLOR_PAIR(i * 6 + 4));
  addstr("  ");
  attron(attr | COLOR_PAIR(i * 6 + 5));
  addstr("BD");
  attroff(attr | COLOR_PAIR(i * 6 + 5));
}


x86 assembly (clang, -O0):
<print_colourpart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xeab(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
imul   $0x6,-0x8(%rbp),%edi
add    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x2c(%rbp),%edi
or     %eax,%edi
call   1040 <attron@plt>
lea    0xe88(%rip),%rdi
call   1060 <addstr@plt>
lea    0xe79(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
imul   $0x6,-0x8(%rbp),%edi
add    $0x2,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x28(%rbp),%edi
or     %eax,%edi
call   1040 <attron@plt>
lea    0xe57(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
imul   $0x6,-0x8(%rbp),%edi
add    $0x2,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x24(%rbp),%edi
or     %eax,%edi
call   1030 <attroff@plt>
lea    0xe29(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
imul   $0x6,-0x8(%rbp),%edi
add    $0x3,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x20(%rbp),%edi
or     %eax,%edi
call   1040 <attron@plt>
lea    0xe0a(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
imul   $0x6,-0x8(%rbp),%edi
add    $0x3,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x1c(%rbp),%edi
or     %eax,%edi
call   1030 <attroff@plt>
lea    0xdd9(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
imul   $0x6,-0x8(%rbp),%edi
add    $0x4,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x18(%rbp),%edi
or     %eax,%edi
call   1040 <attron@plt>
lea    0xdbd(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x6,-0x8(%rbp),%edi
add    $0x4,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x14(%rbp),%edi
or     %eax,%edi
call   1030 <attroff@plt>
lea    0xd89(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
imul   $0x6,-0x8(%rbp),%edi
add    $0x5,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x10(%rbp),%edi
or     %eax,%edi
call   1040 <attron@plt>
lea    0xd70(%rip),%rdi
call   1060 <addstr@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x6,-0x8(%rbp),%edi
add    $0x5,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0xc(%rbp),%edi
or     %eax,%edi
call   1030 <attroff@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_colourpart>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
lea    0xead(%rip),%rdi
call   1060 <addstr@plt>
add    %r14d,%r14d
lea    (%r14,%r14,2),%edi
or     $0x1,%edi
call   1050 <COLOR_PAIR@plt>
or     %ebx,%eax
mov    %eax,%edi
call   1040 <attron@plt>
lea    0xe8e(%rip),%rdi
call   1060 <addstr@plt>
lea    0xe7f(%rip),%r15
mov    %r15,%rdi
call   1060 <addstr@plt>
lea    (%r14,%r14,2),%ebp
add    $0x2,%ebp
mov    %ebp,%edi
call   1050 <COLOR_PAIR@plt>
or     %ebx,%eax
mov    %eax,%edi
call   1040 <attron@plt>
lea    0xe5f(%rip),%rdi
call   1060 <addstr@plt>
mov    %ebp,%edi
call   1050 <COLOR_PAIR@plt>
or     %ebx,%eax
mov    %eax,%edi
call   1030 <attroff@plt>
mov    %r15,%rdi
call   1060 <addstr@plt>
lea    (%r14,%r14,2),%ebp
add    $0x3,%ebp
mov    %ebp,%edi
call   1050 <COLOR_PAIR@plt>
or     %ebx,%eax
mov    %eax,%edi
call   1040 <attron@plt>
lea    0xe27(%rip),%rdi
call   1060 <addstr@plt>
mov    %ebp,%edi
call   1050 <COLOR_PAIR@plt>
or     %ebx,%eax
mov    %eax,%edi
call   1030 <attroff@plt>
mov    %r15,%rdi
call   1060 <addstr@plt>
lea    (%r14,%r14,2),%ebp
add    $0x4,%ebp
mov    %ebp,%edi
call   1050 <COLOR_PAIR@plt>
or     %ebx,%eax
mov    %eax,%edi
call   1040 <attron@plt>
lea    0xdef(%rip),%rdi
call   1060 <addstr@plt>
mov    %ebp,%edi
call   1050 <COLOR_PAIR@plt>
or     %ebx,%eax
mov    %eax,%edi
call   1030 <attroff@plt>
mov    %r15,%rdi
call   1060 <addstr@plt>
lea    (%r14,%r14,2),%ebp
add    $0x5,%ebp
mov    %ebp,%edi
call   1050 <COLOR_PAIR@plt>
or     %ebx,%eax
mov    %eax,%edi
call   1040 <attron@plt>
lea    0xdb7(%rip),%rdi
call   1060 <addstr@plt>
mov    %ebp,%edi
call   1050 <COLOR_PAIR@plt>
or     %eax,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <attroff@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" \00"
@.str.1 = [3 x i8] c"FD\00"
@.str.2 = [3 x i8] c" \00"
@.str.3 = [3 x i8] c"FB\00"
@.str.4 = [3 x i8] c"FW\00"
@.str.5 = [3 x i8] c"BG\00"
@.str.6 = [3 x i8] c"BD\00"
define void @print_colourpart(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 6
%9 = add nsw i32 %8, 1
%10 = call i32 @COLOR_PAIR(i32 %9)
%11 = or i32 %6, %10
%12 = call i32 @attron(i32 %11)
%13 = call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = mul nsw i32 %16, 6
%18 = add nsw i32 %17, 2
%19 = call i32 @COLOR_PAIR(i32 %18)
%20 = or i32 %15, %19
%21 = call i32 @attron(i32 %20)
%22 = call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = mul nsw i32 %24, 6
%26 = add nsw i32 %25, 2
%27 = call i32 @COLOR_PAIR(i32 %26)
%28 = or i32 %23, %27
%29 = call i32 @attroff(i32 %28)
%30 = call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = mul nsw i32 %32, 6
%34 = add nsw i32 %33, 3
%35 = call i32 @COLOR_PAIR(i32 %34)
%36 = or i32 %31, %35
%37 = call i32 @attron(i32 %36)
%38 = call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%39 = load i32, i32* %3
%40 = load i32, i32* %4
%41 = mul nsw i32 %40, 6
%42 = add nsw i32 %41, 3
%43 = call i32 @COLOR_PAIR(i32 %42)
%44 = or i32 %39, %43
%45 = call i32 @attroff(i32 %44)
%46 = call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%47 = load i32, i32* %3
%48 = load i32, i32* %4
%49 = mul nsw i32 %48, 6
%50 = add nsw i32 %49, 4
%51 = call i32 @COLOR_PAIR(i32 %50)
%52 = or i32 %47, %51
%53 = call i32 @attron(i32 %52)
%54 = call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%55 = load i32, i32* %3
%56 = load i32, i32* %4
%57 = mul nsw i32 %56, 6
%58 = add nsw i32 %57, 4
%59 = call i32 @COLOR_PAIR(i32 %58)
%60 = or i32 %55, %59
%61 = call i32 @attroff(i32 %60)
%62 = call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%63 = load i32, i32* %3
%64 = load i32, i32* %4
%65 = mul nsw i32 %64, 6
%66 = add nsw i32 %65, 5
%67 = call i32 @COLOR_PAIR(i32 %66)
%68 = or i32 %63, %67
%69 = call i32 @attron(i32 %68)
%70 = call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%71 = load i32, i32* %3
%72 = load i32, i32* %4
%73 = mul nsw i32 %72, 6
%74 = add nsw i32 %73, 5
%75 = call i32 @COLOR_PAIR(i32 %74)
%76 = or i32 %71, %75
%77 = call i32 @attroff(i32 %76)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
@.str.1 = [3 x i8] c"FD\00"
@.str.2 = [3 x i8] c" \00"
@.str.3 = [3 x i8] c"FB\00"
@.str.4 = [3 x i8] c"FW\00"
@.str.5 = [3 x i8] c"BG\00"
@.str.6 = [3 x i8] c"BD\00"
define void @print_colourpart(i32 %0, i32 %1) {
%3 = tail call i32 @addstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = mul nsw i32 %1, 6
%5 = or i32 %4, 1
%6 = tail call i32 @COLOR_PAIR(i32 %5)
%7 = or i32 %6, %0
%8 = tail call i32 @attron(i32 %7)
%9 = tail call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%11 = add nsw i32 %4, 2
%12 = tail call i32 @COLOR_PAIR(i32 %11)
%13 = or i32 %12, %0
%14 = tail call i32 @attron(i32 %13)
%15 = tail call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%16 = tail call i32 @COLOR_PAIR(i32 %11)
%17 = or i32 %16, %0
%18 = tail call i32 @attroff(i32 %17)
%19 = tail call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%20 = add nsw i32 %4, 3
%21 = tail call i32 @COLOR_PAIR(i32 %20)
%22 = or i32 %21, %0
%23 = tail call i32 @attron(i32 %22)
%24 = tail call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%25 = tail call i32 @COLOR_PAIR(i32 %20)
%26 = or i32 %25, %0
%27 = tail call i32 @attroff(i32 %26)
%28 = tail call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%29 = add nsw i32 %4, 4
%30 = tail call i32 @COLOR_PAIR(i32 %29)
%31 = or i32 %30, %0
%32 = tail call i32 @attron(i32 %31)
%33 = tail call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%34 = tail call i32 @COLOR_PAIR(i32 %29)
%35 = or i32 %34, %0
%36 = tail call i32 @attroff(i32 %35)
%37 = tail call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%38 = add nsw i32 %4, 5
%39 = tail call i32 @COLOR_PAIR(i32 %38)
%40 = or i32 %39, %0
%41 = tail call i32 @attron(i32 %40)
%42 = tail call i32 @addstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%43 = tail call i32 @COLOR_PAIR(i32 %38)
%44 = or i32 %43, %0
%45 = tail call i32 @attroff(i32 %44)
ret void
}