#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*/ sprintf(char *, char *, char const, char const, char const,
                           char const, char const, char const, char const,
                           char const, char const, char const, char const,
                           char const);
int normalize_hw_addr(const char *hw_addr, char hw_modified[]) {
  sprintf(hw_modified, "%c%c:%c%c:%c%c:%c%c:%c%c:%c%c", hw_addr[0], hw_addr[1],
          hw_addr[3], hw_addr[4], hw_addr[6], hw_addr[7], hw_addr[9],
          hw_addr[10], hw_addr[12], hw_addr[13], hw_addr[15], hw_addr[16]);
  return 1;
}


x86 assembly (clang, -O0):
<normalize_hw_addr>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    (%rax),%dl
mov    -0x30(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x30(%rbp),%rax
mov    0x3(%rax),%r8b
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%r9b
mov    -0x30(%rbp),%rax
mov    0x6(%rax),%r13b
mov    -0x30(%rbp),%rax
mov    0x7(%rax),%r12b
mov    -0x30(%rbp),%rax
mov    0x9(%rax),%r15b
mov    -0x30(%rbp),%rax
mov    0xa(%rax),%r14b
mov    -0x30(%rbp),%rax
mov    0xc(%rax),%bl
mov    -0x30(%rbp),%rax
mov    0xd(%rax),%r11b
mov    -0x30(%rbp),%rax
mov    0xf(%rax),%r10b
mov    -0x30(%rbp),%rax
lea    0xe74(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %r8b,%r8d
movsbl %r9b,%r9d
movsbl %r13b,%r13d
mov    %r13d,(%rsp)
movsbl %r12b,%r12d
mov    %r12d,0x8(%rsp)
movsbl %r15b,%r15d
mov    %r15d,0x10(%rsp)
movsbl %r14b,%r14d
mov    %r14d,0x18(%rsp)
movsbl %bl,%ebx
mov    %ebx,0x20(%rsp)
movsbl %r11b,%r11d
mov    %r11d,0x28(%rsp)
movsbl %r10b,%r10d
mov    %r10d,0x30(%rsp)
movsbl 0x10(%rax),%eax
mov    %eax,0x38(%rsp)
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_hw_addr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rax
movsbl (%rdi),%edx
movsbl 0x1(%rdi),%ecx
movsbl 0x3(%rdi),%r8d
movsbl 0x4(%rdi),%r9d
movsbl 0x6(%rdi),%r10d
movsbl 0x7(%rdi),%r11d
movsbl 0x9(%rdi),%r14d
movsbl 0xa(%rdi),%r15d
movsbl 0xc(%rdi),%r12d
movsbl 0xd(%rdi),%r13d
movsbl 0xf(%rdi),%ebx
movsbl 0x10(%rdi),%ebp
lea    0xea4(%rip),%rsi
mov    %rax,%rdi
push   %rbp
push   %rbx
push   %r13
push   %r12
push   %r15
push   %r14
push   %r11
push   %r10
call   1030 <sprintf@plt>
add    $0x40,%rsp
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%c%c:%c%c:%c%c:%c%c:%c%c:%c%c\00"
define i32 @normalize_hw_addr(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 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 4
%17 = load i8, i8* %16
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 6
%20 = load i8, i8* %19
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 7
%23 = load i8, i8* %22
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 9
%26 = load i8, i8* %25
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 10
%29 = load i8, i8* %28
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 12
%32 = load i8, i8* %31
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 13
%35 = load i8, i8* %34
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i64 15
%38 = load i8, i8* %37
%39 = load i8*, i8** %3
%40 = getelementptr inbounds i8, i8* %39, i64 16
%41 = load i8, i8* %40
%42 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 signext %11, i8 signext %14, i8 signext %17, i8 signext %20, i8 signext %23, i8 signext %26, i8 signext %29, i8 signext %32, i8 signext %35, i8 signext %38, i8 signext %41)
ret i32 1
}

LLVM IR (-O2):
@.str = [30 x i8] c"%c%c:%c%c:%c%c:%c%c:%c%c:%c%c\00"
define i32 @normalize_hw_addr(i8* nocapture %0, i8* nocapture writeonly %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 3
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 4
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 6
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 7
%13 = load i8, i8* %12
%14 = getelementptr inbounds i8, i8* %0, i64 9
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %0, i64 10
%17 = load i8, i8* %16
%18 = getelementptr inbounds i8, i8* %0, i64 12
%19 = load i8, i8* %18
%20 = getelementptr inbounds i8, i8* %0, i64 13
%21 = load i8, i8* %20
%22 = getelementptr inbounds i8, i8* %0, i64 15
%23 = load i8, i8* %22
%24 = getelementptr inbounds i8, i8* %0, i64 16
%25 = load i8, i8* %24
%26 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8 signext %3, i8 signext %5, i8 signext %7, i8 signext %9, i8 signext %11, i8 signext %13, i8 signext %15, i8 signext %17, i8 signext %19, i8 signext %21, i8 signext %23, i8 signext %25)
ret i32 1
}