#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_Toggle(int red, int green, int blue) {
  if (red) {
    (*((volatile uint32_t *)0x40025020)) =
        (*((volatile uint32_t *)0x40025020)) ^ 0x08;
  }
  if (green) {
    (*((volatile uint32_t *)0x40005020)) =
        (*((volatile uint32_t *)0x40005020)) ^ 0x08;
  }
  if (blue) {
    (*((volatile uint32_t *)0x40006040)) =
        (*((volatile uint32_t *)0x40006040)) ^ 0x10;
  }
}


x86 assembly (clang, -O0):
<BSP_RGB_D_Toggle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1128 <BSP_RGB_D_Toggle+0x28>
mov    $0x40025020,%eax
mov    (%rax),%ecx
xor    $0x8,%ecx
mov    $0x40025020,%eax
mov    %ecx,(%rax)
cmpl   $0x0,-0x8(%rbp)
je     1143 <BSP_RGB_D_Toggle+0x43>
mov    $0x40005020,%eax
mov    (%rax),%ecx
xor    $0x8,%ecx
mov    $0x40005020,%eax
mov    %ecx,(%rax)
cmpl   $0x0,-0xc(%rbp)
je     115e <BSP_RGB_D_Toggle+0x5e>
mov    $0x40006040,%eax
mov    (%rax),%ecx
xor    $0x10,%ecx
mov    $0x40006040,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_RGB_D_Toggle>:
test   %edi,%edi
je     110c <BSP_RGB_D_Toggle+0xc>
xorl   $0x8,0x40025020
08
test   %esi,%esi
je     1118 <BSP_RGB_D_Toggle+0x18>
xorl   $0x8,0x40005020
08
test   %edx,%edx
je     1124 <BSP_RGB_D_Toggle+0x24>
xorl   $0x10,0x40006040
10
ret

LLVM IR (-O0):
define void @BSP_RGB_D_Toggle(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 %12
9: ; preds = %3
%10 = load volatile i32, i32* inttoptr (i64 1073893408 to i32*)
%11 = xor i32 %10, 8
store volatile i32 %11, i32* inttoptr (i64 1073893408 to i32*)
br label %12
12: ; preds = %9, %3
%13 = load i32, i32* %5
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load volatile i32, i32* inttoptr (i64 1073762336 to i32*)
%17 = xor i32 %16, 8
store volatile i32 %17, i32* inttoptr (i64 1073762336 to i32*)
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %6
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load volatile i32, i32* inttoptr (i64 1073766464 to i32*)
%23 = xor i32 %22, 16
store volatile i32 %23, i32* inttoptr (i64 1073766464 to i32*)
br label %24
24: ; preds = %21, %18
ret void
}

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