#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 *, ...);
int 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 (i != k && j != k) {
            n++;
            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);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
ja     130f <main+0x1ff>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
ja     12fc <main+0x1ec>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     12e9 <main+0x1d9>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
ja     12e4 <main+0x1d4>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     12d1 <main+0x1c1>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     12d1 <main+0x1c1>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jg     12c3 <main+0x1b3>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x1,%eax
je     11de <main+0xce>
jmp    11bc <main+0xac>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
je     11e9 <main+0xd9>
jmp    11cd <main+0xbd>
mov    -0x20(%rbp),%eax
sub    $0x3,%eax
je     11f4 <main+0xe4>
jmp    11ff <main+0xef>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1204 <main+0xf4>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1204 <main+0xf4>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1204 <main+0xf4>
jmp    1204 <main+0xf4>
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x4,%rax
ja     12ab <main+0x19b>
mov    -0x28(%rbp),%rax
lea    0xde0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xde9(%rip),%rdi
lea    0xde8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b0 <main+0x1a0>
lea    0xdcf(%rip),%rdi
lea    0xdd2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b0 <main+0x1a0>
lea    0xdb5(%rip),%rdi
lea    0xdbf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b0 <main+0x1a0>
lea    0xd9b(%rip),%rdi
lea    0xdaa(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b0 <main+0x1a0>
lea    0xd81(%rip),%rdi
lea    0xd96(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b0 <main+0x1a0>
jmp    12b0 <main+0x1a0>
jmp    12b5 <main+0x1a5>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    119e <main+0x8e>
lea    0xd7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d6 <main+0x1c6>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115b <main+0x4b>
jmp    12e9 <main+0x1d9>
jmp    12ee <main+0x1de>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113e <main+0x2e>
jmp    1301 <main+0x1f1>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x18(%rbp),%esi
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
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
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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 i32 @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 %3, %17
%19 = icmp eq i32 %9, %17
%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 i32 0
}