#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);
double dmnsn_sRGB_gamma(double Clinear) {
  if (Clinear == 1.0) {
    return 1.0;
  } else if (Clinear > 0.0031308) {
    return 1.055 * pow(Clinear, 1.0 / 2.4) - 0.055;
  } else {
    return 12.92 * Clinear;
  }
}


x86 assembly (clang, -O0):
<dmnsn_sRGB_gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    114c <dmnsn_sRGB_gamma+0x3c>
jp     114c <dmnsn_sRGB_gamma+0x3c>
movsd  0xebe(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a9 <dmnsn_sRGB_gamma+0x99>
movsd  -0x10(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1197 <dmnsn_sRGB_gamma+0x87>
movsd  -0x10(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xe9b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe97(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a9 <dmnsn_sRGB_gamma+0x99>
movsd  0xe71(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmnsn_sRGB_gamma>:
push   %rax
movsd  0xee7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1121 <dmnsn_sRGB_gamma+0x11>
jnp    1156 <dmnsn_sRGB_gamma+0x46>
ucomisd 0xedf(%rip),%xmm0
jbe    114a <dmnsn_sRGB_gamma+0x3a>
movsd  0xee5(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xee0(%rip),%xmm0
addsd  0xee0(%rip),%xmm0
pop    %rax
ret
mulsd  0xebe(%rip),%xmm0
movapd %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dmnsn_sRGB_gamma(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 1.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %17
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 3.130800e-03
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load double, double* %3
%12 = call double @pow(double %11, double 0x3FDAAAAAAAAAAAAB)
%13 = call double @llvm.fmuladd.f64(double 1.055000e+00, double %12, double -5.500000e-02)
store double %13, double* %2
br label %17
14: ; preds = %7
%15 = load double, double* %3
%16 = fmul double 1.292000e+01, %15
store double %16, double* %2
br label %17
17: ; preds = %14, %10, %6
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @dmnsn_sRGB_gamma(double %0) {
%2 = fcmp oeq double %0, 1.000000e+00
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 3.130800e-03
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = tail call double @pow(double %0, double 0x3FDAAAAAAAAAAAAB)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.055000e+00, double -5.500000e-02)
br label %10
8: ; preds = %3
%9 = fmul double %0, 1.292000e+01
br label %10
10: ; preds = %1, %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ], [ 1.000000e+00, %1 ]
ret double %11
}