#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 */
scalar_t__ abs(int);
int clip23(int);
int /*<<< orphan*/ clp_v(int *, int);
int /*<<< orphan*/ dct_a(int *, int *);
int /*<<< orphan*/ dct_b(int *, int *);
int /*<<< orphan*/ mod64_a(int *, int *);
int /*<<< orphan*/ mod64_b(int *, int *);
int /*<<< orphan*/ mod64_c(int *, int *);
int /*<<< orphan*/ mod_a(int *, int *);
int /*<<< orphan*/ mod_b(int *, int *);
int /*<<< orphan*/ sum_a(int *, int *, int);
int /*<<< orphan*/ sum_b(int *, int *, int);
int /*<<< orphan*/ sum_c(int *, int *, int);
int /*<<< orphan*/ sum_d(int *, int *, int);
void idct_perform64_fixed(int *restrict input, int *restrict output) {
  int mag = 0;
  for (int i = 0; i < 64; i++)
    mag += abs(input[i]);
  int shift = mag > 0x400000 ? 2 : 0;
  int round = shift > 0 ? 1 << (shift - 1) : 0;
  for (int i = 0; i < 64; i++)
    input[i] = (input[i] + round) >> shift;
  sum_a(input, output + 0, 32);
  sum_b(input, output + 32, 32);
  clp_v(output, 64);
  sum_a(output + 0, input + 0, 16);
  sum_b(output + 0, input + 16, 16);
  sum_c(output + 32, input + 32, 16);
  sum_d(output + 32, input + 48, 16);
  clp_v(input, 64);
  sum_a(input + 0, output + 0, 8);
  sum_b(input + 0, output + 8, 8);
  sum_c(input + 16, output + 16, 8);
  sum_d(input + 16, output + 24, 8);
  sum_c(input + 32, output + 32, 8);
  sum_d(input + 32, output + 40, 8);
  sum_c(input + 48, output + 48, 8);
  sum_d(input + 48, output + 56, 8);
  clp_v(output, 64);
  dct_a(output + 0, input + 0);
  dct_b(output + 8, input + 8);
  dct_b(output + 16, input + 16);
  dct_b(output + 24, input + 24);
  dct_b(output + 32, input + 32);
  dct_b(output + 40, input + 40);
  dct_b(output + 48, input + 48);
  dct_b(output + 56, input + 56);
  clp_v(input, 64);
  mod_a(input + 0, output + 0);
  mod_b(input + 16, output + 16);
  mod_b(input + 32, output + 32);
  mod_b(input + 48, output + 48);
  clp_v(output, 64);
  mod64_a(output + 0, input + 0);
  mod64_b(output + 32, input + 32);
  clp_v(input, 64);
  mod64_c(input, output);
  for (int i = 0; i < 64; i++)
    output[i] = clip23(output[i] * (1 << shift));
}


x86 assembly (clang, -O0):
<idct_perform64_fixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x40,-0x18(%rbp)
jge    1233 <idct_perform64_fixed+0x53>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <abs@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11fe <idct_perform64_fixed+0x1e>
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x2,%ecx
cmp    $0x400000,%edx
cmovg  %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1268 <idct_perform64_fixed+0x88>
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x2c(%rbp)
jmp    1272 <idct_perform64_fixed+0x92>
xor    %eax,%eax
mov    %eax,-0x2c(%rbp)
jmp    1272 <idct_perform64_fixed+0x92>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x40,-0x24(%rbp)
jge    12b5 <idct_perform64_fixed+0xd5>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
sar    %cl,%edx
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    127f <idct_perform64_fixed+0x9f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x20,%edx
call   10e0 <sum_a@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x80,%rsi
mov    $0x20,%edx
call   1050 <sum_b@plt>
mov    -0x10(%rbp),%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   10e0 <sum_a@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x40,%rsi
mov    $0x10,%edx
call   1050 <sum_b@plt>
mov    -0x10(%rbp),%rdi
add    $0x80,%rdi
mov    -0x8(%rbp),%rsi
add    $0x80,%rsi
mov    $0x10,%edx
call   10d0 <sum_c@plt>
mov    -0x10(%rbp),%rdi
add    $0x80,%rdi
mov    -0x8(%rbp),%rsi
add    $0xc0,%rsi
mov    $0x10,%edx
call   1070 <sum_d@plt>
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   10e0 <sum_a@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
mov    $0x8,%edx
call   1050 <sum_b@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x10(%rbp),%rsi
add    $0x40,%rsi
mov    $0x8,%edx
call   10d0 <sum_c@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x10(%rbp),%rsi
add    $0x60,%rsi
mov    $0x8,%edx
call   1070 <sum_d@plt>
mov    -0x8(%rbp),%rdi
add    $0x80,%rdi
mov    -0x10(%rbp),%rsi
add    $0x80,%rsi
mov    $0x8,%edx
call   10d0 <sum_c@plt>
mov    -0x8(%rbp),%rdi
add    $0x80,%rdi
mov    -0x10(%rbp),%rsi
add    $0xa0,%rsi
mov    $0x8,%edx
call   1070 <sum_d@plt>
mov    -0x8(%rbp),%rdi
add    $0xc0,%rdi
mov    -0x10(%rbp),%rsi
add    $0xc0,%rsi
mov    $0x8,%edx
call   10d0 <sum_c@plt>
mov    -0x8(%rbp),%rdi
add    $0xc0,%rdi
mov    -0x10(%rbp),%rsi
add    $0xe0,%rsi
mov    $0x8,%edx
call   1070 <sum_d@plt>
mov    -0x10(%rbp),%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10f0 <dct_a@plt>
mov    -0x10(%rbp),%rdi
add    $0x20,%rdi
mov    -0x8(%rbp),%rsi
add    $0x20,%rsi
call   1080 <dct_b@plt>
mov    -0x10(%rbp),%rdi
add    $0x40,%rdi
mov    -0x8(%rbp),%rsi
add    $0x40,%rsi
call   1080 <dct_b@plt>
mov    -0x10(%rbp),%rdi
add    $0x60,%rdi
mov    -0x8(%rbp),%rsi
add    $0x60,%rsi
call   1080 <dct_b@plt>
mov    -0x10(%rbp),%rdi
add    $0x80,%rdi
mov    -0x8(%rbp),%rsi
add    $0x80,%rsi
call   1080 <dct_b@plt>
mov    -0x10(%rbp),%rdi
add    $0xa0,%rdi
mov    -0x8(%rbp),%rsi
add    $0xa0,%rsi
call   1080 <dct_b@plt>
mov    -0x10(%rbp),%rdi
add    $0xc0,%rdi
mov    -0x8(%rbp),%rsi
add    $0xc0,%rsi
call   1080 <dct_b@plt>
mov    -0x10(%rbp),%rdi
add    $0xe0,%rdi
mov    -0x8(%rbp),%rsi
add    $0xe0,%rsi
call   1080 <dct_b@plt>
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1100 <mod_a@plt>
mov    -0x8(%rbp),%rdi
add    $0x40,%rdi
mov    -0x10(%rbp),%rsi
add    $0x40,%rsi
call   1090 <mod_b@plt>
mov    -0x8(%rbp),%rdi
add    $0x80,%rdi
mov    -0x10(%rbp),%rsi
add    $0x80,%rsi
call   1090 <mod_b@plt>
mov    -0x8(%rbp),%rdi
add    $0xc0,%rdi
mov    -0x10(%rbp),%rsi
add    $0xc0,%rsi
call   1090 <mod_b@plt>
mov    -0x10(%rbp),%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10b0 <mod64_a@plt>
mov    -0x10(%rbp),%rdi
add    $0x80,%rdi
mov    -0x8(%rbp),%rsi
add    $0x80,%rsi
call   1030 <mod64_b@plt>
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10a0 <mod64_c@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x40,-0x28(%rbp)
jge    1606 <idct_perform64_fixed+0x426>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x1c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
imul   %eax,%edi
call   10c0 <clip23@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    15c4 <idct_perform64_fixed+0x3e4>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idct_perform64_fixed>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%r14
mov    %rdi,%r12
xor    %ebp,%ebp
mov    $0x3,%ebx
nopl   0x0(%rax,%rax,1)
mov    -0xc(%r12,%rbx,4),%edi
call   1040 <abs@plt>
mov    %rax,%r15
add    %ebp,%r15d
mov    -0x8(%r12,%rbx,4),%edi
call   1040 <abs@plt>
mov    %rax,%rbp
add    %r15d,%ebp
mov    -0x4(%r12,%rbx,4),%edi
call   1040 <abs@plt>
mov    %rax,%r15
add    %ebp,%r15d
mov    (%r12,%rbx,4),%edi
call   1040 <abs@plt>
mov    %rax,%rbp
add    %r15d,%ebp
add    $0x4,%rbx
cmp    $0x43,%rbx
jne    1200 <idct_perform64_fixed+0x20>
xor    %r15d,%r15d
cmp    $0x400001,%ebp
setge  %r15b
add    %r15d,%r15d
lea    -0x1(%r15),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    %ebx,%ebx
cmp    $0x400001,%ebp
cmovl  %ebx,%eax
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqu (%r12),%xmm2
movdqu 0x10(%r12),%xmm3
movdqu 0x20(%r12),%xmm4
movdqu 0x30(%r12),%xmm5
paddd  %xmm0,%xmm2
movd   %r15d,%xmm1
psrad  %xmm1,%xmm2
movdqu %xmm2,(%r12)
paddd  %xmm0,%xmm3
psrad  %xmm1,%xmm3
movdqu %xmm3,0x10(%r12)
paddd  %xmm0,%xmm4
psrad  %xmm1,%xmm4
lea    0x20(%r12),%rax
mov    %rax,0x70(%rsp)
paddd  %xmm0,%xmm5
psrad  %xmm1,%xmm5
movdqu %xmm4,0x20(%r12)
movdqu %xmm5,0x30(%r12)
lea    0x40(%r12),%rbp
movdqu 0x40(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
movdqu %xmm2,0x40(%r12)
movdqu 0x50(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
movdqu %xmm2,0x50(%r12)
lea    0x60(%r12),%rax
mov    %rax,0x68(%rsp)
movdqu 0x60(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
movdqu %xmm2,0x60(%r12)
movdqu 0x70(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
movdqu %xmm2,0x70(%r12)
movdqu 0x80(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
lea    0x80(%r12),%rax
mov    %rax,0x30(%rsp)
movdqu %xmm2,0x80(%r12)
movdqu 0x90(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
movdqu %xmm2,0x90(%r12)
movdqu 0xa0(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
movdqu %xmm2,0xa0(%r12)
movdqu 0xb0(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
lea    0xa0(%r12),%rax
mov    %rax,0x60(%rsp)
movdqu %xmm2,0xb0(%r12)
lea    0xc0(%r12),%rax
mov    %rax,0x8(%rsp)
movdqu 0xc0(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
movdqu %xmm2,0xc0(%r12)
movdqu 0xd0(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
movdqu %xmm2,0xd0(%r12)
lea    0xe0(%r12),%rax
mov    %rax,0x58(%rsp)
movdqu 0xe0(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
movdqu %xmm2,0xe0(%r12)
movdqu 0xf0(%r12),%xmm2
paddd  %xmm0,%xmm2
psrad  %xmm1,%xmm2
movdqu %xmm2,0xf0(%r12)
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   10e0 <sum_a@plt>
lea    0x80(%r14),%r13
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r13,0x20(%rsp)
mov    $0x20,%edx
call   1050 <sum_b@plt>
mov    %r14,%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x10,%edx
call   10e0 <sum_a@plt>
mov    %r14,%rdi
mov    %rbp,0x18(%rsp)
mov    %rbp,%rsi
mov    $0x10,%edx
call   1050 <sum_b@plt>
mov    %r13,%rdi
mov    0x30(%rsp),%rsi
mov    $0x10,%edx
call   10d0 <sum_c@plt>
mov    %r13,%rdi
mov    0x8(%rsp),%rsi
mov    $0x10,%edx
call   1070 <sum_d@plt>
mov    %r12,%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   10e0 <sum_a@plt>
lea    0x20(%r14),%rsi
mov    %rsi,0x50(%rsp)
mov    %r12,%rdi
mov    $0x8,%edx
call   1050 <sum_b@plt>
lea    0x40(%r14),%rsi
mov    %rsi,0x28(%rsp)
mov    %rbp,%rdi
mov    $0x8,%edx
call   10d0 <sum_c@plt>
lea    0x60(%r14),%rsi
mov    %rsi,0x48(%rsp)
mov    %rbp,%rdi
mov    $0x8,%edx
call   1070 <sum_d@plt>
mov    0x30(%rsp),%r13
mov    %r13,%rdi
mov    0x20(%rsp),%rsi
mov    $0x8,%edx
call   10d0 <sum_c@plt>
lea    0xa0(%r14),%rsi
mov    %rsi,0x40(%rsp)
mov    %r13,%rdi
mov    $0x8,%edx
call   1070 <sum_d@plt>
lea    0xc0(%r14),%rsi
mov    %rsi,0x10(%rsp)
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x8,%edx
call   10d0 <sum_c@plt>
lea    0xe0(%r14),%rsi
mov    %rsi,0x38(%rsp)
mov    %rbp,%rdi
mov    $0x8,%edx
call   1070 <sum_d@plt>
mov    %r14,%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   10f0 <dct_a@plt>
mov    0x50(%rsp),%rdi
mov    0x70(%rsp),%rsi
call   1080 <dct_b@plt>
mov    0x28(%rsp),%rdi
mov    0x18(%rsp),%rsi
call   1080 <dct_b@plt>
mov    0x48(%rsp),%rdi
mov    0x68(%rsp),%rsi
call   1080 <dct_b@plt>
mov    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13,%rsi
call   1080 <dct_b@plt>
mov    0x40(%rsp),%rdi
mov    0x60(%rsp),%rsi
call   1080 <dct_b@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1080 <dct_b@plt>
mov    0x38(%rsp),%rdi
mov    0x58(%rsp),%rsi
call   1080 <dct_b@plt>
mov    %r12,%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1100 <mod_a@plt>
mov    0x18(%rsp),%rdi
mov    0x28(%rsp),%rsi
call   1090 <mod_b@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
call   1090 <mod_b@plt>
mov    0x8(%rsp),%rdi
mov    0x10(%rsp),%rsi
call   1090 <mod_b@plt>
mov    %r14,%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   10b0 <mod64_a@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1030 <mod64_b@plt>
mov    %r12,%rdi
mov    $0x40,%esi
call   1060 <clp_v@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   10a0 <mod64_c@plt>
xchg   %ax,%ax
mov    (%r14,%rbx,4),%edi
mov    %r15d,%ecx
shl    %cl,%edi
call   10c0 <clip23@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x40,%rbx
jne    16a0 <idct_perform64_fixed+0x4c0>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @idct_perform64_fixed(i32* noalias %0, i32* noalias %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %11
11: ; preds = %25, %2
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 64
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load i32*, i32** %3
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = call i64 @abs(i32 %19)
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = add nsw i64 %22, %20
%24 = trunc i64 %23 to i32
store i32 %24, i32* %5
br label %25
25: ; preds = %14
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %11
28: ; preds = %11
%29 = load i32, i32* %5
%30 = icmp sgt i32 %29, 4194304
%31 = zext i1 %30 to i64
%32 = select i1 %30, i32 2, i32 0
store i32 %32, i32* %7
%33 = load i32, i32* %7
%34 = icmp sgt i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %28
%36 = load i32, i32* %7
%37 = sub nsw i32 %36, 1
%38 = shl i32 1, %37
br label %40
39: ; preds = %28
br label %40
40: ; preds = %39, %35
%41 = phi i32 [ %38, %35 ], [ 0, %39 ]
store i32 %41, i32* %8
store i32 0, i32* %9
br label %42
42: ; preds = %59, %40
%43 = load i32, i32* %9
%44 = icmp slt i32 %43, 64
br i1 %44, label %45, label %62
45: ; preds = %42
%46 = load i32*, i32** %3
%47 = load i32, i32* %9
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %46, i64 %48
%50 = load i32, i32* %49
%51 = load i32, i32* %8
%52 = add nsw i32 %50, %51
%53 = load i32, i32* %7
%54 = ashr i32 %52, %53
%55 = load i32*, i32** %3
%56 = load i32, i32* %9
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %55, i64 %57
store i32 %54, i32* %58
br label %59
59: ; preds = %45
%60 = load i32, i32* %9
%61 = add nsw i32 %60, 1
store i32 %61, i32* %9
br label %42
62: ; preds = %42
%63 = load i32*, i32** %3
%64 = load i32*, i32** %4
%65 = getelementptr inbounds i32, i32* %64, i64 0
%66 = call i32 @sum_a(i32* %63, i32* %65, i32 32)
%67 = load i32*, i32** %3
%68 = load i32*, i32** %4
%69 = getelementptr inbounds i32, i32* %68, i64 32
%70 = call i32 @sum_b(i32* %67, i32* %69, i32 32)
%71 = load i32*, i32** %4
%72 = call i32 @clp_v(i32* %71, i32 64)
%73 = load i32*, i32** %4
%74 = getelementptr inbounds i32, i32* %73, i64 0
%75 = load i32*, i32** %3
%76 = getelementptr inbounds i32, i32* %75, i64 0
%77 = call i32 @sum_a(i32* %74, i32* %76, i32 16)
%78 = load i32*, i32** %4
%79 = getelementptr inbounds i32, i32* %78, i64 0
%80 = load i32*, i32** %3
%81 = getelementptr inbounds i32, i32* %80, i64 16
%82 = call i32 @sum_b(i32* %79, i32* %81, i32 16)
%83 = load i32*, i32** %4
%84 = getelementptr inbounds i32, i32* %83, i64 32
%85 = load i32*, i32** %3
%86 = getelementptr inbounds i32, i32* %85, i64 32
%87 = call i32 @sum_c(i32* %84, i32* %86, i32 16)
%88 = load i32*, i32** %4
%89 = getelementptr inbounds i32, i32* %88, i64 32
%90 = load i32*, i32** %3
%91 = getelementptr inbounds i32, i32* %90, i64 48
%92 = call i32 @sum_d(i32* %89, i32* %91, i32 16)
%93 = load i32*, i32** %3
%94 = call i32 @clp_v(i32* %93, i32 64)
%95 = load i32*, i32** %3
%96 = getelementptr inbounds i32, i32* %95, i64 0
%97 = load i32*, i32** %4
%98 = getelementptr inbounds i32, i32* %97, i64 0
%99 = call i32 @sum_a(i32* %96, i32* %98, i32 8)
%100 = load i32*, i32** %3
%101 = getelementptr inbounds i32, i32* %100, i64 0
%102 = load i32*, i32** %4
%103 = getelementptr inbounds i32, i32* %102, i64 8
%104 = call i32 @sum_b(i32* %101, i32* %103, i32 8)
%105 = load i32*, i32** %3
%106 = getelementptr inbounds i32, i32* %105, i64 16
%107 = load i32*, i32** %4
%108 = getelementptr inbounds i32, i32* %107, i64 16
%109 = call i32 @sum_c(i32* %106, i32* %108, i32 8)
%110 = load i32*, i32** %3
%111 = getelementptr inbounds i32, i32* %110, i64 16
%112 = load i32*, i32** %4
%113 = getelementptr inbounds i32, i32* %112, i64 24
%114 = call i32 @sum_d(i32* %111, i32* %113, i32 8)
%115 = load i32*, i32** %3
%116 = getelementptr inbounds i32, i32* %115, i64 32
%117 = load i32*, i32** %4
%118 = getelementptr inbounds i32, i32* %117, i64 32
%119 = call i32 @sum_c(i32* %116, i32* %118, i32 8)
%120 = load i32*, i32** %3
%121 = getelementptr inbounds i32, i32* %120, i64 32
%122 = load i32*, i32** %4
%123 = getelementptr inbounds i32, i32* %122, i64 40
%124 = call i32 @sum_d(i32* %121, i32* %123, i32 8)
%125 = load i32*, i32** %3
%126 = getelementptr inbounds i32, i32* %125, i64 48
%127 = load i32*, i32** %4
%128 = getelementptr inbounds i32, i32* %127, i64 48
%129 = call i32 @sum_c(i32* %126, i32* %128, i32 8)
%130 = load i32*, i32** %3
%131 = getelementptr inbounds i32, i32* %130, i64 48
%132 = load i32*, i32** %4
%133 = getelementptr inbounds i32, i32* %132, i64 56
%134 = call i32 @sum_d(i32* %131, i32* %133, i32 8)
%135 = load i32*, i32** %4
%136 = call i32 @clp_v(i32* %135, i32 64)
%137 = load i32*, i32** %4
%138 = getelementptr inbounds i32, i32* %137, i64 0
%139 = load i32*, i32** %3
%140 = getelementptr inbounds i32, i32* %139, i64 0
%141 = call i32 @dct_a(i32* %138, i32* %140)
%142 = load i32*, i32** %4
%143 = getelementptr inbounds i32, i32* %142, i64 8
%144 = load i32*, i32** %3
%145 = getelementptr inbounds i32, i32* %144, i64 8
%146 = call i32 @dct_b(i32* %143, i32* %145)
%147 = load i32*, i32** %4
%148 = getelementptr inbounds i32, i32* %147, i64 16
%149 = load i32*, i32** %3
%150 = getelementptr inbounds i32, i32* %149, i64 16
%151 = call i32 @dct_b(i32* %148, i32* %150)
%152 = load i32*, i32** %4
%153 = getelementptr inbounds i32, i32* %152, i64 24
%154 = load i32*, i32** %3
%155 = getelementptr inbounds i32, i32* %154, i64 24
%156 = call i32 @dct_b(i32* %153, i32* %155)
%157 = load i32*, i32** %4
%158 = getelementptr inbounds i32, i32* %157, i64 32
%159 = load i32*, i32** %3
%160 = getelementptr inbounds i32, i32* %159, i64 32
%161 = call i32 @dct_b(i32* %158, i32* %160)
%162 = load i32*, i32** %4
%163 = getelementptr inbounds i32, i32* %162, i64 40
%164 = load i32*, i32** %3
%165 = getelementptr inbounds i32, i32* %164, i64 40
%166 = call i32 @dct_b(i32* %163, i32* %165)
%167 = load i32*, i32** %4
%168 = getelementptr inbounds i32, i32* %167, i64 48
%169 = load i32*, i32** %3
%170 = getelementptr inbounds i32, i32* %169, i64 48
%171 = call i32 @dct_b(i32* %168, i32* %170)
%172 = load i32*, i32** %4
%173 = getelementptr inbounds i32, i32* %172, i64 56
%174 = load i32*, i32** %3
%175 = getelementptr inbounds i32, i32* %174, i64 56
%176 = call i32 @dct_b(i32* %173, i32* %175)
%177 = load i32*, i32** %3
%178 = call i32 @clp_v(i32* %177, i32 64)
%179 = load i32*, i32** %3
%180 = getelementptr inbounds i32, i32* %179, i64 0
%181 = load i32*, i32** %4
%182 = getelementptr inbounds i32, i32* %181, i64 0
%183 = call i32 @mod_a(i32* %180, i32* %182)
%184 = load i32*, i32** %3
%185 = getelementptr inbounds i32, i32* %184, i64 16
%186 = load i32*, i32** %4
%187 = getelementptr inbounds i32, i32* %186, i64 16
%188 = call i32 @mod_b(i32* %185, i32* %187)
%189 = load i32*, i32** %3
%190 = getelementptr inbounds i32, i32* %189, i64 32
%191 = load i32*, i32** %4
%192 = getelementptr inbounds i32, i32* %191, i64 32
%193 = call i32 @mod_b(i32* %190, i32* %192)
%194 = load i32*, i32** %3
%195 = getelementptr inbounds i32, i32* %194, i64 48
%196 = load i32*, i32** %4
%197 = getelementptr inbounds i32, i32* %196, i64 48
%198 = call i32 @mod_b(i32* %195, i32* %197)
%199 = load i32*, i32** %4
%200 = call i32 @clp_v(i32* %199, i32 64)
%201 = load i32*, i32** %4
%202 = getelementptr inbounds i32, i32* %201, i64 0
%203 = load i32*, i32** %3
%204 = getelementptr inbounds i32, i32* %203, i64 0
%205 = call i32 @mod64_a(i32* %202, i32* %204)
%206 = load i32*, i32** %4
%207 = getelementptr inbounds i32, i32* %206, i64 32
%208 = load i32*, i32** %3
%209 = getelementptr inbounds i32, i32* %208, i64 32
%210 = call i32 @mod64_b(i32* %207, i32* %209)
%211 = load i32*, i32** %3
%212 = call i32 @clp_v(i32* %211, i32 64)
%213 = load i32*, i32** %3
%214 = load i32*, i32** %4
%215 = call i32 @mod64_c(i32* %213, i32* %214)
store i32 0, i32* %10
br label %216
216: ; preds = %233, %62
%217 = load i32, i32* %10
%218 = icmp slt i32 %217, 64
br i1 %218, label %219, label %236
219: ; preds = %216
%220 = load i32*, i32** %4
%221 = load i32, i32* %10
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds i32, i32* %220, i64 %222
%224 = load i32, i32* %223
%225 = load i32, i32* %7
%226 = shl i32 1, %225
%227 = mul nsw i32 %224, %226
%228 = call i32 @clip23(i32 %227)
%229 = load i32*, i32** %4
%230 = load i32, i32* %10
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds i32, i32* %229, i64 %231
store i32 %228, i32* %232
br label %233
233: ; preds = %219
%234 = load i32, i32* %10
%235 = add nsw i32 %234, 1
store i32 %235, i32* %10
br label %216
236: ; preds = %216
ret void
}

LLVM IR (-O2):
define void @idct_perform64_fixed(i32* noalias %0, i32* noalias %1) {
br label %157
3: ; preds = %157
%4 = icmp sgt i32 %182, 4194304
%5 = select i1 %4, i32 2, i32 0
%6 = add nsw i32 %5, -1
%7 = shl nuw nsw i32 1, %6
%8 = select i1 %4, i32 %7, i32 0
%9 = insertelement <4 x i32> poison, i32 %8, i64 0
%10 = shufflevector <4 x i32> %9, <4 x i32> poison, <4 x i32> zeroinitializer
%11 = insertelement <4 x i32> poison, i32 %5, i64 0
%12 = shufflevector <4 x i32> %11, <4 x i32> poison, <4 x i32> zeroinitializer
%13 = bitcast i32* %0 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = add nsw <4 x i32> %14, %10
%16 = ashr <4 x i32> %15, %12
%17 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %16, <4 x i32>* %17
%18 = getelementptr inbounds i32, i32* %0, i64 4
%19 = bitcast i32* %18 to <4 x i32>*
%20 = load <4 x i32>, <4 x i32>* %19
%21 = add nsw <4 x i32> %20, %10
%22 = ashr <4 x i32> %21, %12
%23 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> %22, <4 x i32>* %23
%24 = getelementptr inbounds i32, i32* %0, i64 8
%25 = bitcast i32* %24 to <4 x i32>*
%26 = load <4 x i32>, <4 x i32>* %25
%27 = add nsw <4 x i32> %26, %10
%28 = ashr <4 x i32> %27, %12
%29 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> %28, <4 x i32>* %29
%30 = getelementptr inbounds i32, i32* %0, i64 12
%31 = bitcast i32* %30 to <4 x i32>*
%32 = load <4 x i32>, <4 x i32>* %31
%33 = add nsw <4 x i32> %32, %10
%34 = ashr <4 x i32> %33, %12
%35 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> %34, <4 x i32>* %35
%36 = getelementptr inbounds i32, i32* %0, i64 16
%37 = bitcast i32* %36 to <4 x i32>*
%38 = load <4 x i32>, <4 x i32>* %37
%39 = add nsw <4 x i32> %38, %10
%40 = ashr <4 x i32> %39, %12
%41 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> %40, <4 x i32>* %41
%42 = getelementptr inbounds i32, i32* %0, i64 20
%43 = bitcast i32* %42 to <4 x i32>*
%44 = load <4 x i32>, <4 x i32>* %43
%45 = add nsw <4 x i32> %44, %10
%46 = ashr <4 x i32> %45, %12
%47 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> %46, <4 x i32>* %47
%48 = getelementptr inbounds i32, i32* %0, i64 24
%49 = bitcast i32* %48 to <4 x i32>*
%50 = load <4 x i32>, <4 x i32>* %49
%51 = add nsw <4 x i32> %50, %10
%52 = ashr <4 x i32> %51, %12
%53 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> %52, <4 x i32>* %53
%54 = getelementptr inbounds i32, i32* %0, i64 28
%55 = bitcast i32* %54 to <4 x i32>*
%56 = load <4 x i32>, <4 x i32>* %55
%57 = add nsw <4 x i32> %56, %10
%58 = ashr <4 x i32> %57, %12
%59 = bitcast i32* %54 to <4 x i32>*
store <4 x i32> %58, <4 x i32>* %59
%60 = getelementptr inbounds i32, i32* %0, i64 32
%61 = bitcast i32* %60 to <4 x i32>*
%62 = load <4 x i32>, <4 x i32>* %61
%63 = add nsw <4 x i32> %62, %10
%64 = ashr <4 x i32> %63, %12
%65 = bitcast i32* %60 to <4 x i32>*
store <4 x i32> %64, <4 x i32>* %65
%66 = getelementptr inbounds i32, i32* %0, i64 36
%67 = bitcast i32* %66 to <4 x i32>*
%68 = load <4 x i32>, <4 x i32>* %67
%69 = add nsw <4 x i32> %68, %10
%70 = ashr <4 x i32> %69, %12
%71 = bitcast i32* %66 to <4 x i32>*
store <4 x i32> %70, <4 x i32>* %71
%72 = getelementptr inbounds i32, i32* %0, i64 40
%73 = bitcast i32* %72 to <4 x i32>*
%74 = load <4 x i32>, <4 x i32>* %73
%75 = add nsw <4 x i32> %74, %10
%76 = ashr <4 x i32> %75, %12
%77 = bitcast i32* %72 to <4 x i32>*
store <4 x i32> %76, <4 x i32>* %77
%78 = getelementptr inbounds i32, i32* %0, i64 44
%79 = bitcast i32* %78 to <4 x i32>*
%80 = load <4 x i32>, <4 x i32>* %79
%81 = add nsw <4 x i32> %80, %10
%82 = ashr <4 x i32> %81, %12
%83 = bitcast i32* %78 to <4 x i32>*
store <4 x i32> %82, <4 x i32>* %83
%84 = getelementptr inbounds i32, i32* %0, i64 48
%85 = bitcast i32* %84 to <4 x i32>*
%86 = load <4 x i32>, <4 x i32>* %85
%87 = add nsw <4 x i32> %86, %10
%88 = ashr <4 x i32> %87, %12
%89 = bitcast i32* %84 to <4 x i32>*
store <4 x i32> %88, <4 x i32>* %89
%90 = getelementptr inbounds i32, i32* %0, i64 52
%91 = bitcast i32* %90 to <4 x i32>*
%92 = load <4 x i32>, <4 x i32>* %91
%93 = add nsw <4 x i32> %92, %10
%94 = ashr <4 x i32> %93, %12
%95 = bitcast i32* %90 to <4 x i32>*
store <4 x i32> %94, <4 x i32>* %95
%96 = getelementptr inbounds i32, i32* %0, i64 56
%97 = bitcast i32* %96 to <4 x i32>*
%98 = load <4 x i32>, <4 x i32>* %97
%99 = add nsw <4 x i32> %98, %10
%100 = ashr <4 x i32> %99, %12
%101 = bitcast i32* %96 to <4 x i32>*
store <4 x i32> %100, <4 x i32>* %101
%102 = getelementptr inbounds i32, i32* %0, i64 60
%103 = bitcast i32* %102 to <4 x i32>*
%104 = load <4 x i32>, <4 x i32>* %103
%105 = add nsw <4 x i32> %104, %10
%106 = ashr <4 x i32> %105, %12
%107 = bitcast i32* %102 to <4 x i32>*
store <4 x i32> %106, <4 x i32>* %107
%108 = tail call i32 @sum_a(i32* %0, i32* %1, i32 32)
%109 = getelementptr inbounds i32, i32* %1, i64 32
%110 = tail call i32 @sum_b(i32* %0, i32* %109, i32 32)
%111 = tail call i32 @clp_v(i32* %1, i32 64)
%112 = tail call i32 @sum_a(i32* %1, i32* %0, i32 16)
%113 = getelementptr inbounds i32, i32* %0, i64 16
%114 = tail call i32 @sum_b(i32* %1, i32* %113, i32 16)
%115 = getelementptr inbounds i32, i32* %0, i64 32
%116 = tail call i32 @sum_c(i32* %109, i32* %115, i32 16)
%117 = getelementptr inbounds i32, i32* %0, i64 48
%118 = tail call i32 @sum_d(i32* %109, i32* %117, i32 16)
%119 = tail call i32 @clp_v(i32* %0, i32 64)
%120 = tail call i32 @sum_a(i32* %0, i32* %1, i32 8)
%121 = getelementptr inbounds i32, i32* %1, i64 8
%122 = tail call i32 @sum_b(i32* %0, i32* %121, i32 8)
%123 = getelementptr inbounds i32, i32* %1, i64 16
%124 = tail call i32 @sum_c(i32* %113, i32* %123, i32 8)
%125 = getelementptr inbounds i32, i32* %1, i64 24
%126 = tail call i32 @sum_d(i32* %113, i32* %125, i32 8)
%127 = tail call i32 @sum_c(i32* %115, i32* %109, i32 8)
%128 = getelementptr inbounds i32, i32* %1, i64 40
%129 = tail call i32 @sum_d(i32* %115, i32* %128, i32 8)
%130 = getelementptr inbounds i32, i32* %1, i64 48
%131 = tail call i32 @sum_c(i32* %117, i32* %130, i32 8)
%132 = getelementptr inbounds i32, i32* %1, i64 56
%133 = tail call i32 @sum_d(i32* %117, i32* %132, i32 8)
%134 = tail call i32 @clp_v(i32* %1, i32 64)
%135 = tail call i32 @dct_a(i32* %1, i32* %0)
%136 = getelementptr inbounds i32, i32* %0, i64 8
%137 = tail call i32 @dct_b(i32* %121, i32* %136)
%138 = tail call i32 @dct_b(i32* %123, i32* %113)
%139 = getelementptr inbounds i32, i32* %0, i64 24
%140 = tail call i32 @dct_b(i32* %125, i32* %139)
%141 = tail call i32 @dct_b(i32* %109, i32* %115)
%142 = getelementptr inbounds i32, i32* %0, i64 40
%143 = tail call i32 @dct_b(i32* %128, i32* %142)
%144 = tail call i32 @dct_b(i32* %130, i32* %117)
%145 = getelementptr inbounds i32, i32* %0, i64 56
%146 = tail call i32 @dct_b(i32* %132, i32* %145)
%147 = tail call i32 @clp_v(i32* %0, i32 64)
%148 = tail call i32 @mod_a(i32* %0, i32* %1)
%149 = tail call i32 @mod_b(i32* %113, i32* %123)
%150 = tail call i32 @mod_b(i32* %115, i32* %109)
%151 = tail call i32 @mod_b(i32* %117, i32* %130)
%152 = tail call i32 @clp_v(i32* %1, i32 64)
%153 = tail call i32 @mod64_a(i32* %1, i32* %0)
%154 = tail call i32 @mod64_b(i32* %109, i32* %115)
%155 = tail call i32 @clp_v(i32* %0, i32 64)
%156 = tail call i32 @mod64_c(i32* %0, i32* %1)
br label %186
157: ; preds = %157, %2
%158 = phi i64 [ 0, %2 ], [ %183, %157 ]
%159 = phi i32 [ 0, %2 ], [ %182, %157 ]
%160 = getelementptr inbounds i32, i32* %0, i64 %158
%161 = load i32, i32* %160
%162 = tail call i64 @abs(i32 %161)
%163 = trunc i64 %162 to i32
%164 = add i32 %159, %163
%165 = or i64 %158, 1
%166 = getelementptr inbounds i32, i32* %0, i64 %165
%167 = load i32, i32* %166
%168 = tail call i64 @abs(i32 %167)
%169 = trunc i64 %168 to i32
%170 = add i32 %164, %169
%171 = or i64 %158, 2
%172 = getelementptr inbounds i32, i32* %0, i64 %171
%173 = load i32, i32* %172
%174 = tail call i64 @abs(i32 %173)
%175 = trunc i64 %174 to i32
%176 = add i32 %170, %175
%177 = or i64 %158, 3
%178 = getelementptr inbounds i32, i32* %0, i64 %177
%179 = load i32, i32* %178
%180 = tail call i64 @abs(i32 %179)
%181 = trunc i64 %180 to i32
%182 = add i32 %176, %181
%183 = add nuw nsw i64 %158, 4
%184 = icmp eq i64 %183, 64
br i1 %184, label %3, label %157
185: ; preds = %186
ret void
186: ; preds = %3, %186
%187 = phi i64 [ 0, %3 ], [ %192, %186 ]
%188 = getelementptr inbounds i32, i32* %1, i64 %187
%189 = load i32, i32* %188
%190 = shl i32 %189, %5
%191 = tail call i32 @clip23(i32 %190)
store i32 %191, i32* %188
%192 = add nuw nsw i64 %187, 1
%193 = icmp eq i64 %192, 64
br i1 %193, label %185, label %186
}