#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 Subzero_simple_loop(int *, int);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int);
int simple_loop(int *, int);
int main(int argc, char *argv[]) {
  unsigned TotalTests = 0;
  unsigned Passes = 0;
  unsigned Failures = 0;
  int a[100];
  for (int i = 0; i < 100; ++i)
    a[i] = i * 2 - 100;
  for (int i = -2; i < 100; ++i) {
    ++TotalTests;
    int llc_result = simple_loop(a, i);
    int sz_result = Subzero_simple_loop(a, i);
    if (llc_result == sz_result) {
      ++Passes;
    } else {
      ++Failures;
      printf("Failure: i=%d, llc=%d, sz=%d\n", i, llc_result, sz_result);
    }
  }
  printf("TotalTests=%u Passes=%u Failures=%u\n", TotalTests, Passes, Failures);
  return Failures;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1b4(%rbp)
cmpl   $0x64,-0x1b4(%rbp)
jge    11a3 <main+0x73>
mov    -0x1b4(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x64,%ecx
movslq -0x1b4(%rbp),%rax
mov    %ecx,-0x1b0(%rbp,%rax,4)
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    1168 <main+0x38>
movl   $0xfffffffe,-0x1b8(%rbp)
ff ff ff
cmpl   $0x64,-0x1b8(%rbp)
jge    1253 <main+0x123>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    -0x1b0(%rbp),%rdi
mov    -0x1b8(%rbp),%esi
call   1050 <simple_loop@plt>
mov    %eax,-0x1bc(%rbp)
lea    -0x1b0(%rbp),%rdi
mov    -0x1b8(%rbp),%esi
call   1040 <Subzero_simple_loop@plt>
mov    %eax,-0x1c0(%rbp)
mov    -0x1bc(%rbp),%eax
cmp    -0x1c0(%rbp),%eax
jne    1213 <main+0xe3>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    123a <main+0x10a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1b8(%rbp),%esi
mov    -0x1bc(%rbp),%edx
mov    -0x1c0(%rbp),%ecx
lea    0xdcb(%rip),%rdi
call   1030 <printf@plt>
jmp    123f <main+0x10f>
mov    -0x1b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b8(%rbp)
jmp    11ad <main+0x7d>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xdbb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xedc(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xedf(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xee0(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movaps 0xee6(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movaps 0xee7(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
mov    $0xfffffffe,%ebx
xor    %r14d,%r14d
mov    %rsp,%r13
lea    0xedf(%rip),%r12
xor    %r15d,%r15d
jmp    12da <main+0x1aa>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r15d
mov    %r12,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
je     12fa <main+0x1ca>
mov    %r13,%rdi
mov    %ebx,%esi
call   1050 <simple_loop@plt>
mov    %eax,%ebp
mov    %r13,%rdi
mov    %ebx,%esi
call   1040 <Subzero_simple_loop@plt>
cmp    %eax,%ebp
jne    12c0 <main+0x190>
add    $0x1,%r14d
jmp    12d2 <main+0x1a2>
lea    0xead(%rip),%rdi
mov    $0x66,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
call   1030 <printf@plt>
mov    %r15d,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Failure: i=%d, llc=%d, sz=%d\0A\00"
@.str.1 = [37 x i8] c"TotalTests=%u Passes=%u Failures=%u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [100 x i32]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %10
br label %14
14: ; preds = %24, %2
%15 = load i32, i32* %10
%16 = icmp slt i32 %15, 100
br i1 %16, label %17, label %27
17: ; preds = %14
%18 = load i32, i32* %10
%19 = mul nsw i32 %18, 2
%20 = sub nsw i32 %19, 100
%21 = load i32, i32* %10
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [100 x i32], [100 x i32]* %9, i64 0, i64 %22
store i32 %20, i32* %23
br label %24
24: ; preds = %17
%25 = load i32, i32* %10
%26 = add nsw i32 %25, 1
store i32 %26, i32* %10
br label %14
27: ; preds = %14
store i32 -2, i32* %11
br label %28
28: ; preds = %54, %27
%29 = load i32, i32* %11
%30 = icmp slt i32 %29, 100
br i1 %30, label %31, label %57
31: ; preds = %28
%32 = load i32, i32* %6
%33 = add i32 %32, 1
store i32 %33, i32* %6
%34 = getelementptr inbounds [100 x i32], [100 x i32]* %9, i64 0, i64 0
%35 = load i32, i32* %11
%36 = call i32 @simple_loop(i32* %34, i32 %35)
store i32 %36, i32* %12
%37 = getelementptr inbounds [100 x i32], [100 x i32]* %9, i64 0, i64 0
%38 = load i32, i32* %11
%39 = call i32 @Subzero_simple_loop(i32* %37, i32 %38)
store i32 %39, i32* %13
%40 = load i32, i32* %12
%41 = load i32, i32* %13
%42 = icmp eq i32 %40, %41
br i1 %42, label %43, label %46
43: ; preds = %31
%44 = load i32, i32* %7
%45 = add i32 %44, 1
store i32 %45, i32* %7
br label %53
46: ; preds = %31
%47 = load i32, i32* %8
%48 = add i32 %47, 1
store i32 %48, i32* %8
%49 = load i32, i32* %11
%50 = load i32, i32* %12
%51 = load i32, i32* %13
%52 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %49, i32 %50, i32 %51)
br label %53
53: ; preds = %46, %43
br label %54
54: ; preds = %53
%55 = load i32, i32* %11
%56 = add nsw i32 %55, 1
store i32 %56, i32* %11
br label %28
57: ; preds = %28
%58 = load i32, i32* %6
%59 = load i32, i32* %7
%60 = load i32, i32* %8
%61 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %58, i32 %59, i32 %60)
%62 = load i32, i32* %8
ret i32 %62
}

LLVM IR (-O2):
@.str = [30 x i8] c"Failure: i=%d, llc=%d, sz=%d\0A\00"
@.str.1 = [37 x i8] c"TotalTests=%u Passes=%u Failures=%u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i32]
%4 = bitcast [100 x i32]* %3 to i8*
%5 = bitcast [100 x i32]* %3 to <4 x i32>*
store <4 x i32> <i32 -100, i32 -98, i32 -96, i32 -94>, <4 x i32>* %5
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 -92, i32 -90, i32 -88, i32 -86>, <4 x i32>* %7
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 8
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 -84, i32 -82, i32 -80, i32 -78>, <4 x i32>* %9
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 12
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 -76, i32 -74, i32 -72, i32 -70>, <4 x i32>* %11
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 16
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 -68, i32 -66, i32 -64, i32 -62>, <4 x i32>* %13
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 20
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 -60, i32 -58, i32 -56, i32 -54>, <4 x i32>* %15
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 24
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 -52, i32 -50, i32 -48, i32 -46>, <4 x i32>* %17
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 28
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 -44, i32 -42, i32 -40, i32 -38>, <4 x i32>* %19
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 32
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 -36, i32 -34, i32 -32, i32 -30>, <4 x i32>* %21
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 36
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 -28, i32 -26, i32 -24, i32 -22>, <4 x i32>* %23
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 40
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 -20, i32 -18, i32 -16, i32 -14>, <4 x i32>* %25
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 44
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 -12, i32 -10, i32 -8, i32 -6>, <4 x i32>* %27
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 48
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 -4, i32 -2, i32 0, i32 2>, <4 x i32>* %29
%30 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 52
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 4, i32 6, i32 8, i32 10>, <4 x i32>* %31
%32 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 56
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 12, i32 14, i32 16, i32 18>, <4 x i32>* %33
%34 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 60
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> <i32 20, i32 22, i32 24, i32 26>, <4 x i32>* %35
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 64
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 28, i32 30, i32 32, i32 34>, <4 x i32>* %37
%38 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 68
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 36, i32 38, i32 40, i32 42>, <4 x i32>* %39
%40 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 72
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 44, i32 46, i32 48, i32 50>, <4 x i32>* %41
%42 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 76
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 52, i32 54, i32 56, i32 58>, <4 x i32>* %43
%44 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 80
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> <i32 60, i32 62, i32 64, i32 66>, <4 x i32>* %45
%46 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 84
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> <i32 68, i32 70, i32 72, i32 74>, <4 x i32>* %47
%48 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 88
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> <i32 76, i32 78, i32 80, i32 82>, <4 x i32>* %49
%50 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 92
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> <i32 84, i32 86, i32 88, i32 90>, <4 x i32>* %51
%52 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 96
%53 = bitcast i32* %52 to <4 x i32>*
store <4 x i32> <i32 92, i32 94, i32 96, i32 98>, <4 x i32>* %53
%54 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
br label %57
55: ; preds = %69
%56 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 102, i32 %71, i32 %70)
ret i32 %70
57: ; preds = %2, %69
%58 = phi i32 [ 0, %2 ], [ %71, %69 ]
%59 = phi i32 [ -2, %2 ], [ %72, %69 ]
%60 = phi i32 [ 0, %2 ], [ %70, %69 ]
%61 = call i32 @simple_loop(i32* %54, i32 %59)
%62 = call i32 @Subzero_simple_loop(i32* %54, i32 %59)
%63 = icmp eq i32 %61, %62
br i1 %63, label %64, label %66
64: ; preds = %57
%65 = add i32 %58, 1
br label %69
66: ; preds = %57
%67 = add i32 %60, 1
%68 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %59, i32 %61, i32 %62)
br label %69
69: ; preds = %66, %64
%70 = phi i32 [ %60, %64 ], [ %67, %66 ]
%71 = phi i32 [ %65, %64 ], [ %58, %66 ]
%72 = add nsw i32 %59, 1
%73 = icmp eq i32 %72, 100
br i1 %73, label %55, label %57
}