#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 */

/* Variables and functions */
int /*<<< orphan*/ AssertFailure(char *, int);
unsigned long SysCtlPeripheralMapToNew(unsigned long);
int /*<<< orphan*/ SysCtlPeripheralValid(unsigned long);
void SysCtlPeripheralPowerOff(unsigned long ulPeripheral) {
  {
    if (!(SysCtlPeripheralValid(ulPeripheral))) {
      AssertFailure(
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/"
          "Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/sysctl.c",
          754);
    }
  };
  ulPeripheral = SysCtlPeripheralMapToNew(ulPeripheral);
  (*((volatile unsigned long
          *)(((unsigned long)(0x400fe900 + ((ulPeripheral & 0xff00) >> 8)) &
              0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x400fe900 + ((ulPeripheral & 0xff00) >> 8)) &
               0x000FFFFF)
              << 5) |
             ((ulPeripheral & 0xff) << 2)))) = 0;
}


x86 assembly (clang, -O0):
<SysCtlPeripheralPowerOff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <SysCtlPeripheralValid@plt>
cmp    $0x0,%eax
jne    115f <SysCtlPeripheralPowerOff+0x2f>
lea    0xeab(%rip),%rdi
mov    $0x2f2,%esi
call   1030 <AssertFailure@plt>
mov    -0x8(%rbp),%rdi
call   1040 <SysCtlPeripheralMapToNew@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff00,%rax
shr    $0x8,%rax
add    $0x400fe900,%rax
movabs $0xf0000000,%rcx
and    %rcx,%rax
or     $0x2000000,%rax
mov    -0x8(%rbp),%rcx
and    $0xff00,%rcx
shr    $0x8,%rcx
add    $0x400fe900,%rcx
and    $0xfffff,%rcx
shl    $0x5,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff,%rcx
shl    $0x2,%rcx
or     %rcx,%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPeripheralPowerOff>:
push   %rbx
mov    %rdi,%rbx
call   1050 <SysCtlPeripheralValid@plt>
test   %eax,%eax
jne    114e <SysCtlPeripheralPowerOff+0x1e>
lea    0xebc(%rip),%rdi
mov    $0x2f2,%esi
call   1030 <AssertFailure@plt>
mov    %rbx,%rdi
call   1040 <SysCtlPeripheralMapToNew@plt>
movzbl %al,%ecx
shr    $0x3,%rax
and    $0x1fe0,%eax
shl    $0x2,%rcx
or     %rax,%rcx
movq   $0x0,0x43fd2000(%rcx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/sysctl.c\00"
define void @SysCtlPeripheralPowerOff(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @SysCtlPeripheralValid(i64 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 754)
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = call i64 @SysCtlPeripheralMapToNew(i64 %9)
store i64 %10, i64* %2
%11 = load i64, i64* %2
%12 = and i64 %11, 65280
%13 = lshr i64 %12, 8
%14 = add i64 1074784512, %13
%15 = and i64 %14, 4026531840
%16 = or i64 %15, 33554432
%17 = load i64, i64* %2
%18 = and i64 %17, 65280
%19 = lshr i64 %18, 8
%20 = add i64 1074784512, %19
%21 = and i64 %20, 1048575
%22 = shl i64 %21, 5
%23 = or i64 %16, %22
%24 = load i64, i64* %2
%25 = and i64 %24, 255
%26 = shl i64 %25, 2
%27 = or i64 %23, %26
%28 = inttoptr i64 %27 to i64*
store volatile i64 0, i64* %28
ret void
}

LLVM IR (-O2):
@.str = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AmesianX/OpenBLT/refs/heads/master/Target/Demo/ARMCM3_LM3S_EK_LM3S6965_Crossworks/Boot/lib/driverlib/sysctl.c\00"
define void @SysCtlPeripheralPowerOff(i64 %0) {
%2 = tail call i32 @SysCtlPeripheralValid(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 754)
br label %6
6: ; preds = %4, %1
%7 = tail call i64 @SysCtlPeripheralMapToNew(i64 %0)
%8 = lshr i64 %7, 3
%9 = and i64 %8, 8160
%10 = shl i64 %7, 2
%11 = and i64 %10, 1020
%12 = or i64 %11, %9
%13 = or i64 %12, 1140662272
%14 = inttoptr i64 %13 to i64*
store volatile i64 0, i64* %14
ret void
}