#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 uint32_t;

/* Variables and functions */
void BSP_RGB_D_Set(int red, int green, int blue) {
  if (red) {
    (*((volatile uint32_t *)0x40025020)) = 0x08;
  } else {
    (*((volatile uint32_t *)0x40025020)) = 0x00;
  }
  if (green) {
    (*((volatile uint32_t *)0x40005020)) = 0x08;
  } else {
    (*((volatile uint32_t *)0x40005020)) = 0x00;
  }
  if (blue) {
    (*((volatile uint32_t *)0x40006040)) = 0x10;
  } else {
    (*((volatile uint32_t *)0x40006040)) = 0x00;
  }
}


x86 assembly (clang, -O0):
<BSP_RGB_D_Set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1127 <BSP_RGB_D_Set+0x27>
mov    $0x40025020,%eax
movl   $0x8,(%rax)
jmp    1132 <BSP_RGB_D_Set+0x32>
mov    $0x40025020,%eax
movl   $0x0,(%rax)
cmpl   $0x0,-0x8(%rbp)
je     114c <BSP_RGB_D_Set+0x4c>
mov    $0x40005020,%eax
movl   $0x8,(%rax)
jmp    1157 <BSP_RGB_D_Set+0x57>
mov    $0x40005020,%eax
movl   $0x0,(%rax)
cmpl   $0x0,-0xc(%rbp)
je     1171 <BSP_RGB_D_Set+0x71>
mov    $0x40006040,%eax
movl   $0x10,(%rax)
jmp    117c <BSP_RGB_D_Set+0x7c>
mov    $0x40006040,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_RGB_D_Set>:
xor    %eax,%eax
test   %edx,%edx
setne  %al
xor    %ecx,%ecx
test   %esi,%esi
setne  %cl
xor    %edx,%edx
test   %edi,%edi
setne  %dl
shl    $0x3,%edx
mov    %edx,0x40025020
shl    $0x3,%ecx
mov    %ecx,0x40005020
shl    $0x4,%eax
mov    %eax,0x40006040
ret

LLVM IR (-O0):
define void @BSP_RGB_D_Set(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
store volatile i32 8, i32* inttoptr (i64 1073893408 to i32*)
br label %11
10: ; preds = %3
store volatile i32 0, i32* inttoptr (i64 1073893408 to i32*)
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11
store volatile i32 8, i32* inttoptr (i64 1073762336 to i32*)
br label %16
15: ; preds = %11
store volatile i32 0, i32* inttoptr (i64 1073762336 to i32*)
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16
store volatile i32 16, i32* inttoptr (i64 1073766464 to i32*)
br label %21
20: ; preds = %16
store volatile i32 0, i32* inttoptr (i64 1073766464 to i32*)
br label %21
21: ; preds = %20, %19
ret void
}

LLVM IR (-O2):
define void @BSP_RGB_D_Set(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 0, i32 8
store volatile i32 %5, i32* inttoptr (i64 1073893408 to i32*)
%6 = icmp eq i32 %1, 0
%7 = select i1 %6, i32 0, i32 8
store volatile i32 %7, i32* inttoptr (i64 1073762336 to i32*)
%8 = icmp eq i32 %2, 0
%9 = select i1 %8, i32 0, i32 16
store volatile i32 %9, i32* inttoptr (i64 1073766464 to i32*)
ret void
}