#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 I2STxConfigSet(unsigned long ulBase, unsigned long ulConfig) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  DEBUG_ASSERT((ulConfig & (0x3C000000 | 0x03000000 | 0x00800000 | 0x00400000 |
                            0x0000FC00 | 0x000003F0)) == ulConfig);
  if ((ulConfig & 0x03000000) == 0x03000000) {
    ulConfig &= ~0x02000000;
    (*((volatile unsigned long *)(ulBase + 0x00000004))) = 0x00000002;
  } else {
    (*((volatile unsigned long *)(ulBase + 0x00000004))) = 0;
  }
  (*((volatile unsigned long *)(ulBase + 0x00000008))) = ulConfig;
}


x86 assembly (clang, -O0):
<I2STxConfigSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0x3fc0fff0,%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0x3000000,%rax
cmp    $0x3000000,%rax
jne    1185 <I2STxConfigSet+0x75>
mov    -0x10(%rbp),%rax
and    $0xfffffffffdffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x2,0x4(%rax)
jmp    1191 <I2STxConfigSet+0x81>
mov    -0x8(%rbp),%rax
movq   $0x0,0x4(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxConfigSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40054000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xffffffffc03f000f,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %ebx,%eax
not    %eax
mov    %rbx,%rcx
and    $0xfffffffffdffffff,%rcx
xor    %edx,%edx
test   $0x3000000,%eax
cmovne %rbx,%rcx
sete   %dl
add    %rdx,%rdx
mov    %rdx,0x4(%r14)
mov    %rcx,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2STxConfigSet(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, 1074085888
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = and i64 %9, 1069613040
%11 = load i64, i64* %4
%12 = icmp eq i64 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @DEBUG_ASSERT(i32 %13)
%15 = load i64, i64* %4
%16 = and i64 %15, 50331648
%17 = icmp eq i64 %16, 50331648
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = load i64, i64* %4
%20 = and i64 %19, -33554433
store i64 %20, i64* %4
%21 = load i64, i64* %3
%22 = add i64 %21, 4
%23 = inttoptr i64 %22 to i64*
store volatile i64 2, i64* %23
br label %28
24: ; preds = %2
%25 = load i64, i64* %3
%26 = add i64 %25, 4
%27 = inttoptr i64 %26 to i64*
store volatile i64 0, i64* %27
br label %28
28: ; preds = %24, %18
%29 = load i64, i64* %4
%30 = load i64, i64* %3
%31 = add i64 %30, 8
%32 = inttoptr i64 %31 to i64*
store volatile i64 %29, i64* %32
ret void
}

LLVM IR (-O2):
define void @I2STxConfigSet(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074085888
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = and i64 %1, 1069613040
%7 = icmp eq i64 %6, %1
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = and i64 %1, 50331648
%11 = icmp eq i64 %10, 50331648
%12 = and i64 %1, -33554433
%13 = select i1 %11, i64 2, i64 0
%14 = select i1 %11, i64 %12, i64 %1
%15 = add i64 %0, 4
%16 = inttoptr i64 %15 to i64*
store volatile i64 %13, i64* %16
%17 = add i64 %0, 8
%18 = inttoptr i64 %17 to i64*
store volatile i64 %14, i64* %18
ret void
}