#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 EMACAddrFilterSet(uint32_t ui32Base, uint32_t ui32Index,
                       uint32_t ui32Config) {
  uint32_t ui32Val;
  ;

  ;
  ;
  (*((volatile uint32_t *)(ui32Base + (0x00000040 + ((0x0000004C - 0x00000044) *
                                                     (ui32Index)))))) =
      ((*((volatile uint32_t *)(ui32Base +
                                (0x00000040 +
                                 ((0x0000004C - 0x00000044) * (ui32Index)))))) &
       0xFFFF) |
      ui32Config;
  ui32Val = (*((volatile uint32_t *)(ui32Base +
                                     (0x00000044 + ((0x0000004C - 0x00000044) *
                                                    (ui32Index))))));
  (*((volatile uint32_t *)(ui32Base + (0x00000044 + ((0x0000004C - 0x00000044) *
                                                     (ui32Index)))))) = ui32Val;
}


x86 assembly (clang, -O0):
<EMACAddrFilterSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
add    $0x40,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%ecx
and    $0xffff,%ecx
or     -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x3,%edx
add    $0x40,%edx
add    %edx,%eax
cltq
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
add    $0x44,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%edx
shl    $0x3,%edx
add    $0x44,%edx
add    %edx,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACAddrFilterSet>:
lea    (%rdi,%rsi,8),%eax
add    $0x40,%eax
cltq
mov    (%rax),%ecx
movzwl %cx,%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
lea    (%rdi,%rsi,8),%eax
add    $0x44,%eax
cltq
mov    (%rax),%ecx
mov    %ecx,(%rax)
ret

LLVM IR (-O0):
define void @EMACAddrFilterSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul nsw i32 8, %9
%11 = add nsw i32 64, %10
%12 = add nsw i32 %8, %11
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = and i32 %15, 65535
%17 = load i32, i32* %6
%18 = or i32 %16, %17
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul nsw i32 8, %20
%22 = add nsw i32 64, %21
%23 = add nsw i32 %19, %22
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
store volatile i32 %18, i32* %25
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = mul nsw i32 8, %27
%29 = add nsw i32 68, %28
%30 = add nsw i32 %26, %29
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to i32*
%33 = load volatile i32, i32* %32
store i32 %33, i32* %7
%34 = load i32, i32* %7
%35 = load i32, i32* %4
%36 = load i32, i32* %5
%37 = mul nsw i32 8, %36
%38 = add nsw i32 68, %37
%39 = add nsw i32 %35, %38
%40 = sext i32 %39 to i64
%41 = inttoptr i64 %40 to i32*
store volatile i32 %34, i32* %41
ret void
}

LLVM IR (-O2):
define void @EMACAddrFilterSet(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 3
%5 = add i32 %4, %0
%6 = add i32 %5, 64
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, 65535
%11 = or i32 %10, %2
store volatile i32 %11, i32* %8
%12 = add i32 %5, 68
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
store volatile i32 %15, i32* %14
ret void
}