#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*/ uint8_t;
typedef scalar_t__ uint64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int atoi(char *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void *malloc(int);
int /*<<< orphan*/ print_results(scalar_t__ *, double *, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int sscanf(char *, char *, int *, int *);
scalar_t__ ssd_plane(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
double ssim_plane(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, int, int,
                  int, int *, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  FILE *f[2];
  uint8_t *buf[2], *plane[2][3];
  int *temp;
  uint64_t ssd[3] = {0, 0, 0};
  double ssim[3] = {0, 0, 0};
  int frame_size, w, h;
  int frames, seek;
  int i;
  if (argc < 4 || 2 != sscanf(argv[3], "%dx%d", &w, &h)) {
    printf("tiny_ssim <file1.yuv> <file2.yuv> <width>x<height> [<seek>]\n");
    return -1;
  }
  f[0] = fopen(argv[1], "rb");
  f[1] = fopen(argv[2], "rb");
  sscanf(argv[3], "%dx%d", &w, &h);
  frame_size = w * h * 3 / 2;
  for (i = 0; i < 2; i++) {
    buf[i] = malloc(frame_size);
    plane[i][0] = buf[i];
    plane[i][1] = plane[i][0] + w * h;
    plane[i][2] = plane[i][1] + w * h / 4;
  }
  temp = malloc((2 * w + 12) * sizeof(*temp));
  seek = argc < 5 ? 0 : atoi(argv[4]);
  fseek(f[seek < 0], seek < 0 ? -seek : seek, SEEK_SET);
  for (frames = 0;; frames++) {
    uint64_t ssd_one[3];
    double ssim_one[3];
    if (fread(buf[0], frame_size, 1, f[0]) != 1)
      break;
    if (fread(buf[1], frame_size, 1, f[1]) != 1)
      break;
    for (i = 0; i < 3; i++) {
      ssd_one[i] = ssd_plane(plane[0][i], plane[1][i], w * h >> 2 * !!i);
      ssim_one[i] = ssim_plane(plane[0][i], w >> !!i, plane[1][i], w >> !!i,
                               w >> !!i, h >> !!i, temp, NULL);
      ssd[i] += ssd_one[i];
      ssim[i] += ssim_one[i];
    }
    printf("Frame %d | ", frames);
    print_results(ssd_one, ssim_one, 1, w, h);
    printf("                \r");
    fflush(stdout);
  }
  if (!frames)
    return 0;
  printf("Total %d frames | ", frames);
  print_results(ssd, ssim, frames, w, h);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1060 <memset@plt>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1060 <memset@plt>
cmpl   $0x4,-0x8(%rbp)
jl     1237 <main+0x77>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdeb(%rip),%rsi
lea    -0xa8(%rbp),%rdx
lea    -0xac(%rbp),%rcx
call   10a0 <sscanf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
je     1251 <main+0x91>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1715 <main+0x555>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde3(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdcb(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd70(%rip),%rsi
lea    -0xa8(%rbp),%rdx
lea    -0xac(%rbp),%rcx
call   10a0 <sscanf@plt>
mov    -0xa8(%rbp),%eax
imul   -0xac(%rbp),%eax
imul   $0x3,%eax,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xa4(%rbp)
movl   $0x0,-0xb8(%rbp)
cmpl   $0x2,-0xb8(%rbp)
jge    13b2 <main+0x1f2>
mov    -0xa4(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,%rcx
movslq -0xb8(%rbp),%rax
mov    %rcx,-0x30(%rbp,%rax,8)
movslq -0xb8(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rcx
movslq -0xb8(%rbp),%rdx
lea    -0x60(%rbp),%rax
imul   $0x18,%rdx,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
movslq -0xb8(%rbp),%rcx
lea    -0x60(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%rcx
mov    -0xa8(%rbp),%eax
imul   -0xac(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rcx
movslq -0xb8(%rbp),%rdx
lea    -0x60(%rbp),%rax
imul   $0x18,%rdx,%rdx
add    %rdx,%rax
mov    %rcx,0x8(%rax)
movslq -0xb8(%rbp),%rcx
lea    -0x60(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rcx
mov    -0xa8(%rbp),%eax
imul   -0xac(%rbp),%eax
mov    $0x4,%esi
cltd
idiv   %esi
cltq
shl    $0x2,%rax
add    %rax,%rcx
movslq -0xb8(%rbp),%rdx
lea    -0x60(%rbp),%rax
imul   $0x18,%rdx,%rdx
add    %rdx,%rax
mov    %rcx,0x10(%rax)
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    12cb <main+0x10b>
mov    -0xa8(%rbp),%eax
shl    $0x1,%eax
add    $0xc,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x68(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    13e6 <main+0x226>
xor    %eax,%eax
mov    %eax,-0xf4(%rbp)
jmp    13f9 <main+0x239>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10e0 <atoi@plt>
mov    %eax,-0xf4(%rbp)
mov    -0xf4(%rbp),%eax
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cltq
mov    -0x20(%rbp,%rax,8),%rax
mov    %rax,-0x100(%rbp)
cmpl   $0x0,-0xb4(%rbp)
jge    1442 <main+0x282>
xor    %eax,%eax
sub    -0xb4(%rbp),%eax
mov    %eax,-0x104(%rbp)
jmp    144e <main+0x28e>
mov    -0xb4(%rbp),%eax
mov    %eax,-0x104(%rbp)
mov    -0x100(%rbp),%rdi
mov    -0x104(%rbp),%esi
mov    0x2b7e(%rip),%rax
mov    (%rax),%edx
call   10b0 <fseek@plt>
movl   $0x0,-0xb0(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0xa4(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     1499 <main+0x2d9>
jmp    16b0 <main+0x4f0>
mov    -0x28(%rbp),%rdi
mov    -0xa4(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     14bf <main+0x2ff>
jmp    16b0 <main+0x4f0>
movl   $0x0,-0xb8(%rbp)
cmpl   $0x3,-0xb8(%rbp)
jge    1647 <main+0x487>
movslq -0xb8(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rdi
movslq -0xb8(%rbp),%rax
mov    -0x48(%rbp,%rax,8),%rsi
mov    -0xa8(%rbp),%edx
imul   -0xac(%rbp),%edx
cmpl   $0x0,-0xb8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
shl    $0x1,%ecx
sar    %cl,%edx
call   10c0 <ssd_plane@plt>
mov    %rax,%rcx
movslq -0xb8(%rbp),%rax
mov    %rcx,-0xd0(%rbp,%rax,8)
ff
movslq -0xb8(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rdi
mov    -0xa8(%rbp),%esi
cmpl   $0x0,-0xb8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
sar    %cl,%esi
movslq -0xb8(%rbp),%rax
mov    -0x48(%rbp,%rax,8),%rdx
mov    -0xa8(%rbp),%eax
cmpl   $0x0,-0xb8(%rbp)
setne  %cl
xor    $0xff,%cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
sar    %cl,%eax
mov    %eax,-0x108(%rbp)
mov    -0xa8(%rbp),%r8d
cmpl   $0x0,-0xb8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
sar    %cl,%r8d
mov    -0xac(%rbp),%r9d
cmpl   $0x0,-0xb8(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
sar    %cl,%r9d
mov    -0x108(%rbp),%ecx
mov    -0x68(%rbp),%rax
xor    %r10d,%r10d
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
call   1070 <ssim_plane@plt>
movslq -0xb8(%rbp),%rax
movsd  %xmm0,-0xf0(%rbp,%rax,8)
ff ff
movslq -0xb8(%rbp),%rax
mov    -0xd0(%rbp,%rax,8),%rcx
ff
movslq -0xb8(%rbp),%rax
add    -0x80(%rbp,%rax,8),%rcx
mov    %rcx,-0x80(%rbp,%rax,8)
movslq -0xb8(%rbp),%rax
movsd  -0xf0(%rbp,%rax,8),%xmm0
ff ff
movslq -0xb8(%rbp),%rax
addsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    14c9 <main+0x309>
mov    -0xb0(%rbp),%esi
lea    0x9f2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xd0(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    -0xa8(%rbp),%ecx
mov    -0xac(%rbp),%r8d
mov    $0x1,%edx
call   1050 <print_results@plt>
lea    0x9cb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2943(%rip),%rax
mov    (%rax),%edi
call   1090 <fflush@plt>
mov    -0xb0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb0(%rbp)
jmp    1473 <main+0x2b3>
cmpl   $0x0,-0xb0(%rbp)
jne    16c9 <main+0x509>
movl   $0x0,-0x4(%rbp)
jmp    1715 <main+0x555>
mov    -0xb0(%rbp),%esi
lea    0x98e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    -0xb0(%rbp),%edx
mov    -0xa8(%rbp),%ecx
mov    -0xac(%rbp),%r8d
call   1050 <print_results@plt>
lea    0x93a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
xorpd  %xmm0,%xmm0
movapd %xmm0,0x60(%rsp)
movq   $0x0,0x70(%rsp)
movapd %xmm0,0x20(%rsp)
movq   $0x0,0x30(%rsp)
cmp    $0x4,%edi
jl     1578 <main+0x3a8>
mov    %rsi,%r14
mov    %edi,%r15d
mov    0x18(%rsi),%rdi
lea    0xde3(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   10b0 <sscanf@plt>
cmp    $0x2,%eax
jne    1578 <main+0x3a8>
mov    0x8(%r14),%rdi
lea    0xdc6(%rip),%rbx
mov    %rbx,%rsi
call   10e0 <fopen@plt>
mov    %rax,0x38(%rsp)
mov    %rax,0xb0(%rsp)
mov    0x10(%r14),%rdi
mov    %rbx,%rsi
call   10e0 <fopen@plt>
mov    %rax,0xa8(%rsp)
mov    %rax,0xb8(%rsp)
mov    0x18(%r14),%rdi
lea    0xd84(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   10b0 <sscanf@plt>
movslq 0xc(%rsp),%r13
movslq 0x8(%rsp),%rcx
imul   %r13,%rcx
lea    (%rcx,%rcx,2),%eax
mov    %eax,%r12d
shr    $0x1f,%r12d
add    %eax,%r12d
sar    %r12d
lea    0x3(%rcx),%eax
test   %ecx,%ecx
mov    %rcx,0x18(%rsp)
cmovns %ecx,%eax
mov    %eax,0x10(%rsp)
mov    %r12d,%edi
call   1090 <malloc@plt>
mov    %rax,%rbp
mov    %r12d,%edi
call   1090 <malloc@plt>
mov    %rax,%rbx
lea    0x30(,%r13,8),%edi
call   1090 <malloc@plt>
mov    %rax,0xa0(%rsp)
xor    %eax,%eax
cmp    $0x5,%r15d
jb     12f6 <main+0x126>
mov    0x20(%r14),%rdi
call   10f0 <atoi@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
mov    0xb0(%rsp,%rcx,8),%rdi
mov    %eax,%esi
neg    %esi
cmovs  %eax,%esi
mov    0x2ccf(%rip),%rax
mov    (%rax),%edx
call   10c0 <fseek@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
mov    $0x1,%edx
mov    0x38(%rsp),%rcx
call   1050 <fread@plt>
cmp    $0x1,%eax
jne    15dc <main+0x40c>
mov    0x10(%rsp),%eax
sar    $0x2,%eax
cltq
mov    0x18(%rsp),%rdx
lea    0x0(,%rdx,4),%rcx
add    %rbp,%rcx
lea    (%rbx,%rdx,4),%rdx
mov    %rcx,0x18(%rsp)
lea    (%rcx,%rax,4),%rcx
mov    %rcx,0x90(%rsp)
mov    %rdx,0x10(%rsp)
lea    (%rdx,%rax,4),%rax
mov    %rax,0x80(%rsp)
xor    %r14d,%r14d
mov    %rbx,0x98(%rsp)
mov    %rbp,0x88(%rsp)
mov    0xa0(%rsp),%r13
mov    0x18(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r12d,%esi
mov    $0x1,%edx
mov    0xa8(%rsp),%rcx
call   1050 <fread@plt>
cmp    $0x1,%eax
jne    159d <main+0x3cd>
mov    0x8(%rsp),%edx
imul   0xc(%rsp),%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   10d0 <ssd_plane@plt>
mov    %rax,0x40(%rsp)
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r9d
mov    %rbp,%rdi
mov    %ecx,%esi
mov    %rbx,%rdx
mov    %ecx,%r8d
push   $0x0
push   %r13
call   1080 <ssim_plane@plt>
add    $0x10,%rsp
mov    0x40(%rsp),%rax
add    %rax,0x60(%rsp)
movsd  %xmm0,0xc0(%rsp)
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    0x8(%rsp),%edx
imul   0xc(%rsp),%edx
sar    $0x2,%edx
mov    %r15,%rdi
mov    %r12d,%ebp
mov    0x10(%rsp),%r12
mov    %r12,%rsi
call   10d0 <ssd_plane@plt>
mov    %rax,0x48(%rsp)
mov    0xc(%rsp),%ecx
sar    %ecx
mov    0x8(%rsp),%r9d
sar    %r9d
mov    %r15,%rdi
mov    %ecx,%esi
mov    %r12,%rdx
mov    %ebp,%r12d
mov    %ecx,%r8d
push   $0x0
push   %r13
call   1080 <ssim_plane@plt>
add    $0x10,%rsp
mov    0x48(%rsp),%rax
add    %rax,0x68(%rsp)
movsd  %xmm0,0xc8(%rsp)
addsd  0x28(%rsp),%xmm0
movsd  %xmm0,0x28(%rsp)
mov    0x8(%rsp),%edx
imul   0xc(%rsp),%edx
sar    $0x2,%edx
mov    0x90(%rsp),%rbp
mov    %rbp,%rdi
mov    0x80(%rsp),%rbx
mov    %rbx,%rsi
call   10d0 <ssd_plane@plt>
mov    %rax,0x50(%rsp)
mov    0xc(%rsp),%ecx
sar    %ecx
mov    0x8(%rsp),%r9d
sar    %r9d
mov    %rbp,%rdi
mov    %ecx,%esi
mov    %rbx,%rdx
mov    %ecx,%r8d
push   $0x0
push   %r13
mov    0x98(%rsp),%rbp
mov    0xa8(%rsp),%rbx
call   1080 <ssim_plane@plt>
add    $0x10,%rsp
mov    0x50(%rsp),%rax
add    %rax,0x70(%rsp)
movsd  %xmm0,0xd0(%rsp)
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
lea    0xafb(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
lea    0x40(%rsp),%rdi
lea    0xc0(%rsp),%rsi
mov    $0x1,%edx
call   1070 <print_results@plt>
lea    0xad6(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2a8b(%rip),%rax
mov    (%rax),%edi
call   10a0 <fflush@plt>
add    $0x1,%r14d
mov    %rbp,%rdi
mov    %r12d,%esi
mov    $0x1,%edx
mov    0x38(%rsp),%rcx
call   1050 <fread@plt>
cmp    $0x1,%eax
je     13a0 <main+0x1d0>
jmp    15a2 <main+0x3d2>
lea    0xabb(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %r14d,%r14d
je     15dc <main+0x40c>
lea    0xa7e(%rip),%rdi
xor    %ebx,%ebx
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
lea    0x60(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %r14d,%edx
call   1070 <print_results@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1589 <main+0x3b9>
xor    %ebx,%ebx
jmp    1589 <main+0x3b9>

LLVM IR (-O0):
@.str = [6 x i8] c"%dx%d\00"
@.str.1 = [61 x i8] c"tiny_ssim <file1.yuv> <file2.yuv> <width>x<height> [<seek>]\0A\00"
@.str.2 = [3 x i8] c"rb\00"
@SEEK_SET = global i32 0
@.str.3 = [12 x i8] c"Frame %d | \00"
@.str.4 = [18 x i8] c" \0D\00"
@stdout = global i32 0
@.str.5 = [19 x i8] c"Total %d frames | \00"
@.str.6 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32*]
%7 = alloca [2 x i32*]
%8 = alloca [2 x [3 x i32*]]
%9 = alloca i32*
%10 = alloca [3 x i64]
%11 = alloca [3 x double]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [3 x i64]
%19 = alloca [3 x double]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = bitcast [3 x i64]* %10 to i8*
%21 = bitcast [3 x double]* %11 to i8*
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 4
br i1 %23, label %30, label %24
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 3
%27 = load i8*, i8** %26
%28 = call i32 @sscanf(i8* %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %13, i32* %14)
%29 = icmp ne i32 2, %28
br i1 %29, label %30, label %32
30: ; preds = %24, %2
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %277
32: ; preds = %24
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32* @fopen(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%37 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 0
store i32* %36, i32** %37
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32* @fopen(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%42 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 1
store i32* %41, i32** %42
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 3
%45 = load i8*, i8** %44
%46 = call i32 @sscanf(i8* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %13, i32* %14)
%47 = load i32, i32* %13
%48 = load i32, i32* %14
%49 = mul nsw i32 %47, %48
%50 = mul nsw i32 %49, 3
%51 = sdiv i32 %50, 2
store i32 %51, i32* %12
store i32 0, i32* %17
br label %52
52: ; preds = %99, %32
%53 = load i32, i32* %17
%54 = icmp slt i32 %53, 2
br i1 %54, label %55, label %102
55: ; preds = %52
%56 = load i32, i32* %12
%57 = call i8* @malloc(i32 %56)
%58 = bitcast i8* %57 to i32*
%59 = load i32, i32* %17
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [2 x i32*], [2 x i32*]* %7, i64 0, i64 %60
store i32* %58, i32** %61
%62 = load i32, i32* %17
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [2 x i32*], [2 x i32*]* %7, i64 0, i64 %63
%65 = load i32*, i32** %64
%66 = load i32, i32* %17
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [2 x [3 x i32*]], [2 x [3 x i32*]]* %8, i64 0, i64 %67
%69 = getelementptr inbounds [3 x i32*], [3 x i32*]* %68, i64 0, i64 0
store i32* %65, i32** %69
%70 = load i32, i32* %17
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [2 x [3 x i32*]], [2 x [3 x i32*]]* %8, i64 0, i64 %71
%73 = getelementptr inbounds [3 x i32*], [3 x i32*]* %72, i64 0, i64 0
%74 = load i32*, i32** %73
%75 = load i32, i32* %13
%76 = load i32, i32* %14
%77 = mul nsw i32 %75, %76
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i32, i32* %74, i64 %78
%80 = load i32, i32* %17
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [2 x [3 x i32*]], [2 x [3 x i32*]]* %8, i64 0, i64 %81
%83 = getelementptr inbounds [3 x i32*], [3 x i32*]* %82, i64 0, i64 1
store i32* %79, i32** %83
%84 = load i32, i32* %17
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [2 x [3 x i32*]], [2 x [3 x i32*]]* %8, i64 0, i64 %85
%87 = getelementptr inbounds [3 x i32*], [3 x i32*]* %86, i64 0, i64 1
%88 = load i32*, i32** %87
%89 = load i32, i32* %13
%90 = load i32, i32* %14
%91 = mul nsw i32 %89, %90
%92 = sdiv i32 %91, 4
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i32, i32* %88, i64 %93
%95 = load i32, i32* %17
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [2 x [3 x i32*]], [2 x [3 x i32*]]* %8, i64 0, i64 %96
%98 = getelementptr inbounds [3 x i32*], [3 x i32*]* %97, i64 0, i64 2
store i32* %94, i32** %98
br label %99
99: ; preds = %55
%100 = load i32, i32* %17
%101 = add nsw i32 %100, 1
store i32 %101, i32* %17
br label %52
102: ; preds = %52
%103 = load i32, i32* %13
%104 = mul nsw i32 2, %103
%105 = add nsw i32 %104, 12
%106 = sext i32 %105 to i64
%107 = mul i64 %106, 4
%108 = trunc i64 %107 to i32
%109 = call i8* @malloc(i32 %108)
%110 = bitcast i8* %109 to i32*
store i32* %110, i32** %9
%111 = load i32, i32* %4
%112 = icmp slt i32 %111, 5
br i1 %112, label %113, label %114
113: ; preds = %102
br label %119
114: ; preds = %102
%115 = load i8**, i8*** %5
%116 = getelementptr inbounds i8*, i8** %115, i64 4
%117 = load i8*, i8** %116
%118 = call i32 @atoi(i8* %117)
br label %119
119: ; preds = %114, %113
%120 = phi i32 [ 0, %113 ], [ %118, %114 ]
store i32 %120, i32* %16
%121 = load i32, i32* %16
%122 = icmp slt i32 %121, 0
%123 = zext i1 %122 to i32
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 %124
%126 = load i32*, i32** %125
%127 = load i32, i32* %16
%128 = icmp slt i32 %127, 0
br i1 %128, label %129, label %132
129: ; preds = %119
%130 = load i32, i32* %16
%131 = sub nsw i32 0, %130
br label %134
132: ; preds = %119
%133 = load i32, i32* %16
br label %134
134: ; preds = %132, %129
%135 = phi i32 [ %131, %129 ], [ %133, %132 ]
%136 = load i32, i32* @SEEK_SET
%137 = call i32 @fseek(i32* %126, i32 %135, i32 %136)
store i32 0, i32* %15
br label %138
138: ; preds = %260, %134
%139 = getelementptr inbounds [2 x i32*], [2 x i32*]* %7, i64 0, i64 0
%140 = load i32*, i32** %139
%141 = load i32, i32* %12
%142 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 0
%143 = load i32*, i32** %142
%144 = call i32 @fread(i32* %140, i32 %141, i32 1, i32* %143)
%145 = icmp ne i32 %144, 1
br i1 %145, label %146, label %147
146: ; preds = %138
br label %263
147: ; preds = %138
%148 = getelementptr inbounds [2 x i32*], [2 x i32*]* %7, i64 0, i64 1
%149 = load i32*, i32** %148
%150 = load i32, i32* %12
%151 = getelementptr inbounds [2 x i32*], [2 x i32*]* %6, i64 0, i64 1
%152 = load i32*, i32** %151
%153 = call i32 @fread(i32* %149, i32 %150, i32 1, i32* %152)
%154 = icmp ne i32 %153, 1
br i1 %154, label %155, label %156
155: ; preds = %147
br label %263
156: ; preds = %147
store i32 0, i32* %17
br label %157
157: ; preds = %246, %156
%158 = load i32, i32* %17
%159 = icmp slt i32 %158, 3
br i1 %159, label %160, label %249
160: ; preds = %157
%161 = getelementptr inbounds [2 x [3 x i32*]], [2 x [3 x i32*]]* %8, i64 0, i64 0
%162 = load i32, i32* %17
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds [3 x i32*], [3 x i32*]* %161, i64 0, i64 %163
%165 = load i32*, i32** %164
%166 = getelementptr inbounds [2 x [3 x i32*]], [2 x [3 x i32*]]* %8, i64 0, i64 1
%167 = load i32, i32* %17
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [3 x i32*], [3 x i32*]* %166, i64 0, i64 %168
%170 = load i32*, i32** %169
%171 = load i32, i32* %13
%172 = load i32, i32* %14
%173 = mul nsw i32 %171, %172
%174 = load i32, i32* %17
%175 = icmp ne i32 %174, 0
%176 = xor i1 %175, true
%177 = xor i1 %176, true
%178 = zext i1 %177 to i32
%179 = mul nsw i32 2, %178
%180 = ashr i32 %173, %179
%181 = call i64 @ssd_plane(i32* %165, i32* %170, i32 %180)
%182 = load i32, i32* %17
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds [3 x i64], [3 x i64]* %18, i64 0, i64 %183
store i64 %181, i64* %184
%185 = getelementptr inbounds [2 x [3 x i32*]], [2 x [3 x i32*]]* %8, i64 0, i64 0
%186 = load i32, i32* %17
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [3 x i32*], [3 x i32*]* %185, i64 0, i64 %187
%189 = load i32*, i32** %188
%190 = load i32, i32* %13
%191 = load i32, i32* %17
%192 = icmp ne i32 %191, 0
%193 = xor i1 %192, true
%194 = xor i1 %193, true
%195 = zext i1 %194 to i32
%196 = ashr i32 %190, %195
%197 = getelementptr inbounds [2 x [3 x i32*]], [2 x [3 x i32*]]* %8, i64 0, i64 1
%198 = load i32, i32* %17
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds [3 x i32*], [3 x i32*]* %197, i64 0, i64 %199
%201 = load i32*, i32** %200
%202 = load i32, i32* %13
%203 = load i32, i32* %17
%204 = icmp ne i32 %203, 0
%205 = xor i1 %204, true
%206 = xor i1 %205, true
%207 = zext i1 %206 to i32
%208 = ashr i32 %202, %207
%209 = load i32, i32* %13
%210 = load i32, i32* %17
%211 = icmp ne i32 %210, 0
%212 = xor i1 %211, true
%213 = xor i1 %212, true
%214 = zext i1 %213 to i32
%215 = ashr i32 %209, %214
%216 = load i32, i32* %14
%217 = load i32, i32* %17
%218 = icmp ne i32 %217, 0
%219 = xor i1 %218, true
%220 = xor i1 %219, true
%221 = zext i1 %220 to i32
%222 = ashr i32 %216, %221
%223 = load i32*, i32** %9
%224 = call double @ssim_plane(i32* %189, i32 %196, i32* %201, i32 %208, i32 %215, i32 %222, i32* %223, i32* null)
%225 = load i32, i32* %17
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 %226
store double %224, double* %227
%228 = load i32, i32* %17
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds [3 x i64], [3 x i64]* %18, i64 0, i64 %229
%231 = load i64, i64* %230
%232 = load i32, i32* %17
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds [3 x i64], [3 x i64]* %10, i64 0, i64 %233
%235 = load i64, i64* %234
%236 = add nsw i64 %235, %231
store i64 %236, i64* %234
%237 = load i32, i32* %17
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 %238
%240 = load double, double* %239
%241 = load i32, i32* %17
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 %242
%244 = load double, double* %243
%245 = fadd double %244, %240
store double %245, double* %243
br label %246
246: ; preds = %160
%247 = load i32, i32* %17
%248 = add nsw i32 %247, 1
store i32 %248, i32* %17
br label %157
249: ; preds = %157
%250 = load i32, i32* %15
%251 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %250)
%252 = getelementptr inbounds [3 x i64], [3 x i64]* %18, i64 0, i64 0
%253 = getelementptr inbounds [3 x double], [3 x double]* %19, i64 0, i64 0
%254 = load i32, i32* %13
%255 = load i32, i32* %14
%256 = call i32 @print_results(i64* %252, double* %253, i32 1, i32 %254, i32 %255)
%257 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%258 = load i32, i32* @stdout
%259 = call i32 @fflush(i32 %258)
br label %260
260: ; preds = %249
%261 = load i32, i32* %15
%262 = add nsw i32 %261, 1
store i32 %262, i32* %15
br label %138
263: ; preds = %155, %146
%264 = load i32, i32* %15
%265 = icmp ne i32 %264, 0
br i1 %265, label %267, label %266
266: ; preds = %263
store i32 0, i32* %3
br label %277
267: ; preds = %263
%268 = load i32, i32* %15
%269 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %268)
%270 = getelementptr inbounds [3 x i64], [3 x i64]* %10, i64 0, i64 0
%271 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0, i64 0
%272 = load i32, i32* %15
%273 = load i32, i32* %13
%274 = load i32, i32* %14
%275 = call i32 @print_results(i64* %270, double* %271, i32 %272, i32 %273, i32 %274)
%276 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %3
br label %277
277: ; preds = %267, %266, %30
%278 = load i32, i32* %3
ret i32 %278
}

LLVM IR (-O2):
@.str = [6 x i8] c"%dx%d\00"
@.str.2 = [3 x i8] c"rb\00"
@SEEK_SET = global i32 0
@.str.3 = [12 x i8] c"Frame %d | \00"
@.str.4 = [18 x i8] c" \0D\00"
@stdout = global i32 0
@.str.5 = [19 x i8] c"Total %d frames | \00"
@str = [60 x i8] c"tiny_ssim <file1.yuv> <file2.yuv> <width>x<height> [<seek>]\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i32*]
%4 = alloca [3 x i64]
%5 = alloca [3 x double]
%6 = alloca i32
%7 = alloca i32
%8 = alloca [3 x i64]
%9 = alloca [3 x double]
%10 = bitcast [2 x i32*]* %3 to i8*
%11 = bitcast [3 x i64]* %4 to i8*
%12 = bitcast [3 x double]* %5 to i8*
%13 = bitcast i32* %6 to i8*
%14 = bitcast i32* %7 to i8*
%15 = icmp slt i32 %0, 4
br i1 %15, label %21, label %16
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 3
%18 = load i8*, i8** %17
%19 = call i32 @sscanf(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%20 = icmp eq i32 %19, 2
br i1 %20, label %23, label %21
21: ; preds = %16, %2
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
br label %155
23: ; preds = %16
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = call i32* @fopen(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%27 = getelementptr inbounds [2 x i32*], [2 x i32*]* %3, i64 0, i64 0
store i32* %26, i32** %27
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%31 = getelementptr inbounds [2 x i32*], [2 x i32*]* %3, i64 0, i64 1
store i32* %30, i32** %31
%32 = load i8*, i8** %17
%33 = call i32 @sscanf(i8* %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%34 = load i32, i32* %6
%35 = load i32, i32* %7
%36 = mul nsw i32 %35, %34
%37 = mul nsw i32 %36, 3
%38 = sdiv i32 %37, 2
%39 = sext i32 %36 to i64
%40 = sdiv i32 %36, 4
%41 = sext i32 %40 to i64
%42 = call i8* @malloc(i32 %38)
%43 = bitcast i8* %42 to i32*
%44 = getelementptr inbounds i32, i32* %43, i64 %39
%45 = getelementptr inbounds i32, i32* %44, i64 %41
%46 = call i8* @malloc(i32 %38)
%47 = bitcast i8* %46 to i32*
%48 = getelementptr inbounds i32, i32* %47, i64 %39
%49 = getelementptr inbounds i32, i32* %48, i64 %41
%50 = shl i32 %34, 3
%51 = add i32 %50, 48
%52 = call i8* @malloc(i32 %51)
%53 = bitcast i8* %52 to i32*
%54 = icmp ult i32 %0, 5
br i1 %54, label %59, label %55
55: ; preds = %23
%56 = getelementptr inbounds i8*, i8** %1, i64 4
%57 = load i8*, i8** %56
%58 = call i32 @atoi(i8* %57)
br label %59
59: ; preds = %23, %55
%60 = phi i32 [ %58, %55 ], [ 0, %23 ]
%61 = lshr i32 %60, 31
%62 = zext i32 %61 to i64
%63 = getelementptr inbounds [2 x i32*], [2 x i32*]* %3, i64 0, i64 %62
%64 = load i32*, i32** %63
%65 = call i32 @llvm.abs.i32(i32 %60, i1 true)
%66 = load i32, i32* @SEEK_SET
%67 = call i32 @fseek(i32* %64, i32 %65, i32 %66)
%68 = bitcast [3 x i64]* %8 to i8*
%69 = bitcast [3 x double]* %9 to i8*
%70 = call i32 @fread(i32* %43, i32 %38, i32 1, i32* %26)
%71 = icmp eq i32 %70, 1
br i1 %71, label %73, label %72
72: ; preds = %59
br label %155
73: ; preds = %59
%74 = getelementptr inbounds [3 x i64], [3 x i64]* %8, i64 0, i64 0
%75 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 0
%76 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
%77 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%78 = getelementptr inbounds [3 x i64], [3 x i64]* %8, i64 0, i64 1
%79 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 1
%80 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 1
%81 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
%82 = getelementptr inbounds [3 x i64], [3 x i64]* %8, i64 0, i64 2
%83 = getelementptr inbounds [3 x double], [3 x double]* %9, i64 0, i64 2
%84 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 2
%85 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 2
br label %86
86: ; preds = %73, %90
%87 = phi i32 [ 0, %73 ], [ %140, %90 ]
%88 = call i32 @fread(i32* %47, i32 %38, i32 1, i32* %30)
%89 = icmp eq i32 %88, 1
br i1 %89, label %90, label %144
90: ; preds = %86
%91 = load i32, i32* %6
%92 = load i32, i32* %7
%93 = mul nsw i32 %92, %91
%94 = call i64 @ssd_plane(i32* %43, i32* %47, i32 %93)
store i64 %94, i64* %74
%95 = load i32, i32* %6
%96 = load i32, i32* %7
%97 = call double @ssim_plane(i32* %43, i32 %95, i32* %47, i32 %95, i32 %95, i32 %96, i32* %53, i32* null)
store double %97, double* %75
%98 = load i64, i64* %74
%99 = load i64, i64* %76
%100 = add nsw i64 %99, %98
store i64 %100, i64* %76
%101 = load double, double* %77
%102 = fadd double %97, %101
store double %102, double* %77
%103 = load i32, i32* %6
%104 = load i32, i32* %7
%105 = mul nsw i32 %104, %103
%106 = ashr i32 %105, 2
%107 = call i64 @ssd_plane(i32* %44, i32* %48, i32 %106)
store i64 %107, i64* %78
%108 = load i32, i32* %6
%109 = ashr i32 %108, 1
%110 = load i32, i32* %7
%111 = ashr i32 %110, 1
%112 = call double @ssim_plane(i32* %44, i32 %109, i32* %48, i32 %109, i32 %109, i32 %111, i32* %53, i32* null)
store double %112, double* %79
%113 = load i64, i64* %78
%114 = load i64, i64* %80
%115 = add nsw i64 %114, %113
store i64 %115, i64* %80
%116 = load double, double* %81
%117 = fadd double %112, %116
store double %117, double* %81
%118 = load i32, i32* %6
%119 = load i32, i32* %7
%120 = mul nsw i32 %119, %118
%121 = ashr i32 %120, 2
%122 = call i64 @ssd_plane(i32* %45, i32* %49, i32 %121)
store i64 %122, i64* %82
%123 = load i32, i32* %6
%124 = ashr i32 %123, 1
%125 = load i32, i32* %7
%126 = ashr i32 %125, 1
%127 = call double @ssim_plane(i32* %45, i32 %124, i32* %49, i32 %124, i32 %124, i32 %126, i32* %53, i32* null)
store double %127, double* %83
%128 = load i64, i64* %82
%129 = load i64, i64* %84
%130 = add nsw i64 %129, %128
store i64 %130, i64* %84
%131 = load double, double* %85
%132 = fadd double %127, %131
store double %132, double* %85
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %87)
%134 = load i32, i32* %6
%135 = load i32, i32* %7
%136 = call i32 @print_results(i64* %74, double* %75, i32 1, i32 %134, i32 %135)
%137 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%138 = load i32, i32* @stdout
%139 = call i32 @fflush(i32 %138)
%140 = add nuw nsw i32 %87, 1
%141 = call i32 @fread(i32* %43, i32 %38, i32 1, i32* %26)
%142 = icmp eq i32 %141, 1
br i1 %142, label %86, label %143
143: ; preds = %90
br label %146
144: ; preds = %86
%145 = icmp eq i32 %87, 0
br i1 %145, label %155, label %146
146: ; preds = %143, %144
%147 = phi i32 [ %140, %143 ], [ %87, %144 ]
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %147)
%149 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
%150 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%151 = load i32, i32* %6
%152 = load i32, i32* %7
%153 = call i32 @print_results(i64* %149, double* %150, i32 %147, i32 %151, i32 %152)
%154 = call i32 @putchar(i32 10)
br label %155
155: ; preds = %72, %144, %146, %21
%156 = phi i32 [ -1, %21 ], [ 0, %146 ], [ 0, %144 ], [ 0, %72 ]
ret i32 %156
}