#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*/ idct8(double *, int, double const *);
void idct8x8(double *x, int xstride, const double *y, int ystride) {
  double t[8 * 8];
  int i;
  for (i = 0; i < 8; i++)
    idct8(t + i, 8, y + ystride * i);
  for (i = 0; i < 8; i++)
    idct8(x + i, xstride, t + 8 * i);
}


x86 assembly (clang, -O0):
<idct8x8>:
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    118a <idct8x8+0x7a>
lea    -0x220(%rbp),%rdi
movslq -0x224(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%eax
imul   -0x224(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    $0x8,%esi
call   1030 <idct8@plt>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    1133 <idct8x8+0x23>
movl   $0x0,-0x224(%rbp)
cmpl   $0x8,-0x224(%rbp)
jge    11e8 <idct8x8+0xd8>
mov    -0x8(%rbp),%rdi
movslq -0x224(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
lea    -0x220(%rbp),%rdx
mov    -0x224(%rbp),%eax
shl    $0x3,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
call   1030 <idct8@plt>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    1194 <idct8x8+0x84>
add    $0x230,%rsp
pop    %rbp
ret

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

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