#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 */
float const lab_f_inv(float const);
void dt_Lab_to_XYZ(const float *Lab, float *XYZ) {
  const float d50[3] = {0.9642, 1.0, 0.8249};
  const float fy = (Lab[0] + 16.0f) / 116.0f;
  const float fx = Lab[1] / 500.0f + fy;
  const float fz = fy - Lab[2] / 200.0f;
  XYZ[0] = d50[0] * lab_f_inv(fx);
  XYZ[1] = d50[1] * lab_f_inv(fy);
  XYZ[2] = d50[2] * lab_f_inv(fz);
}


x86 assembly (clang, -O0):
<dt_Lab_to_XYZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xee9(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xee7(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  0xecc(%rip),%xmm0
addss  (%rax),%xmm0
movss  0xebc(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  0xe9e(%rip),%xmm1
divss  %xmm1,%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
movss  0xe76(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x24(%rbp),%xmm0
call   1030 <lab_f_inv@plt>
movaps %xmm0,%xmm1
movss  -0x34(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x20(%rbp),%xmm0
call   1030 <lab_f_inv@plt>
movaps %xmm0,%xmm1
movss  -0x30(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
call   1030 <lab_f_inv@plt>
movaps %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
mulss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_Lab_to_XYZ>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movss  (%rdi),%xmm1
addss  0xedc(%rip),%xmm1
divss  0xed8(%rip),%xmm1
movss  %xmm1,0x8(%rsp)
movss  0x4(%rdi),%xmm0
divss  0xec9(%rip),%xmm0
addss  %xmm1,%xmm0
movss  0x8(%rdi),%xmm2
divss  0xebc(%rip),%xmm2
addss  %xmm1,%xmm2
movss  %xmm2,0xc(%rsp)
call   1030 <lab_f_inv@plt>
mulss  0xea9(%rip),%xmm0
movss  %xmm0,(%rbx)
movss  0x8(%rsp),%xmm0
call   1030 <lab_f_inv@plt>
movss  %xmm0,0x4(%rbx)
movss  0xc(%rsp),%xmm0
call   1030 <lab_f_inv@plt>
mulss  0xe86(%rip),%xmm0
movss  %xmm0,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.dt_Lab_to_XYZ.d50 = [3 x float] [float 0x3FEEDABA00000000, float 1.000000e+00, float 0x3FEA6594A0000000]
define void @dt_Lab_to_XYZ(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [3 x float]
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%9 = bitcast [3 x float]* %5 to i8*
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fadd float %12, 1.600000e+01
%14 = fdiv float %13, 1.160000e+02
store float %14, float* %6
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
%17 = load float, float* %16
%18 = fdiv float %17, 5.000000e+02
%19 = load float, float* %6
%20 = fadd float %18, %19
store float %20, float* %7
%21 = load float, float* %6
%22 = load float*, float** %3
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = fdiv float %24, 2.000000e+02
%26 = fsub float %21, %25
store float %26, float* %8
%27 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%28 = load float, float* %27
%29 = load float, float* %7
%30 = call float @lab_f_inv(float %29)
%31 = fmul float %28, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 0
store float %31, float* %33
%34 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 1
%35 = load float, float* %34
%36 = load float, float* %6
%37 = call float @lab_f_inv(float %36)
%38 = fmul float %35, %37
%39 = load float*, float** %4
%40 = getelementptr inbounds float, float* %39, i64 1
store float %38, float* %40
%41 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 2
%42 = load float, float* %41
%43 = load float, float* %8
%44 = call float @lab_f_inv(float %43)
%45 = fmul float %42, %44
%46 = load float*, float** %4
%47 = getelementptr inbounds float, float* %46, i64 2
store float %45, float* %47
ret void
}

LLVM IR (-O2):
define void @dt_Lab_to_XYZ(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = fadd float %3, 1.600000e+01
%5 = fdiv float %4, 1.160000e+02
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = fdiv float %7, 5.000000e+02
%9 = fadd float %8, %5
%10 = getelementptr inbounds float, float* %0, i64 2
%11 = load float, float* %10
%12 = fdiv float %11, 2.000000e+02
%13 = fsub float %5, %12
%14 = tail call float @lab_f_inv(float %9)
%15 = fmul float %14, 0x3FEEDABA00000000
store float %15, float* %1
%16 = tail call float @lab_f_inv(float %5)
%17 = getelementptr inbounds float, float* %1, i64 1
store float %16, float* %17
%18 = tail call float @lab_f_inv(float %13)
%19 = fmul float %18, 0x3FEA6594A0000000
%20 = getelementptr inbounds float, float* %1, i64 2
store float %19, float* %20
ret void
}