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


x86 assembly (clang, -O0):
<unpacklo32>:
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
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
mov    -0x18(%rbp),%rsi
add    $0x4,%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):
<unpacklo32>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x4(%rsp),%rdi
mov    %r12,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x8(%rsp),%rdi
add    $0x4,%rbx
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0xc(%rsp),%rdi
add    $0x4,%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 @unpacklo32(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 = call i32 @memcpy(i8* %8, i8* %9, i32 4)
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds i8, i8* %11, i64 4
%13 = load i8*, i8** %6
%14 = call i32 @memcpy(i8* %12, i8* %13, i32 4)
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%16 = getelementptr inbounds i8, i8* %15, i64 8
%17 = load i8*, i8** %5
%18 = getelementptr inbounds i8, i8* %17, i64 4
%19 = call i32 @memcpy(i8* %16, i8* %18, i32 4)
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%21 = getelementptr inbounds i8, i8* %20, i64 12
%22 = load i8*, i8** %6
%23 = getelementptr inbounds i8, i8* %22, i64 4
%24 = call i32 @memcpy(i8* %21, i8* %23, i32 4)
%25 = load i8*, i8** %4
%26 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%27 = call i32 @memcpy(i8* %25, i8* %26, i32 16)
ret void
}

LLVM IR (-O2):
define void @unpacklo32(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 = call i32 @memcpy(i8* %5, i8* %1, i32 4)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 4
%8 = call i32 @memcpy(i8* %7, i8* %2, i32 4)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 8
%10 = getelementptr inbounds i8, i8* %1, i64 4
%11 = call i32 @memcpy(i8* %9, i8* %10, i32 4)
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 12
%13 = getelementptr inbounds i8, i8* %2, i64 4
%14 = call i32 @memcpy(i8* %12, i8* %13, i32 4)
%15 = call i32 @memcpy(i8* %0, i8* %5, i32 16)
ret void
}