#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 char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ Hex_encode(char *, int, char const *, int);
void AddrTools_printMac(uint8_t output[18], const uint8_t binMac[6]) {
  uint8_t hex[12];
  Hex_encode(hex, 12, binMac, 6);
  output[0] = hex[0];
  output[1] = hex[1];
  output[2] = ':';
  output[3] = hex[2];
  output[4] = hex[3];
  output[5] = ':';
  output[6] = hex[4];
  output[7] = hex[5];
  output[8] = ':';
  output[9] = hex[6];
  output[10] = hex[7];
  output[11] = ':';
  output[12] = hex[8];
  output[13] = hex[9];
  output[14] = ':';
  output[15] = hex[10];
  output[16] = hex[11];
  output[17] = '\0';
}


x86 assembly (clang, -O0):
<AddrTools_printMac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0xc,%esi
mov    $0x6,%ecx
call   1030 <Hex_encode@plt>
mov    -0x1c(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x1b(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x3a,0x2(%rax)
mov    -0x1a(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x19(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x8(%rbp),%rax
movb   $0x3a,0x5(%rax)
mov    -0x18(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x6(%rax)
mov    -0x17(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0x8(%rbp),%rax
movb   $0x3a,0x8(%rax)
mov    -0x16(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x9(%rax)
mov    -0x15(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xa(%rax)
mov    -0x8(%rbp),%rax
movb   $0x3a,0xb(%rax)
mov    -0x14(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xc(%rax)
mov    -0x13(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xd(%rax)
mov    -0x8(%rbp),%rax
movb   $0x3a,0xe(%rax)
mov    -0x12(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xf(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x10(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x11(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddrTools_printMac>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0x4(%rsp),%rdi
mov    $0xc,%esi
mov    $0x6,%ecx
call   1030 <Hex_encode@plt>
mov    0x4(%rsp),%al
mov    %al,(%rbx)
mov    0x5(%rsp),%al
mov    %al,0x1(%rbx)
movb   $0x3a,0x2(%rbx)
mov    0x6(%rsp),%al
mov    %al,0x3(%rbx)
mov    0x7(%rsp),%al
mov    %al,0x4(%rbx)
movb   $0x3a,0x5(%rbx)
mov    0x8(%rsp),%al
mov    %al,0x6(%rbx)
mov    0x9(%rsp),%al
mov    %al,0x7(%rbx)
movb   $0x3a,0x8(%rbx)
mov    0xa(%rsp),%al
mov    %al,0x9(%rbx)
mov    0xb(%rsp),%al
mov    %al,0xa(%rbx)
movb   $0x3a,0xb(%rbx)
mov    0xc(%rsp),%al
mov    %al,0xc(%rbx)
mov    0xd(%rsp),%al
mov    %al,0xd(%rbx)
movb   $0x3a,0xe(%rbx)
mov    0xe(%rsp),%al
mov    %al,0xf(%rbx)
mov    0xf(%rsp),%al
mov    %al,0x10(%rbx)
movb   $0x0,0x11(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @AddrTools_printMac(i8* nocapture writeonly %0, i8* %1) {
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = call i32 @Hex_encode(i8* %4, i32 12, i8* %1, i32 6)
%6 = load i8, i8* %4
store i8 %6, i8* %0
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 1
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 58, i8* %10
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 2
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %12, i8* %13
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 3
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %15, i8* %16
%17 = getelementptr inbounds i8, i8* %0, i64 5
store i8 58, i8* %17
%18 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 4
%19 = load i8, i8* %18
%20 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %19, i8* %20
%21 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 5
%22 = load i8, i8* %21
%23 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %22, i8* %23
%24 = getelementptr inbounds i8, i8* %0, i64 8
store i8 58, i8* %24
%25 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 6
%26 = load i8, i8* %25
%27 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %26, i8* %27
%28 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 7
%29 = load i8, i8* %28
%30 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %29, i8* %30
%31 = getelementptr inbounds i8, i8* %0, i64 11
store i8 58, i8* %31
%32 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 8
%33 = load i8, i8* %32
%34 = getelementptr inbounds i8, i8* %0, i64 12
store i8 %33, i8* %34
%35 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 9
%36 = load i8, i8* %35
%37 = getelementptr inbounds i8, i8* %0, i64 13
store i8 %36, i8* %37
%38 = getelementptr inbounds i8, i8* %0, i64 14
store i8 58, i8* %38
%39 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 10
%40 = load i8, i8* %39
%41 = getelementptr inbounds i8, i8* %0, i64 15
store i8 %40, i8* %41
%42 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 11
%43 = load i8, i8* %42
%44 = getelementptr inbounds i8, i8* %0, i64 16
store i8 %43, i8* %44
%45 = getelementptr inbounds i8, i8* %0, i64 17
store i8 0, i8* %45
ret void
}