#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 SysCtlPeripheralClockGating(bool bEnable) {
  if ((((*((volatile uint32_t *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) ==
       (0x10000000 | 0x00050000))) {
    if (bEnable) {
      (*((volatile uint32_t *)(0x400FE060))) |= 0x08000000;
    } else {
      (*((volatile uint32_t *)(0x400FE060))) &= ~(0x08000000);
    }
  } else {
    if (bEnable) {
      (*((volatile uint32_t *)(0x400FE0B0))) |= 0x20000000;
    } else {
      (*((volatile uint32_t *)(0x400FE0B0))) &= ~0x20000000;
    }
  }
}


x86 assembly (clang, -O0):
<SysCtlPeripheralClockGating>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%eax
and    $0x70ff0000,%eax
cmp    $0x10050000,%eax
jne    115a <SysCtlPeripheralClockGating+0x5a>
cmpl   $0x0,-0x4(%rbp)
je     1141 <SysCtlPeripheralClockGating+0x41>
mov    $0x400fe060,%eax
mov    (%rax),%ecx
or     $0x8000000,%ecx
mov    $0x400fe060,%eax
mov    %ecx,(%rax)
jmp    1155 <SysCtlPeripheralClockGating+0x55>
mov    $0x400fe060,%eax
mov    (%rax),%ecx
and    $0xf7ffffff,%ecx
mov    $0x400fe060,%eax
mov    %ecx,(%rax)
jmp    1196 <SysCtlPeripheralClockGating+0x96>
cmpl   $0x0,-0x4(%rbp)
je     117d <SysCtlPeripheralClockGating+0x7d>
mov    $0x400fe0b0,%eax
mov    (%rax),%ecx
or     $0x20000000,%ecx
mov    $0x400fe0b0,%eax
mov    %ecx,(%rax)
jmp    1191 <SysCtlPeripheralClockGating+0x91>
mov    $0x400fe0b0,%eax
mov    (%rax),%ecx
and    $0xdfffffff,%ecx
mov    $0x400fe0b0,%eax
mov    %ecx,(%rax)
jmp    1196 <SysCtlPeripheralClockGating+0x96>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPeripheralClockGating>:
mov    $0x70ff0000,%eax
and    0x400fe000,%eax
cmp    $0x10050000,%eax
jne    112b <SysCtlPeripheralClockGating+0x2b>
mov    0x400fe060,%eax
test   %edi,%edi
je     1143 <SysCtlPeripheralClockGating+0x43>
or     $0x8000000,%eax
mov    %eax,0x400fe060
ret
mov    0x400fe0b0,%eax
test   %edi,%edi
je     1150 <SysCtlPeripheralClockGating+0x50>
or     $0x20000000,%eax
mov    %eax,0x400fe0b0
ret
and    $0xf7ffffff,%eax
mov    %eax,0x400fe060
ret
and    $0xdfffffff,%eax
mov    %eax,0x400fe0b0
ret

LLVM IR (-O0):
define void @SysCtlPeripheralClockGating(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%4 = and i32 %3, 1895759872
%5 = icmp eq i32 %4, 268763136
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
%11 = or i32 %10, 134217728
store volatile i32 %11, i32* inttoptr (i64 1074782304 to i32*)
br label %15
12: ; preds = %6
%13 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
%14 = and i32 %13, -134217729
store volatile i32 %14, i32* inttoptr (i64 1074782304 to i32*)
br label %15
15: ; preds = %12, %9
br label %26
16: ; preds = %1
%17 = load i32, i32* %2
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load volatile i32, i32* inttoptr (i64 1074782384 to i32*)
%21 = or i32 %20, 536870912
store volatile i32 %21, i32* inttoptr (i64 1074782384 to i32*)
br label %25
22: ; preds = %16
%23 = load volatile i32, i32* inttoptr (i64 1074782384 to i32*)
%24 = and i32 %23, -536870913
store volatile i32 %24, i32* inttoptr (i64 1074782384 to i32*)
br label %25
25: ; preds = %22, %19
br label %26
26: ; preds = %25, %15
ret void
}

LLVM IR (-O2):
define void @SysCtlPeripheralClockGating(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%3 = and i32 %2, 1895759872
%4 = icmp eq i32 %3, 268763136
%5 = icmp eq i32 %0, 0
br i1 %4, label %6, label %12
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
br i1 %5, label %10, label %8
8: ; preds = %6
%9 = or i32 %7, 134217728
store volatile i32 %9, i32* inttoptr (i64 1074782304 to i32*)
br label %18
10: ; preds = %6
%11 = and i32 %7, -134217729
store volatile i32 %11, i32* inttoptr (i64 1074782304 to i32*)
br label %18
12: ; preds = %1
%13 = load volatile i32, i32* inttoptr (i64 1074782384 to i32*)
br i1 %5, label %16, label %14
14: ; preds = %12
%15 = or i32 %13, 536870912
store volatile i32 %15, i32* inttoptr (i64 1074782384 to i32*)
br label %18
16: ; preds = %12
%17 = and i32 %13, -536870913
store volatile i32 %17, i32* inttoptr (i64 1074782384 to i32*)
br label %18
18: ; preds = %14, %16, %8, %10
ret void
}