#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*/ opt_MAC(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *);
int /*<<< orphan*/ opt_reverse_arraybytecpy(int /*<<< orphan*/ *,
                                            int /*<<< orphan*/ *, int);
void opt_doReaderMAC(uint8_t *cc_nr_p, uint8_t *div_key_p, uint8_t mac[4]) {
  static uint8_t cc_nr[12];
  opt_reverse_arraybytecpy(cc_nr, cc_nr_p, 12);
  uint8_t dest[] = {0, 0, 0, 0, 0, 0, 0, 0};
  opt_MAC(div_key_p, cc_nr, dest);
  opt_reverse_arraybytecpy(mac, dest, 4);
  return;
}


x86 assembly (clang, -O0):
<opt_doReaderMAC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f01(%rip),%rdi
mov    $0xc,%edx
call   1030 <opt_reverse_arraybytecpy@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    0x2ed8(%rip),%rsi
call   1040 <opt_MAC@plt>
mov    -0x18(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x4,%edx
call   1030 <opt_reverse_arraybytecpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_doReaderMAC>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x2f05(%rip),%r15
mov    %r15,%rdi
mov    $0xc,%edx
call   1030 <opt_reverse_arraybytecpy@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%r12
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <opt_MAC@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x4,%edx
call   1030 <opt_reverse_arraybytecpy@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@opt_doReaderMAC.cc_nr = internal global [12 x i32] zeroinitializer
define void @opt_doReaderMAC(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca [8 x i32]
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = call i32 @opt_reverse_arraybytecpy(i32* getelementptr inbounds ([12 x i32], [12 x i32]* @opt_doReaderMAC.cc_nr, i64 0, i64 0), i32* %8, i32 12)
%10 = bitcast [8 x i32]* %7 to i8*
%11 = load i32*, i32** %5
%12 = getelementptr inbounds [8 x i32], [8 x i32]* %7, i64 0, i64 0
%13 = call i32 @opt_MAC(i32* %11, i32* getelementptr inbounds ([12 x i32], [12 x i32]* @opt_doReaderMAC.cc_nr, i64 0, i64 0), i32* %12)
%14 = load i32*, i32** %6
%15 = getelementptr inbounds [8 x i32], [8 x i32]* %7, i64 0, i64 0
%16 = call i32 @opt_reverse_arraybytecpy(i32* %14, i32* %15, i32 4)
ret void
}

LLVM IR (-O2):
@opt_doReaderMAC.cc_nr = internal global [12 x i32] zeroinitializer
define void @opt_doReaderMAC(i32* %0, i32* %1, i32* %2) {
%4 = alloca [8 x i32]
%5 = tail call i32 @opt_reverse_arraybytecpy(i32* getelementptr inbounds ([12 x i32], [12 x i32]* @opt_doReaderMAC.cc_nr, i64 0, i64 0), i32* %0, i32 12)
%6 = bitcast [8 x i32]* %4 to i8*
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%8 = call i32 @opt_MAC(i32* %1, i32* getelementptr inbounds ([12 x i32], [12 x i32]* @opt_doReaderMAC.cc_nr, i64 0, i64 0), i32* %7)
%9 = call i32 @opt_reverse_arraybytecpy(i32* %2, i32* %7, i32 4)
ret void
}