#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 */
float pow(float, double);
float color_srgb_to_scene_linear(float c) {
  if (c < 0.04045)
    return (c < 0.0) ? 0.0 : c * (1.0 / 12.92);
  else
    return pow((c + 0.055) * (1.0 / 1.055), 2.4);
}


x86 assembly (clang, -O0):
<color_srgb_to_scene_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1188 <color_srgb_to_scene_linear+0x78>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    115b <color_srgb_to_scene_linear+0x4b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1175 <color_srgb_to_scene_linear+0x65>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11bf <color_srgb_to_scene_linear+0xaf>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe6b(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movsd  0xe53(%rip),%xmm1
call   1030 <pow@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_srgb_to_scene_linear>:
cvtss2sd %xmm0,%xmm1
movsd  0xee4(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    113b <color_srgb_to_scene_linear+0x2b>
mulsd  0xef6(%rip),%xmm1
cvtsd2ss %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret
addsd  0xec5(%rip),%xmm1
mulsd  0xec5(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movsd  0xebe(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define float @color_srgb_to_scene_linear(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 4.045000e-02
br i1 %6, label %7, label %19
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %7
br label %16
12: ; preds = %7
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fmul double %14, 0x3FB3D0722149B580
br label %16
16: ; preds = %12, %11
%17 = phi double [ 0.000000e+00, %11 ], [ %15, %12 ]
%18 = fptrunc double %17 to float
store float %18, float* %2
br label %26
19: ; preds = %1
%20 = load float, float* %3
%21 = fpext float %20 to double
%22 = fadd double %21, 5.500000e-02
%23 = fmul double %22, 0x3FEE54EDCD0AEB60
%24 = fptrunc double %23 to float
%25 = call float @pow(float %24, double 2.400000e+00)
store float %25, float* %2
br label %26
26: ; preds = %19, %16
%27 = load float, float* %2
ret float %27
}

LLVM IR (-O2):
define float @color_srgb_to_scene_linear(float %0) {
%2 = fpext float %0 to double
%3 = fcmp olt double %2, 4.045000e-02
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = fcmp olt float %0, 0.000000e+00
%6 = fmul double %2, 0x3FB3D0722149B580
%7 = fptrunc double %6 to float
%8 = select i1 %5, float 0.000000e+00, float %7
br label %14
9: ; preds = %1
%10 = fadd double %2, 5.500000e-02
%11 = fmul double %10, 0x3FEE54EDCD0AEB60
%12 = fptrunc double %11 to float
%13 = tail call float @pow(float %12, double 2.400000e+00)
br label %14
14: ; preds = %9, %4
%15 = phi float [ %8, %4 ], [ %13, %9 ]
ret float %15
}