#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 */
typedef int c;

/* Variables and functions */
unsigned int nsvg__RGBA(unsigned char, unsigned char, unsigned char,
                        unsigned char);
float nsvg__clampf(float, float, float);
unsigned int nsvg__applyOpacity(unsigned int c, float u) {
  int iu = (int)(nsvg__clampf(u, 0.0f, 1.0f) * 256.0f);
  int r = (c)&0xff;
  int g = (c >> 8) & 0xff;
  int b = (c >> 16) & 0xff;
  int a = (((c >> 24) & 0xff) * iu) >> 8;
  return nsvg__RGBA((unsigned char)r, (unsigned char)g, (unsigned char)b,
                    (unsigned char)a);
}


x86 assembly (clang, -O0):
<nsvg__applyOpacity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
movss  0xec4(%rip),%xmm2
call   1030 <nsvg__clampf@plt>
movss  0xeb3(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
imul   -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%sil
mov    -0x14(%rbp),%eax
mov    %al,%dl
mov    -0x18(%rbp),%eax
mov    %al,%cl
mov    -0x1c(%rbp),%eax
movzbl %sil,%edi
movzbl %dl,%esi
movzbl %cl,%edx
movzbl %al,%ecx
call   1040 <nsvg__RGBA@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsvg__applyOpacity>:
push   %rbx
mov    %edi,%ebx
movss  0xed5(%rip),%xmm2
xorps  %xmm1,%xmm1
call   1030 <nsvg__clampf@plt>
mulss  0xec9(%rip),%xmm0
cvttss2si %xmm0,%eax
mov    %ebx,%edx
shr    $0x10,%edx
mov    %ebx,%ecx
shr    $0x18,%ecx
imul   %eax,%ecx
movzbl %ch,%ecx
movzbl %bl,%edi
movzbl %bh,%esi
movzbl %dl,%edx
pop    %rbx
jmp    1040 <nsvg__RGBA@plt>

LLVM IR (-O0):
define i32 @nsvg__applyOpacity(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store float %1, float* %4
%10 = load float, float* %4
%11 = call float @nsvg__clampf(float %10, float 0.000000e+00, float 1.000000e+00)
%12 = fmul float %11, 2.560000e+02
%13 = fptosi float %12 to i32
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = and i32 %14, 255
store i32 %15, i32* %6
%16 = load i32, i32* %3
%17 = lshr i32 %16, 8
%18 = and i32 %17, 255
store i32 %18, i32* %7
%19 = load i32, i32* %3
%20 = lshr i32 %19, 16
%21 = and i32 %20, 255
store i32 %21, i32* %8
%22 = load i32, i32* %3
%23 = lshr i32 %22, 24
%24 = and i32 %23, 255
%25 = load i32, i32* %5
%26 = mul i32 %24, %25
%27 = lshr i32 %26, 8
store i32 %27, i32* %9
%28 = load i32, i32* %6
%29 = trunc i32 %28 to i8
%30 = load i32, i32* %7
%31 = trunc i32 %30 to i8
%32 = load i32, i32* %8
%33 = trunc i32 %32 to i8
%34 = load i32, i32* %9
%35 = trunc i32 %34 to i8
%36 = call i32 @nsvg__RGBA(i8 zeroext %29, i8 zeroext %31, i8 zeroext %33, i8 zeroext %35)
ret i32 %36
}

LLVM IR (-O2):
define i32 @nsvg__applyOpacity(i32 %0, float %1) {
%3 = tail call float @nsvg__clampf(float %1, float 0.000000e+00, float 1.000000e+00)
%4 = fmul float %3, 2.560000e+02
%5 = fptosi float %4 to i32
%6 = lshr i32 %0, 8
%7 = lshr i32 %0, 16
%8 = lshr i32 %0, 24
%9 = mul i32 %8, %5
%10 = lshr i32 %9, 8
%11 = trunc i32 %0 to i8
%12 = trunc i32 %6 to i8
%13 = trunc i32 %7 to i8
%14 = trunc i32 %10 to i8
%15 = tail call i32 @nsvg__RGBA(i8 zeroext %11, i8 zeroext %12, i8 zeroext %13, i8 zeroext %14)
ret i32 %15
}