#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_sub8x8_dct8_mmxext(int /*<<< orphan*/ **,
                                           int /*<<< orphan*/ *, int,
                                           int /*<<< orphan*/ *, int);
void p264_sub16x16_dct8_mmxext(int16_t dct[4][8][8], uint8_t *pix1, int i_pix1,
                               uint8_t *pix2, int i_pix2) {
  p264_sub8x8_dct8_mmxext(dct[0], pix1, i_pix1, pix2, i_pix2);
  p264_sub8x8_dct8_mmxext(dct[1], pix1 + 8, i_pix1, pix2 + 8, i_pix2);
  p264_sub8x8_dct8_mmxext(dct[2], pix1 + 8 * i_pix1, i_pix1, pix2 + 8 * i_pix2,
                          i_pix2);
  p264_sub8x8_dct8_mmxext(dct[3], pix1 + 8 * i_pix1 + 8, i_pix1,
                          pix2 + 8 * i_pix2 + 8, i_pix2);
}


x86 assembly (clang, -O0):
<p264_sub16x16_dct8_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_sub8x8_dct8_mmxext@plt>
mov    -0x8(%rbp),%rdi
add    $0x100,%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
add    $0x20,%rcx
mov    -0x24(%rbp),%r8d
call   1030 <p264_sub8x8_dct8_mmxext@plt>
mov    -0x8(%rbp),%rdi
add    $0x200,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x3,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%eax
shl    $0x3,%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x24(%rbp),%r8d
call   1030 <p264_sub8x8_dct8_mmxext@plt>
mov    -0x8(%rbp),%rdi
add    $0x300,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x3,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
add    $0x20,%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%eax
shl    $0x3,%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
add    $0x20,%rcx
mov    -0x24(%rbp),%r8d
call   1030 <p264_sub8x8_dct8_mmxext@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p264_sub16x16_dct8_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_sub8x8_dct8_mmxext@plt>
lea    0x100(%rbx),%rdi
lea    0x20(%r13),%rsi
lea    0x20(%r15),%rcx
mov    %r12d,%edx
mov    %r14d,%r8d
call   1030 <p264_sub8x8_dct8_mmxext@plt>
lea    0x200(%rbx),%rdi
lea    0x0(,%r12,8),%eax
cltq
mov    %rax,(%rsp)
lea    0x0(%r13,%rax,4),%rsi
lea    0x0(,%r14,8),%eax
movslq %eax,%rbp
lea    (%r15,%rbp,4),%rcx
mov    %r12d,%edx
mov    %r14d,%r8d
call   1030 <p264_sub8x8_dct8_mmxext@plt>
add    $0x300,%rbx
mov    (%rsp),%rax
lea    0x20(,%rax,4),%rsi
add    %r13,%rsi
lea    0x20(%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_sub8x8_dct8_mmxext@plt>

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

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