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


x86 assembly (clang, -O0):
<color_scene_linear_to_srgb>:
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_scene_linear_to_srgb+0x78>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    115b <color_scene_linear_to_srgb+0x4b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1175 <color_scene_linear_to_srgb+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    11bb <color_scene_linear_to_srgb+0xab>
movss  -0x8(%rbp),%xmm0
movsd  0xe83(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xe66(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe62(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_scene_linear_to_srgb>:
push   %rax
cvtss2sd %xmm0,%xmm1
movsd  0xee3(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    113e <color_scene_linear_to_srgb+0x2e>
xorpd  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ja     115b <color_scene_linear_to_srgb+0x4b>
mulsd  0xee8(%rip),%xmm1
movapd %xmm1,%xmm0
jmp    115b <color_scene_linear_to_srgb+0x4b>
movsd  0xec2(%rip),%xmm1
call   1030 <pow@plt>
mulsd  0xebd(%rip),%xmm0
addsd  0xebd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @color_scene_linear_to_srgb(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, 3.130800e-03
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, 1.292000e+01
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 %24
19: ; preds = %1
%20 = load float, float* %3
%21 = call double @pow(float %20, double 0x3FDAAAAAAAAAAAAB)
%22 = call double @llvm.fmuladd.f64(double 1.055000e+00, double %21, double -5.500000e-02)
%23 = fptrunc double %22 to float
store float %23, float* %2
br label %24
24: ; preds = %19, %16
%25 = load float, float* %2
ret float %25
}

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