#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ SysCtlDelay(int);
void OneWireDMAEnable(uint32_t ui32Base, uint32_t ui32DMAFlags) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000000))) &
        ~((0x00000006 | 0x00000018 | 0x00070000))) |
       (ui32DMAFlags >> 8));
  (*((volatile uint32_t *)(ui32Base + 0x00000120))) = (ui32DMAFlags & 0xf);
  if ((ui32DMAFlags & (0x00000002 | 0x00000006)) &&
      !(ui32DMAFlags & 0x00000008)) {
    if ((((*((volatile uint32_t *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) ==
         (0x10000000 | 0x000A0000))) {
      SysCtlDelay(9);
    }
    (*((volatile uint32_t *)(ui32Base + 0x00000008))) = 0xffffffff;
  }
}


x86 assembly (clang, -O0):
<OneWireDMAEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    $0xfff8ffe1,%ecx
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
mov    -0x4(%rbp),%eax
add    $0x120,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x6,%eax
cmp    $0x0,%eax
je     119f <OneWireDMAEnable+0x8f>
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    119f <OneWireDMAEnable+0x8f>
mov    $0x400fe000,%eax
mov    (%rax),%eax
and    $0x70ff0000,%eax
cmp    $0x100a0000,%eax
jne    1191 <OneWireDMAEnable+0x81>
mov    $0x9,%edi
call   1030 <SysCtlDelay@plt>
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
movl   $0xffffffff,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneWireDMAEnable>:
push   %rbx
movslq %edi,%rbx
mov    $0xfff8ffe1,%eax
and    (%rbx),%eax
mov    %esi,%ecx
sar    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,(%rbx)
mov    %esi,%eax
and    $0xf,%eax
mov    %eax,0x120(%rbx)
test   $0x6,%sil
je     115e <OneWireDMAEnable+0x4e>
and    $0x8,%esi
jne    115e <OneWireDMAEnable+0x4e>
mov    $0x70ff0000,%eax
and    0x400fe000,%eax
cmp    $0x100a0000,%eax
jne    1157 <OneWireDMAEnable+0x47>
mov    $0x9,%edi
call   1030 <SysCtlDelay@plt>
movl   $0xffffffff,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @OneWireDMAEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 0
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -458783
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = or i32 %10, %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 0
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
store volatile i32 %13, i32* %17
%18 = load i32, i32* %4
%19 = and i32 %18, 15
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 288
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
store volatile i32 %19, i32* %23
%24 = load i32, i32* %4
%25 = and i32 %24, 6
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %42
27: ; preds = %2
%28 = load i32, i32* %4
%29 = and i32 %28, 8
%30 = icmp ne i32 %29, 0
br i1 %30, label %42, label %31
31: ; preds = %27
%32 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%33 = and i32 %32, 1895759872
%34 = icmp eq i32 %33, 269090816
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = call i32 @SysCtlDelay(i32 9)
br label %37
37: ; preds = %35, %31
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 8
%40 = sext i32 %39 to i64
%41 = inttoptr i64 %40 to i32*
store volatile i32 -1, i32* %41
br label %42
42: ; preds = %37, %27, %2
ret void
}

LLVM IR (-O2):
define void @OneWireDMAEnable(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -458783
%7 = ashr i32 %1, 8
%8 = or i32 %6, %7
store volatile i32 %8, i32* %4
%9 = and i32 %1, 15
%10 = add nsw i32 %0, 288
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %9, i32* %12
%13 = and i32 %1, 6
%14 = icmp ne i32 %13, 0
%15 = and i32 %1, 8
%16 = icmp eq i32 %15, 0
%17 = and i1 %14, %16
br i1 %17, label %18, label %28
18: ; preds = %2
%19 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%20 = and i32 %19, 1895759872
%21 = icmp eq i32 %20, 269090816
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = tail call i32 @SysCtlDelay(i32 9)
br label %24
24: ; preds = %22, %18
%25 = add nsw i32 %0, 8
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
store volatile i32 -1, i32* %27
br label %28
28: ; preds = %24, %2
ret void
}