#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*/ printf(char *, char *, unsigned char, unsigned char,
                          unsigned char, unsigned char, unsigned char,
                          unsigned char);
void printmac(void *src, char *title) {
  unsigned char *karl = src;
  printf("%s: %02x:%02x:%02x:%02x:%02x:%02x\n", title, karl[0], karl[1],
         karl[2], karl[3], karl[4], karl[5]);
}


x86 assembly (clang, -O0):
<printmac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%dl
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%r8b
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%r9b
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%r10b
mov    -0x18(%rbp),%rax
lea    0xea4(%rip),%rdi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %r10b,%r10d
mov    %r10d,(%rsp)
movzbl 0x5(%rax),%eax
mov    %eax,0x8(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmac>:
push   %rax
movzbl (%rdi),%edx
movzbl 0x1(%rdi),%ecx
movzbl 0x2(%rdi),%r8d
movzbl 0x3(%rdi),%r9d
movzbl 0x4(%rdi),%r10d
movzbl 0x5(%rdi),%eax
lea    0xece(%rip),%rdi
push   %rax
push   %r10
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [35 x i8] c"%s: %02x:%02x:%02x:%02x:%02x:%02x\0A\00"
define void @printmac(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 3
%19 = load i8, i8* %18
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 4
%22 = load i8, i8* %21
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 5
%25 = load i8, i8* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %7, i8 zeroext %10, i8 zeroext %13, i8 zeroext %16, i8 zeroext %19, i8 zeroext %22, i8 zeroext %25)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"%s: %02x:%02x:%02x:%02x:%02x:%02x\0A\00"
define void @printmac(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 3
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 4
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 5
%13 = load i8, i8* %12
%14 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %1, i8 zeroext %3, i8 zeroext %5, i8 zeroext %7, i8 zeroext %9, i8 zeroext %11, i8 zeroext %13)
ret void
}