#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_inverse_gamma(double CsRGB) {
  if (CsRGB == 1.0) {
    return 1.0;
  } else if (CsRGB <= 0.040449936) {
    return CsRGB / 12.92;
  } else {
    return pow((CsRGB + 0.055) / 1.055, 2.4);
  }
}


x86 assembly (clang, -O0):
<dmnsn_sRGB_inverse_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_inverse_gamma+0x3c>
jp     114c <dmnsn_sRGB_inverse_gamma+0x3c>
movsd  0xebe(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a5 <dmnsn_sRGB_inverse_gamma+0x95>
movsd  0xeb4(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     117a <dmnsn_sRGB_inverse_gamma+0x6a>
movsd  -0x10(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a5 <dmnsn_sRGB_inverse_gamma+0x95>
movsd  0xe9e(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xe89(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe75(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmnsn_sRGB_inverse_gamma>:
movsd  0xee8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1125 <dmnsn_sRGB_inverse_gamma+0x15>
jp     1125 <dmnsn_sRGB_inverse_gamma+0x15>
movapd %xmm1,%xmm0
ret
movsd  0xedb(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1150 <dmnsn_sRGB_inverse_gamma+0x40>
addsd  0xedd(%rip),%xmm0
divsd  0xedd(%rip),%xmm0
movsd  0xedd(%rip),%xmm1
jmp    1030 <pow@plt>
divsd  0xeb8(%rip),%xmm0
movapd %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dmnsn_sRGB_inverse_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 %18
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ole double %8, 0x3FA4B5DAA07D970D
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load double, double* %3
%12 = fdiv double %11, 1.292000e+01
store double %12, double* %2
br label %18
13: ; preds = %7
%14 = load double, double* %3
%15 = fadd double %14, 5.500000e-02
%16 = fdiv double %15, 1.055000e+00
%17 = call double @pow(double %16, double 2.400000e+00)
store double %17, double* %2
br label %18
18: ; preds = %13, %10, %6
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @dmnsn_sRGB_inverse_gamma(double %0) {
%2 = fcmp oeq double %0, 1.000000e+00
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = fcmp ugt double %0, 0x3FA4B5DAA07D970D
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = fdiv double %0, 1.292000e+01
br label %11
7: ; preds = %3
%8 = fadd double %0, 5.500000e-02
%9 = fdiv double %8, 1.055000e+00
%10 = tail call double @pow(double %9, double 2.400000e+00)
br label %11
11: ; preds = %1, %7, %5
%12 = phi double [ %6, %5 ], [ %10, %7 ], [ 1.000000e+00, %1 ]
ret double %12
}