#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 cbrt(double);
void(libclut_model_ciexyz_to_cieluv)(double X, double Y, double Z, double Xn,
                                     double Yn, double Zn, double *L, double *u,
                                     double *v) {
  do {
    double xn__ = (Xn), yn__ = (Yn);
    double t__ = xn__ + 15 * yn__ + 3 * (Zn);
    double u__ = 4 * xn__ / t__;
    double v__ = 9 * yn__ / t__;
    double x__ = (X), y__ = (Y);
    t__ = x__ + 15 * y__ + 3 * (Z);
    u__ = 4 * x__ / t__ - u__;
    v__ = 9 * y__ / t__ - v__;
    y__ /= yn__;
    if (y__ * 24389 <= (double)216)
      y__ *= 24389, y__ /= 27;
    else
      y__ = cbrt(y__) * 116 - 16;
    *(L) = y__;
    y__ *= 13;
    *(u) = y__ * u__;
    *(v) = y__ * v__;
  } while (0);
}


x86 assembly (clang, -O0):
<libclut_model_ciexyz_to_cieluv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
mov    %rdi,-0x38(%rbp)
mov    %rsi,-0x40(%rbp)
mov    %rdx,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  0xebd(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  0xea0(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe83(%rip),%xmm0
mulsd  -0x50(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe64(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
movsd  0xe47(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe2a(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe0d(%rip),%xmm0
mulsd  -0x78(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xde9(%rip),%xmm0
mulsd  -0x80(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xdb2(%rip),%xmm1
mulsd  -0x80(%rbp),%xmm1
movsd  0xd9d(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     129a <libclut_model_ciexyz_to_cieluv+0x18a>
movsd  0xd93(%rip),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  0xda4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    12b3 <libclut_model_ciexyz_to_cieluv+0x1a3>
movsd  -0x80(%rbp),%xmm0
call   1030 <cbrt@plt>
imul   $0x74,%eax,%eax
sub    $0x10,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xd70(%rip),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x80(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mov    -0x48(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libclut_model_ciexyz_to_cieluv>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movapd %xmm0,%xmm8
movsd  0xed1(%rip),%xmm0
movapd %xmm4,%xmm6
mulsd  %xmm0,%xmm6
addsd  %xmm3,%xmm6
movsd  0xec5(%rip),%xmm7
mulsd  %xmm7,%xmm5
addsd  %xmm6,%xmm5
mulsd  %xmm1,%xmm0
addsd  %xmm8,%xmm0
mulsd  %xmm7,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm1,%xmm0
divsd  %xmm4,%xmm0
movsd  0xea4(%rip),%xmm6
mulsd  %xmm0,%xmm6
movsd  0xea0(%rip),%xmm7
ucomisd %xmm6,%xmm7
jae    11da <libclut_model_ciexyz_to_cieluv+0xca>
movsd  %xmm1,0x28(%rsp)
movsd  %xmm8,0x20(%rsp)
movsd  %xmm5,0x18(%rsp)
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm4,(%rsp)
call   1030 <cbrt@plt>
movsd  (%rsp),%xmm4
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
movsd  0x18(%rsp),%xmm5
movsd  0x20(%rsp),%xmm8
movsd  0x28(%rsp),%xmm1
imul   $0x74,%eax,%eax
add    $0xfffffff0,%eax
xorps  %xmm6,%xmm6
cvtsi2sd %eax,%xmm6
jmp    11e2 <libclut_model_ciexyz_to_cieluv+0xd2>
divsd  0xe3e(%rip),%xmm6
movsd  0xe3e(%rip),%xmm0
mulsd  %xmm0,%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm4
divsd  %xmm5,%xmm4
subsd  %xmm4,%xmm1
movsd  0xe2a(%rip),%xmm0
mulsd  %xmm0,%xmm8
divsd  %xmm2,%xmm8
mulsd  %xmm0,%xmm3
divsd  %xmm5,%xmm3
subsd  %xmm3,%xmm8
movsd  %xmm6,(%rbx)
mulsd  0xe0f(%rip),%xmm6
mulsd  %xmm6,%xmm8
movsd  %xmm8,(%r15)
mulsd  %xmm1,%xmm6
movsd  %xmm6,(%r14)
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @libclut_model_ciexyz_to_cieluv(double %0, double %1, double %2, double %3, double %4, double %5, double* %6, double* %7, double* %8) {
%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
%24 = alloca double
%25 = alloca double
store double %0, double* %10
store double %1, double* %11
store double %2, double* %12
store double %3, double* %13
store double %4, double* %14
store double %5, double* %15
store double* %6, double** %16
store double* %7, double** %17
store double* %8, double** %18
br label %26
26: ; preds = %9
%27 = load double, double* %13
store double %27, double* %19
%28 = load double, double* %14
store double %28, double* %20
%29 = load double, double* %19
%30 = load double, double* %20
%31 = call double @llvm.fmuladd.f64(double 1.500000e+01, double %30, double %29)
%32 = load double, double* %15
%33 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %32, double %31)
store double %33, double* %21
%34 = load double, double* %19
%35 = fmul double 4.000000e+00, %34
%36 = load double, double* %21
%37 = fdiv double %35, %36
store double %37, double* %22
%38 = load double, double* %20
%39 = fmul double 9.000000e+00, %38
%40 = load double, double* %21
%41 = fdiv double %39, %40
store double %41, double* %23
%42 = load double, double* %10
store double %42, double* %24
%43 = load double, double* %11
store double %43, double* %25
%44 = load double, double* %24
%45 = load double, double* %25
%46 = call double @llvm.fmuladd.f64(double 1.500000e+01, double %45, double %44)
%47 = load double, double* %12
%48 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %47, double %46)
store double %48, double* %21
%49 = load double, double* %24
%50 = fmul double 4.000000e+00, %49
%51 = load double, double* %21
%52 = fdiv double %50, %51
%53 = load double, double* %22
%54 = fsub double %52, %53
store double %54, double* %22
%55 = load double, double* %25
%56 = fmul double 9.000000e+00, %55
%57 = load double, double* %21
%58 = fdiv double %56, %57
%59 = load double, double* %23
%60 = fsub double %58, %59
store double %60, double* %23
%61 = load double, double* %20
%62 = load double, double* %25
%63 = fdiv double %62, %61
store double %63, double* %25
%64 = load double, double* %25
%65 = fmul double %64, 2.438900e+04
%66 = fcmp ole double %65, 2.160000e+02
br i1 %66, label %67, label %72
67: ; preds = %26
%68 = load double, double* %25
%69 = fmul double %68, 2.438900e+04
store double %69, double* %25
%70 = load double, double* %25
%71 = fdiv double %70, 2.700000e+01
store double %71, double* %25
br label %78
72: ; preds = %26
%73 = load double, double* %25
%74 = call i32 @cbrt(double %73)
%75 = mul nsw i32 %74, 116
%76 = sub nsw i32 %75, 16
%77 = sitofp i32 %76 to double
store double %77, double* %25
br label %78
78: ; preds = %72, %67
%79 = load double, double* %25
%80 = load double*, double** %16
store double %79, double* %80
%81 = load double, double* %25
%82 = fmul double %81, 1.300000e+01
store double %82, double* %25
%83 = load double, double* %25
%84 = load double, double* %22
%85 = fmul double %83, %84
%86 = load double*, double** %17
store double %85, double* %86
%87 = load double, double* %25
%88 = load double, double* %23
%89 = fmul double %87, %88
%90 = load double*, double** %18
store double %89, double* %90
br label %91
91: ; preds = %78
ret void
}

LLVM IR (-O2):
define void @libclut_model_ciexyz_to_cieluv(double %0, double %1, double %2, double %3, double %4, double %5, double* nocapture writeonly %6, double* nocapture writeonly %7, double* nocapture writeonly %8) {
%10 = tail call double @llvm.fmuladd.f64(double %4, double 1.500000e+01, double %3)
%11 = tail call double @llvm.fmuladd.f64(double %5, double 3.000000e+00, double %10)
%12 = tail call double @llvm.fmuladd.f64(double %1, double 1.500000e+01, double %0)
%13 = tail call double @llvm.fmuladd.f64(double %2, double 3.000000e+00, double %12)
%14 = fdiv double %1, %4
%15 = fmul double %14, 2.438900e+04
%16 = fcmp ugt double %15, 2.160000e+02
br i1 %16, label %19, label %17
17: ; preds = %9
%18 = fdiv double %15, 2.700000e+01
br label %24
19: ; preds = %9
%20 = tail call i32 @cbrt(double %14)
%21 = mul nsw i32 %20, 116
%22 = add nsw i32 %21, -16
%23 = sitofp i32 %22 to double
br label %24
24: ; preds = %19, %17
%25 = phi double [ %18, %17 ], [ %23, %19 ]
%26 = fmul double %1, 9.000000e+00
%27 = fdiv double %26, %13
%28 = fmul double %4, 9.000000e+00
%29 = fdiv double %28, %11
%30 = fsub double %27, %29
%31 = fmul double %0, 4.000000e+00
%32 = fdiv double %31, %13
%33 = fmul double %3, 4.000000e+00
%34 = fdiv double %33, %11
%35 = fsub double %32, %34
store double %25, double* %6
%36 = fmul double %25, 1.300000e+01
%37 = fmul double %35, %36
store double %37, double* %7
%38 = fmul double %30, %36
store double %38, double* %8
ret void
}