#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 ADCPhaseDelaySet(unsigned long ulBase, unsigned long ulPhase) {
  DEBUG_ASSERT((ulBase == 0x40038000) || (ulBase == 0x40039000));
  DEBUG_ASSERT((ulPhase == 0x00000000) || (ulPhase == 0x00000001) ||
               (ulPhase == 0x00000002) || (ulPhase == 0x00000003) ||
               (ulPhase == 0x00000004) || (ulPhase == 0x00000005) ||
               (ulPhase == 0x00000006) || (ulPhase == 0x00000007) ||
               (ulPhase == 0x00000008) || (ulPhase == 0x00000009) ||
               (ulPhase == 0x0000000A) || (ulPhase == 0x0000000B) ||
               (ulPhase == 0x0000000C) || (ulPhase == 0x0000000D) ||
               (ulPhase == 0x0000000E) || (ulPhase == 0x0000000F));
  (*((volatile unsigned long *)(ulBase + 0x00000024))) = ulPhase;
}


x86 assembly (clang, -O0):
<ADCPhaseDelaySet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x40038000,-0x8(%rbp)
40
mov    %al,-0x11(%rbp)
je     1141 <ADCPhaseDelaySet+0x31>
cmpq   $0x40039000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0x1,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0x2,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0x3,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0x4,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0x5,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0x6,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0x7,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0x8,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0x9,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0xa,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0xb,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0xc,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0xd,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
mov    $0x1,%al
cmpq   $0xe,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     1249 <ADCPhaseDelaySet+0x139>
cmpq   $0xf,-0x10(%rbp)
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x24(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCPhaseDelaySet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40038000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x10,%r14
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,0x24(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ADCPhaseDelaySet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073971200
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1073975296
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, 0
br i1 %15, label %61, label %16
16: ; preds = %10
%17 = load i64, i64* %4
%18 = icmp eq i64 %17, 1
br i1 %18, label %61, label %19
19: ; preds = %16
%20 = load i64, i64* %4
%21 = icmp eq i64 %20, 2
br i1 %21, label %61, label %22
22: ; preds = %19
%23 = load i64, i64* %4
%24 = icmp eq i64 %23, 3
br i1 %24, label %61, label %25
25: ; preds = %22
%26 = load i64, i64* %4
%27 = icmp eq i64 %26, 4
br i1 %27, label %61, label %28
28: ; preds = %25
%29 = load i64, i64* %4
%30 = icmp eq i64 %29, 5
br i1 %30, label %61, label %31
31: ; preds = %28
%32 = load i64, i64* %4
%33 = icmp eq i64 %32, 6
br i1 %33, label %61, label %34
34: ; preds = %31
%35 = load i64, i64* %4
%36 = icmp eq i64 %35, 7
br i1 %36, label %61, label %37
37: ; preds = %34
%38 = load i64, i64* %4
%39 = icmp eq i64 %38, 8
br i1 %39, label %61, label %40
40: ; preds = %37
%41 = load i64, i64* %4
%42 = icmp eq i64 %41, 9
br i1 %42, label %61, label %43
43: ; preds = %40
%44 = load i64, i64* %4
%45 = icmp eq i64 %44, 10
br i1 %45, label %61, label %46
46: ; preds = %43
%47 = load i64, i64* %4
%48 = icmp eq i64 %47, 11
br i1 %48, label %61, label %49
49: ; preds = %46
%50 = load i64, i64* %4
%51 = icmp eq i64 %50, 12
br i1 %51, label %61, label %52
52: ; preds = %49
%53 = load i64, i64* %4
%54 = icmp eq i64 %53, 13
br i1 %54, label %61, label %55
55: ; preds = %52
%56 = load i64, i64* %4
%57 = icmp eq i64 %56, 14
br i1 %57, label %61, label %58
58: ; preds = %55
%59 = load i64, i64* %4
%60 = icmp eq i64 %59, 15
br label %61
61: ; preds = %58, %55, %52, %49, %46, %43, %40, %37, %34, %31, %28, %25, %22, %19, %16, %10
%62 = phi i1 [ true, %55 ], [ true, %52 ], [ true, %49 ], [ true, %46 ], [ true, %43 ], [ true, %40 ], [ true, %37 ], [ true, %34 ], [ true, %31 ], [ true, %28 ], [ true, %25 ], [ true, %22 ], [ true, %19 ], [ true, %16 ], [ true, %10 ], [ %60, %58 ]
%63 = zext i1 %62 to i32
%64 = call i32 @DEBUG_ASSERT(i32 %63)
%65 = load i64, i64* %4
%66 = load i64, i64* %3
%67 = add i64 %66, 36
%68 = inttoptr i64 %67 to i64*
store volatile i64 %65, i64* %68
ret void
}

LLVM IR (-O2):
define void @ADCPhaseDelaySet(i64 %0, i64 %1) {
%3 = and i64 %0, -4097
%4 = icmp eq i64 %3, 1073971200
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = icmp ult i64 %1, 16
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = add i64 %0, 36
%11 = inttoptr i64 %10 to i64*
store volatile i64 %1, i64* %11
ret void
}