#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*/ DEBUG_ASSERT(int);
void SysCtlADCSpeedSet(unsigned long ulSpeed) {
  DEBUG_ASSERT((ulSpeed == 0x00000F00) || (ulSpeed == 0x00000A00) ||
               (ulSpeed == 0x00000500) || (ulSpeed == 0x00000000));
  (*((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)
mov    $0x1,%al
cmpq   $0xf00,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1160 <SysCtlADCSpeedSet+0x50>
mov    $0x1,%al
cmpq   $0xa00,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1160 <SysCtlADCSpeedSet+0x50>
mov    $0x1,%al
cmpq   $0x500,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1160 <SysCtlADCSpeedSet+0x50>
cmpq   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@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
mov    $0x1,%edi
cmp    $0x500,%rbx
je     113d <SysCtlADCSpeedSet+0x2d>
cmp    $0xa00,%rbx
je     113d <SysCtlADCSpeedSet+0x2d>
cmp    $0xf00,%rbx
je     113d <SysCtlADCSpeedSet+0x2d>
xor    %edi,%edi
test   %rbx,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@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):
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 %14, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 2560
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = load i64, i64* %2
%10 = icmp eq i64 %9, 1280
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = load i64, i64* %2
%13 = icmp eq i64 %12, 0
br label %14
14: ; preds = %11, %8, %5, %1
%15 = phi i1 [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = call i32 @DEBUG_ASSERT(i32 %16)
%18 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%19 = and i64 %18, -3841
%20 = load i64, i64* %2
%21 = or i64 %19, %20
store volatile i64 %21, i64* inttoptr (i64 1074782464 to i64*)
%22 = load volatile i64, i64* inttoptr (i64 1074782480 to i64*)
%23 = and i64 %22, -3841
%24 = load i64, i64* %2
%25 = or i64 %23, %24
store volatile i64 %25, i64* inttoptr (i64 1074782480 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlADCSpeedSet(i64 %0) {
switch i64 %0, label %2 [
i64 3840, label %5
i64 2560, label %5
i64 1280, label %5
]
2: ; preds = %1
%3 = icmp eq i64 %0, 0
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
%8 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%9 = and i64 %8, -3841
%10 = or i64 %9, %0
store volatile i64 %10, i64* inttoptr (i64 1074782464 to i64*)
%11 = load volatile i64, i64* inttoptr (i64 1074782480 to i64*)
%12 = and i64 %11, -3841
%13 = or i64 %12, %0
store volatile i64 %13, i64* inttoptr (i64 1074782480 to i64*)
ret void
}