#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 pow(double, double);
void rgb2luv(unsigned char *RGB, float *LUV, int size) {
  int i;
  double x, y, X, Y, Z, den, u2, v2, X0, Z0, Y0, u20, v20, r, g, b;
  X0 = (0.607 + 0.174 + 0.201);
  Y0 = (0.299 + 0.587 + 0.114);
  Z0 = (0.066 + 1.117);
  u20 = 4 * X0 / (X0 + 15 * Y0 + 3 * Z0);
  v20 = 9 * Y0 / (X0 + 15 * Y0 + 3 * Z0);
  for (i = 0; i < size; i += 3) {
    if (RGB[i] <= 20)
      r = (double)(8.715e-4 * RGB[i]);
    else
      r = (double)pow((RGB[i] + 25.245) / 280.245, 2.22);
    if (RGB[i + 1] <= 20)
      g = (double)(8.715e-4 * RGB[i + 1]);
    else
      g = (double)pow((RGB[i + 1] + 25.245) / 280.245, 2.22);
    if (RGB[i + 2] <= 20)
      b = (double)(8.715e-4 * RGB[i + 2]);
    else
      b = (double)pow((RGB[i + 2] + 25.245) / 280.245, 2.22);
    X = 0.412453 * r + 0.357580 * g + 0.180423 * b;
    Y = 0.212671 * r + 0.715160 * g + 0.072169 * b;
    Z = 0.019334 * r + 0.119193 * g + 0.950227 * b;
    if (X == 0.0 && Y == 0.0 && Z == 0.0) {
      x = 1.0 / 3.0;
      y = 1.0 / 3.0;
    } else {
      den = X + Y + Z;
      x = X / den;
      y = Y / den;
    }
    den = -2 * x + 12 * y + 3;
    u2 = 4 * x / den;
    v2 = 9 * y / den;
    if (Y > 0.008856)
      LUV[i] = (float)(116 * pow(Y, 1.0 / 3.0) - 16);
    else
      LUV[i] = (float)(903.3 * Y);
    LUV[i + 1] = (float)(13 * LUV[i] * (u2 - u20));
    LUV[i + 2] = (float)(13 * LUV[i] * (v2 - v20));
  }
}


x86 assembly (clang, -O0):
<rgb2luv>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  0xf02(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xec3(%rip),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  0xe9c(%rip),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x68(%rbp),%xmm1
movsd  0xe7f(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  0xe76(%rip),%xmm0
mulsd  -0x70(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  0xe57(%rip),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x68(%rbp),%xmm1
movsd  0xe3a(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1631 <rgb2luv+0x521>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x14,%eax
jg     1228 <rgb2luv+0x118>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cvtsi2sd %eax,%xmm1
movsd  0xe39(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    1269 <rgb2luv+0x159>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe08(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xdf4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xde0(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x14,%eax
jg     12b1 <rgb2luv+0x1a1>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cvtsi2sd %eax,%xmm1
movsd  0xdb0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    12f7 <rgb2luv+0x1e7>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cvtsi2sd %eax,%xmm0
movsd  0xd7a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xd66(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xd52(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x14,%eax
jg     133f <rgb2luv+0x22f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cvtsi2sd %eax,%xmm1
movsd  0xd22(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
jmp    1385 <rgb2luv+0x275>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
cvtsi2sd %eax,%xmm0
movsd  0xcec(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xcd8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcc4(%rip),%xmm1
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  0xd03(%rip),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  0xceb(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xccb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x88(%rbp),%xmm1
ff
movsd  0xca6(%rip),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  0xc8e(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xc6e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x88(%rbp),%xmm1
ff
movsd  0xc49(%rip),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  0xc31(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xc11(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14bb <rgb2luv+0x3ab>
jp     14bb <rgb2luv+0x3ab>
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14bb <rgb2luv+0x3ab>
jp     14bb <rgb2luv+0x3ab>
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    14bb <rgb2luv+0x3ab>
jp     14bb <rgb2luv+0x3ab>
movsd  0xbfc(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xbef(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    14ed <rgb2luv+0x3dd>
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x38(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xbb6(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xaf1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xaf8(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xad9(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xb55(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    158b <rgb2luv+0x47b>
movsd  -0x38(%rbp),%xmm0
movsd  0xb36(%rip),%xmm1
call   1030 <pow@plt>
imul   $0x74,%eax,%eax
sub    $0x10,%eax
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    15a9 <rgb2luv+0x499>
movsd  0xb25(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  0xb07(%rip),%xmm0
mulss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x50(%rbp),%xmm1
subsd  -0x78(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  0xaca(%rip),%xmm0
mulss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x58(%rbp),%xmm1
subsd  -0x80(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x18(%rbp)
jmp    11de <rgb2luv+0xce>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb2luv>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
test   %edx,%edx
jle    13b8 <rgb2luv+0x2a8>
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
xor    %ebx,%ebx
jmp    1197 <rgb2luv+0x87>
nop
mulsd  0xf28(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
divsd  %xmm4,%xmm2
divsd  %xmm4,%xmm3
movss  %xmm0,(%r15,%rbx,4)
mulss  0xf6e(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xf12(%rip),%xmm2
mulsd  %xmm0,%xmm2
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
addsd  0xf07(%rip),%xmm3
mulsd  %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
movss  %xmm1,0x4(%r15,%rbx,4)
movss  %xmm0,0x8(%r15,%rbx,4)
add    $0x3,%rbx
cmp    %r14d,%ebx
jge    13b8 <rgb2luv+0x2a8>
movzbl 0x0(%rbp,%rbx,1),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
cmp    $0x14,%al
ja     11c0 <rgb2luv+0xb0>
mulsd  0xe69(%rip),%xmm0
jmp    11e4 <rgb2luv+0xd4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  0xe38(%rip),%xmm0
divsd  0xe38(%rip),%xmm0
movsd  0xe38(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movzbl 0x1(%rbp,%rbx,1),%eax
xorps  %xmm5,%xmm5
cvtsi2sd %eax,%xmm5
cmp    $0x14,%al
movapd %xmm0,(%rsp)
ja     1210 <rgb2luv+0x100>
mulsd  0xe17(%rip),%xmm5
jmp    1238 <rgb2luv+0x128>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addsd  0xde8(%rip),%xmm5
divsd  0xde8(%rip),%xmm5
movapd %xmm5,%xmm0
movsd  0xde4(%rip),%xmm1
call   1030 <pow@plt>
xorps  %xmm5,%xmm5
cvtsi2sd %eax,%xmm5
movzbl 0x2(%rbp,%rbx,1),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
cmp    $0x14,%al
ja     1260 <rgb2luv+0x150>
mulsd  0xdc8(%rip),%xmm1
jmp    1294 <rgb2luv+0x184>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
addsd  0xd98(%rip),%xmm1
divsd  0xd98(%rip),%xmm1
movapd %xmm1,%xmm0
movsd  0xd94(%rip),%xmm1
movapd %xmm5,0x10(%rsp)
call   1030 <pow@plt>
movapd 0x10(%rsp),%xmm5
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
xorpd  %xmm3,%xmm3
movapd (%rsp),%xmm4
movapd %xmm5,%xmm0
unpcklpd %xmm5,%xmm0
mulpd  0xdd3(%rip),%xmm0
movapd %xmm4,%xmm2
unpcklpd %xmm4,%xmm2
mulpd  0xdd3(%rip),%xmm2
addpd  %xmm0,%xmm2
movapd %xmm1,%xmm0
unpcklpd %xmm1,%xmm0
mulpd  0xdcf(%rip),%xmm0
addpd  %xmm2,%xmm0
mulsd  0xd43(%rip),%xmm5
mulsd  0xd43(%rip),%xmm4
addsd  %xmm5,%xmm4
mulsd  0xd3f(%rip),%xmm1
addsd  %xmm4,%xmm1
movapd %xmm0,%xmm2
unpckhpd %xmm0,%xmm2
ucomisd %xmm3,%xmm2
jne    131d <rgb2luv+0x20d>
jp     131d <rgb2luv+0x20d>
ucomisd %xmm3,%xmm0
jne    131d <rgb2luv+0x20d>
jp     131d <rgb2luv+0x20d>
ucomisd %xmm3,%xmm1
movapd 0xd97(%rip),%xmm3
jne    131d <rgb2luv+0x20d>
jnp    1331 <rgb2luv+0x221>
addsd  %xmm0,%xmm2
addsd  %xmm2,%xmm1
unpcklpd %xmm1,%xmm1
movapd %xmm0,%xmm3
divpd  %xmm1,%xmm3
movapd %xmm3,%xmm4
mulsd  0xcfb(%rip),%xmm4
movapd %xmm3,%xmm2
unpckhpd %xmm3,%xmm2
movapd %xmm2,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm1,%xmm4
addsd  0xce7(%rip),%xmm4
mulsd  0xce7(%rip),%xmm2
mulsd  0xce7(%rip),%xmm3
ucomisd 0xce7(%rip),%xmm0
jbe    1130 <rgb2luv+0x20>
movsd  0xce9(%rip),%xmm1
movapd %xmm3,(%rsp)
movapd %xmm2,0x10(%rsp)
movsd  %xmm4,0x20(%rsp)
call   1030 <pow@plt>
movsd  0x20(%rsp),%xmm4
movapd 0x10(%rsp),%xmm2
movapd (%rsp),%xmm3
imul   $0x74,%eax,%eax
add    $0xfffffff0,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
jmp    113c <rgb2luv+0x2c>
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @rgb2luv(i8* %0, float* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca float*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
store i8* %0, i8** %4
store float* %1, float** %5
store i32 %2, i32* %6
store double 0x3FEF6C8B43958106, double* %16
store double 0x3FEFFFFFFFFFFFFF, double* %18
store double 1.183000e+00, double* %17
%24 = load double, double* %16
%25 = fmul double 4.000000e+00, %24
%26 = load double, double* %16
%27 = load double, double* %18
%28 = call double @llvm.fmuladd.f64(double 1.500000e+01, double %27, double %26)
%29 = load double, double* %17
%30 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %29, double %28)
%31 = fdiv double %25, %30
store double %31, double* %19
%32 = load double, double* %18
%33 = fmul double 9.000000e+00, %32
%34 = load double, double* %16
%35 = load double, double* %18
%36 = call double @llvm.fmuladd.f64(double 1.500000e+01, double %35, double %34)
%37 = load double, double* %17
%38 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %37, double %36)
%39 = fdiv double %33, %38
store double %39, double* %20
store i32 0, i32* %7
br label %40
40: ; preds = %246, %3
%41 = load i32, i32* %7
%42 = load i32, i32* %6
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %249
44: ; preds = %40
%45 = load i8*, i8** %4
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %45, i64 %47
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = icmp sle i32 %50, 20
br i1 %51, label %52, label %61
52: ; preds = %44
%53 = load i8*, i8** %4
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %53, i64 %55
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = sitofp i32 %58 to double
%60 = fmul double 0x3F4C8EABFFCDAB19, %59
store double %60, double* %21
br label %73
61: ; preds = %44
%62 = load i8*, i8** %4
%63 = load i32, i32* %7
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %62, i64 %64
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = sitofp i32 %67 to double
%69 = fadd double %68, 2.524500e+01
%70 = fdiv double %69, 2.802450e+02
%71 = call i32 @pow(double %70, double 2.220000e+00)
%72 = sitofp i32 %71 to double
store double %72, double* %21
br label %73
73: ; preds = %61, %52
%74 = load i8*, i8** %4
%75 = load i32, i32* %7
%76 = add nsw i32 %75, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %74, i64 %77
%79 = load i8, i8* %78
%80 = zext i8 %79 to i32
%81 = icmp sle i32 %80, 20
br i1 %81, label %82, label %92
82: ; preds = %73
%83 = load i8*, i8** %4
%84 = load i32, i32* %7
%85 = add nsw i32 %84, 1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %83, i64 %86
%88 = load i8, i8* %87
%89 = zext i8 %88 to i32
%90 = sitofp i32 %89 to double
%91 = fmul double 0x3F4C8EABFFCDAB19, %90
store double %91, double* %22
br label %105
92: ; preds = %73
%93 = load i8*, i8** %4
%94 = load i32, i32* %7
%95 = add nsw i32 %94, 1
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %93, i64 %96
%98 = load i8, i8* %97
%99 = zext i8 %98 to i32
%100 = sitofp i32 %99 to double
%101 = fadd double %100, 2.524500e+01
%102 = fdiv double %101, 2.802450e+02
%103 = call i32 @pow(double %102, double 2.220000e+00)
%104 = sitofp i32 %103 to double
store double %104, double* %22
br label %105
105: ; preds = %92, %82
%106 = load i8*, i8** %4
%107 = load i32, i32* %7
%108 = add nsw i32 %107, 2
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8, i8* %106, i64 %109
%111 = load i8, i8* %110
%112 = zext i8 %111 to i32
%113 = icmp sle i32 %112, 20
br i1 %113, label %114, label %124
114: ; preds = %105
%115 = load i8*, i8** %4
%116 = load i32, i32* %7
%117 = add nsw i32 %116, 2
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %115, i64 %118
%120 = load i8, i8* %119
%121 = zext i8 %120 to i32
%122 = sitofp i32 %121 to double
%123 = fmul double 0x3F4C8EABFFCDAB19, %122
store double %123, double* %23
br label %137
124: ; preds = %105
%125 = load i8*, i8** %4
%126 = load i32, i32* %7
%127 = add nsw i32 %126, 2
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds i8, i8* %125, i64 %128
%130 = load i8, i8* %129
%131 = zext i8 %130 to i32
%132 = sitofp i32 %131 to double
%133 = fadd double %132, 2.524500e+01
%134 = fdiv double %133, 2.802450e+02
%135 = call i32 @pow(double %134, double 2.220000e+00)
%136 = sitofp i32 %135 to double
store double %136, double* %23
br label %137
137: ; preds = %124, %114
%138 = load double, double* %21
%139 = load double, double* %22
%140 = fmul double 3.575800e-01, %139
%141 = call double @llvm.fmuladd.f64(double 4.124530e-01, double %138, double %140)
%142 = load double, double* %23
%143 = call double @llvm.fmuladd.f64(double 1.804230e-01, double %142, double %141)
store double %143, double* %10
%144 = load double, double* %21
%145 = load double, double* %22
%146 = fmul double 7.151600e-01, %145
%147 = call double @llvm.fmuladd.f64(double 2.126710e-01, double %144, double %146)
%148 = load double, double* %23
%149 = call double @llvm.fmuladd.f64(double 0x3FB279AAE6C8F755, double %148, double %147)
store double %149, double* %11
%150 = load double, double* %21
%151 = load double, double* %22
%152 = fmul double 1.191930e-01, %151
%153 = call double @llvm.fmuladd.f64(double 1.933400e-02, double %150, double %152)
%154 = load double, double* %23
%155 = call double @llvm.fmuladd.f64(double 9.502270e-01, double %154, double %153)
store double %155, double* %12
%156 = load double, double* %10
%157 = fcmp oeq double %156, 0.000000e+00
br i1 %157, label %158, label %165
158: ; preds = %137
%159 = load double, double* %11
%160 = fcmp oeq double %159, 0.000000e+00
br i1 %160, label %161, label %165
161: ; preds = %158
%162 = load double, double* %12
%163 = fcmp oeq double %162, 0.000000e+00
br i1 %163, label %164, label %165
164: ; preds = %161
store double 0x3FD5555555555555, double* %8
store double 0x3FD5555555555555, double* %9
br label %177
165: ; preds = %161, %158, %137
%166 = load double, double* %10
%167 = load double, double* %11
%168 = fadd double %166, %167
%169 = load double, double* %12
%170 = fadd double %168, %169
store double %170, double* %13
%171 = load double, double* %10
%172 = load double, double* %13
%173 = fdiv double %171, %172
store double %173, double* %8
%174 = load double, double* %11
%175 = load double, double* %13
%176 = fdiv double %174, %175
store double %176, double* %9
br label %177
177: ; preds = %165, %164
%178 = load double, double* %8
%179 = load double, double* %9
%180 = fmul double 1.200000e+01, %179
%181 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %178, double %180)
%182 = fadd double %181, 3.000000e+00
store double %182, double* %13
%183 = load double, double* %8
%184 = fmul double 4.000000e+00, %183
%185 = load double, double* %13
%186 = fdiv double %184, %185
store double %186, double* %14
%187 = load double, double* %9
%188 = fmul double 9.000000e+00, %187
%189 = load double, double* %13
%190 = fdiv double %188, %189
store double %190, double* %15
%191 = load double, double* %11
%192 = fcmp ogt double %191, 8.856000e-03
br i1 %192, label %193, label %203
193: ; preds = %177
%194 = load double, double* %11
%195 = call i32 @pow(double %194, double 0x3FD5555555555555)
%196 = mul nsw i32 116, %195
%197 = sub nsw i32 %196, 16
%198 = sitofp i32 %197 to float
%199 = load float*, float** %5
%200 = load i32, i32* %7
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds float, float* %199, i64 %201
store float %198, float* %202
br label %211
203: ; preds = %177
%204 = load double, double* %11
%205 = fmul double 0x408C3A6666666666, %204
%206 = fptrunc double %205 to float
%207 = load float*, float** %5
%208 = load i32, i32* %7
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds float, float* %207, i64 %209
store float %206, float* %210
br label %211
211: ; preds = %203, %193
%212 = load float*, float** %5
%213 = load i32, i32* %7
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds float, float* %212, i64 %214
%216 = load float, float* %215
%217 = fmul float 1.300000e+01, %216
%218 = fpext float %217 to double
%219 = load double, double* %14
%220 = load double, double* %19
%221 = fsub double %219, %220
%222 = fmul double %218, %221
%223 = fptrunc double %222 to float
%224 = load float*, float** %5
%225 = load i32, i32* %7
%226 = add nsw i32 %225, 1
%227 = sext i32 %226 to i64
%228 = getelementptr inbounds float, float* %224, i64 %227
store float %223, float* %228
%229 = load float*, float** %5
%230 = load i32, i32* %7
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds float, float* %229, i64 %231
%233 = load float, float* %232
%234 = fmul float 1.300000e+01, %233
%235 = fpext float %234 to double
%236 = load double, double* %15
%237 = load double, double* %20
%238 = fsub double %236, %237
%239 = fmul double %235, %238
%240 = fptrunc double %239 to float
%241 = load float*, float** %5
%242 = load i32, i32* %7
%243 = add nsw i32 %242, 2
%244 = sext i32 %243 to i64
%245 = getelementptr inbounds float, float* %241, i64 %244
store float %240, float* %245
br label %246
246: ; preds = %211
%247 = load i32, i32* %7
%248 = add nsw i32 %247, 3
store i32 %248, i32* %7
br label %40
249: ; preds = %40
ret void
}

LLVM IR (-O2):
define void @rgb2luv(i8* nocapture %0, float* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %109
5: ; preds = %3, %93
%6 = phi i64 [ %106, %93 ], [ 0, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp ult i8 %8, 21
%10 = uitofp i8 %8 to double
br i1 %9, label %11, label %13
11: ; preds = %5
%12 = fmul double %10, 0x3F4C8EABFFCDAB19
br label %18
13: ; preds = %5
%14 = fadd double %10, 2.524500e+01
%15 = fdiv double %14, 2.802450e+02
%16 = tail call i32 @pow(double %15, double 2.220000e+00)
%17 = sitofp i32 %16 to double
br label %18
18: ; preds = %13, %11
%19 = phi double [ %12, %11 ], [ %17, %13 ]
%20 = add nuw nsw i64 %6, 1
%21 = getelementptr inbounds i8, i8* %0, i64 %20
%22 = load i8, i8* %21
%23 = icmp ult i8 %22, 21
%24 = uitofp i8 %22 to double
br i1 %23, label %25, label %27
25: ; preds = %18
%26 = fmul double %24, 0x3F4C8EABFFCDAB19
br label %32
27: ; preds = %18
%28 = fadd double %24, 2.524500e+01
%29 = fdiv double %28, 2.802450e+02
%30 = tail call i32 @pow(double %29, double 2.220000e+00)
%31 = sitofp i32 %30 to double
br label %32
32: ; preds = %27, %25
%33 = phi double [ %26, %25 ], [ %31, %27 ]
%34 = add nuw nsw i64 %6, 2
%35 = getelementptr inbounds i8, i8* %0, i64 %34
%36 = load i8, i8* %35
%37 = icmp ult i8 %36, 21
%38 = uitofp i8 %36 to double
br i1 %37, label %39, label %41
39: ; preds = %32
%40 = fmul double %38, 0x3F4C8EABFFCDAB19
br label %46
41: ; preds = %32
%42 = fadd double %38, 2.524500e+01
%43 = fdiv double %42, 2.802450e+02
%44 = tail call i32 @pow(double %43, double 2.220000e+00)
%45 = sitofp i32 %44 to double
br label %46
46: ; preds = %41, %39
%47 = phi double [ %40, %39 ], [ %45, %41 ]
%48 = insertelement <2 x double> poison, double %33, i64 0
%49 = shufflevector <2 x double> %48, <2 x double> poison, <2 x i32> zeroinitializer
%50 = fmul <2 x double> %49, <double 7.151600e-01, double 3.575800e-01>
%51 = insertelement <2 x double> poison, double %19, i64 0
%52 = shufflevector <2 x double> %51, <2 x double> poison, <2 x i32> zeroinitializer
%53 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %52, <2 x double> <double 2.126710e-01, double 4.124530e-01>, <2 x double> %50)
%54 = insertelement <2 x double> poison, double %47, i64 0
%55 = shufflevector <2 x double> %54, <2 x double> poison, <2 x i32> zeroinitializer
%56 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> <double 0x3FB279AAE6C8F755, double 1.804230e-01>, <2 x double> %53)
%57 = fmul double %33, 1.191930e-01
%58 = tail call double @llvm.fmuladd.f64(double %19, double 1.933400e-02, double %57)
%59 = tail call double @llvm.fmuladd.f64(double %47, double 9.502270e-01, double %58)
%60 = extractelement <2 x double> %56, i64 1
%61 = fcmp oeq double %60, 0.000000e+00
%62 = extractelement <2 x double> %56, i64 0
%63 = fcmp oeq double %62, 0.000000e+00
%64 = select i1 %61, i1 %63, i1 false
%65 = fcmp oeq double %59, 0.000000e+00
%66 = select i1 %64, i1 %65, i1 false
br i1 %66, label %73, label %67
67: ; preds = %46
%68 = fadd double %60, %62
%69 = fadd double %59, %68
%70 = insertelement <2 x double> poison, double %69, i64 0
%71 = shufflevector <2 x double> %70, <2 x double> poison, <2 x i32> zeroinitializer
%72 = fdiv <2 x double> %56, %71
br label %73
73: ; preds = %46, %67
%74 = phi <2 x double> [ %72, %67 ], [ <double 0x3FD5555555555555, double 0x3FD5555555555555>, %46 ]
%75 = extractelement <2 x double> %74, i64 0
%76 = fmul double %75, 1.200000e+01
%77 = extractelement <2 x double> %74, i64 1
%78 = tail call double @llvm.fmuladd.f64(double %77, double -2.000000e+00, double %76)
%79 = fadd double %78, 3.000000e+00
%80 = fmul double %77, 4.000000e+00
%81 = fdiv double %80, %79
%82 = fmul double %75, 9.000000e+00
%83 = fdiv double %82, %79
%84 = fcmp ogt double %62, 8.856000e-03
br i1 %84, label %85, label %90
85: ; preds = %73
%86 = tail call i32 @pow(double %62, double 0x3FD5555555555555)
%87 = mul nsw i32 %86, 116
%88 = add nsw i32 %87, -16
%89 = sitofp i32 %88 to float
br label %93
90: ; preds = %73
%91 = fmul double %62, 0x408C3A6666666666
%92 = fptrunc double %91 to float
br label %93
93: ; preds = %90, %85
%94 = phi float [ %89, %85 ], [ %92, %90 ]
%95 = getelementptr inbounds float, float* %1, i64 %6
store float %94, float* %95
%96 = fmul float %94, 1.300000e+01
%97 = fpext float %96 to double
%98 = fadd double %81, 0xBFC9BE2CBFA13520
%99 = fmul double %98, %97
%100 = fptrunc double %99 to float
%101 = getelementptr inbounds float, float* %1, i64 %20
store float %100, float* %101
%102 = fadd double %83, 0xBFDD7DD805C469F5
%103 = fmul double %102, %97
%104 = fptrunc double %103 to float
%105 = getelementptr inbounds float, float* %1, i64 %34
store float %104, float* %105
%106 = add nuw i64 %6, 3
%107 = trunc i64 %106 to i32
%108 = icmp slt i32 %107, %2
br i1 %108, label %5, label %109
109: ; preds = %93, %3
ret void
}