void ShowColor(C) float C;
{
  if (C == 0.0)
    printf("BLACK\n");
  else if (C == 1.0)
    printf("RED\n");
  else if (C == 2.0)
    printf("GREEN\n");
  else if (C == 3.0)
    printf("BLUE\n");
  else if (C == 4.0)
    printf("CYAN\n");
  else if (C == 5.0)
    printf("YELLOW\n");
  else if (C == 6.0)
    printf("PURPLE\n");
  else if (C == 7.0)
    printf("WHITE\n");
}


x86 assembly (clang, -O0):
<ShowColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1150 <ShowColor+0x40>
jp     1150 <ShowColor+0x40>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12da <ShowColor+0x1ca>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1184 <ShowColor+0x74>
jp     1184 <ShowColor+0x74>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d5 <ShowColor+0x1c5>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe73(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11b8 <ShowColor+0xa8>
jp     11b8 <ShowColor+0xa8>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d0 <ShowColor+0x1c0>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe47(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11ec <ShowColor+0xdc>
jp     11ec <ShowColor+0xdc>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cb <ShowColor+0x1bb>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe1b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1220 <ShowColor+0x110>
jp     1220 <ShowColor+0x110>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c6 <ShowColor+0x1b6>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdef(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1254 <ShowColor+0x144>
jp     1254 <ShowColor+0x144>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12c1 <ShowColor+0x1b1>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdc3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1288 <ShowColor+0x178>
jp     1288 <ShowColor+0x178>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12bc <ShowColor+0x1ac>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd97(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12b7 <ShowColor+0x1a7>
jp     12b7 <ShowColor+0x1a7>
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12bc <ShowColor+0x1ac>
jmp    12c1 <ShowColor+0x1b1>
jmp    12c6 <ShowColor+0x1b6>
jmp    12cb <ShowColor+0x1bb>
jmp    12d0 <ShowColor+0x1c0>
jmp    12d5 <ShowColor+0x1c5>
jmp    12da <ShowColor+0x1ca>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowColor>:
cvtsd2ss %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112a <ShowColor+0x1a>
jp     112a <ShowColor+0x1a>
lea    0xf1f(%rip),%rdi
jmp    1030 <puts@plt>
ucomiss 0xecf(%rip),%xmm0
jne    1141 <ShowColor+0x31>
jp     1141 <ShowColor+0x31>
lea    0xf04(%rip),%rdi
jmp    1030 <puts@plt>
ucomiss 0xebc(%rip),%xmm0
jne    1158 <ShowColor+0x48>
jp     1158 <ShowColor+0x48>
lea    0xee7(%rip),%rdi
jmp    1030 <puts@plt>
ucomiss 0xea9(%rip),%xmm0
jne    116f <ShowColor+0x5f>
jp     116f <ShowColor+0x5f>
lea    0xecb(%rip),%rdi
jmp    1030 <puts@plt>
ucomiss 0xe96(%rip),%xmm0
jne    1186 <ShowColor+0x76>
jp     1186 <ShowColor+0x76>
lea    0xeaf(%rip),%rdi
jmp    1030 <puts@plt>
ucomiss 0xe83(%rip),%xmm0
jne    119d <ShowColor+0x8d>
jp     119d <ShowColor+0x8d>
lea    0xe91(%rip),%rdi
jmp    1030 <puts@plt>
ucomiss 0xe70(%rip),%xmm0
jne    11b4 <ShowColor+0xa4>
jp     11b4 <ShowColor+0xa4>
lea    0xe73(%rip),%rdi
jmp    1030 <puts@plt>
ucomiss 0xe5d(%rip),%xmm0
jne    11cb <ShowColor+0xbb>
jp     11cb <ShowColor+0xbb>
lea    0xe56(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [7 x i8] c"BLACK\0A\00"
@.str.1 = [5 x i8] c"RED\0A\00"
@.str.2 = [7 x i8] c"GREEN\0A\00"
@.str.3 = [6 x i8] c"BLUE\0A\00"
@.str.4 = [6 x i8] c"CYAN\0A\00"
@.str.5 = [8 x i8] c"YELLOW\0A\00"
@.str.6 = [8 x i8] c"PURPLE\0A\00"
@.str.7 = [7 x i8] c"WHITE\0A\00"
define void @ShowColor(double %0) {
%2 = alloca float
%3 = fptrunc double %0 to float
store float %3, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fcmp oeq double %5, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %58
9: ; preds = %1
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fcmp oeq double %11, 1.000000e+00
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %57
15: ; preds = %9
%16 = load float, float* %2
%17 = fpext float %16 to double
%18 = fcmp oeq double %17, 2.000000e+00
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %56
21: ; preds = %15
%22 = load float, float* %2
%23 = fpext float %22 to double
%24 = fcmp oeq double %23, 3.000000e+00
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %55
27: ; preds = %21
%28 = load float, float* %2
%29 = fpext float %28 to double
%30 = fcmp oeq double %29, 4.000000e+00
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %54
33: ; preds = %27
%34 = load float, float* %2
%35 = fpext float %34 to double
%36 = fcmp oeq double %35, 5.000000e+00
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %53
39: ; preds = %33
%40 = load float, float* %2
%41 = fpext float %40 to double
%42 = fcmp oeq double %41, 6.000000e+00
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %52
45: ; preds = %39
%46 = load float, float* %2
%47 = fpext float %46 to double
%48 = fcmp oeq double %47, 7.000000e+00
br i1 %48, label %49, label %51
49: ; preds = %45
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %51
51: ; preds = %49, %45
br label %52
52: ; preds = %51, %43
br label %53
53: ; preds = %52, %37
br label %54
54: ; preds = %53, %31
br label %55
55: ; preds = %54, %25
br label %56
56: ; preds = %55, %19
br label %57
57: ; preds = %56, %13
br label %58
58: ; preds = %57, %7
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"WHITE\00"
@str.8 = [7 x i8] c"PURPLE\00"
@str.9 = [7 x i8] c"YELLOW\00"
@str.10 = [5 x i8] c"CYAN\00"
@str.11 = [5 x i8] c"BLUE\00"
@str.12 = [6 x i8] c"GREEN\00"
@str.13 = [4 x i8] c"RED\00"
@str.14 = [6 x i8] c"BLACK\00"
define void @ShowColor(double %0) {
%2 = fptrunc double %0 to float
%3 = fcmp oeq float %2, 0.000000e+00
br i1 %3, label %18, label %4
4: ; preds = %1
%5 = fcmp oeq float %2, 1.000000e+00
br i1 %5, label %18, label %6
6: ; preds = %4
%7 = fcmp oeq float %2, 2.000000e+00
br i1 %7, label %18, label %8
8: ; preds = %6
%9 = fcmp oeq float %2, 3.000000e+00
br i1 %9, label %18, label %10
10: ; preds = %8
%11 = fcmp oeq float %2, 4.000000e+00
br i1 %11, label %18, label %12
12: ; preds = %10
%13 = fcmp oeq float %2, 5.000000e+00
br i1 %13, label %18, label %14
14: ; preds = %12
%15 = fcmp oeq float %2, 6.000000e+00
br i1 %15, label %18, label %16
16: ; preds = %14
%17 = fcmp oeq float %2, 7.000000e+00
br i1 %17, label %18, label %21
18: ; preds = %16, %14, %12, %10, %8, %6, %4, %1
%19 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.14, i64 0, i64 0), %1 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.13, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.12, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.11, i64 0, i64 0), %8 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.10, i64 0, i64 0), %10 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.9, i64 0, i64 0), %12 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.8, i64 0, i64 0), %14 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %16 ]
%20 = tail call i32 @puts(i8* dereferenceable(1) %19)
br label %21
21: ; preds = %18, %16
ret void
}