#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 */
int /*<<< orphan*/ glClearColor(unsigned char, unsigned char, unsigned char,
                                unsigned char);
int gl_set_bg_color(unsigned char r, unsigned char g, unsigned char b,
                    unsigned char a) {
  glClearColor(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
  return 0;
}


x86 assembly (clang, -O0):
<gl_set_bg_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xec1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,%sil
movzbl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,%dl
movzbl -0x3(%rbp),%eax
cvtsi2sd %eax,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %al,%cl
movzbl -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
movzbl %sil,%edi
movzbl %dl,%esi
movzbl %cl,%edx
movzbl %al,%ecx
call   1030 <glClearColor@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_set_bg_color>:
push   %rax
cvtsi2sd %edi,%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
movzbl %al,%edi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
call   1030 <glClearColor@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gl_set_bg_color(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 2.550000e+02
%13 = fptoui double %12 to i8
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = sitofp i32 %15 to double
%17 = fdiv double %16, 2.550000e+02
%18 = fptoui double %17 to i8
%19 = load i8, i8* %7
%20 = zext i8 %19 to i32
%21 = sitofp i32 %20 to double
%22 = fdiv double %21, 2.550000e+02
%23 = fptoui double %22 to i8
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = sitofp i32 %25 to double
%27 = fdiv double %26, 2.550000e+02
%28 = fptoui double %27 to i8
%29 = call i32 @glClearColor(i8 zeroext %13, i8 zeroext %18, i8 zeroext %23, i8 zeroext %28)
ret i32 0
}

LLVM IR (-O2):
define i32 @gl_set_bg_color(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = uitofp i8 %0 to double
%6 = fdiv double %5, 2.550000e+02
%7 = fptoui double %6 to i8
%8 = uitofp i8 %1 to double
%9 = fdiv double %8, 2.550000e+02
%10 = fptoui double %9 to i8
%11 = uitofp i8 %2 to double
%12 = fdiv double %11, 2.550000e+02
%13 = fptoui double %12 to i8
%14 = uitofp i8 %3 to double
%15 = fdiv double %14, 2.550000e+02
%16 = fptoui double %15 to i8
%17 = tail call i32 @glClearColor(i8 zeroext %7, i8 zeroext %10, i8 zeroext %13, i8 zeroext %16)
ret i32 0
}