#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 ADCProcessorTrigger(unsigned long ulBase, unsigned long ulSequenceNum) {
  DEBUG_ASSERT((ulBase == 0x40038000) || (ulBase == 0x40039000));
  DEBUG_ASSERT((ulSequenceNum & 0xf) < 4);
  (*((volatile unsigned long *)(ulBase + 0x00000028))) |=
      ((ulSequenceNum & 0xffff0000) | (1 << (ulSequenceNum & 0xf)));
}


x86 assembly (clang, -O0):
<ADCProcessorTrigger>:
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 <ADCProcessorTrigger+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    -0x10(%rbp),%rax
and    $0xf,%rax
cmp    $0x4,%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
movabs $0xffff0000,%rdx
and    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rax
and    $0xf,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
or     %rax,%rdx
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x28(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCProcessorTrigger>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40038000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r15d,%ebx
and    $0xf,%ebx
xor    %edi,%edi
cmp    $0x4,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
and    $0xffff0000,%r15d
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
or     %r15,%rax
or     %rax,0x28(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ADCProcessorTrigger(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 = and i64 %14, 15
%16 = icmp ult i64 %15, 4
%17 = zext i1 %16 to i32
%18 = call i32 @DEBUG_ASSERT(i32 %17)
%19 = load i64, i64* %4
%20 = and i64 %19, 4294901760
%21 = load i64, i64* %4
%22 = and i64 %21, 15
%23 = trunc i64 %22 to i32
%24 = shl i32 1, %23
%25 = sext i32 %24 to i64
%26 = or i64 %20, %25
%27 = load i64, i64* %3
%28 = add i64 %27, 40
%29 = inttoptr i64 %28 to i64*
%30 = load volatile i64, i64* %29
%31 = or i64 %30, %26
store volatile i64 %31, i64* %29
ret void
}

LLVM IR (-O2):
define void @ADCProcessorTrigger(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 = and i64 %1, 15
%8 = icmp ult i64 %7, 4
%9 = zext i1 %8 to i32
%10 = tail call i32 @DEBUG_ASSERT(i32 %9)
%11 = and i64 %1, 4294901760
%12 = trunc i64 %7 to i32
%13 = shl nuw nsw i32 1, %12
%14 = zext i32 %13 to i64
%15 = or i64 %11, %14
%16 = add i64 %0, 40
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = or i64 %15, %18
store volatile i64 %19, i64* %17
ret void
}