#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*/ h264_loop_filter_chroma_intra_mmx2(int /*<<< orphan*/ *, int,
                                                      int, int);
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);
  h264_loop_filter_chroma_intra_mmx2(trans + 2 * 8, 8, alpha - 1, beta - 1);
  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>
lea    -0x98(%rbp),%rdi
add    $0x40,%rdi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x8,%esi
call   1040 <h264_loop_filter_chroma_intra_mmx2@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   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %ecx,%r13d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r15
lea    -0x8(%rdi),%r14
lea    0x8(%rsp),%rdi
mov    %r14,%rsi
mov    $0x8,%edx
mov    %ebx,%ecx
call   1030 <transpose4x4@plt>
lea    0x18(%rsp),%r12
lea    0x0(,%rbx,4),%eax
cltq
lea    (%r15,%rax,4),%r15
add    $0xfffffffffffffff8,%r15
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x8,%edx
mov    %ebx,%ecx
call   1030 <transpose4x4@plt>
lea    0x48(%rsp),%rdi
add    $0xffffffff,%ebp
add    $0xffffffff,%r13d
mov    $0x8,%esi
mov    %ebp,%edx
mov    %r13d,%ecx
call   1040 <h264_loop_filter_chroma_intra_mmx2@plt>
mov    %r14,%rdi
lea    0x8(%rsp),%rsi
mov    %ebx,%edx
mov    $0x8,%ecx
call   1030 <transpose4x4@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
mov    $0x8,%ecx
call   1030 <transpose4x4@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
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 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%26 = getelementptr inbounds i32, i32* %25, i64 16
%27 = load i32, i32* %7
%28 = sub nsw i32 %27, 1
%29 = load i32, i32* %8
%30 = sub nsw i32 %29, 1
%31 = call i32 @h264_loop_filter_chroma_intra_mmx2(i32* %26, i32 8, i32 %28, i32 %30)
%32 = load i32*, i32** %5
%33 = getelementptr inbounds i32, i32* %32, i64 -2
%34 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%35 = load i32, i32* %6
%36 = call i32 @transpose4x4(i32* %33, i32* %34, i32 %35, i32 8)
%37 = load i32*, i32** %5
%38 = getelementptr inbounds i32, i32* %37, i64 -2
%39 = load i32, i32* %6
%40 = mul nsw i32 4, %39
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %38, i64 %41
%43 = getelementptr inbounds [32 x i32], [32 x i32]* %9, i64 0, i64 0
%44 = getelementptr inbounds i32, i32* %43, i64 4
%45 = load i32, i32* %6
%46 = call i32 @transpose4x4(i32* %42, i32* %44, i32 %45, 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 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 16
%16 = add nsw i32 %2, -1
%17 = add nsw i32 %3, -1
%18 = call i32 @h264_loop_filter_chroma_intra_mmx2(i32* %15, i32 8, i32 %16, i32 %17)
%19 = call i32 @transpose4x4(i32* %8, i32* %7, i32 %1, i32 8)
%20 = call i32 @transpose4x4(i32* %13, i32* %10, i32 %1, i32 8)
ret void
}