#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_LM3S6965_Crossworks/Boot/lib/driverlib/sysctl.c",
          2670);
    }
  };
  (*((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    $0xa6e,%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    $0xa6e,%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_LM3S6965_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 2670)
br label %16
16: ; preds = %14, %11, %8, %5, %1
%17 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%18 = and i64 %17, -3841
%19 = load i64, i64* %2
%20 = or i64 %18, %19
store volatile i64 %20, i64* inttoptr (i64 1074782464 to i64*)
%21 = load volatile i64, i64* inttoptr (i64 1074782480 to i64*)
%22 = and i64 %21, -3841
%23 = load i64, i64* %2
%24 = or i64 %22, %23
store volatile i64 %24, 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_LM3S6965_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 2670)
br label %4
4: ; preds = %1, %1, %1, %1, %2
%5 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%6 = and i64 %5, -3841
%7 = or i64 %6, %0
store volatile i64 %7, i64* inttoptr (i64 1074782464 to i64*)
%8 = load volatile i64, i64* inttoptr (i64 1074782480 to i64*)
%9 = and i64 %8, -3841
%10 = or i64 %9, %0
store volatile i64 %10, i64* inttoptr (i64 1074782480 to i64*)
ret void
}