#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 */
scalar_t__ fmaxf(float, int /*<<< orphan*/);
int /*<<< orphan*/ fminf(float, scalar_t__);
scalar_t__ linear2srgb(float);
scalar_t__ srgb2linear(float);
__attribute__((always_)) void
imReduceHalfBox4sRGB(unsigned char *dst, unsigned char *src, int bytesperpixel,
                     int bytesperline, float *dithersum) {
  int i, offset[4], sum3;
  float sum0, sum1, sum2;
  offset[0] = 0;
  offset[1] = bytesperpixel;
  offset[2] = bytesperline;
  offset[3] = bytesperline + bytesperpixel;
  sum0 = 0.0f;
  sum1 = 0.0f;
  sum2 = 0.0f;
  sum3 = 2;
  for (i = 0; i < 4; i++) {
    sum0 += srgb2linear((float)src[offset[i] + 0]);
    sum1 += srgb2linear((float)src[offset[i] + 1]);
    sum2 += srgb2linear((float)src[offset[i] + 2]);
    sum3 += (int)src[offset[i] + 2];
  }
  dst[0] = (unsigned char)(fmaxf(
      0.0f, fminf(255.0f, linear2srgb(sum0 * 0.25f) + 0.5f)));
  dst[1] = (unsigned char)(fmaxf(
      0.0f, fminf(255.0f, linear2srgb(sum1 * 0.25f) + 0.5f)));
  dst[2] = (unsigned char)(fmaxf(
      0.0f, fminf(255.0f, linear2srgb(sum2 * 0.25f) + 0.5f)));
  dst[3] = (unsigned char)(sum3 >> 2);
  return;
}


x86 assembly (clang, -O0):
<imReduceHalfBox4sRGB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
movl   $0x2,-0x44(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    1255 <imReduceHalfBox4sRGB+0x115>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movslq -0x40(%rbp,%rcx,4),%rcx
movzbl (%rax,%rcx,1),%eax
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
cvtsi2ss %rax,%xmm1
movss  -0x48(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rax
movslq -0x40(%rbp,%rax,4),%rax
movzbl 0x1(%rax,%rcx,1),%eax
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
cvtsi2ss %rax,%xmm1
movss  -0x4c(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rax
movslq -0x40(%rbp,%rax,4),%rax
movzbl 0x2(%rax,%rcx,1),%eax
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
cvtsi2ss %rax,%xmm0
addss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    -0x40(%rbp,%rcx,4),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
add    -0x44(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119c <imReduceHalfBox4sRGB+0x5c>
movss  0xdab(%rip),%xmm0
mulss  -0x48(%rbp),%xmm0
call   1030 <linear2srgb@plt>
cvtsi2ss %rax,%xmm0
movss  0xd90(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
movss  0xd7b(%rip),%xmm0
call   1050 <fminf@plt>
mov    %eax,%edi
xorps  %xmm0,%xmm0
call   1060 <fmaxf@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movss  0xd64(%rip),%xmm0
mulss  -0x4c(%rbp),%xmm0
call   1030 <linear2srgb@plt>
cvtsi2ss %rax,%xmm0
movss  0xd49(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
movss  0xd34(%rip),%xmm0
call   1050 <fminf@plt>
mov    %eax,%edi
xorps  %xmm0,%xmm0
call   1060 <fmaxf@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
movss  0xd1c(%rip),%xmm0
mulss  -0x50(%rbp),%xmm0
call   1030 <linear2srgb@plt>
cvtsi2ss %rax,%xmm0
movss  0xd01(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
movss  0xcec(%rip),%xmm0
call   1050 <fminf@plt>
mov    %eax,%edi
xorps  %xmm0,%xmm0
call   1060 <fmaxf@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x44(%rbp),%eax
sar    $0x2,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imReduceHalfBox4sRGB>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %rsi,%rbx
mov    %rdi,0x20(%rsp)
lea    (%r15,%r12,1),%eax
mov    %eax,0x18(%rsp)
movzbl (%rsi),%eax
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,0xc(%rsp)
movzbl 0x1(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,0x14(%rsp)
movzbl 0x2(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,0x10(%rsp)
movzbl 0x2(%rbx),%r14d
movslq %r12d,%rbp
movzbl (%rbx,%rbp,1),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
mov    %rax,%r12
movzbl 0x1(%rbx,%rbp,1),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
mov    %rax,%r13
movzbl 0x2(%rbx,%rbp,1),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r12,%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %r13,%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movzbl 0x2(%rbx,%rbp,1),%r13d
add    %r14d,%r13d
addss  0x10(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
movslq %r15d,%rbp
movzbl (%rbx,%rbp,1),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
mov    %rax,%r15
movzbl 0x1(%rbx,%rbp,1),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
mov    %rax,%r12
movzbl 0x2(%rbx,%rbp,1),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %r15,%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %r12,%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movzbl 0x2(%rbx,%rbp,1),%r15d
add    %r13d,%r15d
addss  0x10(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
movslq 0x18(%rsp),%rbp
movzbl (%rbx,%rbp,1),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  0x1c(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
movzbl 0x1(%rbx,%rbp,1),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  0xc(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movzbl 0x2(%rbx,%rbp,1),%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
call   1040 <srgb2linear@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movzbl 0x2(%rbx,%rbp,1),%eax
lea    (%rax,%r15,1),%ebx
add    $0x2,%ebx
movss  0x10(%rsp),%xmm0
mulss  0xcb4(%rip),%xmm0
call   1030 <linear2srgb@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  0xca3(%rip),%xmm0
cvttss2si %xmm0,%rdi
movss  0xc9a(%rip),%xmm0
call   1050 <fminf@plt>
xorps  %xmm0,%xmm0
mov    %eax,%edi
call   1060 <fmaxf@plt>
mov    0x20(%rsp),%rbp
mov    %al,0x0(%rbp)
movss  0xc(%rsp),%xmm0
mulss  0xc6d(%rip),%xmm0
call   1030 <linear2srgb@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  0xc5c(%rip),%xmm0
cvttss2si %xmm0,%rdi
movss  0xc53(%rip),%xmm0
call   1050 <fminf@plt>
xorps  %xmm0,%xmm0
mov    %eax,%edi
call   1060 <fmaxf@plt>
mov    %al,0x1(%rbp)
movss  0x18(%rsp),%xmm0
mulss  0xc2b(%rip),%xmm0
call   1030 <linear2srgb@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  0xc1a(%rip),%xmm0
cvttss2si %xmm0,%rdi
movss  0xc11(%rip),%xmm0
call   1050 <fminf@plt>
xorps  %xmm0,%xmm0
mov    %eax,%edi
call   1060 <fmaxf@plt>
mov    %al,0x2(%rbp)
shr    $0x2,%ebx
mov    %bl,0x3(%rbp)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @imReduceHalfBox4sRGB(i8* %0, i8* %1, i32 %2, i32 %3, float* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca float*
%11 = alloca i32
%12 = alloca [4 x i32]
%13 = alloca i32
%14 = alloca float
%15 = alloca float
%16 = alloca float
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store float* %4, float** %10
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 0
store i32 0, i32* %17
%18 = load i32, i32* %8
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 1
store i32 %18, i32* %19
%20 = load i32, i32* %9
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 2
store i32 %20, i32* %21
%22 = load i32, i32* %9
%23 = load i32, i32* %8
%24 = add nsw i32 %22, %23
%25 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 3
store i32 %24, i32* %25
store float 0.000000e+00, float* %14
store float 0.000000e+00, float* %15
store float 0.000000e+00, float* %16
store i32 2, i32* %13
store i32 0, i32* %11
br label %26
26: ; preds = %84, %5
%27 = load i32, i32* %11
%28 = icmp slt i32 %27, 4
br i1 %28, label %29, label %87
29: ; preds = %26
%30 = load i8*, i8** %7
%31 = load i32, i32* %11
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = add nsw i32 %34, 0
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %30, i64 %36
%38 = load i8, i8* %37
%39 = uitofp i8 %38 to float
%40 = call i64 @srgb2linear(float %39)
%41 = sitofp i64 %40 to float
%42 = load float, float* %14
%43 = fadd float %42, %41
store float %43, float* %14
%44 = load i8*, i8** %7
%45 = load i32, i32* %11
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = add nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %44, i64 %50
%52 = load i8, i8* %51
%53 = uitofp i8 %52 to float
%54 = call i64 @srgb2linear(float %53)
%55 = sitofp i64 %54 to float
%56 = load float, float* %15
%57 = fadd float %56, %55
store float %57, float* %15
%58 = load i8*, i8** %7
%59 = load i32, i32* %11
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = add nsw i32 %62, 2
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %58, i64 %64
%66 = load i8, i8* %65
%67 = uitofp i8 %66 to float
%68 = call i64 @srgb2linear(float %67)
%69 = sitofp i64 %68 to float
%70 = load float, float* %16
%71 = fadd float %70, %69
store float %71, float* %16
%72 = load i8*, i8** %7
%73 = load i32, i32* %11
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 %74
%76 = load i32, i32* %75
%77 = add nsw i32 %76, 2
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i8, i8* %72, i64 %78
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = load i32, i32* %13
%83 = add nsw i32 %82, %81
store i32 %83, i32* %13
br label %84
84: ; preds = %29
%85 = load i32, i32* %11
%86 = add nsw i32 %85, 1
store i32 %86, i32* %11
br label %26
87: ; preds = %26
%88 = load float, float* %14
%89 = fmul float %88, 2.500000e-01
%90 = call i64 @linear2srgb(float %89)
%91 = sitofp i64 %90 to float
%92 = fadd float %91, 5.000000e-01
%93 = fptosi float %92 to i64
%94 = call i32 @fminf(float 2.550000e+02, i64 %93)
%95 = call i64 @fmaxf(float 0.000000e+00, i32 %94)
%96 = trunc i64 %95 to i8
%97 = load i8*, i8** %6
%98 = getelementptr inbounds i8, i8* %97, i64 0
store i8 %96, i8* %98
%99 = load float, float* %15
%100 = fmul float %99, 2.500000e-01
%101 = call i64 @linear2srgb(float %100)
%102 = sitofp i64 %101 to float
%103 = fadd float %102, 5.000000e-01
%104 = fptosi float %103 to i64
%105 = call i32 @fminf(float 2.550000e+02, i64 %104)
%106 = call i64 @fmaxf(float 0.000000e+00, i32 %105)
%107 = trunc i64 %106 to i8
%108 = load i8*, i8** %6
%109 = getelementptr inbounds i8, i8* %108, i64 1
store i8 %107, i8* %109
%110 = load float, float* %16
%111 = fmul float %110, 2.500000e-01
%112 = call i64 @linear2srgb(float %111)
%113 = sitofp i64 %112 to float
%114 = fadd float %113, 5.000000e-01
%115 = fptosi float %114 to i64
%116 = call i32 @fminf(float 2.550000e+02, i64 %115)
%117 = call i64 @fmaxf(float 0.000000e+00, i32 %116)
%118 = trunc i64 %117 to i8
%119 = load i8*, i8** %6
%120 = getelementptr inbounds i8, i8* %119, i64 2
store i8 %118, i8* %120
%121 = load i32, i32* %13
%122 = ashr i32 %121, 2
%123 = trunc i32 %122 to i8
%124 = load i8*, i8** %6
%125 = getelementptr inbounds i8, i8* %124, i64 3
store i8 %123, i8* %125
ret void
}

LLVM IR (-O2):
define void @imReduceHalfBox4sRGB(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2, i32 %3, float* nocapture readnone %4) {
%6 = add nsw i32 %3, %2
%7 = load i8, i8* %1
%8 = uitofp i8 %7 to float
%9 = tail call i64 @srgb2linear(float %8)
%10 = sitofp i64 %9 to float
%11 = getelementptr inbounds i8, i8* %1, i64 1
%12 = load i8, i8* %11
%13 = uitofp i8 %12 to float
%14 = tail call i64 @srgb2linear(float %13)
%15 = sitofp i64 %14 to float
%16 = getelementptr inbounds i8, i8* %1, i64 2
%17 = load i8, i8* %16
%18 = uitofp i8 %17 to float
%19 = tail call i64 @srgb2linear(float %18)
%20 = sitofp i64 %19 to float
%21 = load i8, i8* %16
%22 = zext i8 %21 to i16
%23 = add nuw nsw i16 %22, 2
%24 = sext i32 %2 to i64
%25 = getelementptr inbounds i8, i8* %1, i64 %24
%26 = load i8, i8* %25
%27 = uitofp i8 %26 to float
%28 = tail call i64 @srgb2linear(float %27)
%29 = sitofp i64 %28 to float
%30 = fadd float %10, %29
%31 = add nsw i32 %2, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %1, i64 %32
%34 = load i8, i8* %33
%35 = uitofp i8 %34 to float
%36 = tail call i64 @srgb2linear(float %35)
%37 = sitofp i64 %36 to float
%38 = fadd float %15, %37
%39 = add nsw i32 %2, 2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %1, i64 %40
%42 = load i8, i8* %41
%43 = uitofp i8 %42 to float
%44 = tail call i64 @srgb2linear(float %43)
%45 = sitofp i64 %44 to float
%46 = fadd float %20, %45
%47 = load i8, i8* %41
%48 = zext i8 %47 to i16
%49 = add nuw nsw i16 %23, %48
%50 = sext i32 %3 to i64
%51 = getelementptr inbounds i8, i8* %1, i64 %50
%52 = load i8, i8* %51
%53 = uitofp i8 %52 to float
%54 = tail call i64 @srgb2linear(float %53)
%55 = sitofp i64 %54 to float
%56 = fadd float %30, %55
%57 = add nsw i32 %3, 1
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %1, i64 %58
%60 = load i8, i8* %59
%61 = uitofp i8 %60 to float
%62 = tail call i64 @srgb2linear(float %61)
%63 = sitofp i64 %62 to float
%64 = fadd float %38, %63
%65 = add nsw i32 %3, 2
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %1, i64 %66
%68 = load i8, i8* %67
%69 = uitofp i8 %68 to float
%70 = tail call i64 @srgb2linear(float %69)
%71 = sitofp i64 %70 to float
%72 = fadd float %46, %71
%73 = load i8, i8* %67
%74 = zext i8 %73 to i16
%75 = add nuw nsw i16 %49, %74
%76 = sext i32 %6 to i64
%77 = getelementptr inbounds i8, i8* %1, i64 %76
%78 = load i8, i8* %77
%79 = uitofp i8 %78 to float
%80 = tail call i64 @srgb2linear(float %79)
%81 = sitofp i64 %80 to float
%82 = fadd float %56, %81
%83 = add nsw i32 %6, 1
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %1, i64 %84
%86 = load i8, i8* %85
%87 = uitofp i8 %86 to float
%88 = tail call i64 @srgb2linear(float %87)
%89 = sitofp i64 %88 to float
%90 = fadd float %64, %89
%91 = add nsw i32 %6, 2
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8, i8* %1, i64 %92
%94 = load i8, i8* %93
%95 = uitofp i8 %94 to float
%96 = tail call i64 @srgb2linear(float %95)
%97 = sitofp i64 %96 to float
%98 = fadd float %72, %97
%99 = load i8, i8* %93
%100 = zext i8 %99 to i16
%101 = add nuw nsw i16 %75, %100
%102 = fmul float %82, 2.500000e-01
%103 = tail call i64 @linear2srgb(float %102)
%104 = sitofp i64 %103 to float
%105 = fadd float %104, 5.000000e-01
%106 = fptosi float %105 to i64
%107 = tail call i32 @fminf(float 2.550000e+02, i64 %106)
%108 = tail call i64 @fmaxf(float 0.000000e+00, i32 %107)
%109 = trunc i64 %108 to i8
store i8 %109, i8* %0
%110 = fmul float %90, 2.500000e-01
%111 = tail call i64 @linear2srgb(float %110)
%112 = sitofp i64 %111 to float
%113 = fadd float %112, 5.000000e-01
%114 = fptosi float %113 to i64
%115 = tail call i32 @fminf(float 2.550000e+02, i64 %114)
%116 = tail call i64 @fmaxf(float 0.000000e+00, i32 %115)
%117 = trunc i64 %116 to i8
%118 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %117, i8* %118
%119 = fmul float %98, 2.500000e-01
%120 = tail call i64 @linear2srgb(float %119)
%121 = sitofp i64 %120 to float
%122 = fadd float %121, 5.000000e-01
%123 = fptosi float %122 to i64
%124 = tail call i32 @fminf(float 2.550000e+02, i64 %123)
%125 = tail call i64 @fmaxf(float 0.000000e+00, i32 %124)
%126 = trunc i64 %125 to i8
%127 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %126, i8* %127
%128 = lshr i16 %101, 2
%129 = trunc i16 %128 to i8
%130 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %129, i8* %130
ret void
}