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


x86 assembly (clang, -O0):
<I2STxRxConfigSet>:
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    -0x8(%rbp),%rax
movq   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,0x804(%rax)
mov    -0x10(%rbp),%rax
and    $0x3000000,%rax
cmp    $0x2000000,%rax
jne    11a5 <I2STxRxConfigSet+0x95>
mov    -0x8(%rbp),%rax
mov    0x804(%rax),%rcx
or     $0x4,%rcx
mov    %rcx,0x804(%rax)
mov    -0x10(%rbp),%rax
and    $0xfffffffffdffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3000000,%rax
cmp    $0x3000000,%rax
jne    11e1 <I2STxRxConfigSet+0xd1>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     $0x2,%rcx
mov    %rcx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x804(%rax),%rcx
or     $0x2,%rcx
mov    %rcx,0x804(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x808(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxRxConfigSet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xffffffffc03f000f,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
movq   $0x0,0x4(%rbx)
movq   $0x0,0x804(%rbx)
mov    %r14d,%eax
and    $0x3000000,%eax
cmp    $0x2000000,%eax
jne    116f <I2STxRxConfigSet+0x5f>
orq    $0x4,0x804(%rbx)
04
and    $0xfffffffffdffffff,%r14
mov    %r14d,%eax
not    %eax
test   $0x3000000,%eax
jne    1188 <I2STxRxConfigSet+0x78>
orq    $0x2,0x4(%rbx)
orq    $0x2,0x804(%rbx)
02
mov    %r14,0x8(%rbx)
mov    %r14,0x808(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2STxRxConfigSet(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* %3
%16 = add i64 %15, 4
%17 = inttoptr i64 %16 to i64*
store volatile i64 0, i64* %17
%18 = load i64, i64* %3
%19 = add i64 %18, 2052
%20 = inttoptr i64 %19 to i64*
store volatile i64 0, i64* %20
%21 = load i64, i64* %4
%22 = and i64 %21, 50331648
%23 = icmp eq i64 %22, 33554432
br i1 %23, label %24, label %32
24: ; preds = %2
%25 = load i64, i64* %3
%26 = add i64 %25, 2052
%27 = inttoptr i64 %26 to i64*
%28 = load volatile i64, i64* %27
%29 = or i64 %28, 4
store volatile i64 %29, i64* %27
%30 = load i64, i64* %4
%31 = and i64 %30, -33554433
store i64 %31, i64* %4
br label %32
32: ; preds = %24, %2
%33 = load i64, i64* %4
%34 = and i64 %33, 50331648
%35 = icmp eq i64 %34, 50331648
br i1 %35, label %36, label %47
36: ; preds = %32
%37 = load i64, i64* %3
%38 = add i64 %37, 4
%39 = inttoptr i64 %38 to i64*
%40 = load volatile i64, i64* %39
%41 = or i64 %40, 2
store volatile i64 %41, i64* %39
%42 = load i64, i64* %3
%43 = add i64 %42, 2052
%44 = inttoptr i64 %43 to i64*
%45 = load volatile i64, i64* %44
%46 = or i64 %45, 2
store volatile i64 %46, i64* %44
br label %47
47: ; preds = %36, %32
%48 = load i64, i64* %4
%49 = load i64, i64* %3
%50 = add i64 %49, 8
%51 = inttoptr i64 %50 to i64*
store volatile i64 %48, i64* %51
%52 = load i64, i64* %4
%53 = load i64, i64* %3
%54 = add i64 %53, 2056
%55 = inttoptr i64 %54 to i64*
store volatile i64 %52, i64* %55
ret void
}

LLVM IR (-O2):
define void @I2STxRxConfigSet(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 = add i64 %0, 4
%11 = inttoptr i64 %10 to i64*
store volatile i64 0, i64* %11
%12 = add i64 %0, 2052
%13 = inttoptr i64 %12 to i64*
store volatile i64 0, i64* %13
%14 = and i64 %1, 50331648
%15 = icmp eq i64 %14, 33554432
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load volatile i64, i64* %13
%18 = or i64 %17, 4
store volatile i64 %18, i64* %13
%19 = and i64 %1, -33554433
br label %20
20: ; preds = %16, %2
%21 = phi i64 [ %19, %16 ], [ %1, %2 ]
%22 = and i64 %21, 50331648
%23 = icmp eq i64 %22, 50331648
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load volatile i64, i64* %11
%26 = or i64 %25, 2
store volatile i64 %26, i64* %11
%27 = load volatile i64, i64* %13
%28 = or i64 %27, 2
store volatile i64 %28, i64* %13
br label %29
29: ; preds = %24, %20
%30 = add i64 %0, 8
%31 = inttoptr i64 %30 to i64*
store volatile i64 %21, i64* %31
%32 = add i64 %0, 2056
%33 = inttoptr i64 %32 to i64*
store volatile i64 %21, i64* %33
ret void
}