#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 */
scalar_t__ pow(float const, int);
void luv_to_linear(float *luv) {
  const float L = luv[0];
  const float U = luv[1] - 100.0f;
  const float V = luv[2] - 100.0f;
  if (L == 0) {
    luv[0] = luv[1] = luv[2] = 0;
    return;
  }
  const float xn = 0.312713f;
  const float yn = 0.329016f;
  const float Yn = 1.0f;
  const float un = 4 * xn / (-2 * xn + 12 * yn + 3);
  const float vn = 9 * yn / (-2 * xn + 12 * yn + 3);
  const float y_adjust_2 = 0.00110705645f;
  const float u = U / (13 * L) + un;
  const float v = V / (13 * L) + vn;
  const float Y =
      L > 8 ? Yn * ((float)pow((L + 16) / 116, 3)) : Yn * L * y_adjust_2;
  const float X = (9 / 4.0f) * Y * u / v;
  const float Z = (9 * Y - 15 * v * Y - v * X) / (3 * v);
  const float r = 3.240479f * X - 1.53715f * Y - 0.498535f * Z;
  const float g = -0.969256f * X + 1.875991f * Y + 0.041556f * Z;
  const float b = 0.055648f * X - 0.204043f * Y + 1.057311f * Z;
  luv[0] = b;
  luv[1] = g;
  luv[2] = r;
}


x86 assembly (clang, -O0):
<luv_to_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  0xec6(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
movss  0xeac(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    119c <luv_to_linear+0x8c>
jp     119c <luv_to_linear+0x8c>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
jmp    1430 <luv_to_linear+0x320>
movss  0xe7c(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe6b(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xe5a(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xe45(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xe30(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  0xe2f(%rip),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x10(%rbp),%xmm0
movss  0xe15(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xe08(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xdee(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  0xdd9(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xdbf(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    128c <luv_to_linear+0x17c>
movss  0xdd2(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xdc1(%rip),%xmm1
divss  %xmm1,%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
cvtsi2ss %rax,%xmm1
movss  0xd9a(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
jmp    12aa <luv_to_linear+0x19a>
movss  0xd84(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  0xd73(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  0xda0(%rip),%xmm0
mulss  -0x38(%rbp),%xmm0
mulss  -0x30(%rbp),%xmm0
divss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x38(%rbp),%xmm1
movss  0xd7b(%rip),%xmm0
mulss  -0x34(%rbp),%xmm0
mulss  -0x38(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xd58(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x34(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xd25(%rip),%xmm1
mulss  -0x34(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  0xd06(%rip),%xmm0
mulss  -0x38(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xce8(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x40(%rbp),%xmm0
movss  0xccf(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  0xcb1(%rip),%xmm0
mulss  -0x38(%rbp),%xmm0
movss  0xca0(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x40(%rbp),%xmm0
movss  0xc87(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  0xc69(%rip),%xmm0
mulss  -0x38(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xc4b(%rip),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x40(%rbp),%xmm0
movss  0xc32(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x4c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x44(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<luv_to_linear>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movss  (%rdi),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1139 <luv_to_linear+0x29>
jp     1139 <luv_to_linear+0x29>
movl   $0x0,0x8(%rbx)
movq   $0x0,(%rbx)
jmp    1291 <luv_to_linear+0x181>
movss  0xebf(%rip),%xmm5
movss  0x8(%rbx),%xmm3
addss  %xmm5,%xmm3
addss  0x4(%rbx),%xmm5
movss  0xead(%rip),%xmm1
mulss  %xmm0,%xmm1
divss  %xmm1,%xmm5
addss  0xea1(%rip),%xmm5
divss  %xmm1,%xmm3
addss  0xe99(%rip),%xmm3
ucomiss 0xe96(%rip),%xmm0
jbe    11b8 <luv_to_linear+0xa8>
addss  0xe94(%rip),%xmm0
divss  0xe90(%rip),%xmm0
mov    $0x3,%edi
movss  %xmm5,0xc(%rsp)
movss  %xmm3,0x8(%rsp)
call   1030 <pow@plt>
movss  0x8(%rsp),%xmm3
movss  0xc(%rsp),%xmm5
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
jmp    11c0 <luv_to_linear+0xb0>
mulss  0xe54(%rip),%xmm0
movss  0xe58(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm5
divss  %xmm3,%xmm5
movss  0xe48(%rip),%xmm2
mulss  %xmm3,%xmm2
mulss  %xmm0,%xmm2
movss  0xe3c(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  %xmm2,%xmm1
movaps %xmm3,%xmm2
mulss  %xmm5,%xmm2
subss  %xmm2,%xmm1
mulss  0xe25(%rip),%xmm3
divss  %xmm3,%xmm1
movss  0xe1d(%rip),%xmm2
mulss  %xmm0,%xmm2
movss  0xe15(%rip),%xmm3
mulss  %xmm5,%xmm3
addss  %xmm2,%xmm3
movss  0xe09(%rip),%xmm2
mulss  %xmm1,%xmm2
addss  %xmm3,%xmm2
movss  0xdfd(%rip),%xmm3
mulss  %xmm0,%xmm3
movss  0xdf5(%rip),%xmm4
mulss  %xmm5,%xmm4
addss  %xmm3,%xmm4
movss  0xde9(%rip),%xmm3
mulss  %xmm1,%xmm3
mulss  0xde1(%rip),%xmm0
mulss  0xddd(%rip),%xmm5
addss  %xmm4,%xmm3
addss  %xmm0,%xmm5
mulss  0xdd1(%rip),%xmm1
addss  %xmm5,%xmm1
movss  %xmm1,(%rbx)
movss  %xmm3,0x4(%rbx)
movss  %xmm2,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @luv_to_linear(float* %0) {
%2 = alloca float*
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
store float* %0, float** %2
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 0
%22 = load float, float* %21
store float %22, float* %3
%23 = load float*, float** %2
%24 = getelementptr inbounds float, float* %23, i64 1
%25 = load float, float* %24
%26 = fsub float %25, 1.000000e+02
store float %26, float* %4
%27 = load float*, float** %2
%28 = getelementptr inbounds float, float* %27, i64 2
%29 = load float, float* %28
%30 = fsub float %29, 1.000000e+02
store float %30, float* %5
%31 = load float, float* %3
%32 = fcmp oeq float %31, 0.000000e+00
br i1 %32, label %33, label %40
33: ; preds = %1
%34 = load float*, float** %2
%35 = getelementptr inbounds float, float* %34, i64 2
store float 0.000000e+00, float* %35
%36 = load float*, float** %2
%37 = getelementptr inbounds float, float* %36, i64 1
store float 0.000000e+00, float* %37
%38 = load float*, float** %2
%39 = getelementptr inbounds float, float* %38, i64 0
store float 0.000000e+00, float* %39
br label %115
40: ; preds = %1
store float 0x3FD4037D60000000, float* %6
store float 0x3FD50E9920000000, float* %7
store float 1.000000e+00, float* %8
store float 0x3FC95297C0000000, float* %9
store float 0x3FDDF92040000000, float* %10
store float 0x3F522354C0000000, float* %11
%41 = load float, float* %4
%42 = load float, float* %3
%43 = fmul float 1.300000e+01, %42
%44 = fdiv float %41, %43
%45 = fadd float %44, 0x3FC95297C0000000
store float %45, float* %12
%46 = load float, float* %5
%47 = load float, float* %3
%48 = fmul float 1.300000e+01, %47
%49 = fdiv float %46, %48
%50 = fadd float %49, 0x3FDDF92040000000
store float %50, float* %13
%51 = load float, float* %3
%52 = fcmp ogt float %51, 8.000000e+00
br i1 %52, label %53, label %60
53: ; preds = %40
%54 = load float, float* %3
%55 = fadd float %54, 1.600000e+01
%56 = fdiv float %55, 1.160000e+02
%57 = call i64 @pow(float %56, i32 3)
%58 = sitofp i64 %57 to float
%59 = fmul float 1.000000e+00, %58
br label %64
60: ; preds = %40
%61 = load float, float* %3
%62 = fmul float 1.000000e+00, %61
%63 = fmul float %62, 0x3F522354C0000000
br label %64
64: ; preds = %60, %53
%65 = phi float [ %59, %53 ], [ %63, %60 ]
store float %65, float* %14
%66 = load float, float* %14
%67 = fmul float 2.250000e+00, %66
%68 = load float, float* %12
%69 = fmul float %67, %68
%70 = load float, float* %13
%71 = fdiv float %69, %70
store float %71, float* %15
%72 = load float, float* %14
%73 = load float, float* %13
%74 = fmul float 1.500000e+01, %73
%75 = load float, float* %14
%76 = fmul float %74, %75
%77 = fneg float %76
%78 = call float @llvm.fmuladd.f32(float 9.000000e+00, float %72, float %77)
%79 = load float, float* %13
%80 = load float, float* %15
%81 = fneg float %79
%82 = call float @llvm.fmuladd.f32(float %81, float %80, float %78)
%83 = load float, float* %13
%84 = fmul float 3.000000e+00, %83
%85 = fdiv float %82, %84
store float %85, float* %16
%86 = load float, float* %15
%87 = load float, float* %14
%88 = fmul float 0x3FF8982AA0000000, %87
%89 = fneg float %88
%90 = call float @llvm.fmuladd.f32(float 0x4009EC8040000000, float %86, float %89)
%91 = load float, float* %16
%92 = call float @llvm.fmuladd.f32(float 0xBFDFE7FF60000000, float %91, float %90)
store float %92, float* %17
%93 = load float, float* %15
%94 = load float, float* %14
%95 = fmul float 0x3FFE040F20000000, %94
%96 = call float @llvm.fmuladd.f32(float 0xBFEF042520000000, float %93, float %95)
%97 = load float, float* %16
%98 = call float @llvm.fmuladd.f32(float 0x3FA546D400000000, float %97, float %96)
store float %98, float* %18
%99 = load float, float* %15
%100 = load float, float* %14
%101 = fmul float 0x3FCA1E14C0000000, %100
%102 = fneg float %101
%103 = call float @llvm.fmuladd.f32(float 0x3FAC7DE500000000, float %99, float %102)
%104 = load float, float* %16
%105 = call float @llvm.fmuladd.f32(float 0x3FF0EABF00000000, float %104, float %103)
store float %105, float* %19
%106 = load float, float* %19
%107 = load float*, float** %2
%108 = getelementptr inbounds float, float* %107, i64 0
store float %106, float* %108
%109 = load float, float* %18
%110 = load float*, float** %2
%111 = getelementptr inbounds float, float* %110, i64 1
store float %109, float* %111
%112 = load float, float* %17
%113 = load float*, float** %2
%114 = getelementptr inbounds float, float* %113, i64 2
store float %112, float* %114
br label %115
115: ; preds = %64, %33
ret void
}

LLVM IR (-O2):
define void @luv_to_linear(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = getelementptr inbounds float, float* %0, i64 2
%5 = fcmp oeq float %2, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %0
br label %46
7: ; preds = %1
%8 = load float, float* %4
%9 = fadd float %8, -1.000000e+02
%10 = load float, float* %3
%11 = fadd float %10, -1.000000e+02
%12 = fmul float %2, 1.300000e+01
%13 = fdiv float %11, %12
%14 = fadd float %13, 0x3FC95297C0000000
%15 = fdiv float %9, %12
%16 = fadd float %15, 0x3FDDF92040000000
%17 = fcmp ogt float %2, 8.000000e+00
br i1 %17, label %18, label %23
18: ; preds = %7
%19 = fadd float %2, 1.600000e+01
%20 = fdiv float %19, 1.160000e+02
%21 = tail call i64 @pow(float %20, i32 3)
%22 = sitofp i64 %21 to float
br label %25
23: ; preds = %7
%24 = fmul float %2, 0x3F522354C0000000
br label %25
25: ; preds = %23, %18
%26 = phi float [ %22, %18 ], [ %24, %23 ]
%27 = fmul float %26, 2.250000e+00
%28 = fmul float %14, %27
%29 = fdiv float %28, %16
%30 = fmul float %16, -1.500000e+01
%31 = fmul float %30, %26
%32 = tail call float @llvm.fmuladd.f32(float %26, float 9.000000e+00, float %31)
%33 = fneg float %16
%34 = tail call float @llvm.fmuladd.f32(float %33, float %29, float %32)
%35 = fmul float %16, 3.000000e+00
%36 = fdiv float %34, %35
%37 = fmul float %26, 0xBFF8982AA0000000
%38 = tail call float @llvm.fmuladd.f32(float %29, float 0x4009EC8040000000, float %37)
%39 = tail call float @llvm.fmuladd.f32(float %36, float 0xBFDFE7FF60000000, float %38)
%40 = fmul float %26, 0x3FFE040F20000000
%41 = tail call float @llvm.fmuladd.f32(float %29, float 0xBFEF042520000000, float %40)
%42 = tail call float @llvm.fmuladd.f32(float %36, float 0x3FA546D400000000, float %41)
%43 = fmul float %26, 0xBFCA1E14C0000000
%44 = tail call float @llvm.fmuladd.f32(float %29, float 0x3FAC7DE500000000, float %43)
%45 = tail call float @llvm.fmuladd.f32(float %36, float 0x3FF0EABF00000000, float %44)
store float %45, float* %0
store float %42, float* %3
store float %39, float* %4
br label %46
46: ; preds = %25, %6
ret void
}