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

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ dct(int *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fidct(int *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ idct(int *);
int /*<<< orphan*/ init_dct();
int /*<<< orphan*/ init_idct();
float pow(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int k;
  volatile int b[8][8];
  int *p = &(b[0][0]);
  int mode = atoi(argv[1]);
  if (mode == 0) {
    init_dct();
    init_idct();
    for (k = 0; k < 64; k++) {
      float x = pow(3, k);
      int y = (int)x;
      int m = y % 75;
      p[k] = m;
    }
    dct(p);
    fidct(p);
    for (k = 0; k < 64; k++) {
      printf("%d\n", p[k]);
    }
  } else {
    FILE *in = fopen(argv[2], "r");
    FILE *out = fopen(argv[3], "w");
    int n = atoi(argv[4]);
    if (mode == 1) {
      init_dct();
      for (k = 0; k < n; k++) {
        fread(p, sizeof(int), 64, in);
        dct(p);
        fwrite(p, sizeof(int), 64, out);
      }
    } else if (mode == 2) {
      init_idct();
      for (k = 0; k < n; k++) {
        fread(p, sizeof(int), 64, in);
        idct(p);
        fwrite(p, sizeof(int), 64, out);
      }
    } else if (mode == 3) {
      for (k = 0; k < n; k++) {
        fread(p, sizeof(int), 64, in);
        fidct(p);
        fwrite(p, sizeof(int), 64, out);
      }
    }
    fclose(in);
    fclose(out);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x120(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x12c(%rbp)
cmpl   $0x0,-0x12c(%rbp)
jne    12d5 <main+0x115>
mov    $0x0,%al
call   1040 <init_dct@plt>
mov    $0x0,%al
call   10a0 <init_idct@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    127f <main+0xbf>
mov    -0x14(%rbp),%esi
mov    $0x3,%edi
call   10c0 <pow@plt>
movss  %xmm0,-0x130(%rbp)
ff
cvttss2si -0x130(%rbp),%eax
ff
mov    %eax,-0x134(%rbp)
mov    -0x134(%rbp),%eax
mov    $0x4b,%ecx
cltd
idiv   %ecx
mov    %edx,-0x138(%rbp)
mov    -0x138(%rbp),%edx
mov    -0x128(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    121c <main+0x5c>
mov    -0x128(%rbp),%rdi
call   1090 <dct@plt>
mov    -0x128(%rbp),%rdi
call   1070 <fidct@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    12d0 <main+0x110>
mov    -0x128(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd43(%rip),%rdi
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    129e <main+0xde>
jmp    14c2 <main+0x302>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd20(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x140(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd07(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x148(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x14c(%rbp)
cmpl   $0x1,-0x12c(%rbp)
jne    13a1 <main+0x1e1>
mov    $0x0,%al
call   1040 <init_dct@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x14c(%rbp),%eax
jge    139c <main+0x1dc>
mov    -0x128(%rbp),%rdi
mov    -0x140(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1030 <fread@plt>
mov    -0x128(%rbp),%rdi
call   1090 <dct@plt>
mov    -0x128(%rbp),%rdi
mov    -0x148(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   10e0 <fwrite@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1339 <main+0x179>
jmp    14aa <main+0x2ea>
cmpl   $0x2,-0x12c(%rbp)
jne    1424 <main+0x264>
mov    $0x0,%al
call   10a0 <init_idct@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x14c(%rbp),%eax
jge    141f <main+0x25f>
mov    -0x128(%rbp),%rdi
mov    -0x140(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1030 <fread@plt>
mov    -0x128(%rbp),%rdi
call   1080 <idct@plt>
mov    -0x128(%rbp),%rdi
mov    -0x148(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   10e0 <fwrite@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13bc <main+0x1fc>
jmp    14a5 <main+0x2e5>
cmpl   $0x3,-0x12c(%rbp)
jne    14a0 <main+0x2e0>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x14c(%rbp),%eax
jge    149b <main+0x2db>
mov    -0x128(%rbp),%rdi
mov    -0x140(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   1030 <fread@plt>
mov    -0x128(%rbp),%rdi
call   1070 <fidct@plt>
mov    -0x128(%rbp),%rdi
mov    -0x148(%rbp),%rcx
mov    $0x4,%esi
mov    $0x40,%edx
call   10e0 <fwrite@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1438 <main+0x278>
jmp    14a0 <main+0x2e0>
jmp    14a5 <main+0x2e5>
jmp    14aa <main+0x2ea>
mov    -0x140(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x148(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   10d0 <atoi@plt>
test   %eax,%eax
je     127c <main+0xbc>
mov    %eax,%r15d
mov    0x10(%rbx),%rdi
lea    0xe13(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r14
mov    0x18(%rbx),%rdi
lea    0xe02(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,%r12
mov    0x20(%rbx),%rdi
call   10d0 <atoi@plt>
mov    %eax,%ebp
cmp    $0x1,%r15d
je     133a <main+0x17a>
cmp    $0x2,%r15d
je     1389 <main+0x1c9>
cmp    $0x3,%r15d
jne    13d7 <main+0x217>
test   %ebp,%ebp
jle    13d7 <main+0x217>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1070 <fidct@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r12,%rcx
call   10e0 <fwrite@plt>
add    $0xffffffff,%ebp
jne    1240 <main+0x80>
jmp    13d7 <main+0x217>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <init_dct@plt>
xor    %eax,%eax
call   10a0 <init_idct@plt>
nopl   0x0(%rax)
mov    $0x3,%edi
mov    %ebx,%esi
call   10c0 <pow@plt>
cvttss2si %xmm0,%eax
cltq
imul   $0x1b4e81b5,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
imul   $0x4b,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%rsp,%rbx,4)
lea    0x1(%rbx),%esi
mov    $0x3,%edi
call   10c0 <pow@plt>
cvttss2si %xmm0,%eax
cltq
imul   $0x1b4e81b5,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
imul   $0x4b,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,0x4(%rsp,%rbx,4)
add    $0x2,%rbx
cmp    $0x40,%rbx
jne    1290 <main+0xd0>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1090 <dct@plt>
mov    %rbx,%rdi
call   1070 <fidct@plt>
xor    %ebp,%ebp
lea    0xcec(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rsp,%rbp,4),%esi
mov    %rbx,%rdi
call   1060 <printf@plt>
add    $0x1,%rbp
cmp    $0x40,%rbp
jne    1320 <main+0x160>
jmp    13e7 <main+0x227>
xor    %eax,%eax
call   1040 <init_dct@plt>
test   %ebp,%ebp
jle    13d7 <main+0x217>
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1090 <dct@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r12,%rcx
call   10e0 <fwrite@plt>
add    $0xffffffff,%ebp
jne    1350 <main+0x190>
jmp    13d7 <main+0x217>
xor    %eax,%eax
call   10a0 <init_idct@plt>
test   %ebp,%ebp
jle    13d7 <main+0x217>
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1080 <idct@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x40,%edx
mov    %r12,%rcx
call   10e0 <fwrite@plt>
add    $0xffffffff,%ebp
jne    13a0 <main+0x1e0>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [8 x [8 x i32]]
%8 = alloca i32*
%9 = alloca i32
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %7, i64 0, i64 0
%17 = getelementptr inbounds [8 x i32], [8 x i32]* %16, i64 0, i64 0
store i32* %17, i32** %8
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %9
%22 = load i32, i32* %9
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %64
24: ; preds = %2
%25 = call i32 (...) @init_dct()
%26 = call i32 (...) @init_idct()
store i32 0, i32* %6
br label %27
27: ; preds = %42, %24
%28 = load i32, i32* %6
%29 = icmp slt i32 %28, 64
br i1 %29, label %30, label %45
30: ; preds = %27
%31 = load i32, i32* %6
%32 = call float @pow(i32 3, i32 %31)
store float %32, float* %10
%33 = load float, float* %10
%34 = fptosi float %33 to i32
store i32 %34, i32* %11
%35 = load i32, i32* %11
%36 = srem i32 %35, 75
store i32 %36, i32* %12
%37 = load i32, i32* %12
%38 = load i32*, i32** %8
%39 = load i32, i32* %6
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i32, i32* %38, i64 %40
store i32 %37, i32* %41
br label %42
42: ; preds = %30
%43 = load i32, i32* %6
%44 = add nsw i32 %43, 1
store i32 %44, i32* %6
br label %27
45: ; preds = %27
%46 = load i32*, i32** %8
%47 = call i32 @dct(i32* %46)
%48 = load i32*, i32** %8
%49 = call i32 @fidct(i32* %48)
store i32 0, i32* %6
br label %50
50: ; preds = %60, %45
%51 = load i32, i32* %6
%52 = icmp slt i32 %51, 64
br i1 %52, label %53, label %63
53: ; preds = %50
%54 = load i32*, i32** %8
%55 = load i32, i32* %6
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %54, i64 %56
%58 = load i32, i32* %57
%59 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %53
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 1
store i32 %62, i32* %6
br label %50
63: ; preds = %50
br label %148
64: ; preds = %2
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 2
%67 = load i8*, i8** %66
%68 = call i32* @fopen(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %68, i32** %13
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 3
%71 = load i8*, i8** %70
%72 = call i32* @fopen(i8* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %72, i32** %14
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 4
%75 = load i8*, i8** %74
%76 = call i32 @atoi(i8* %75)
store i32 %76, i32* %15
%77 = load i32, i32* %9
%78 = icmp eq i32 %77, 1
br i1 %78, label %79, label %98
79: ; preds = %64
%80 = call i32 (...) @init_dct()
store i32 0, i32* %6
br label %81
81: ; preds = %94, %79
%82 = load i32, i32* %6
%83 = load i32, i32* %15
%84 = icmp slt i32 %82, %83
br i1 %84, label %85, label %97
85: ; preds = %81
%86 = load i32*, i32** %8
%87 = load i32*, i32** %13
%88 = call i32 @fread(i32* %86, i32 4, i32 64, i32* %87)
%89 = load i32*, i32** %8
%90 = call i32 @dct(i32* %89)
%91 = load i32*, i32** %8
%92 = load i32*, i32** %14
%93 = call i32 @fwrite(i32* %91, i32 4, i32 64, i32* %92)
br label %94
94: ; preds = %85
%95 = load i32, i32* %6
%96 = add nsw i32 %95, 1
store i32 %96, i32* %6
br label %81
97: ; preds = %81
br label %143
98: ; preds = %64
%99 = load i32, i32* %9
%100 = icmp eq i32 %99, 2
br i1 %100, label %101, label %120
101: ; preds = %98
%102 = call i32 (...) @init_idct()
store i32 0, i32* %6
br label %103
103: ; preds = %116, %101
%104 = load i32, i32* %6
%105 = load i32, i32* %15
%106 = icmp slt i32 %104, %105
br i1 %106, label %107, label %119
107: ; preds = %103
%108 = load i32*, i32** %8
%109 = load i32*, i32** %13
%110 = call i32 @fread(i32* %108, i32 4, i32 64, i32* %109)
%111 = load i32*, i32** %8
%112 = call i32 @idct(i32* %111)
%113 = load i32*, i32** %8
%114 = load i32*, i32** %14
%115 = call i32 @fwrite(i32* %113, i32 4, i32 64, i32* %114)
br label %116
116: ; preds = %107
%117 = load i32, i32* %6
%118 = add nsw i32 %117, 1
store i32 %118, i32* %6
br label %103
119: ; preds = %103
br label %142
120: ; preds = %98
%121 = load i32, i32* %9
%122 = icmp eq i32 %121, 3
br i1 %122, label %123, label %141
123: ; preds = %120
store i32 0, i32* %6
br label %124
124: ; preds = %137, %123
%125 = load i32, i32* %6
%126 = load i32, i32* %15
%127 = icmp slt i32 %125, %126
br i1 %127, label %128, label %140
128: ; preds = %124
%129 = load i32*, i32** %8
%130 = load i32*, i32** %13
%131 = call i32 @fread(i32* %129, i32 4, i32 64, i32* %130)
%132 = load i32*, i32** %8
%133 = call i32 @fidct(i32* %132)
%134 = load i32*, i32** %8
%135 = load i32*, i32** %14
%136 = call i32 @fwrite(i32* %134, i32 4, i32 64, i32* %135)
br label %137
137: ; preds = %128
%138 = load i32, i32* %6
%139 = add nsw i32 %138, 1
store i32 %139, i32* %6
br label %124
140: ; preds = %124
br label %141
141: ; preds = %140, %120
br label %142
142: ; preds = %141, %119
br label %143
143: ; preds = %142, %97
%144 = load i32*, i32** %13
%145 = call i32 @fclose(i32* %144)
%146 = load i32*, i32** %14
%147 = call i32 @fclose(i32* %146)
br label %148
148: ; preds = %143, %63
%149 = load i32, i32* %3
ret i32 %149
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [8 x [8 x i32]]
%4 = bitcast [8 x [8 x i32]]* %3 to i8*
%5 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 0, i64 0
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %38
10: ; preds = %2
%11 = tail call i32 (...) @init_dct()
%12 = tail call i32 (...) @init_idct()
br label %13
13: ; preds = %13, %10
%14 = phi i64 [ 0, %10 ], [ %26, %13 ]
%15 = trunc i64 %14 to i32
%16 = tail call float @pow(i32 3, i32 %15)
%17 = fptosi float %16 to i32
%18 = srem i32 %17, 75
%19 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 0, i64 %14
store i32 %18, i32* %19
%20 = or i64 %14, 1
%21 = trunc i64 %20 to i32
%22 = tail call float @pow(i32 3, i32 %21)
%23 = fptosi float %22 to i32
%24 = srem i32 %23, 75
%25 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 0, i64 %20
store i32 %24, i32* %25
%26 = add nuw nsw i64 %14, 2
%27 = icmp eq i64 %26, 64
br i1 %27, label %28, label %13
28: ; preds = %13
%29 = call i32 @dct(i32* %5)
%30 = call i32 @fidct(i32* %5)
br label %31
31: ; preds = %28, %31
%32 = phi i64 [ 0, %28 ], [ %36, %31 ]
%33 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %3, i64 0, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = add nuw nsw i64 %32, 1
%37 = icmp eq i64 %36, 64
br i1 %37, label %80, label %31
38: ; preds = %2
%39 = getelementptr inbounds i8*, i8** %1, i64 2
%40 = load i8*, i8** %39
%41 = tail call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%42 = getelementptr inbounds i8*, i8** %1, i64 3
%43 = load i8*, i8** %42
%44 = tail call i32* @fopen(i8* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%45 = getelementptr inbounds i8*, i8** %1, i64 4
%46 = load i8*, i8** %45
%47 = tail call i32 @atoi(i8* %46)
switch i32 %8, label %77 [
i32 1, label %50
i32 2, label %60
i32 3, label %48
]
48: ; preds = %38
%49 = icmp sgt i32 %47, 0
br i1 %49, label %70, label %77
50: ; preds = %38
%51 = tail call i32 (...) @init_dct()
%52 = icmp sgt i32 %47, 0
br i1 %52, label %53, label %77
53: ; preds = %50, %53
%54 = phi i32 [ %58, %53 ], [ 0, %50 ]
%55 = call i32 @fread(i32* %5, i32 4, i32 64, i32* %41)
%56 = call i32 @dct(i32* %5)
%57 = call i32 @fwrite(i32* %5, i32 4, i32 64, i32* %44)
%58 = add nuw nsw i32 %54, 1
%59 = icmp eq i32 %58, %47
br i1 %59, label %77, label %53
60: ; preds = %38
%61 = tail call i32 (...) @init_idct()
%62 = icmp sgt i32 %47, 0
br i1 %62, label %63, label %77
63: ; preds = %60, %63
%64 = phi i32 [ %68, %63 ], [ 0, %60 ]
%65 = call i32 @fread(i32* %5, i32 4, i32 64, i32* %41)
%66 = call i32 @idct(i32* %5)
%67 = call i32 @fwrite(i32* %5, i32 4, i32 64, i32* %44)
%68 = add nuw nsw i32 %64, 1
%69 = icmp eq i32 %68, %47
br i1 %69, label %77, label %63
70: ; preds = %48, %70
%71 = phi i32 [ %75, %70 ], [ 0, %48 ]
%72 = call i32 @fread(i32* %5, i32 4, i32 64, i32* %41)
%73 = call i32 @fidct(i32* %5)
%74 = call i32 @fwrite(i32* %5, i32 4, i32 64, i32* %44)
%75 = add nuw nsw i32 %71, 1
%76 = icmp eq i32 %75, %47
br i1 %76, label %77, label %70
77: ; preds = %70, %63, %53, %48, %60, %50, %38
%78 = call i32 @fclose(i32* %41)
%79 = call i32 @fclose(i32* %44)
br label %80
80: ; preds = %31, %77
ret i32 0
}