#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 */
struct ether_header {
  int *ether_shost;
  int *ether_dhost;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printMacAddress(struct ether_header *eh) {
  printf("\n\n/**********MAC ADDRESS**********/\n");
  printf("Destination MAC: %x:%x:%x:%x:%x:%x\n", eh->ether_shost[0],
         eh->ether_shost[1], eh->ether_shost[2], eh->ether_shost[3],
         eh->ether_shost[4], eh->ether_shost[5]);
  printf("Destination MAC: %x:%x:%x:%x:%x:%x\n", eh->ether_dhost[0],
         eh->ether_dhost[1], eh->ether_dhost[2], eh->ether_dhost[3],
         eh->ether_dhost[4], eh->ether_dhost[5]);
  printf("/***************************/\n\n");
}


x86 assembly (clang, -O0):
<printMacAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0xc(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x10(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x14(%rax),%eax
lea    0xeb7(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0xc(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x10(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x14(%rax),%eax
lea    0xe63(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMacAddress>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rax
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%eax
mov    %eax,(%rsp)
lea    0xead(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rax
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%eax
mov    %eax,(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.ether_header = type { i32*, i32* }
@.str = [37 x i8] c"\0A\0A/**********MAC ADDRESS**********/\0A\00"
@.str.1 = [36 x i8] c"Destination MAC: %x:%x:%x:%x:%x:%x\0A\00"
@.str.2 = [32 x i8] c"/***************************/\0A\0A\00"
define void @printMacAddress(%struct.ether_header* %0) {
%2 = alloca %struct.ether_header*
store %struct.ether_header* %0, %struct.ether_header** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.ether_header*, %struct.ether_header** %2
%5 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %4, i32 0, i32 0
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load %struct.ether_header*, %struct.ether_header** %2
%10 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %9, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = load %struct.ether_header*, %struct.ether_header** %2
%15 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %14, i32 0, i32 0
%16 = load i32*, i32** %15
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = load %struct.ether_header*, %struct.ether_header** %2
%20 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %19, i32 0, i32 0
%21 = load i32*, i32** %20
%22 = getelementptr inbounds i32, i32* %21, i64 3
%23 = load i32, i32* %22
%24 = load %struct.ether_header*, %struct.ether_header** %2
%25 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %24, i32 0, i32 0
%26 = load i32*, i32** %25
%27 = getelementptr inbounds i32, i32* %26, i64 4
%28 = load i32, i32* %27
%29 = load %struct.ether_header*, %struct.ether_header** %2
%30 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %29, i32 0, i32 0
%31 = load i32*, i32** %30
%32 = getelementptr inbounds i32, i32* %31, i64 5
%33 = load i32, i32* %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %13, i32 %18, i32 %23, i32 %28, i32 %33)
%35 = load %struct.ether_header*, %struct.ether_header** %2
%36 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %35, i32 0, i32 1
%37 = load i32*, i32** %36
%38 = getelementptr inbounds i32, i32* %37, i64 0
%39 = load i32, i32* %38
%40 = load %struct.ether_header*, %struct.ether_header** %2
%41 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %40, i32 0, i32 1
%42 = load i32*, i32** %41
%43 = getelementptr inbounds i32, i32* %42, i64 1
%44 = load i32, i32* %43
%45 = load %struct.ether_header*, %struct.ether_header** %2
%46 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %45, i32 0, i32 1
%47 = load i32*, i32** %46
%48 = getelementptr inbounds i32, i32* %47, i64 2
%49 = load i32, i32* %48
%50 = load %struct.ether_header*, %struct.ether_header** %2
%51 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %50, i32 0, i32 1
%52 = load i32*, i32** %51
%53 = getelementptr inbounds i32, i32* %52, i64 3
%54 = load i32, i32* %53
%55 = load %struct.ether_header*, %struct.ether_header** %2
%56 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %55, i32 0, i32 1
%57 = load i32*, i32** %56
%58 = getelementptr inbounds i32, i32* %57, i64 4
%59 = load i32, i32* %58
%60 = load %struct.ether_header*, %struct.ether_header** %2
%61 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %60, i32 0, i32 1
%62 = load i32*, i32** %61
%63 = getelementptr inbounds i32, i32* %62, i64 5
%64 = load i32, i32* %63
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %39, i32 %44, i32 %49, i32 %54, i32 %59, i32 %64)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ether_header = type { i32*, i32* }
@.str.1 = [36 x i8] c"Destination MAC: %x:%x:%x:%x:%x:%x\0A\00"
@str = [36 x i8] c"\0A\0A/**********MAC ADDRESS**********/\00"
@str.3 = [31 x i8] c"/***************************/\0A\00"
define void @printMacAddress(%struct.ether_header* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %4, i64 2
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %4, i64 3
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %4, i64 4
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %4, i64 5
%15 = load i32, i32* %14
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15)
%17 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %0, i64 0, i32 1
%18 = load i32*, i32** %17
%19 = load i32, i32* %18
%20 = getelementptr inbounds i32, i32* %18, i64 1
%21 = load i32, i32* %20
%22 = getelementptr inbounds i32, i32* %18, i64 2
%23 = load i32, i32* %22
%24 = getelementptr inbounds i32, i32* %18, i64 3
%25 = load i32, i32* %24
%26 = getelementptr inbounds i32, i32* %18, i64 4
%27 = load i32, i32* %26
%28 = getelementptr inbounds i32, i32* %18, i64 5
%29 = load i32, i32* %28
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %21, i32 %23, i32 %25, i32 %27, i32 %29)
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.3, i64 0, i64 0))
ret void
}