#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 */
double pow(double, double);
void Lab2XYZ(double L, double a, double b, double *X, double *Y, double *Z) {
  double fX, fY, fZ;
  fY = (L + 16.0) / 116.0;
  if (fY > 0.206893)
    *Y = pow(fY, 3.0);
  else
    *Y = (fY - 16.0 / 116.0) / 7.787;
  fX = a / 500.0 + fY;
  if (fX > 0.206893)
    *X = pow(fX, 3.0);
  else
    *X = (fX - 16.0 / 116.0) / 7.787;
  fZ = fY - b / 200.0;
  if (fZ > 0.206893)
    *Z = pow(fZ, 3.0);
  else
    *Z = (fZ - 16.0 / 116.0) / 7.787;
  (*X) *= (0.950456 * 255.0);
  (*Y) *= 255.0;
  (*Z) *= (1.088754 * 255.0);
}


x86 assembly (clang, -O0):
<Lab2XYZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
movsd  0xed5(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1187 <Lab2XYZ+0x77>
movsd  -0x40(%rbp),%xmm0
movsd  0xeb3(%rip),%xmm1
call   1030 <pow@plt>
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    11ac <Lab2XYZ+0x9c>
movsd  -0x40(%rbp),%xmm0
movsd  0xe8c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe78(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xe2c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11fd <Lab2XYZ+0xed>
movsd  -0x38(%rbp),%xmm0
movsd  0xe3d(%rip),%xmm1
call   1030 <pow@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1222 <Lab2XYZ+0x112>
movsd  -0x38(%rbp),%xmm0
movsd  0xe16(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe02(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe04(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  0xdb2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1277 <Lab2XYZ+0x167>
movsd  -0x48(%rbp),%xmm0
movsd  0xdc3(%rip),%xmm1
call   1030 <pow@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    129c <Lab2XYZ+0x18c>
movsd  -0x48(%rbp),%xmm0
movsd  0xd9c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xd88(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xda8(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0xd8c(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x30(%rbp),%rax
movsd  0xd70(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lab2XYZ>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movapd %xmm0,%xmm3
addsd  0xedb(%rip),%xmm3
divsd  0xedb(%rip),%xmm3
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  %xmm2,0x18(%rsp)
movapd %xmm1,%xmm2
ucomisd 0xec8(%rip),%xmm3
movsd  %xmm3,0x8(%rsp)
jbe    1175 <Lab2XYZ+0x65>
movsd  0xed0(%rip),%xmm1
movapd %xmm3,%xmm0
movsd  %xmm2,0x10(%rsp)
call   1030 <pow@plt>
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm3
jmp    1189 <Lab2XYZ+0x79>
movsd  0xe9b(%rip),%xmm0
addsd  %xmm3,%xmm0
divsd  0xe97(%rip),%xmm0
movsd  %xmm0,(%r15)
divsd  0xe9a(%rip),%xmm2
addsd  %xmm3,%xmm2
ucomisd 0xe6e(%rip),%xmm2
jbe    11c1 <Lab2XYZ+0xb1>
movsd  0xe7c(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm3
movapd %xmm0,%xmm2
jmp    11d1 <Lab2XYZ+0xc1>
addsd  0xe4f(%rip),%xmm2
divsd  0xe4f(%rip),%xmm2
movsd  %xmm2,(%rbx)
movsd  0x18(%rsp),%xmm0
divsd  0xe55(%rip),%xmm0
addsd  %xmm0,%xmm3
ucomisd 0xe21(%rip),%xmm3
jbe    1208 <Lab2XYZ+0xf8>
movsd  0xe2f(%rip),%xmm1
movapd %xmm3,%xmm0
call   1030 <pow@plt>
movapd %xmm0,%xmm3
jmp    1218 <Lab2XYZ+0x108>
addsd  0xe08(%rip),%xmm3
divsd  0xe08(%rip),%xmm3
movsd  %xmm3,(%r14)
movsd  (%rbx),%xmm0
mulsd  0xe17(%rip),%xmm0
movsd  %xmm0,(%rbx)
movsd  (%r15),%xmm0
mulsd  0xe0e(%rip),%xmm0
movsd  %xmm0,(%r15)
movsd  (%r14),%xmm0
mulsd  0xe04(%rip),%xmm0
movsd  %xmm0,(%r14)
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Lab2XYZ(double %0, double %1, double %2, double* %3, double* %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca double
%14 = alloca double
%15 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double* %3, double** %10
store double* %4, double** %11
store double* %5, double** %12
%16 = load double, double* %7
%17 = fadd double %16, 1.600000e+01
%18 = fdiv double %17, 1.160000e+02
store double %18, double* %14
%19 = load double, double* %14
%20 = fcmp ogt double %19, 2.068930e-01
br i1 %20, label %21, label %25
21: ; preds = %6
%22 = load double, double* %14
%23 = call double @pow(double %22, double 3.000000e+00)
%24 = load double*, double** %11
store double %23, double* %24
br label %30
25: ; preds = %6
%26 = load double, double* %14
%27 = fsub double %26, 0x3FC1A7B9611A7B96
%28 = fdiv double %27, 0x401F25E353F7CED9
%29 = load double*, double** %11
store double %28, double* %29
br label %30
30: ; preds = %25, %21
%31 = load double, double* %8
%32 = fdiv double %31, 5.000000e+02
%33 = load double, double* %14
%34 = fadd double %32, %33
store double %34, double* %13
%35 = load double, double* %13
%36 = fcmp ogt double %35, 2.068930e-01
br i1 %36, label %37, label %41
37: ; preds = %30
%38 = load double, double* %13
%39 = call double @pow(double %38, double 3.000000e+00)
%40 = load double*, double** %10
store double %39, double* %40
br label %46
41: ; preds = %30
%42 = load double, double* %13
%43 = fsub double %42, 0x3FC1A7B9611A7B96
%44 = fdiv double %43, 0x401F25E353F7CED9
%45 = load double*, double** %10
store double %44, double* %45
br label %46
46: ; preds = %41, %37
%47 = load double, double* %14
%48 = load double, double* %9
%49 = fdiv double %48, 2.000000e+02
%50 = fsub double %47, %49
store double %50, double* %15
%51 = load double, double* %15
%52 = fcmp ogt double %51, 2.068930e-01
br i1 %52, label %53, label %57
53: ; preds = %46
%54 = load double, double* %15
%55 = call double @pow(double %54, double 3.000000e+00)
%56 = load double*, double** %12
store double %55, double* %56
br label %62
57: ; preds = %46
%58 = load double, double* %15
%59 = fsub double %58, 0x3FC1A7B9611A7B96
%60 = fdiv double %59, 0x401F25E353F7CED9
%61 = load double*, double** %12
store double %60, double* %61
br label %62
62: ; preds = %57, %53
%63 = load double*, double** %10
%64 = load double, double* %63
%65 = fmul double %64, 0x406E4BB890D5A5B9
store double %65, double* %63
%66 = load double*, double** %11
%67 = load double, double* %66
%68 = fmul double %67, 2.550000e+02
store double %68, double* %66
%69 = load double*, double** %12
%70 = load double, double* %69
%71 = fmul double %70, 0x40715A1DC725C3DF
store double %71, double* %69
ret void
}

LLVM IR (-O2):
define void @Lab2XYZ(double %0, double %1, double %2, double* nocapture %3, double* nocapture %4, double* nocapture %5) {
%7 = fadd double %0, 1.600000e+01
%8 = fdiv double %7, 1.160000e+02
%9 = fcmp ogt double %8, 2.068930e-01
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call double @pow(double %8, double 3.000000e+00)
br label %15
12: ; preds = %6
%13 = fadd double %8, 0xBFC1A7B9611A7B96
%14 = fdiv double %13, 0x401F25E353F7CED9
br label %15
15: ; preds = %12, %10
%16 = phi double [ %14, %12 ], [ %11, %10 ]
store double %16, double* %4
%17 = fdiv double %1, 5.000000e+02
%18 = fadd double %17, %8
%19 = fcmp ogt double %18, 2.068930e-01
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = tail call double @pow(double %18, double 3.000000e+00)
br label %25
22: ; preds = %15
%23 = fadd double %18, 0xBFC1A7B9611A7B96
%24 = fdiv double %23, 0x401F25E353F7CED9
br label %25
25: ; preds = %22, %20
%26 = phi double [ %24, %22 ], [ %21, %20 ]
store double %26, double* %3
%27 = fdiv double %2, 2.000000e+02
%28 = fsub double %8, %27
%29 = fcmp ogt double %28, 2.068930e-01
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = tail call double @pow(double %28, double 3.000000e+00)
br label %35
32: ; preds = %25
%33 = fadd double %28, 0xBFC1A7B9611A7B96
%34 = fdiv double %33, 0x401F25E353F7CED9
br label %35
35: ; preds = %32, %30
%36 = phi double [ %34, %32 ], [ %31, %30 ]
store double %36, double* %5
%37 = load double, double* %3
%38 = fmul double %37, 0x406E4BB890D5A5B9
store double %38, double* %3
%39 = load double, double* %4
%40 = fmul double %39, 2.550000e+02
store double %40, double* %4
%41 = load double, double* %5
%42 = fmul double %41, 0x40715A1DC725C3DF
store double %42, double* %5
ret void
}