#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 int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ strtol(int /*<<< orphan*/ *, int /*<<< orphan*/ **, int);
int cck_mac_transfer(uint8_t *mac, uint8_t *mac_key) {
  uint8_t *p = mac;
  int i = 0;
  for (i = 0; i < 6; i++) {
    mac_key[i] = strtol(p, &p, 16);
    p++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cck_mac_transfer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jge    1179 <cck_mac_transfer+0x69>
mov    -0x18(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1136 <cck_mac_transfer+0x26>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cck_mac_transfer>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,(%rsp)
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,(%rbx)
mov    (%rsp),%rdi
add    $0x4,%rdi
mov    %rdi,(%rsp)
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,0x4(%rbx)
mov    (%rsp),%rdi
add    $0x4,%rdi
mov    %rdi,(%rsp)
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,0x8(%rbx)
mov    (%rsp),%rdi
add    $0x4,%rdi
mov    %rdi,(%rsp)
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,0xc(%rbx)
mov    (%rsp),%rdi
add    $0x4,%rdi
mov    %rdi,(%rsp)
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,0x10(%rbx)
mov    (%rsp),%rdi
add    $0x4,%rdi
mov    %rdi,(%rsp)
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,0x14(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @cck_mac_transfer(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
store i32* %7, i32** %5
store i32 0, i32* %6
store i32 0, i32* %6
br label %8
8: ; preds = %20, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 6
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i32*, i32** %5
%13 = call i32 @strtol(i32* %12, i32** %5, i32 16)
%14 = load i32*, i32** %4
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %13, i32* %17
%18 = load i32*, i32** %5
%19 = getelementptr inbounds i32, i32* %18, i32 1
store i32* %19, i32** %5
br label %20
20: ; preds = %11
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %8
23: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @cck_mac_transfer(i32* %0, i32* nocapture writeonly %1) {
%3 = alloca i32*
%4 = bitcast i32** %3 to i8*
store i32* %0, i32** %3
%5 = call i32 @strtol(i32* %0, i32** %3, i32 16)
store i32 %5, i32* %1
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32* %7, i32** %3
%8 = call i32 @strtol(i32* %7, i32** %3, i32 16)
%9 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %8, i32* %9
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32* %11, i32** %3
%12 = call i32 @strtol(i32* %11, i32** %3, i32 16)
%13 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %12, i32* %13
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32* %15, i32** %3
%16 = call i32 @strtol(i32* %15, i32** %3, i32 16)
%17 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %16, i32* %17
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32* %19, i32** %3
%20 = call i32 @strtol(i32* %19, i32** %3, i32 16)
%21 = getelementptr inbounds i32, i32* %1, i64 4
store i32 %20, i32* %21
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 1
store i32* %23, i32** %3
%24 = call i32 @strtol(i32* %23, i32** %3, i32 16)
%25 = getelementptr inbounds i32, i32* %1, i64 5
store i32 %24, i32* %25
ret i32 0
}