#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*/ b;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float *, int);
void transpose(float *a) {
  float b[16];
  memcpy(b, a, sizeof(b));
  a[1] = b[4];
  a[2] = b[8];
  a[3] = b[12];
  a[6] = b[9];
  a[7] = b[13];
  a[11] = b[14];
}


x86 assembly (clang, -O0):
<transpose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
movss  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x30(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
movss  -0x2c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x18(%rax)
movss  -0x1c(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x1c(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x2c(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transpose>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    %rbx,%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x4(%rbx)
movss  0x20(%rsp),%xmm0
movss  %xmm0,0x8(%rbx)
movss  0x30(%rsp),%xmm0
movss  %xmm0,0xc(%rbx)
movss  0x24(%rsp),%xmm0
movss  %xmm0,0x18(%rbx)
movss  0x34(%rsp),%xmm0
movss  %xmm0,0x1c(%rbx)
movss  0x38(%rsp),%xmm0
movss  %xmm0,0x2c(%rbx)
add    $0x40,%rsp
pop    %rbx
ret

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

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