#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*/ bzero(char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned char const,
                            unsigned char const, unsigned char const,
                            unsigned char const, unsigned char const,
                            unsigned char const);
void human_readable_MAC(const unsigned char *orig_mac, char *mac) {
  bzero(mac, 24);
  snprintf(mac, 24, "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X", orig_mac[0], orig_mac[1],
           orig_mac[2], orig_mac[3], orig_mac[4], orig_mac[5]);
}


x86 assembly (clang, -O0):
<human_readable_MAC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x18,%esi
call   1040 <bzero@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%r8b
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%r9b
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%r11b
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r10b
mov    -0x8(%rbp),%rax
mov    $0x18,%esi
lea    0xe88(%rip),%rdx
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %r11b,%r11d
mov    %r11d,(%rsp)
movzbl %r10b,%r10d
mov    %r10d,0x8(%rsp)
movzbl 0x5(%rax),%eax
mov    %eax,0x10(%rsp)
call   1030 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<human_readable_MAC>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x18,%esi
call   1040 <bzero@plt>
movzbl (%rbx),%ecx
movzbl 0x1(%rbx),%r8d
movzbl 0x2(%rbx),%r9d
movzbl 0x3(%rbx),%r10d
movzbl 0x4(%rbx),%eax
movzbl 0x5(%rbx),%ebx
sub    $0x8,%rsp
lea    0xea4(%rip),%rdx
mov    %r14,%rdi
mov    $0x18,%esi
push   %rbx
push   %rax
push   %r10
call   1030 <snprintf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [30 x i8] c"%.2X-%.2X-%.2X-%.2X-%.2X-%.2X\00"
define void @human_readable_MAC(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @bzero(i8* %1, i32 24)
%4 = load i8, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 3
%10 = load i8, i8* %9
%11 = getelementptr inbounds i8, i8* %0, i64 4
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 5
%14 = load i8, i8* %13
%15 = tail call i32 @snprintf(i8* %1, i32 24, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8 zeroext %4, i8 zeroext %6, i8 zeroext %8, i8 zeroext %10, i8 zeroext %12, i8 zeroext %14)
ret void
}