#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 EthernetMACAddrGet(unsigned long ulBase, unsigned char *pucMACAddr) {
  unsigned long ulTemp;
  unsigned char *pucTemp = (unsigned char *)&ulTemp;
  DEBUG_ASSERT(ulBase == 0x40048000);
  DEBUG_ASSERT(pucMACAddr != 0);
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000014)));
  pucMACAddr[0] = pucTemp[0];
  pucMACAddr[1] = pucTemp[1];
  pucMACAddr[2] = pucTemp[2];
  pucMACAddr[3] = pucTemp[3];
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000018)));
  pucMACAddr[4] = pucTemp[0];
  pucMACAddr[5] = pucTemp[1];
}


x86 assembly (clang, -O0):
<EthernetMACAddrGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x40048000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x20(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x20(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x20(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x5(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetMACAddrGet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40048000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x14(%rbx),%rax
mov    %eax,(%r14)
mov    0x18(%rbx),%rax
mov    %ax,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @EthernetMACAddrGet(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%7 = bitcast i64* %5 to i8*
store i8* %7, i8** %6
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1074036736
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
%14 = zext i1 %13 to i32
%15 = call i32 @DEBUG_ASSERT(i32 %14)
%16 = load i64, i64* %3
%17 = add i64 %16, 20
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
store i64 %19, i64* %5
%20 = load i8*, i8** %6
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 0
store i8 %22, i8* %24
%25 = load i8*, i8** %6
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 1
store i8 %27, i8* %29
%30 = load i8*, i8** %6
%31 = getelementptr inbounds i8, i8* %30, i64 2
%32 = load i8, i8* %31
%33 = load i8*, i8** %4
%34 = getelementptr inbounds i8, i8* %33, i64 2
store i8 %32, i8* %34
%35 = load i8*, i8** %6
%36 = getelementptr inbounds i8, i8* %35, i64 3
%37 = load i8, i8* %36
%38 = load i8*, i8** %4
%39 = getelementptr inbounds i8, i8* %38, i64 3
store i8 %37, i8* %39
%40 = load i64, i64* %3
%41 = add i64 %40, 24
%42 = inttoptr i64 %41 to i64*
%43 = load volatile i64, i64* %42
store i64 %43, i64* %5
%44 = load i8*, i8** %6
%45 = getelementptr inbounds i8, i8* %44, i64 0
%46 = load i8, i8* %45
%47 = load i8*, i8** %4
%48 = getelementptr inbounds i8, i8* %47, i64 4
store i8 %46, i8* %48
%49 = load i8*, i8** %6
%50 = getelementptr inbounds i8, i8* %49, i64 1
%51 = load i8, i8* %50
%52 = load i8*, i8** %4
%53 = getelementptr inbounds i8, i8* %52, i64 5
store i8 %51, i8* %53
ret void
}

LLVM IR (-O2):
define void @EthernetMACAddrGet(i64 %0, i8* writeonly %1) {
%3 = icmp eq i64 %0, 1074036736
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = add i64 %0, 20
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = trunc i64 %11 to i8
%13 = lshr i64 %11, 8
%14 = trunc i64 %13 to i8
%15 = lshr i64 %11, 16
%16 = trunc i64 %15 to i8
%17 = lshr i64 %11, 24
%18 = trunc i64 %17 to i8
store i8 %12, i8* %1
%19 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %14, i8* %19
%20 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %16, i8* %20
%21 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %18, i8* %21
%22 = add i64 %0, 24
%23 = inttoptr i64 %22 to i64*
%24 = load volatile i64, i64* %23
%25 = trunc i64 %24 to i8
%26 = lshr i64 %24, 8
%27 = trunc i64 %26 to i8
%28 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %25, i8* %28
%29 = getelementptr inbounds i8, i8* %1, i64 5
store i8 %27, i8* %29
ret void
}