#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*/ i2cinit();
void BSP_LightSensor_Init(void) {
  i2cinit();
  (*((volatile uint32_t *)0x40004528)) &= ~0x20;
  (*((volatile uint32_t *)0x4000452C)) =
      ((*((volatile uint32_t *)0x4000452C)) & 0xFF0FFFFF) + 0x00000000;
  (*((volatile uint32_t *)0x40004400)) &= ~0x20;
  (*((volatile uint32_t *)0x40004420)) &= ~0x20;
  (*((volatile uint32_t *)0x4000451C)) |= 0x20;
}


x86 assembly (clang, -O0):
<BSP_LightSensor_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <i2cinit@plt>
mov    $0x40004528,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    $0x40004528,%eax
mov    %ecx,(%rax)
mov    $0x4000452c,%eax
mov    (%rax),%ecx
and    $0xff0fffff,%ecx
add    $0x0,%ecx
mov    $0x4000452c,%eax
mov    %ecx,(%rax)
mov    $0x40004400,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    $0x40004400,%eax
mov    %ecx,(%rax)
mov    $0x40004420,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    $0x40004420,%eax
mov    %ecx,(%rax)
mov    $0x4000451c,%eax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    $0x4000451c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_LightSensor_Init>:
push   %rax
xor    %eax,%eax
call   1030 <i2cinit@plt>
andl   $0xffffffdf,0x40004528
df
andl   $0xff0fffff,0x4000452c
ff ff 0f ff
andl   $0xffffffdf,0x40004400
df
andl   $0xffffffdf,0x40004420
df
orl    $0x20,0x4000451c
20
pop    %rax
ret

LLVM IR (-O0):
define void @BSP_LightSensor_Init() {
%1 = call i32 (...) @i2cinit()
%2 = load volatile i32, i32* inttoptr (i64 1073759528 to i32*)
%3 = and i32 %2, -33
store volatile i32 %3, i32* inttoptr (i64 1073759528 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 1073759532 to i32*)
%5 = and i32 %4, -15728641
%6 = add i32 %5, 0
store volatile i32 %6, i32* inttoptr (i64 1073759532 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 1073759232 to i32*)
%8 = and i32 %7, -33
store volatile i32 %8, i32* inttoptr (i64 1073759232 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 1073759264 to i32*)
%10 = and i32 %9, -33
store volatile i32 %10, i32* inttoptr (i64 1073759264 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1073759516 to i32*)
%12 = or i32 %11, 32
store volatile i32 %12, i32* inttoptr (i64 1073759516 to i32*)
ret void
}

LLVM IR (-O2):
define void @BSP_LightSensor_Init() {
%1 = tail call i32 (...) @i2cinit()
%2 = load volatile i32, i32* inttoptr (i64 1073759528 to i32*)
%3 = and i32 %2, -33
store volatile i32 %3, i32* inttoptr (i64 1073759528 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 1073759532 to i32*)
%5 = and i32 %4, -15728641
store volatile i32 %5, i32* inttoptr (i64 1073759532 to i32*)
%6 = load volatile i32, i32* inttoptr (i64 1073759232 to i32*)
%7 = and i32 %6, -33
store volatile i32 %7, i32* inttoptr (i64 1073759232 to i32*)
%8 = load volatile i32, i32* inttoptr (i64 1073759264 to i32*)
%9 = and i32 %8, -33
store volatile i32 %9, i32* inttoptr (i64 1073759264 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 1073759516 to i32*)
%11 = or i32 %10, 32
store volatile i32 %11, i32* inttoptr (i64 1073759516 to i32*)
ret void
}