#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_idct8_mmxext(int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ **);
void p264_add16x16_idct8_mmxext(uint8_t *dst, int i_dst, int16_t dct[4][8][8]) {
  p264_add8x8_idct8_mmxext(dst, i_dst, dct[0]);
  p264_add8x8_idct8_mmxext(dst + 8, i_dst, dct[1]);
  p264_add8x8_idct8_mmxext(dst + 8 * i_dst, i_dst, dct[2]);
  p264_add8x8_idct8_mmxext(dst + 8 * i_dst + 8, i_dst, dct[3]);
}


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

x86 assembly (clang, -O2):
<p264_add16x16_idct8_mmxext>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r15
call   1030 <p264_add8x8_idct8_mmxext@plt>
lea    0x20(%r15),%rdi
lea    0x100(%rbx),%rdx
mov    %r14d,%esi
call   1030 <p264_add8x8_idct8_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_idct8_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_idct8_mmxext@plt>

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

LLVM IR (-O2):
define void @p264_add16x16_idct8_mmxext(i32* %0, i32 %1, [8 x [8 x i32]]* %2) {
%4 = bitcast [8 x [8 x i32]]* %2 to i32**
%5 = tail call i32 @p264_add8x8_idct8_mmxext(i32* %0, i32 %1, i32** %4)
%6 = getelementptr inbounds i32, i32* %0, i64 8
%7 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %2, i64 1, i64 0
%8 = bitcast [8 x i32]* %7 to i32**
%9 = tail call i32 @p264_add8x8_idct8_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 [8 x [8 x i32]], [8 x [8 x i32]]* %2, i64 2, i64 0
%14 = bitcast [8 x i32]* %13 to i32**
%15 = tail call i32 @p264_add8x8_idct8_mmxext(i32* %12, i32 %1, i32** %14)
%16 = getelementptr inbounds i32, i32* %12, i64 8
%17 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %2, i64 3, i64 0
%18 = bitcast [8 x i32]* %17 to i32**
%19 = tail call i32 @p264_add8x8_idct8_mmxext(i32* %16, i32 %1, i32** %18)
ret void
}