#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_add8x8_idct_mmxext(int /*<<< orphan*/ *, int,
                                           int /*<<< orphan*/ ***);
void p264_add16x16_idct_mmxext(uint8_t *p_dst, int i_dst,
                               int16_t dct[16][4][4]) {
  p264_add8x8_idct_mmxext(&p_dst[0], i_dst, &dct[0]);
  p264_add8x8_idct_mmxext(&p_dst[8], i_dst, &dct[4]);
  p264_add8x8_idct_mmxext(&p_dst[8 * i_dst], i_dst, &dct[8]);
  p264_add8x8_idct_mmxext(&p_dst[8 * i_dst + 8], i_dst, &dct[12]);
}


x86 assembly (clang, -O0):
<p264_add16x16_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_add8x8_idct_mmxext@plt>
mov    -0x8(%rbp),%rdi
add    $0x20,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x100,%rdx
call   1030 <p264_add8x8_idct_mmxext@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x200,%rdx
call   1030 <p264_add8x8_idct_mmxext@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
add    $0x8,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x300,%rdx
call   1030 <p264_add8x8_idct_mmxext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p264_add16x16_idct_mmxext>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r15
call   1030 <p264_add8x8_idct_mmxext@plt>
lea    0x20(%r15),%rdi
lea    0x100(%rbx),%rdx
mov    %r14d,%esi
call   1030 <p264_add8x8_idct_mmxext@plt>
lea    0x0(,%r14,8),%eax
movslq %eax,%r12
lea    (%r15,%r12,4),%rdi
lea    0x200(%rbx),%rdx
mov    %r14d,%esi
call   1030 <p264_add8x8_idct_mmxext@plt>
lea    (%r15,%r12,4),%rdi
add    $0x20,%rdi
add    $0x300,%rbx
mov    %r14d,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <p264_add8x8_idct_mmxext@plt>

LLVM IR (-O0):
define void @p264_add16x16_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 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %5
%10 = load [4 x [4 x i32]]*, [4 x [4 x i32]]** %6
%11 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %10, i64 0
%12 = bitcast [4 x [4 x i32]]* %11 to i32***
%13 = call i32 @p264_add8x8_idct_mmxext(i32* %8, i32 %9, i32*** %12)
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 8
%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 4
%19 = bitcast [4 x [4 x i32]]* %18 to i32***
%20 = call i32 @p264_add8x8_idct_mmxext(i32* %15, i32 %16, i32*** %19)
%21 = load i32*, i32** %4
%22 = load i32, i32* %5
%23 = mul nsw i32 8, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %21, i64 %24
%26 = load i32, i32* %5
%27 = load [4 x [4 x i32]]*, [4 x [4 x i32]]** %6
%28 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %27, i64 8
%29 = bitcast [4 x [4 x i32]]* %28 to i32***
%30 = call i32 @p264_add8x8_idct_mmxext(i32* %25, i32 %26, i32*** %29)
%31 = load i32*, i32** %4
%32 = load i32, i32* %5
%33 = mul nsw i32 8, %32
%34 = add nsw i32 %33, 8
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %31, i64 %35
%37 = load i32, i32* %5
%38 = load [4 x [4 x i32]]*, [4 x [4 x i32]]** %6
%39 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %38, i64 12
%40 = bitcast [4 x [4 x i32]]* %39 to i32***
%41 = call i32 @p264_add8x8_idct_mmxext(i32* %36, i32 %37, i32*** %40)
ret void
}

LLVM IR (-O2):
define void @p264_add16x16_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_add8x8_idct_mmxext(i32* %0, i32 %1, i32*** %4)
%6 = getelementptr inbounds i32, i32* %0, i64 8
%7 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 4
%8 = bitcast [4 x [4 x i32]]* %7 to i32***
%9 = tail call i32 @p264_add8x8_idct_mmxext(i32* %6, i32 %1, i32*** %8)
%10 = shl nsw i32 %1, 3
%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 8
%14 = bitcast [4 x [4 x i32]]* %13 to i32***
%15 = tail call i32 @p264_add8x8_idct_mmxext(i32* %12, i32 %1, i32*** %14)
%16 = add nsw i32 %10, 8
%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 12
%20 = bitcast [4 x [4 x i32]]* %19 to i32***
%21 = tail call i32 @p264_add8x8_idct_mmxext(i32* %18, i32 %1, i32*** %20)
ret void
}