#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(unsigned char *, unsigned char *, int);
void unpackhi32(unsigned char *t, unsigned char *a, unsigned char *b) {
  unsigned char tmp[16];
  memcpy(tmp, a + 8, 4);
  memcpy(tmp + 4, b + 8, 4);
  memcpy(tmp + 8, a + 12, 4);
  memcpy(tmp + 12, b + 12, 4);
  memcpy(t, tmp, 16);
}


x86 assembly (clang, -O0):
<unpackhi32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0xc,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
mov    -0x18(%rbp),%rsi
add    $0xc,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpackhi32>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%r15
add    $0x8,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x4(%rsp),%rdi
lea    0x8(%r12),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x8(%rsp),%rdi
add    $0xc,%rbx
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0xc(%rsp),%rdi
add    $0xc,%r12
mov    %r12,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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