#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 */
struct idct_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dct_a(struct idct_context const *, double *, double *);
int /*<<< orphan*/ dct_b(struct idct_context const *, double *, double *);
int /*<<< orphan*/ mod_a(struct idct_context const *, double *, double *);
int /*<<< orphan*/ mod_b(struct idct_context const *, double *, double *);
int /*<<< orphan*/ mod_c(struct idct_context const *, double *, double *);
int /*<<< orphan*/ sum_a(double *, double *, int);
int /*<<< orphan*/ sum_b(double *, double *, int);
int /*<<< orphan*/ sum_c(double *, double *, int);
int /*<<< orphan*/ sum_d(double *, double *, int);
void idct_perform32_float(const struct idct_context *restrict idct,
                          double *restrict input, double *restrict output) {
  sum_a(input, output + 0, 16);
  sum_b(input, output + 16, 16);
  sum_a(output + 0, input + 0, 8);
  sum_b(output + 0, input + 8, 8);
  sum_c(output + 16, input + 16, 8);
  sum_d(output + 16, input + 24, 8);
  dct_a(idct, input + 0, output + 0);
  dct_b(idct, input + 8, output + 8);
  dct_b(idct, input + 16, output + 16);
  dct_b(idct, input + 24, output + 24);
  mod_a(idct, output + 0, input + 0);
  mod_b(idct, output + 16, input + 16);
  mod_c(idct, input, output);
}


x86 assembly (clang, -O0):
<idct_perform32_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1080 <sum_a@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x80,%rsi
mov    $0x10,%edx
call   1030 <sum_b@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1080 <sum_a@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x40,%rsi
mov    $0x8,%edx
call   1030 <sum_b@plt>
mov    -0x18(%rbp),%rdi
add    $0x80,%rdi
mov    -0x10(%rbp),%rsi
add    $0x80,%rsi
mov    $0x8,%edx
call   1070 <sum_c@plt>
mov    -0x18(%rbp),%rdi
add    $0x80,%rdi
mov    -0x10(%rbp),%rsi
add    $0xc0,%rsi
mov    $0x8,%edx
call   1040 <sum_d@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1090 <dct_a@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x40,%rsi
mov    -0x18(%rbp),%rdx
add    $0x40,%rdx
call   1050 <dct_b@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x80,%rsi
mov    -0x18(%rbp),%rdx
add    $0x80,%rdx
call   1050 <dct_b@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0xc0,%rsi
mov    -0x18(%rbp),%rdx
add    $0xc0,%rdx
call   1050 <dct_b@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   10a0 <mod_a@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0x80,%rsi
mov    -0x10(%rbp),%rdx
add    $0x80,%rdx
call   1060 <mod_b@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   10b0 <mod_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idct_perform32_float>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    $0x10,%edx
call   1080 <sum_a@plt>
lea    0x80(%r14),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x10,%edx
call   1030 <sum_b@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1080 <sum_a@plt>
lea    0x40(%rbx),%rsi
mov    %rsi,(%rsp)
mov    %r14,%rdi
mov    $0x8,%edx
call   1030 <sum_b@plt>
lea    0x80(%rbx),%rbp
mov    %r12,%rdi
mov    %rbp,%rsi
mov    $0x8,%edx
call   1070 <sum_c@plt>
lea    0xc0(%rbx),%r13
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x8,%edx
call   1040 <sum_d@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1090 <dct_a@plt>
lea    0x40(%r14),%rdx
mov    %r15,%rdi
mov    (%rsp),%rsi
call   1050 <dct_b@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
call   1050 <dct_b@plt>
lea    0xc0(%r14),%rdx
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <dct_b@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   10a0 <mod_a@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
call   1060 <mod_b@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10b0 <mod_c@plt>

LLVM IR (-O0):
%struct.idct_context = type { i32 }
define void @idct_perform32_float(%struct.idct_context* noalias %0, double* noalias %1, double* noalias %2) {
%4 = alloca %struct.idct_context*
%5 = alloca double*
%6 = alloca double*
store %struct.idct_context* %0, %struct.idct_context** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = load double*, double** %6
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = call i32 @sum_a(double* %7, double* %9, i32 16)
%11 = load double*, double** %5
%12 = load double*, double** %6
%13 = getelementptr inbounds double, double* %12, i64 16
%14 = call i32 @sum_b(double* %11, double* %13, i32 16)
%15 = load double*, double** %6
%16 = getelementptr inbounds double, double* %15, i64 0
%17 = load double*, double** %5
%18 = getelementptr inbounds double, double* %17, i64 0
%19 = call i32 @sum_a(double* %16, double* %18, i32 8)
%20 = load double*, double** %6
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double*, double** %5
%23 = getelementptr inbounds double, double* %22, i64 8
%24 = call i32 @sum_b(double* %21, double* %23, i32 8)
%25 = load double*, double** %6
%26 = getelementptr inbounds double, double* %25, i64 16
%27 = load double*, double** %5
%28 = getelementptr inbounds double, double* %27, i64 16
%29 = call i32 @sum_c(double* %26, double* %28, i32 8)
%30 = load double*, double** %6
%31 = getelementptr inbounds double, double* %30, i64 16
%32 = load double*, double** %5
%33 = getelementptr inbounds double, double* %32, i64 24
%34 = call i32 @sum_d(double* %31, double* %33, i32 8)
%35 = load %struct.idct_context*, %struct.idct_context** %4
%36 = load double*, double** %5
%37 = getelementptr inbounds double, double* %36, i64 0
%38 = load double*, double** %6
%39 = getelementptr inbounds double, double* %38, i64 0
%40 = call i32 @dct_a(%struct.idct_context* %35, double* %37, double* %39)
%41 = load %struct.idct_context*, %struct.idct_context** %4
%42 = load double*, double** %5
%43 = getelementptr inbounds double, double* %42, i64 8
%44 = load double*, double** %6
%45 = getelementptr inbounds double, double* %44, i64 8
%46 = call i32 @dct_b(%struct.idct_context* %41, double* %43, double* %45)
%47 = load %struct.idct_context*, %struct.idct_context** %4
%48 = load double*, double** %5
%49 = getelementptr inbounds double, double* %48, i64 16
%50 = load double*, double** %6
%51 = getelementptr inbounds double, double* %50, i64 16
%52 = call i32 @dct_b(%struct.idct_context* %47, double* %49, double* %51)
%53 = load %struct.idct_context*, %struct.idct_context** %4
%54 = load double*, double** %5
%55 = getelementptr inbounds double, double* %54, i64 24
%56 = load double*, double** %6
%57 = getelementptr inbounds double, double* %56, i64 24
%58 = call i32 @dct_b(%struct.idct_context* %53, double* %55, double* %57)
%59 = load %struct.idct_context*, %struct.idct_context** %4
%60 = load double*, double** %6
%61 = getelementptr inbounds double, double* %60, i64 0
%62 = load double*, double** %5
%63 = getelementptr inbounds double, double* %62, i64 0
%64 = call i32 @mod_a(%struct.idct_context* %59, double* %61, double* %63)
%65 = load %struct.idct_context*, %struct.idct_context** %4
%66 = load double*, double** %6
%67 = getelementptr inbounds double, double* %66, i64 16
%68 = load double*, double** %5
%69 = getelementptr inbounds double, double* %68, i64 16
%70 = call i32 @mod_b(%struct.idct_context* %65, double* %67, double* %69)
%71 = load %struct.idct_context*, %struct.idct_context** %4
%72 = load double*, double** %5
%73 = load double*, double** %6
%74 = call i32 @mod_c(%struct.idct_context* %71, double* %72, double* %73)
ret void
}

LLVM IR (-O2):
%struct.idct_context = type { i32 }
define void @idct_perform32_float(%struct.idct_context* noalias %0, double* noalias %1, double* noalias %2) {
%4 = tail call i32 @sum_a(double* %1, double* %2, i32 16)
%5 = getelementptr inbounds double, double* %2, i64 16
%6 = tail call i32 @sum_b(double* %1, double* %5, i32 16)
%7 = tail call i32 @sum_a(double* %2, double* %1, i32 8)
%8 = getelementptr inbounds double, double* %1, i64 8
%9 = tail call i32 @sum_b(double* %2, double* %8, i32 8)
%10 = getelementptr inbounds double, double* %1, i64 16
%11 = tail call i32 @sum_c(double* %5, double* %10, i32 8)
%12 = getelementptr inbounds double, double* %1, i64 24
%13 = tail call i32 @sum_d(double* %5, double* %12, i32 8)
%14 = tail call i32 @dct_a(%struct.idct_context* %0, double* %1, double* %2)
%15 = getelementptr inbounds double, double* %2, i64 8
%16 = tail call i32 @dct_b(%struct.idct_context* %0, double* %8, double* %15)
%17 = tail call i32 @dct_b(%struct.idct_context* %0, double* %10, double* %5)
%18 = getelementptr inbounds double, double* %2, i64 24
%19 = tail call i32 @dct_b(%struct.idct_context* %0, double* %12, double* %18)
%20 = tail call i32 @mod_a(%struct.idct_context* %0, double* %2, double* %1)
%21 = tail call i32 @mod_b(%struct.idct_context* %0, double* %5, double* %10)
%22 = tail call i32 @mod_c(%struct.idct_context* %0, double* %1, double* %2)
ret void
}