#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);
void SysCtlPWMClockSet(unsigned long ulConfig) {
  {
    if (!((ulConfig == 0x00000000) || (ulConfig == 0x00100000) ||
          (ulConfig == 0x00120000) || (ulConfig == 0x00140000) ||
          (ulConfig == 0x00160000) || (ulConfig == 0x00180000) ||
          (ulConfig == 0x001A0000))) {
      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",
          2585);
    }
  };
  {
    if (!((*((volatile unsigned long *)(0x400FE010))) & 0x00100000)) {
      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",
          2596);
    }
  };
  (*((volatile unsigned long *)(0x400FE060))) =
      (((*((volatile unsigned long *)(0x400FE060))) &
        ~(0x00100000 | 0x000E0000)) |
       ulConfig);
}


x86 assembly (clang, -O0):
<SysCtlPWMClockSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118c <SysCtlPWMClockSet+0x7c>
cmpq   $0x100000,-0x8(%rbp)
je     118c <SysCtlPWMClockSet+0x7c>
cmpq   $0x120000,-0x8(%rbp)
je     118c <SysCtlPWMClockSet+0x7c>
cmpq   $0x140000,-0x8(%rbp)
je     118c <SysCtlPWMClockSet+0x7c>
cmpq   $0x160000,-0x8(%rbp)
je     118c <SysCtlPWMClockSet+0x7c>
cmpq   $0x180000,-0x8(%rbp)
je     118c <SysCtlPWMClockSet+0x7c>
cmpq   $0x1a0000,-0x8(%rbp)
je     118c <SysCtlPWMClockSet+0x7c>
lea    0xe7e(%rip),%rdi
mov    $0xa19,%esi
call   1030 <AssertFailure@plt>
mov    $0x400fe010,%eax
mov    (%rax),%rax
and    $0x100000,%rax
cmp    $0x0,%rax
jne    11b5 <SysCtlPWMClockSet+0xa5>
lea    0xe55(%rip),%rdi
mov    $0xa24,%esi
call   1030 <AssertFailure@plt>
mov    $0x400fe060,%eax
mov    (%rax),%rcx
and    $0xffffffffffe1ffff,%rcx
or     -0x8(%rbp),%rcx
mov    $0x400fe060,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPWMClockSet>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
rol    $0x2f,%rax
lea    -0x8(%rax),%rcx
cmp    $0x6,%rcx
jae    1160 <SysCtlPWMClockSet+0x50>
testq  $0x100000,0x400fe010
jne    1144 <SysCtlPWMClockSet+0x34>
lea    0xec6(%rip),%rdi
mov    $0xa24,%esi
call   1030 <AssertFailure@plt>
mov    $0xffffffffffe1ffff,%rax
and    0x400fe060,%rax
40
or     %rbx,%rax
mov    %rax,0x400fe060
40
pop    %rbx
ret
test   %rax,%rax
je     1125 <SysCtlPWMClockSet+0x15>
lea    0xe94(%rip),%rdi
mov    $0xa19,%esi
call   1030 <AssertFailure@plt>
jmp    1125 <SysCtlPWMClockSet+0x15>

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 @SysCtlPWMClockSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %25, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1048576
br i1 %7, label %25, label %8
8: ; preds = %5
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 1179648
br i1 %10, label %25, label %11
11: ; preds = %8
%12 = load i64, i64* %2
%13 = icmp eq i64 %12, 1310720
br i1 %13, label %25, label %14
14: ; preds = %11
%15 = load i64, i64* %2
%16 = icmp eq i64 %15, 1441792
br i1 %16, label %25, label %17
17: ; preds = %14
%18 = load i64, i64* %2
%19 = icmp eq i64 %18, 1572864
br i1 %19, label %25, label %20
20: ; preds = %17
%21 = load i64, i64* %2
%22 = icmp eq i64 %21, 1703936
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 2585)
br label %25
25: ; preds = %23, %20, %17, %14, %11, %8, %5, %1
%26 = load volatile i64, i64* inttoptr (i64 1074782224 to i64*)
%27 = and i64 %26, 1048576
%28 = icmp ne i64 %27, 0
br i1 %28, label %31, label %29
29: ; preds = %25
%30 = call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 2596)
br label %31
31: ; preds = %29, %25
%32 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%33 = and i64 %32, -1966081
%34 = load i64, i64* %2
%35 = or i64 %33, %34
store volatile i64 %35, i64* inttoptr (i64 1074782304 to i64*)
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 @SysCtlPWMClockSet(i64 %0) {
%2 = tail call i64 @llvm.fshl.i64(i64 %0, i64 %0, i64 47)
switch i64 %2, label %3 [
i64 13, label %5
i64 12, label %5
i64 11, label %5
i64 10, label %5
i64 9, label %5
i64 8, label %5
i64 0, label %5
]
3: ; preds = %1
%4 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 2585)
br label %5
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %3
%6 = load volatile i64, i64* inttoptr (i64 1074782224 to i64*)
%7 = and i64 %6, 1048576
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 2596)
br label %11
11: ; preds = %9, %5
%12 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%13 = and i64 %12, -1966081
%14 = or i64 %13, %0
store volatile i64 %14, i64* inttoptr (i64 1074782304 to i64*)
ret void
}