#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 SysCtlADCSpeedSet(unsigned long ulSpeed) {
  {
    if (!((ulSpeed == 0x00000F00) || (ulSpeed == 0x00000A00) ||
          (ulSpeed == 0x00000500) || (ulSpeed == 0x00000000))) {
      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_LM3S8962_Crossworks/Boot/lib/driverlib/sysctl.c",
          1917);
    }
  };
  {
    if (!((*((volatile unsigned long *)(0x400FE010))) & 0x00010000)) {
      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_LM3S8962_Crossworks/Boot/lib/driverlib/sysctl.c",
          1925);
    }
  };
  (*((volatile unsigned long *)(0x400FE100))) =
      (((*((volatile unsigned long *)(0x400FE100))) & ~(0x00000F00)) | ulSpeed);
  (*((volatile unsigned long *)(0x400FE110))) =
      (((*((volatile unsigned long *)(0x400FE110))) & ~(0x00000F00)) | ulSpeed);
}


x86 assembly (clang, -O0):
<SysCtlADCSpeedSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0xf00,-0x8(%rbp)
je     1162 <SysCtlADCSpeedSet+0x52>
cmpq   $0xa00,-0x8(%rbp)
je     1162 <SysCtlADCSpeedSet+0x52>
cmpq   $0x500,-0x8(%rbp)
je     1162 <SysCtlADCSpeedSet+0x52>
cmpq   $0x0,-0x8(%rbp)
je     1162 <SysCtlADCSpeedSet+0x52>
lea    0xea8(%rip),%rdi
mov    $0x77d,%esi
call   1030 <AssertFailure@plt>
mov    $0x400fe010,%eax
mov    (%rax),%rax
and    $0x10000,%rax
cmp    $0x0,%rax
jne    118b <SysCtlADCSpeedSet+0x7b>
lea    0xe7f(%rip),%rdi
mov    $0x785,%esi
call   1030 <AssertFailure@plt>
mov    $0x400fe100,%eax
mov    (%rax),%rcx
and    $0xfffffffffffff0ff,%rcx
or     -0x8(%rbp),%rcx
mov    $0x400fe100,%eax
mov    %rcx,(%rax)
mov    $0x400fe110,%eax
mov    (%rax),%rcx
and    $0xfffffffffffff0ff,%rcx
or     -0x8(%rbp),%rcx
mov    $0x400fe110,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlADCSpeedSet>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x9ff,%rdi
jg     112d <SysCtlADCSpeedSet+0x1d>
test   %rbx,%rbx
je     1150 <SysCtlADCSpeedSet+0x40>
cmp    $0x500,%rbx
je     1150 <SysCtlADCSpeedSet+0x40>
jmp    113f <SysCtlADCSpeedSet+0x2f>
cmp    $0xa00,%rbx
je     1150 <SysCtlADCSpeedSet+0x40>
cmp    $0xf00,%rbx
je     1150 <SysCtlADCSpeedSet+0x40>
lea    0xeba(%rip),%rdi
mov    $0x77d,%esi
call   1030 <AssertFailure@plt>
testq  $0x10000,0x400fe010
jne    116f <SysCtlADCSpeedSet+0x5f>
lea    0xe9b(%rip),%rdi
mov    $0x785,%esi
call   1030 <AssertFailure@plt>
mov    $0xfffffffffffff0ff,%rax
mov    0x400fe100,%rcx
40
and    %rax,%rcx
or     %rbx,%rcx
mov    %rcx,0x400fe100
40
and    0x400fe110,%rax
40
or     %rbx,%rax
mov    %rax,0x400fe110
40
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_LM3S8962_Crossworks/Boot/lib/driverlib/sysctl.c\00"
define void @SysCtlADCSpeedSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 3840
br i1 %4, label %16, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 2560
br i1 %7, label %16, label %8
8: ; preds = %5
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 1280
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = load i64, i64* %2
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1917)
br label %16
16: ; preds = %14, %11, %8, %5, %1
%17 = load volatile i64, i64* inttoptr (i64 1074782224 to i64*)
%18 = and i64 %17, 65536
%19 = icmp ne i64 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %16
%21 = call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1925)
br label %22
22: ; preds = %20, %16
%23 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%24 = and i64 %23, -3841
%25 = load i64, i64* %2
%26 = or i64 %24, %25
store volatile i64 %26, i64* inttoptr (i64 1074782464 to i64*)
%27 = load volatile i64, i64* inttoptr (i64 1074782480 to i64*)
%28 = and i64 %27, -3841
%29 = load i64, i64* %2
%30 = or i64 %28, %29
store volatile i64 %30, i64* inttoptr (i64 1074782480 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_LM3S8962_Crossworks/Boot/lib/driverlib/sysctl.c\00"
define void @SysCtlADCSpeedSet(i64 %0) {
switch i64 %0, label %2 [
i64 3840, label %4
i64 2560, label %4
i64 1280, label %4
i64 0, label %4
]
2: ; preds = %1
%3 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1917)
br label %4
4: ; preds = %1, %1, %1, %1, %2
%5 = load volatile i64, i64* inttoptr (i64 1074782224 to i64*)
%6 = and i64 %5, 65536
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @AssertFailure(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i32 1925)
br label %10
10: ; preds = %8, %4
%11 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%12 = and i64 %11, -3841
%13 = or i64 %12, %0
store volatile i64 %13, i64* inttoptr (i64 1074782464 to i64*)
%14 = load volatile i64, i64* inttoptr (i64 1074782480 to i64*)
%15 = and i64 %14, -3841
%16 = or i64 %15, %0
store volatile i64 %16, i64* inttoptr (i64 1074782480 to i64*)
ret void
}