#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 */
int /*<<< orphan*/ BSP_RGB_D_Set(int, int, int);
void BSP_RGB_D_Init(int red, int green, int blue) {
  (*((volatile uint32_t *)0x400FE608)) |= 0x00000026;
  while (((*((volatile uint32_t *)0x400FEA08)) & 0x26) != 0x26) {
  };
  (*((volatile uint32_t *)0x40025528)) &= ~0x08;
  (*((volatile uint32_t *)0x40006528)) &= ~0x10;
  (*((volatile uint32_t *)0x40005528)) &= ~0x08;
  (*((volatile uint32_t *)0x4002552C)) =
      ((*((volatile uint32_t *)0x4002552C)) & 0xFFFF0FFF) + 0x00000000;
  (*((volatile uint32_t *)0x4000652C)) =
      ((*((volatile uint32_t *)0x4000652C)) & 0xFFF0FFFF) + 0x00000000;
  (*((volatile uint32_t *)0x4000552C)) =
      ((*((volatile uint32_t *)0x4000552C)) & 0xFFFF0FFF) + 0x00000000;
  (*((volatile uint32_t *)0x40025400)) |= 0x08;
  (*((volatile uint32_t *)0x40006400)) |= 0x10;
  (*((volatile uint32_t *)0x40005400)) |= 0x08;
  (*((volatile uint32_t *)0x40025420)) &= ~0x08;
  (*((volatile uint32_t *)0x40006420)) &= ~0x10;
  (*((volatile uint32_t *)0x40005420)) &= ~0x08;
  (*((volatile uint32_t *)0x40025510)) &= ~0x08;
  (*((volatile uint32_t *)0x40006510)) &= ~0x10;
  (*((volatile uint32_t *)0x40005510)) &= ~0x08;
  (*((volatile uint32_t *)0x4002551C)) |= 0x08;
  (*((volatile uint32_t *)0x4000651C)) |= 0x10;
  (*((volatile uint32_t *)0x4000551C)) |= 0x08;
  BSP_RGB_D_Set(red, green, blue);
}


x86 assembly (clang, -O0):
<BSP_RGB_D_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x400fe608,%eax
mov    (%rax),%ecx
or     $0x26,%ecx
mov    $0x400fe608,%eax
mov    %ecx,(%rax)
mov    $0x400fea08,%eax
mov    (%rax),%eax
and    $0x26,%eax
cmp    $0x26,%eax
je     114a <BSP_RGB_D_Init+0x3a>
jmp    1132 <BSP_RGB_D_Init+0x22>
mov    $0x40025528,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x40025528,%eax
mov    %ecx,(%rax)
mov    $0x40006528,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    $0x40006528,%eax
mov    %ecx,(%rax)
mov    $0x40005528,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x40005528,%eax
mov    %ecx,(%rax)
mov    $0x4002552c,%eax
mov    (%rax),%ecx
and    $0xffff0fff,%ecx
add    $0x0,%ecx
mov    $0x4002552c,%eax
mov    %ecx,(%rax)
mov    $0x4000652c,%eax
mov    (%rax),%ecx
and    $0xfff0ffff,%ecx
add    $0x0,%ecx
mov    $0x4000652c,%eax
mov    %ecx,(%rax)
mov    $0x4000552c,%eax
mov    (%rax),%ecx
and    $0xffff0fff,%ecx
add    $0x0,%ecx
mov    $0x4000552c,%eax
mov    %ecx,(%rax)
mov    $0x40025400,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x40025400,%eax
mov    %ecx,(%rax)
mov    $0x40006400,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    $0x40006400,%eax
mov    %ecx,(%rax)
mov    $0x40005400,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x40005400,%eax
mov    %ecx,(%rax)
mov    $0x40025420,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x40025420,%eax
mov    %ecx,(%rax)
mov    $0x40006420,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    $0x40006420,%eax
mov    %ecx,(%rax)
mov    $0x40005420,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x40005420,%eax
mov    %ecx,(%rax)
mov    $0x40025510,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x40025510,%eax
mov    %ecx,(%rax)
mov    $0x40006510,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    $0x40006510,%eax
mov    %ecx,(%rax)
mov    $0x40005510,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    $0x40005510,%eax
mov    %ecx,(%rax)
mov    $0x4002551c,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x4002551c,%eax
mov    %ecx,(%rax)
mov    $0x4000651c,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    $0x4000651c,%eax
mov    %ecx,(%rax)
mov    $0x4000551c,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x4000551c,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <BSP_RGB_D_Set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_RGB_D_Init>:
orl    $0x26,0x400fe608
26
nopl   0x0(%rax,%rax,1)
mov    0x400fea08,%eax
not    %eax
test   $0x26,%al
jne    1120 <BSP_RGB_D_Init+0x10>
andl   $0xfffffff7,0x40025528
f7
andl   $0xffffffef,0x40006528
ef
andl   $0xfffffff7,0x40005528
f7
andl   $0xffff0fff,0x4002552c
ff 0f ff ff
andl   $0xfff0ffff,0x4000652c
ff ff f0 ff
andl   $0xffff0fff,0x4000552c
ff 0f ff ff
orl    $0x8,0x40025400
08
orl    $0x10,0x40006400
10
orl    $0x8,0x40005400
08
andl   $0xfffffff7,0x40025420
f7
andl   $0xffffffef,0x40006420
ef
andl   $0xfffffff7,0x40005420
f7
andl   $0xfffffff7,0x40025510
f7
andl   $0xffffffef,0x40006510
ef
andl   $0xfffffff7,0x40005510
f7
orl    $0x8,0x4002551c
08
orl    $0x10,0x4000651c
10
orl    $0x8,0x4000551c
08
jmp    1030 <BSP_RGB_D_Set@plt>

LLVM IR (-O0):
define void @BSP_RGB_D_Init(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 volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%8 = or i32 %7, 38
store volatile i32 %8, i32* inttoptr (i64 1074783752 to i32*)
br label %9
9: ; preds = %13, %3
%10 = load volatile i32, i32* inttoptr (i64 1074784776 to i32*)
%11 = and i32 %10, 38
%12 = icmp ne i32 %11, 38
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
%15 = load volatile i32, i32* inttoptr (i64 1073894696 to i32*)
%16 = and i32 %15, -9
store volatile i32 %16, i32* inttoptr (i64 1073894696 to i32*)
%17 = load volatile i32, i32* inttoptr (i64 1073767720 to i32*)
%18 = and i32 %17, -17
store volatile i32 %18, i32* inttoptr (i64 1073767720 to i32*)
%19 = load volatile i32, i32* inttoptr (i64 1073763624 to i32*)
%20 = and i32 %19, -9
store volatile i32 %20, i32* inttoptr (i64 1073763624 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 1073894700 to i32*)
%22 = and i32 %21, -61441
%23 = add i32 %22, 0
store volatile i32 %23, i32* inttoptr (i64 1073894700 to i32*)
%24 = load volatile i32, i32* inttoptr (i64 1073767724 to i32*)
%25 = and i32 %24, -983041
%26 = add i32 %25, 0
store volatile i32 %26, i32* inttoptr (i64 1073767724 to i32*)
%27 = load volatile i32, i32* inttoptr (i64 1073763628 to i32*)
%28 = and i32 %27, -61441
%29 = add i32 %28, 0
store volatile i32 %29, i32* inttoptr (i64 1073763628 to i32*)
%30 = load volatile i32, i32* inttoptr (i64 1073894400 to i32*)
%31 = or i32 %30, 8
store volatile i32 %31, i32* inttoptr (i64 1073894400 to i32*)
%32 = load volatile i32, i32* inttoptr (i64 1073767424 to i32*)
%33 = or i32 %32, 16
store volatile i32 %33, i32* inttoptr (i64 1073767424 to i32*)
%34 = load volatile i32, i32* inttoptr (i64 1073763328 to i32*)
%35 = or i32 %34, 8
store volatile i32 %35, i32* inttoptr (i64 1073763328 to i32*)
%36 = load volatile i32, i32* inttoptr (i64 1073894432 to i32*)
%37 = and i32 %36, -9
store volatile i32 %37, i32* inttoptr (i64 1073894432 to i32*)
%38 = load volatile i32, i32* inttoptr (i64 1073767456 to i32*)
%39 = and i32 %38, -17
store volatile i32 %39, i32* inttoptr (i64 1073767456 to i32*)
%40 = load volatile i32, i32* inttoptr (i64 1073763360 to i32*)
%41 = and i32 %40, -9
store volatile i32 %41, i32* inttoptr (i64 1073763360 to i32*)
%42 = load volatile i32, i32* inttoptr (i64 1073894672 to i32*)
%43 = and i32 %42, -9
store volatile i32 %43, i32* inttoptr (i64 1073894672 to i32*)
%44 = load volatile i32, i32* inttoptr (i64 1073767696 to i32*)
%45 = and i32 %44, -17
store volatile i32 %45, i32* inttoptr (i64 1073767696 to i32*)
%46 = load volatile i32, i32* inttoptr (i64 1073763600 to i32*)
%47 = and i32 %46, -9
store volatile i32 %47, i32* inttoptr (i64 1073763600 to i32*)
%48 = load volatile i32, i32* inttoptr (i64 1073894684 to i32*)
%49 = or i32 %48, 8
store volatile i32 %49, i32* inttoptr (i64 1073894684 to i32*)
%50 = load volatile i32, i32* inttoptr (i64 1073767708 to i32*)
%51 = or i32 %50, 16
store volatile i32 %51, i32* inttoptr (i64 1073767708 to i32*)
%52 = load volatile i32, i32* inttoptr (i64 1073763612 to i32*)
%53 = or i32 %52, 8
store volatile i32 %53, i32* inttoptr (i64 1073763612 to i32*)
%54 = load i32, i32* %4
%55 = load i32, i32* %5
%56 = load i32, i32* %6
%57 = call i32 @BSP_RGB_D_Set(i32 %54, i32 %55, i32 %56)
ret void
}

LLVM IR (-O2):
define void @BSP_RGB_D_Init(i32 %0, i32 %1, i32 %2) {
%4 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%5 = or i32 %4, 38
store volatile i32 %5, i32* inttoptr (i64 1074783752 to i32*)
br label %6
6: ; preds = %6, %3
%7 = load volatile i32, i32* inttoptr (i64 1074784776 to i32*)
%8 = and i32 %7, 38
%9 = icmp eq i32 %8, 38
br i1 %9, label %10, label %6
10: ; preds = %6
%11 = load volatile i32, i32* inttoptr (i64 1073894696 to i32*)
%12 = and i32 %11, -9
store volatile i32 %12, i32* inttoptr (i64 1073894696 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 1073767720 to i32*)
%14 = and i32 %13, -17
store volatile i32 %14, i32* inttoptr (i64 1073767720 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 1073763624 to i32*)
%16 = and i32 %15, -9
store volatile i32 %16, i32* inttoptr (i64 1073763624 to i32*)
%17 = load volatile i32, i32* inttoptr (i64 1073894700 to i32*)
%18 = and i32 %17, -61441
store volatile i32 %18, i32* inttoptr (i64 1073894700 to i32*)
%19 = load volatile i32, i32* inttoptr (i64 1073767724 to i32*)
%20 = and i32 %19, -983041
store volatile i32 %20, i32* inttoptr (i64 1073767724 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 1073763628 to i32*)
%22 = and i32 %21, -61441
store volatile i32 %22, i32* inttoptr (i64 1073763628 to i32*)
%23 = load volatile i32, i32* inttoptr (i64 1073894400 to i32*)
%24 = or i32 %23, 8
store volatile i32 %24, i32* inttoptr (i64 1073894400 to i32*)
%25 = load volatile i32, i32* inttoptr (i64 1073767424 to i32*)
%26 = or i32 %25, 16
store volatile i32 %26, i32* inttoptr (i64 1073767424 to i32*)
%27 = load volatile i32, i32* inttoptr (i64 1073763328 to i32*)
%28 = or i32 %27, 8
store volatile i32 %28, i32* inttoptr (i64 1073763328 to i32*)
%29 = load volatile i32, i32* inttoptr (i64 1073894432 to i32*)
%30 = and i32 %29, -9
store volatile i32 %30, i32* inttoptr (i64 1073894432 to i32*)
%31 = load volatile i32, i32* inttoptr (i64 1073767456 to i32*)
%32 = and i32 %31, -17
store volatile i32 %32, i32* inttoptr (i64 1073767456 to i32*)
%33 = load volatile i32, i32* inttoptr (i64 1073763360 to i32*)
%34 = and i32 %33, -9
store volatile i32 %34, i32* inttoptr (i64 1073763360 to i32*)
%35 = load volatile i32, i32* inttoptr (i64 1073894672 to i32*)
%36 = and i32 %35, -9
store volatile i32 %36, i32* inttoptr (i64 1073894672 to i32*)
%37 = load volatile i32, i32* inttoptr (i64 1073767696 to i32*)
%38 = and i32 %37, -17
store volatile i32 %38, i32* inttoptr (i64 1073767696 to i32*)
%39 = load volatile i32, i32* inttoptr (i64 1073763600 to i32*)
%40 = and i32 %39, -9
store volatile i32 %40, i32* inttoptr (i64 1073763600 to i32*)
%41 = load volatile i32, i32* inttoptr (i64 1073894684 to i32*)
%42 = or i32 %41, 8
store volatile i32 %42, i32* inttoptr (i64 1073894684 to i32*)
%43 = load volatile i32, i32* inttoptr (i64 1073767708 to i32*)
%44 = or i32 %43, 16
store volatile i32 %44, i32* inttoptr (i64 1073767708 to i32*)
%45 = load volatile i32, i32* inttoptr (i64 1073763612 to i32*)
%46 = or i32 %45, 8
store volatile i32 %46, i32* inttoptr (i64 1073763612 to i32*)
%47 = tail call i32 @BSP_RGB_D_Set(i32 %0, i32 %1, i32 %2)
ret void
}