#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*/ memcpy(char *, char *, int);
void RewindBTAddr(char *addr) {
  char revaddr[6];
  revaddr[0] = addr[5];
  revaddr[1] = addr[4];
  revaddr[2] = addr[3];
  revaddr[3] = addr[2];
  revaddr[4] = addr[1];
  revaddr[5] = addr[0];
  memcpy(addr, revaddr, 6);
}


x86 assembly (clang, -O0):
<RewindBTAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x5(%rax),%al
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xe(%rbp),%rsi
mov    $0x6,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RewindBTAddr>:
push   %rax
mov    0x5(%rdi),%al
mov    %al,0x2(%rsp)
mov    0x4(%rdi),%al
mov    %al,0x3(%rsp)
mov    0x3(%rdi),%al
mov    %al,0x4(%rsp)
mov    0x2(%rdi),%al
mov    %al,0x5(%rsp)
mov    0x1(%rdi),%al
mov    %al,0x6(%rsp)
mov    (%rdi),%al
mov    %al,0x7(%rsp)
lea    0x2(%rsp),%rsi
mov    $0x6,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @RewindBTAddr(i8* %0) {
%2 = alloca i8*
%3 = alloca [6 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 5
%6 = load i8, i8* %5
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 4
%10 = load i8, i8* %9
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 1
store i8 %10, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = load i8, i8* %13
%15 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 2
store i8 %14, i8* %15
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 3
store i8 %18, i8* %19
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 4
store i8 %22, i8* %23
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 5
store i8 %26, i8* %27
%28 = load i8*, i8** %2
%29 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%30 = call i32 @memcpy(i8* %28, i8* %29, i32 6)
ret void
}

LLVM IR (-O2):
define void @RewindBTAddr(i8* %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds i8, i8* %0, i64 5
%5 = load i8, i8* %4
store i8 %5, i8* %3
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = load i8, i8* %6
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 1
store i8 %7, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 3
%10 = load i8, i8* %9
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 2
store i8 %10, i8* %11
%12 = getelementptr inbounds i8, i8* %0, i64 2
%13 = load i8, i8* %12
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 3
store i8 %13, i8* %14
%15 = getelementptr inbounds i8, i8* %0, i64 1
%16 = load i8, i8* %15
%17 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 4
store i8 %16, i8* %17
%18 = load i8, i8* %0
%19 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 5
store i8 %18, i8* %19
%20 = call i32 @memcpy(i8* %0, i8* %3, i32 6)
ret void
}