#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_add4x4_idct_mmxext(int /*<<< orphan*/ *, int,
                                           int /*<<< orphan*/ **);
void p264_add8x8_idct_mmxext(uint8_t *p_dst, int i_dst, int16_t dct[4][4][4]) {
  p264_add4x4_idct_mmxext(p_dst, i_dst, dct[0]);
  p264_add4x4_idct_mmxext(&p_dst[4], i_dst, dct[1]);
  p264_add4x4_idct_mmxext(&p_dst[4 * i_dst + 0], i_dst, dct[2]);
  p264_add4x4_idct_mmxext(&p_dst[4 * i_dst + 4], i_dst, dct[3]);
}


x86 assembly (clang, -O0):
<p264_add8x8_idct_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <p264_add4x4_idct_mmxext@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x40,%rdx
call   1030 <p264_add4x4_idct_mmxext@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
add    $0x0,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x80,%rdx
call   1030 <p264_add4x4_idct_mmxext@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
add    $0x4,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0xc0,%rdx
call   1030 <p264_add4x4_idct_mmxext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p264_add8x8_idct_mmxext>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r15
call   1030 <p264_add4x4_idct_mmxext@plt>
lea    0x10(%r15),%rdi
lea    0x40(%rbx),%rdx
mov    %r14d,%esi
call   1030 <p264_add4x4_idct_mmxext@plt>
lea    0x0(,%r14,4),%eax
movslq %eax,%r12
lea    (%r15,%r12,4),%rdi
lea    0x80(%rbx),%rdx
mov    %r14d,%esi
call   1030 <p264_add4x4_idct_mmxext@plt>
lea    (%r15,%r12,4),%rdi
add    $0x10,%rdi
add    $0xc0,%rbx
mov    %r14d,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <p264_add4x4_idct_mmxext@plt>

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

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