#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 */
void EMACIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  if (ui32IntFlags & (0x00000001 | 0x00000040 | 0x00004000 | 0x00000004)) {
    ui32IntFlags |= 0x00010000;
  }
  if (ui32IntFlags &
      (0x00000002 | 0x00000008 | 0x00000010 | 0x00000020 | 0x00000080 |
       0x00000100 | 0x00000200 | 0x00000400 | 0x00002000)) {
    ui32IntFlags |= 0x00008000;
  }
  if (ui32IntFlags & ~0x80000000) {
    (*((volatile uint32_t *)(ui32Base + 0x00000C14))) =
        (ui32IntFlags & ~0x80000000);
  }
  if (ui32IntFlags & 0x80000000) {
    (*((volatile uint32_t *)(ui32Base + 0x00000FD8))) |= 0x00000001;
  }
}


x86 assembly (clang, -O0):
<EMACIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x4045,%eax
cmp    $0x0,%eax
je     1126 <EMACIntClear+0x26>
mov    -0x8(%rbp),%eax
or     $0x10000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x27ba,%eax
cmp    $0x0,%eax
je     1142 <EMACIntClear+0x42>
mov    -0x8(%rbp),%eax
or     $0x8000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x7fffffff,%eax
cmp    $0x0,%eax
je     1168 <EMACIntClear+0x68>
mov    -0x8(%rbp),%ecx
and    $0x7fffffff,%ecx
mov    -0x4(%rbp),%eax
add    $0xc14,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     118a <EMACIntClear+0x8a>
mov    -0x4(%rbp),%eax
add    $0xfd8,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACIntClear>:
mov    %esi,%ecx
or     $0x10000,%ecx
test   $0x4045,%esi
cmove  %esi,%ecx
mov    %ecx,%eax
or     $0x8000,%eax
test   $0x27ba,%ecx
cmove  %ecx,%eax
mov    %eax,%edx
movslq %edi,%rcx
and    $0x7fffffff,%edx
je     1134 <EMACIntClear+0x34>
mov    %edx,0xc14(%rcx)
test   %eax,%eax
js     1139 <EMACIntClear+0x39>
ret
orl    $0x1,0xfd8(%rcx)
ret

LLVM IR (-O0):
define void @EMACIntClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 16453
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = or i32 %9, 65536
store i32 %10, i32* %4
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = and i32 %12, 10170
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %4
%17 = or i32 %16, 32768
store i32 %17, i32* %4
br label %18
18: ; preds = %15, %11
%19 = load i32, i32* %4
%20 = and i32 %19, 2147483647
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %18
%23 = load i32, i32* %4
%24 = and i32 %23, 2147483647
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 3092
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i32*
store volatile i32 %24, i32* %28
br label %29
29: ; preds = %22, %18
%30 = load i32, i32* %4
%31 = and i32 %30, -2147483648
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %40
33: ; preds = %29
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 4056
%36 = sext i32 %35 to i64
%37 = inttoptr i64 %36 to i32*
%38 = load volatile i32, i32* %37
%39 = or i32 %38, 1
store volatile i32 %39, i32* %37
br label %40
40: ; preds = %33, %29
ret void
}

LLVM IR (-O2):
define void @EMACIntClear(i32 %0, i32 %1) {
%3 = and i32 %1, 16453
%4 = icmp eq i32 %3, 0
%5 = or i32 %1, 65536
%6 = select i1 %4, i32 %1, i32 %5
%7 = and i32 %6, 10170
%8 = icmp eq i32 %7, 0
%9 = or i32 %6, 32768
%10 = select i1 %8, i32 %6, i32 %9
%11 = and i32 %10, 2147483647
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %2
%14 = add nsw i32 %0, 3092
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %11, i32* %16
br label %17
17: ; preds = %13, %2
%18 = icmp sgt i32 %10, -1
br i1 %18, label %25, label %19
19: ; preds = %17
%20 = add nsw i32 %0, 4056
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
%23 = load volatile i32, i32* %22
%24 = or i32 %23, 1
store volatile i32 %24, i32* %22
br label %25
25: ; preds = %19, %17
ret void
}