void ps_setcolor(color) int color;
{
  int i;
  static float pscolor[] = {0.0, 0.0,  0.0,  1.,   0.,   0.,  .94, .39, 0.0,
                            1.0, .647, 0.0,  1.0,  .803, 0.0, 1.0, 1.0, 0.0,
                            .60, .80,  .196, 0.0,  1.0,  0.0, 0.0, 1.0, 1.0,
                            0.0, 0.0,  1.0,  .627, .125, .94};
  char bob[100];
  if (color == 0)
    i = 0;
  else
    i = 3 * (color - 19);
  sprintf(bob, " %.3f %.3f %.3f setrgbcolor", pscolor[i], pscolor[i + 1],
          pscolor[i + 2]);
  ps_write(bob);
}


x86 assembly (clang, -O0):
<ps_setcolor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1141 <ps_setcolor+0x21>
movl   $0x0,-0x8(%rbp)
jmp    114d <ps_setcolor+0x2d>
mov    -0x4(%rbp),%eax
sub    $0x13,%eax
imul   $0x3,%eax,%eax
mov    %eax,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
movslq -0x8(%rbp),%rcx
lea    0x2ee4(%rip),%rax
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2ecb(%rip),%rax
movss  (%rax,%rcx,4),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x8(%rbp),%eax
add    $0x2,%eax
movslq %eax,%rcx
lea    0x2eb2(%rip),%rax
movss  (%rax,%rcx,4),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe62(%rip),%rsi
mov    $0x3,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
mov    $0x0,%al
call   1030 <ps_write@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_setcolor>:
push   %rbx
sub    $0x70,%rsp
test   %edi,%edi
lea    -0x39(%rdi,%rdi,2),%eax
cmove  %edi,%eax
cltq
lea    0xec9(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
movss  0x4(%rcx,%rax,4),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x8(%rcx,%rax,4),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xf29(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3,%al
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <ps_write@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@ps_setcolor.pscolor = internal global [33 x float] [float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0x3FEE147AE0000000, float 0x3FD8F5C280000000, float 0.000000e+00, float 1.000000e+00, float 0x3FE4B43960000000, float 0.000000e+00, float 1.000000e+00, float 0x3FE9B22D00000000, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0x3FE3333340000000, float 0x3FE99999A0000000, float 0x3FC9168720000000, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0x3FE4106240000000, float 1.250000e-01, float 0x3FEE147AE0000000]
@.str = [28 x i8] c" %.3f %.3f %.3f setrgbcolor\00"
define void @ps_setcolor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i8]
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %3
br label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 19
%11 = mul nsw i32 3, %10
store i32 %11, i32* %3
br label %12
12: ; preds = %8, %7
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [33 x float], [33 x float]* @ps_setcolor.pscolor, i64 0, i64 %15
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [33 x float], [33 x float]* @ps_setcolor.pscolor, i64 0, i64 %21
%23 = load float, float* %22
%24 = fpext float %23 to double
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [33 x float], [33 x float]* @ps_setcolor.pscolor, i64 0, i64 %27
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = call i32 (i8*, i8*, ...) @sprintf(i8* %13, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %18, double %24, double %30)
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%33 = call i32 (i8*, ...) bitcast (i32 (...)* @ps_write to i32 (i8*, ...)*)(i8* %32)
ret void
}

LLVM IR (-O2):
@ps_setcolor.pscolor = internal unnamed_addr constant [33 x float] [float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 0x3FEE147AE0000000, float 0x3FD8F5C280000000, float 0.000000e+00, float 1.000000e+00, float 0x3FE4B43960000000, float 0.000000e+00, float 1.000000e+00, float 0x3FE9B22D00000000, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0x3FE3333340000000, float 0x3FE99999A0000000, float 0x3FC9168720000000, float 0.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00, float 0x3FE4106240000000, float 1.250000e-01, float 0x3FEE147AE0000000]
@.str = [28 x i8] c" %.3f %.3f %.3f setrgbcolor\00"
define void @ps_setcolor(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
%5 = mul i32 %0, 3
%6 = add i32 %5, -57
%7 = select i1 %4, i32 0, i32 %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [33 x float], [33 x float]* @ps_setcolor.pscolor, i64 0, i64 %8
%10 = load float, float* %9
%11 = fpext float %10 to double
%12 = add nsw i32 %7, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [33 x float], [33 x float]* @ps_setcolor.pscolor, i64 0, i64 %13
%15 = load float, float* %14
%16 = fpext float %15 to double
%17 = add nsw i32 %7, 2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [33 x float], [33 x float]* @ps_setcolor.pscolor, i64 0, i64 %18
%20 = load float, float* %19
%21 = fpext float %20 to double
%22 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %11, double %16, double %21)
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @ps_write to i32 (i8*, ...)*)(i8* %3)
ret void
}