#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*/ transpose4x4(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int,
                                int);
void h264_h_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha,
                                          int beta) {
  uint8_t trans[8 * 4] __attribute__((aligned(8)));
  transpose4x4(trans, pix - 2, 8, stride);
  transpose4x4(trans + 4, pix - 2 + 4 * stride, 8, stride);
  transpose4x4(pix - 2, trans, stride, 8);
  transpose4x4(pix - 2 + 4 * stride, trans + 4, stride, 8);
}


x86 assembly (clang, -O0):
<h264_h_loop_filter_chroma_intra_mmx2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
lea    -0x98(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0xfffffffffffffff8,%rsi
mov    -0xc(%rbp),%ecx
mov    $0x8,%edx
call   1030 <transpose4x4@plt>
lea    -0x98(%rbp),%rdi
add    $0x10,%rdi
mov    -0x8(%rbp),%rsi
add    $0xfffffffffffffff8,%rsi
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0xc(%rbp),%ecx
mov    $0x8,%edx
call   1030 <transpose4x4@plt>
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffff8,%rdi
lea    -0x98(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x8,%ecx
call   1030 <transpose4x4@plt>
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffff8,%rdi
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x98(%rbp),%rsi
add    $0x10,%rsi
mov    -0xc(%rbp),%edx
mov    $0x8,%ecx
call   1030 <transpose4x4@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264_h_loop_filter_chroma_intra_mmx2>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x8(%rdi),%r15
mov    %rsp,%r12
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x8,%edx
mov    %ebx,%ecx
call   1030 <transpose4x4@plt>
lea    0x10(%rsp),%r13
lea    0x0(,%rbx,4),%eax
cltq
lea    (%r14,%rax,4),%r14
add    $0xfffffffffffffff8,%r14
mov    %r13,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
mov    %ebx,%ecx
call   1030 <transpose4x4@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
mov    $0x8,%ecx
call   1030 <transpose4x4@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %ebx,%edx
mov    $0x8,%ecx
call   1030 <transpose4x4@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @h264_h_loop_filter_chroma_intra_mmx2(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [32 x i32]
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 -2
%13 = load i32, i32* %6
%14 = call i32 @transpose4x4(i32* %10, i32* %12, i32 8, i32 %13)
%15 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%16 = getelementptr inbounds i32, i32* %15, i64 4
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i64 -2
%19 = load i32, i32* %6
%20 = mul nsw i32 4, %19
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
%23 = load i32, i32* %6
%24 = call i32 @transpose4x4(i32* %16, i32* %22, i32 8, i32 %23)
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 -2
%27 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%28 = load i32, i32* %6
%29 = call i32 @transpose4x4(i32* %26, i32* %27, i32 %28, i32 8)
%30 = load i32*, i32** %5
%31 = getelementptr inbounds i32, i32* %30, i64 -2
%32 = load i32, i32* %6
%33 = mul nsw i32 4, %32
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i32, i32* %31, i64 %34
%36 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%37 = getelementptr inbounds i32, i32* %36, i64 4
%38 = load i32, i32* %6
%39 = call i32 @transpose4x4(i32* %35, i32* %37, i32 %38, i32 8)
ret void
}

LLVM IR (-O2):
define void @h264_h_loop_filter_chroma_intra_mmx2(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [32 x i32]
%6 = bitcast [32 x i32]* %5 to i8*
%7 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 0
%8 = getelementptr inbounds i32, i32* %0, i64 -2
%9 = call i32 @transpose4x4(i32* %7, i32* %8, i32 8, i32 %1)
%10 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 4
%11 = shl nsw i32 %1, 2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %8, i64 %12
%14 = call i32 @transpose4x4(i32* %10, i32* %13, i32 8, i32 %1)
%15 = call i32 @transpose4x4(i32* %8, i32* %7, i32 %1, i32 8)
%16 = call i32 @transpose4x4(i32* %13, i32* %10, i32 %1, i32 8)
ret void
}