#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 sqrt(double);
double icmCIE94(double Lab1[3], double Lab2[3]) {
  double desq, dhsq;
  double dlsq, dcsq;
  double c12;
  {
    double dl, da, db;
    dl = Lab1[0] - Lab2[0];
    dlsq = dl * dl;
    da = Lab1[1] - Lab2[1];
    db = Lab1[2] - Lab2[2];
    desq = dlsq + da * da + db * db;
  }
  {
    double c1, c2, dc;
    c1 = sqrt(Lab1[1] * Lab1[1] + Lab1[2] * Lab1[2]);
    c2 = sqrt(Lab2[1] * Lab2[1] + Lab2[2] * Lab2[2]);
    c12 = sqrt(c1 * c2);
    dc = c2 - c1;
    dcsq = dc * dc;
  }
  if ((dhsq = desq - dlsq - dcsq) < 0.0)
    dhsq = 0.0;
  {
    double sc, sh;
    sc = 1.0 + 0.048 * c12;
    sh = 1.0 + 0.014 * c12;
    return sqrt(dlsq + dcsq / (sc * sc) + dhsq / (sh * sh));
  }
}


x86 assembly (clang, -O0):
<icmCIE94>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
subsd  -0x30(%rbp),%xmm1
movsd  %xmm1,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    126a <icmCIE94+0x15a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xd99(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd85(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  0xd67(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd63(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
mulsd  -0x70(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
mulsd  -0x78(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icmCIE94>:
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rbx
movsd  (%rdi),%xmm2
movsd  0x8(%rdi),%xmm0
movsd  (%rsi),%xmm1
movaps %xmm1,0x40(%rsp)
movapd %xmm0,%xmm1
subsd  0x8(%rsi),%xmm1
movsd  %xmm1,0x28(%rsp)
movsd  0x10(%rdi),%xmm1
movapd %xmm1,%xmm3
subsd  0x10(%rsi),%xmm3
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm0
movaps %xmm2,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
jb     1171 <icmCIE94+0x61>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
jmp    117e <icmCIE94+0x6e>
call   1030 <sqrt@plt>
xorpd  %xmm4,%xmm4
movapd %xmm0,%xmm2
movsd  0x8(%rbx),%xmm0
movsd  0x10(%rbx),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm4,%xmm0
jb     11a0 <icmCIE94+0x90>
sqrtsd %xmm0,%xmm0
jmp    11b1 <icmCIE94+0xa1>
movapd %xmm2,0x30(%rsp)
call   1030 <sqrt@plt>
movapd 0x30(%rsp),%xmm2
movapd 0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
unpcklpd %xmm0,%xmm3
movapd 0x40(%rsp),%xmm1
unpcklpd %xmm2,%xmm1
subpd  %xmm1,%xmm3
mulpd  %xmm3,%xmm3
movsd  0x28(%rsp),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm4,%xmm4
addsd  %xmm1,%xmm4
mulsd  %xmm0,%xmm2
xorpd  %xmm5,%xmm5
ucomisd %xmm5,%xmm2
jb     1200 <icmCIE94+0xf0>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1225 <icmCIE94+0x115>
movapd %xmm2,%xmm0
movapd %xmm3,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
call   1030 <sqrt@plt>
xorpd  %xmm5,%xmm5
movsd  0x8(%rsp),%xmm4
movapd 0x10(%rsp),%xmm3
subsd  %xmm3,%xmm4
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
subsd  %xmm1,%xmm4
xorpd  %xmm2,%xmm2
maxsd  %xmm4,%xmm2
unpcklpd %xmm0,%xmm0
mulpd  0xdb7(%rip),%xmm0
addpd  0xdbf(%rip),%xmm0
mulpd  %xmm0,%xmm0
movapd %xmm3,%xmm1
shufpd $0x1,%xmm2,%xmm1
divpd  %xmm0,%xmm1
addsd  %xmm1,%xmm3
unpckhpd %xmm1,%xmm1
addsd  %xmm3,%xmm1
ucomisd %xmm5,%xmm1
jb     1281 <icmCIE94+0x171>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbx
ret
movapd %xmm1,%xmm0
add    $0x50,%rsp
pop    %rbx
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @icmCIE94(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%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
%16 = alloca double
%17 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = load double*, double** %4
%22 = getelementptr inbounds double, double* %21, i64 0
%23 = load double, double* %22
%24 = fsub double %20, %23
store double %24, double* %10
%25 = load double, double* %10
%26 = load double, double* %10
%27 = fmul double %25, %26
store double %27, double* %7
%28 = load double*, double** %3
%29 = getelementptr inbounds double, double* %28, i64 1
%30 = load double, double* %29
%31 = load double*, double** %4
%32 = getelementptr inbounds double, double* %31, i64 1
%33 = load double, double* %32
%34 = fsub double %30, %33
store double %34, double* %11
%35 = load double*, double** %3
%36 = getelementptr inbounds double, double* %35, i64 2
%37 = load double, double* %36
%38 = load double*, double** %4
%39 = getelementptr inbounds double, double* %38, i64 2
%40 = load double, double* %39
%41 = fsub double %37, %40
store double %41, double* %12
%42 = load double, double* %7
%43 = load double, double* %11
%44 = load double, double* %11
%45 = call double @llvm.fmuladd.f64(double %43, double %44, double %42)
%46 = load double, double* %12
%47 = load double, double* %12
%48 = call double @llvm.fmuladd.f64(double %46, double %47, double %45)
store double %48, double* %5
%49 = load double*, double** %3
%50 = getelementptr inbounds double, double* %49, i64 1
%51 = load double, double* %50
%52 = load double*, double** %3
%53 = getelementptr inbounds double, double* %52, i64 1
%54 = load double, double* %53
%55 = load double*, double** %3
%56 = getelementptr inbounds double, double* %55, i64 2
%57 = load double, double* %56
%58 = load double*, double** %3
%59 = getelementptr inbounds double, double* %58, i64 2
%60 = load double, double* %59
%61 = fmul double %57, %60
%62 = call double @llvm.fmuladd.f64(double %51, double %54, double %61)
%63 = call double @sqrt(double %62)
store double %63, double* %13
%64 = load double*, double** %4
%65 = getelementptr inbounds double, double* %64, i64 1
%66 = load double, double* %65
%67 = load double*, double** %4
%68 = getelementptr inbounds double, double* %67, i64 1
%69 = load double, double* %68
%70 = load double*, double** %4
%71 = getelementptr inbounds double, double* %70, i64 2
%72 = load double, double* %71
%73 = load double*, double** %4
%74 = getelementptr inbounds double, double* %73, i64 2
%75 = load double, double* %74
%76 = fmul double %72, %75
%77 = call double @llvm.fmuladd.f64(double %66, double %69, double %76)
%78 = call double @sqrt(double %77)
store double %78, double* %14
%79 = load double, double* %13
%80 = load double, double* %14
%81 = fmul double %79, %80
%82 = call double @sqrt(double %81)
store double %82, double* %9
%83 = load double, double* %14
%84 = load double, double* %13
%85 = fsub double %83, %84
store double %85, double* %15
%86 = load double, double* %15
%87 = load double, double* %15
%88 = fmul double %86, %87
store double %88, double* %8
%89 = load double, double* %5
%90 = load double, double* %7
%91 = fsub double %89, %90
%92 = load double, double* %8
%93 = fsub double %91, %92
store double %93, double* %6
%94 = fcmp olt double %93, 0.000000e+00
br i1 %94, label %95, label %96
95: ; preds = %2
store double 0.000000e+00, double* %6
br label %96
96: ; preds = %95, %2
%97 = load double, double* %9
%98 = call double @llvm.fmuladd.f64(double 4.800000e-02, double %97, double 1.000000e+00)
store double %98, double* %16
%99 = load double, double* %9
%100 = call double @llvm.fmuladd.f64(double 1.400000e-02, double %99, double 1.000000e+00)
store double %100, double* %17
%101 = load double, double* %7
%102 = load double, double* %8
%103 = load double, double* %16
%104 = load double, double* %16
%105 = fmul double %103, %104
%106 = fdiv double %102, %105
%107 = fadd double %101, %106
%108 = load double, double* %6
%109 = load double, double* %17
%110 = load double, double* %17
%111 = fmul double %109, %110
%112 = fdiv double %108, %111
%113 = fadd double %107, %112
%114 = call double @sqrt(double %113)
ret double %114
}

LLVM IR (-O2):
define double @icmCIE94(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fsub double %6, %8
%10 = getelementptr inbounds double, double* %0, i64 2
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %1, i64 2
%13 = load double, double* %12
%14 = fsub double %11, %13
%15 = fmul double %11, %11
%16 = tail call double @llvm.fmuladd.f64(double %6, double %6, double %15)
%17 = tail call double @sqrt(double %16)
%18 = load double, double* %7
%19 = load double, double* %12
%20 = fmul double %19, %19
%21 = tail call double @llvm.fmuladd.f64(double %18, double %18, double %20)
%22 = tail call double @sqrt(double %21)
%23 = insertelement <2 x double> poison, double %3, i64 0
%24 = insertelement <2 x double> %23, double %22, i64 1
%25 = insertelement <2 x double> poison, double %4, i64 0
%26 = insertelement <2 x double> %25, double %17, i64 1
%27 = fsub <2 x double> %24, %26
%28 = fmul <2 x double> %27, %27
%29 = extractelement <2 x double> %28, i64 0
%30 = tail call double @llvm.fmuladd.f64(double %9, double %9, double %29)
%31 = tail call double @llvm.fmuladd.f64(double %14, double %14, double %30)
%32 = fmul double %17, %22
%33 = tail call double @sqrt(double %32)
%34 = fsub double %31, %29
%35 = extractelement <2 x double> %28, i64 1
%36 = fsub double %34, %35
%37 = fcmp olt double %36, 0.000000e+00
%38 = select i1 %37, double 0.000000e+00, double %36
%39 = insertelement <2 x double> poison, double %33, i64 0
%40 = shufflevector <2 x double> %39, <2 x double> poison, <2 x i32> zeroinitializer
%41 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %40, <2 x double> <double 4.800000e-02, double 1.400000e-02>, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
%42 = fmul <2 x double> %41, %41
%43 = insertelement <2 x double> poison, double %35, i64 0
%44 = insertelement <2 x double> %43, double %38, i64 1
%45 = fdiv <2 x double> %44, %42
%46 = fadd <2 x double> %28, %45
%47 = shufflevector <2 x double> %45, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%48 = fadd <2 x double> %46, %47
%49 = extractelement <2 x double> %48, i64 0
%50 = tail call double @sqrt(double %49)
ret double %50
}