#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;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ p264_sub4x4_dct_mmxext(int /*<<< orphan*/ **,
                                          int /*<<< orphan*/ *, int,
                                          int /*<<< orphan*/ *, int);
void p264_sub8x8_dct_mmxext(int16_t dct[4][4][4], uint8_t *pix1, int i_pix1,
                            uint8_t *pix2, int i_pix2) {
  p264_sub4x4_dct_mmxext(dct[0], &pix1[0], i_pix1, &pix2[0], i_pix2);
  p264_sub4x4_dct_mmxext(dct[1], &pix1[4], i_pix1, &pix2[4], i_pix2);
  p264_sub4x4_dct_mmxext(dct[2], &pix1[4 * i_pix1 + 0], i_pix1,
                         &pix2[4 * i_pix2 + 0], i_pix2);
  p264_sub4x4_dct_mmxext(dct[3], &pix1[4 * i_pix1 + 4], i_pix1,
                         &pix2[4 * i_pix2 + 4], i_pix2);
}


x86 assembly (clang, -O0):
<p264_sub8x8_dct_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <p264_sub4x4_dct_mmxext@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
add    $0x10,%rcx
mov    -0x24(%rbp),%r8d
call   1030 <p264_sub4x4_dct_mmxext@plt>
mov    -0x8(%rbp),%rdi
add    $0x80,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
add    $0x0,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%eax
shl    $0x2,%eax
add    $0x0,%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x24(%rbp),%r8d
call   1030 <p264_sub4x4_dct_mmxext@plt>
mov    -0x8(%rbp),%rdi
add    $0xc0,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x2,%eax
add    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%eax
shl    $0x2,%eax
add    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x24(%rbp),%r8d
call   1030 <p264_sub4x4_dct_mmxext@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p264_sub8x8_dct_mmxext>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %edx,%r12d
mov    %rsi,%r13
mov    %rdi,%rbx
call   1030 <p264_sub4x4_dct_mmxext@plt>
lea    0x40(%rbx),%rdi
lea    0x10(%r13),%rsi
lea    0x10(%r15),%rcx
mov    %r12d,%edx
mov    %r14d,%r8d
call   1030 <p264_sub4x4_dct_mmxext@plt>
lea    0x80(%rbx),%rdi
lea    0x0(,%r12,4),%eax
cltq
mov    %rax,(%rsp)
lea    0x0(%r13,%rax,4),%rsi
lea    0x0(,%r14,4),%eax
movslq %eax,%rbp
lea    (%r15,%rbp,4),%rcx
mov    %r12d,%edx
mov    %r14d,%r8d
call   1030 <p264_sub4x4_dct_mmxext@plt>
add    $0xc0,%rbx
mov    (%rsp),%rax
lea    0x10(,%rax,4),%rsi
add    %r13,%rsi
lea    0x10(%r15,%rbp,4),%rcx
mov    %rbx,%rdi
mov    %r12d,%edx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <p264_sub4x4_dct_mmxext@plt>

LLVM IR (-O0):
define void @p264_sub8x8_dct_mmxext([4 x [4 x i32]]* %0, i32* %1, i32 %2, i32* %3, i32 %4) {
%6 = alloca [4 x [4 x i32]]*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
store [4 x [4 x i32]]* %0, [4 x [4 x i32]]** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load [4 x [4 x i32]]*, [4 x [4 x i32]]** %6
%12 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %11, i64 0
%13 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %12, i64 0, i64 0
%14 = bitcast [4 x i32]* %13 to i32**
%15 = load i32*, i32** %7
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %8
%18 = load i32*, i32** %9
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %10
%21 = call i32 @p264_sub4x4_dct_mmxext(i32** %14, i32* %16, i32 %17, i32* %19, i32 %20)
%22 = load [4 x [4 x i32]]*, [4 x [4 x i32]]** %6
%23 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %22, i64 1
%24 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %23, i64 0, i64 0
%25 = bitcast [4 x i32]* %24 to i32**
%26 = load i32*, i32** %7
%27 = getelementptr inbounds i32, i32* %26, i64 4
%28 = load i32, i32* %8
%29 = load i32*, i32** %9
%30 = getelementptr inbounds i32, i32* %29, i64 4
%31 = load i32, i32* %10
%32 = call i32 @p264_sub4x4_dct_mmxext(i32** %25, i32* %27, i32 %28, i32* %30, i32 %31)
%33 = load [4 x [4 x i32]]*, [4 x [4 x i32]]** %6
%34 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %33, i64 2
%35 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %34, i64 0, i64 0
%36 = bitcast [4 x i32]* %35 to i32**
%37 = load i32*, i32** %7
%38 = load i32, i32* %8
%39 = mul nsw i32 4, %38
%40 = add nsw i32 %39, 0
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %37, i64 %41
%43 = load i32, i32* %8
%44 = load i32*, i32** %9
%45 = load i32, i32* %10
%46 = mul nsw i32 4, %45
%47 = add nsw i32 %46, 0
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %44, i64 %48
%50 = load i32, i32* %10
%51 = call i32 @p264_sub4x4_dct_mmxext(i32** %36, i32* %42, i32 %43, i32* %49, i32 %50)
%52 = load [4 x [4 x i32]]*, [4 x [4 x i32]]** %6
%53 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %52, i64 3
%54 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %53, i64 0, i64 0
%55 = bitcast [4 x i32]* %54 to i32**
%56 = load i32*, i32** %7
%57 = load i32, i32* %8
%58 = mul nsw i32 4, %57
%59 = add nsw i32 %58, 4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %56, i64 %60
%62 = load i32, i32* %8
%63 = load i32*, i32** %9
%64 = load i32, i32* %10
%65 = mul nsw i32 4, %64
%66 = add nsw i32 %65, 4
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i32, i32* %63, i64 %67
%69 = load i32, i32* %10
%70 = call i32 @p264_sub4x4_dct_mmxext(i32** %55, i32* %61, i32 %62, i32* %68, i32 %69)
ret void
}

LLVM IR (-O2):
define void @p264_sub8x8_dct_mmxext([4 x [4 x i32]]* %0, i32* %1, i32 %2, i32* %3, i32 %4) {
%6 = bitcast [4 x [4 x i32]]* %0 to i32**
%7 = tail call i32 @p264_sub4x4_dct_mmxext(i32** %6, i32* %1, i32 %2, i32* %3, i32 %4)
%8 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %0, i64 1, i64 0
%9 = bitcast [4 x i32]* %8 to i32**
%10 = getelementptr inbounds i32, i32* %1, i64 4
%11 = getelementptr inbounds i32, i32* %3, i64 4
%12 = tail call i32 @p264_sub4x4_dct_mmxext(i32** %9, i32* %10, i32 %2, i32* %11, i32 %4)
%13 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %0, i64 2, i64 0
%14 = bitcast [4 x i32]* %13 to i32**
%15 = shl nsw i32 %2, 2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %1, i64 %16
%18 = shl nsw i32 %4, 2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %3, i64 %19
%21 = tail call i32 @p264_sub4x4_dct_mmxext(i32** %14, i32* %17, i32 %2, i32* %20, i32 %4)
%22 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %0, i64 3, i64 0
%23 = bitcast [4 x i32]* %22 to i32**
%24 = add nsw i32 %15, 4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %1, i64 %25
%27 = add nsw i32 %18, 4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %3, i64 %28
%30 = tail call i32 @p264_sub4x4_dct_mmxext(i32** %23, i32* %26, i32 %2, i32* %29, i32 %4)
ret void
}