#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 */

/* Variables and functions */
int /*<<< orphan*/ fdct8(double *, double const *, int);
void fdct8x8(double *y, int ystride, const double *x, int xstride) {
  double t[8 * 8];
  int i;
  for (i = 0; i < 8; i++)
    fdct8(t + 8 * i, x + i, xstride);
  for (i = 0; i < 8; i++)
    fdct8(y + ystride * i, t + i, 8);
}


x86 assembly (clang, -O0):
<fdct8x8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x224(%rbp)
cmpl   $0x8,-0x224(%rbp)
jge    1187 <fdct8x8+0x77>
lea    -0x220(%rbp),%rdi
mov    -0x224(%rbp),%eax
shl    $0x3,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x224(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <fdct8@plt>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    1133 <fdct8x8+0x23>
movl   $0x0,-0x224(%rbp)
cmpl   $0x8,-0x224(%rbp)
jge    11e8 <fdct8x8+0xd8>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
imul   -0x224(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
lea    -0x220(%rbp),%rsi
movslq -0x224(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    $0x8,%edx
call   1030 <fdct8@plt>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    1191 <fdct8x8+0x81>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdct8x8>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x200,%rsp
mov    %ecx,%ebp
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %rdi,%r12
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <fdct8@plt>
lea    0x40(%rsp),%rdi
lea    0x8(%rbx),%rsi
mov    %ebp,%edx
call   1030 <fdct8@plt>
lea    0x80(%rsp),%rdi
lea    0x10(%rbx),%rsi
mov    %ebp,%edx
call   1030 <fdct8@plt>
lea    0xc0(%rsp),%rdi
lea    0x18(%rbx),%rsi
mov    %ebp,%edx
call   1030 <fdct8@plt>
lea    0x100(%rsp),%rdi
lea    0x20(%rbx),%rsi
mov    %ebp,%edx
call   1030 <fdct8@plt>
lea    0x140(%rsp),%rdi
lea    0x28(%rbx),%rsi
mov    %ebp,%edx
call   1030 <fdct8@plt>
lea    0x180(%rsp),%rdi
lea    0x30(%rbx),%rsi
mov    %ebp,%edx
call   1030 <fdct8@plt>
lea    0x1c0(%rsp),%rdi
add    $0x38,%rbx
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <fdct8@plt>
movslq %r15d,%rbp
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1030 <fdct8@plt>
lea    (%r12,%rbp,8),%rdi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1030 <fdct8@plt>
mov    %rbp,%rdi
shl    $0x4,%rdi
add    %r12,%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1030 <fdct8@plt>
lea    0x0(,%rbp,2),%rbx
add    %rbp,%rbx
lea    (%r12,%rbx,8),%rdi
lea    0x18(%rsp),%rsi
mov    $0x8,%edx
call   1030 <fdct8@plt>
mov    %rbp,%rdi
shl    $0x5,%rdi
add    %r12,%rdi
lea    0x20(%rsp),%rsi
mov    $0x8,%edx
call   1030 <fdct8@plt>
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
lea    (%r12,%rax,8),%rdi
lea    0x28(%rsp),%rsi
mov    $0x8,%edx
call   1030 <fdct8@plt>
shl    $0x4,%rbx
add    %r12,%rbx
lea    0x30(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <fdct8@plt>
imul   $0x38,%rbp,%rdi
add    %r12,%rdi
lea    0x38(%rsp),%rsi
mov    $0x8,%edx
call   1030 <fdct8@plt>
add    $0x200,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fdct8x8(double* %0, i32 %1, double* %2, i32 %3) {
%5 = alloca [64 x double]
%6 = bitcast [64 x double]* %5 to i8*
%7 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 0
%8 = call i32 @fdct8(double* %7, double* %2, i32 %3)
%9 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 8
%10 = getelementptr inbounds double, double* %2, i64 1
%11 = call i32 @fdct8(double* %9, double* %10, i32 %3)
%12 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 16
%13 = getelementptr inbounds double, double* %2, i64 2
%14 = call i32 @fdct8(double* %12, double* %13, i32 %3)
%15 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 24
%16 = getelementptr inbounds double, double* %2, i64 3
%17 = call i32 @fdct8(double* %15, double* %16, i32 %3)
%18 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 32
%19 = getelementptr inbounds double, double* %2, i64 4
%20 = call i32 @fdct8(double* %18, double* %19, i32 %3)
%21 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 40
%22 = getelementptr inbounds double, double* %2, i64 5
%23 = call i32 @fdct8(double* %21, double* %22, i32 %3)
%24 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 48
%25 = getelementptr inbounds double, double* %2, i64 6
%26 = call i32 @fdct8(double* %24, double* %25, i32 %3)
%27 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 56
%28 = getelementptr inbounds double, double* %2, i64 7
%29 = call i32 @fdct8(double* %27, double* %28, i32 %3)
%30 = sext i32 %1 to i64
%31 = call i32 @fdct8(double* %0, double* %7, i32 8)
%32 = getelementptr inbounds double, double* %0, i64 %30
%33 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 1
%34 = call i32 @fdct8(double* %32, double* %33, i32 8)
%35 = shl nsw i64 %30, 1
%36 = getelementptr inbounds double, double* %0, i64 %35
%37 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 2
%38 = call i32 @fdct8(double* %36, double* %37, i32 8)
%39 = mul nsw i64 %30, 3
%40 = getelementptr inbounds double, double* %0, i64 %39
%41 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 3
%42 = call i32 @fdct8(double* %40, double* %41, i32 8)
%43 = shl nsw i64 %30, 2
%44 = getelementptr inbounds double, double* %0, i64 %43
%45 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 4
%46 = call i32 @fdct8(double* %44, double* %45, i32 8)
%47 = mul nsw i64 %30, 5
%48 = getelementptr inbounds double, double* %0, i64 %47
%49 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 5
%50 = call i32 @fdct8(double* %48, double* %49, i32 8)
%51 = mul nsw i64 %30, 6
%52 = getelementptr inbounds double, double* %0, i64 %51
%53 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 6
%54 = call i32 @fdct8(double* %52, double* %53, i32 8)
%55 = mul nsw i64 %30, 7
%56 = getelementptr inbounds double, double* %0, i64 %55
%57 = getelementptr inbounds [64 x double], [64 x double]* %5, i64 0, i64 7
%58 = call i32 @fdct8(double* %56, double* %57, i32 8)
ret void
}