#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_Button1_Init(void) {
  (*((volatile uint32_t *)0x400FE608)) |= 0x00000008;
  while (((*((volatile uint32_t *)0x400FEA08)) & 0x08) == 0) {
  };
  (*((volatile uint32_t *)0x40007528)) &= ~0x40;
  (*((volatile uint32_t *)0x4000752C)) =
      ((*((volatile uint32_t *)0x4000752C)) & 0xF0FFFFFF) + 0x00000000;
  (*((volatile uint32_t *)0x40007400)) &= ~0x40;
  (*((volatile uint32_t *)0x40007420)) &= ~0x40;
  (*((volatile uint32_t *)0x40007510)) &= ~0x40;
  (*((volatile uint32_t *)0x4000751C)) |= 0x40;
}


x86 assembly (clang, -O0):
<BSP_Button1_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe608,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    $0x400fe608,%eax
mov    %ecx,(%rax)
mov    $0x400fea08,%eax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    112d <BSP_Button1_Init+0x2d>
jmp    1115 <BSP_Button1_Init+0x15>
mov    $0x40007528,%eax
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    $0x40007528,%eax
mov    %ecx,(%rax)
mov    $0x4000752c,%eax
mov    (%rax),%ecx
and    $0xf0ffffff,%ecx
add    $0x0,%ecx
mov    $0x4000752c,%eax
mov    %ecx,(%rax)
mov    $0x40007400,%eax
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    $0x40007400,%eax
mov    %ecx,(%rax)
mov    $0x40007420,%eax
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    $0x40007420,%eax
mov    %ecx,(%rax)
mov    $0x40007510,%eax
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    $0x40007510,%eax
mov    %ecx,(%rax)
mov    $0x4000751c,%eax
mov    (%rax),%ecx
or     $0x40,%ecx
mov    $0x4000751c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_Button1_Init>:
orl    $0x8,0x400fe608
08
nopl   0x0(%rax,%rax,1)
testl  $0x8,0x400fea08
je     1110 <BSP_Button1_Init+0x10>
andl   $0xffffffbf,0x40007528
bf
andl   $0xf0ffffff,0x4000752c
ff ff ff f0
andl   $0xffffffbf,0x40007400
bf
andl   $0xffffffbf,0x40007420
bf
andl   $0xffffffbf,0x40007510
bf
orl    $0x40,0x4000751c
40
ret

LLVM IR (-O0):
define void @BSP_Button1_Init() {
%1 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%2 = or i32 %1, 8
store volatile i32 %2, i32* inttoptr (i64 1074783752 to i32*)
br label %3
3: ; preds = %7, %0
%4 = load volatile i32, i32* inttoptr (i64 1074784776 to i32*)
%5 = and i32 %4, 8
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load volatile i32, i32* inttoptr (i64 1073771816 to i32*)
%10 = and i32 %9, -65
store volatile i32 %10, i32* inttoptr (i64 1073771816 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1073771820 to i32*)
%12 = and i32 %11, -251658241
%13 = add i32 %12, 0
store volatile i32 %13, i32* inttoptr (i64 1073771820 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1073771520 to i32*)
%15 = and i32 %14, -65
store volatile i32 %15, i32* inttoptr (i64 1073771520 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1073771552 to i32*)
%17 = and i32 %16, -65
store volatile i32 %17, i32* inttoptr (i64 1073771552 to i32*)
%18 = load volatile i32, i32* inttoptr (i64 1073771792 to i32*)
%19 = and i32 %18, -65
store volatile i32 %19, i32* inttoptr (i64 1073771792 to i32*)
%20 = load volatile i32, i32* inttoptr (i64 1073771804 to i32*)
%21 = or i32 %20, 64
store volatile i32 %21, i32* inttoptr (i64 1073771804 to i32*)
ret void
}

LLVM IR (-O2):
define void @BSP_Button1_Init() {
%1 = load volatile i32, i32* inttoptr (i64 1074783752 to i32*)
%2 = or i32 %1, 8
store volatile i32 %2, i32* inttoptr (i64 1074783752 to i32*)
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* inttoptr (i64 1074784776 to i32*)
%5 = and i32 %4, 8
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = load volatile i32, i32* inttoptr (i64 1073771816 to i32*)
%9 = and i32 %8, -65
store volatile i32 %9, i32* inttoptr (i64 1073771816 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 1073771820 to i32*)
%11 = and i32 %10, -251658241
store volatile i32 %11, i32* inttoptr (i64 1073771820 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1073771520 to i32*)
%13 = and i32 %12, -65
store volatile i32 %13, i32* inttoptr (i64 1073771520 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1073771552 to i32*)
%15 = and i32 %14, -65
store volatile i32 %15, i32* inttoptr (i64 1073771552 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1073771792 to i32*)
%17 = and i32 %16, -65
store volatile i32 %17, i32* inttoptr (i64 1073771792 to i32*)
%18 = load volatile i32, i32* inttoptr (i64 1073771804 to i32*)
%19 = or i32 %18, 64
store volatile i32 %19, i32* inttoptr (i64 1073771804 to i32*)
ret void
}