#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 */
typedef enum color { ____Placeholder_color } color;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void main() {
  enum color { red, yellow, blue, white, black };
  enum color i, j, k, pri;
  int n = 0, loop;
  for (i = red; i <= black; i++) {
    for (j = red; j <= black; j++) {
      if (i != j) {
        for (k = red; k <= black; k++) {
          if ((k != i) && (k != j)) {
            n = n + 1;
            printf("%-4d", n);
            for (loop = 1; loop <= 3; loop++) {
              switch (loop) {
              case 1:
                pri = i;
                break;
              case 2:
                pri = j;
                break;
              case 3:
                pri = k;
                break;
              default:
                break;
              }
              switch (pri) {
              case red:
                printf("%-10s", "red");
                break;
              case yellow:
                printf("%-10s", "yellow");
                break;
              case blue:
                printf("%-10s", "blue");
                break;
              case white:
                printf("%-10s", "white");
                break;
              case black:
                printf("%-10s", "black");
                break;
              default:
                break;
              }
            }
            printf("\n");
          }
        }
      }
    }
  }
  printf("\ntotal:%5d\n", n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
ja     1308 <main+0x1f8>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
ja     12f5 <main+0x1e5>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     12e2 <main+0x1d2>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
ja     12dd <main+0x1cd>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     12ca <main+0x1ba>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     12ca <main+0x1ba>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jg     12bc <main+0x1ac>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x1,%eax
je     11d7 <main+0xc7>
jmp    11b5 <main+0xa5>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     11e2 <main+0xd2>
jmp    11c6 <main+0xb6>
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
je     11ed <main+0xdd>
jmp    11f8 <main+0xe8>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11fd <main+0xed>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11fd <main+0xed>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11fd <main+0xed>
jmp    11fd <main+0xed>
mov    -0x10(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x4,%rax
ja     12a4 <main+0x194>
mov    -0x28(%rbp),%rax
lea    0xde7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdf0(%rip),%rdi
lea    0xdef(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
lea    0xdd6(%rip),%rdi
lea    0xdd9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
lea    0xdbc(%rip),%rdi
lea    0xdc6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
lea    0xda2(%rip),%rdi
lea    0xdb1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
lea    0xd88(%rip),%rdi
lea    0xd9d(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
jmp    12a9 <main+0x199>
jmp    12ae <main+0x19e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1197 <main+0x87>
lea    0xd82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cf <main+0x1bf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <main+0x44>
jmp    12e2 <main+0x1d2>
jmp    12e7 <main+0x1d7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <main+0x27>
jmp    12fa <main+0x1ea>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
mov    -0x14(%rbp),%esi
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed3(%rip),%r15
xor    %r13d,%r13d
xor    %ebx,%ebx
jmp    114c <main+0x2c>
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x5,%ebx
je     121f <main+0xff>
mov    %ebx,%ebx
xor    %ebp,%ebp
jmp    1168 <main+0x48>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
cmp    $0x5,%ebp
je     1140 <main+0x20>
cmp    %ebp,%ebx
je     1160 <main+0x40>
mov    %ebp,%eax
mov    %rax,(%rsp)
xor    %r12d,%r12d
lea    0x2c7c(%rip),%r14
jmp    1198 <main+0x78>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
add    $0x8,%r14
cmp    $0x5,%r12d
je     1160 <main+0x40>
cmp    %r12d,%ebx
je     118a <main+0x6a>
cmp    %r12d,%ebp
je     118a <main+0x6a>
add    $0x1,%r13d
lea    0xe53(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x4,%ebx
jbe    11d0 <main+0xb0>
cmp    $0x4,%ebp
jbe    11ea <main+0xca>
cmp    $0x4,%r12d
ja     1180 <main+0x60>
jmp    120d <main+0xed>
nopl   0x0(%rax)
lea    0x2c21(%rip),%rax
mov    (%rax,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x4,%ebp
ja     11c1 <main+0xa1>
lea    0x2c07(%rip),%rax
mov    (%rsp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x4,%r12d
ja     1180 <main+0x60>
mov    (%r14),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1180 <main+0x60>
lea    0xe01(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%-4d\00"
@.str.1 = [6 x i8] c"%-10s\00"
@.str.2 = [4 x i8] c"red\00"
@.str.3 = [7 x i8] c"yellow\00"
@.str.4 = [5 x i8] c"blue\00"
@.str.5 = [6 x i8] c"white\00"
@.str.6 = [6 x i8] c"black\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [12 x i8] c"\0Atotal:%5d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %5
store i32 0, i32* %1
br label %7
7: ; preds = %76, %0
%8 = load i32, i32* %1
%9 = icmp ule i32 %8, 4
br i1 %9, label %10, label %79
10: ; preds = %7
store i32 0, i32* %2
br label %11
11: ; preds = %72, %10
%12 = load i32, i32* %2
%13 = icmp ule i32 %12, 4
br i1 %13, label %14, label %75
14: ; preds = %11
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %71
18: ; preds = %14
store i32 0, i32* %3
br label %19
19: ; preds = %67, %18
%20 = load i32, i32* %3
%21 = icmp ule i32 %20, 4
br i1 %21, label %22, label %70
22: ; preds = %19
%23 = load i32, i32* %3
%24 = load i32, i32* %1
%25 = icmp ne i32 %23, %24
br i1 %25, label %26, label %66
26: ; preds = %22
%27 = load i32, i32* %3
%28 = load i32, i32* %2
%29 = icmp ne i32 %27, %28
br i1 %29, label %30, label %66
30: ; preds = %26
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
%33 = load i32, i32* %5
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %33)
store i32 1, i32* %6
br label %35
35: ; preds = %61, %30
%36 = load i32, i32* %6
%37 = icmp sle i32 %36, 3
br i1 %37, label %38, label %64
38: ; preds = %35
%39 = load i32, i32* %6
switch i32 %39, label %46 [
i32 1, label %40
i32 2, label %42
i32 3, label %44
]
40: ; preds = %38
%41 = load i32, i32* %1
store i32 %41, i32* %4
br label %47
42: ; preds = %38
%43 = load i32, i32* %2
store i32 %43, i32* %4
br label %47
44: ; preds = %38
%45 = load i32, i32* %3
store i32 %45, i32* %4
br label %47
46: ; preds = %38
br label %47
47: ; preds = %46, %44, %42, %40
%48 = load i32, i32* %4
switch i32 %48, label %59 [
i32 0, label %49
i32 1, label %51
i32 2, label %53
i32 3, label %55
i32 4, label %57
]
49: ; preds = %47
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %60
51: ; preds = %47
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %60
53: ; preds = %47
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %60
55: ; preds = %47
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %60
57: ; preds = %47
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %60
59: ; preds = %47
br label %60
60: ; preds = %59, %57, %55, %53, %51, %49
br label %61
61: ; preds = %60
%62 = load i32, i32* %6
%63 = add nsw i32 %62, 1
store i32 %63, i32* %6
br label %35
64: ; preds = %35
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %66
66: ; preds = %64, %26, %22
br label %67
67: ; preds = %66
%68 = load i32, i32* %3
%69 = add i32 %68, 1
store i32 %69, i32* %3
br label %19
70: ; preds = %19
br label %71
71: ; preds = %70, %14
br label %72
72: ; preds = %71
%73 = load i32, i32* %2
%74 = add i32 %73, 1
store i32 %74, i32* %2
br label %11
75: ; preds = %11
br label %76
76: ; preds = %75
%77 = load i32, i32* %1
%78 = add i32 %77, 1
store i32 %78, i32* %1
br label %7
79: ; preds = %7
%80 = load i32, i32* %5
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %80)
ret void
}

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