#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 /*<<< orphan*/ hash(int);
void test() {
  int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14;
  for (i0 = 1; i0 <= 10000; i0++) {
    for (i1 = 1000; i1 <= 1016; i1++) {
      for (i2 = 1; i2 <= ((-2 * i1 + 2033) < (2 * i1 - 1999) ? (-2 * i1 + 2033)
                                                             : (2 * i1 - 1999));
           i2++) {
        if (2 * i1 == i2 + 1999) {
          {
            hash(2);
            hash(i0);
            hash(i1);
            hash(i2);
            hash(1);
            hash(i0);
            hash(2 * i1 - 1000);
            hash(1);
            hash(2);
            hash(i0);
            hash(i1 - 499);
            hash(2 * i1 - 1999);
            hash(i0);
            hash(2 * i1 - 1999);
            hash(i1 - 999);
            hash(i1 - 999);
          };
        }
        if (i2 == 1) {
          if (i1 % 2 == 0) {
            {
              hash(1);
              hash(i0);
              hash(i1);
              hash(i2);
              hash(2);
              hash(i0);
              hash((i1 + 2) / 2);
              hash(i1 - 999);
              hash(i0);
              hash(i1 - 999);
              hash((i1 - 998) / 2);
              hash((i1 - 998) / 2);
            };
          }
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jg     1360 <test+0x250>
movl   $0x3e8,-0x8(%rbp)
cmpl   $0x3f8,-0x8(%rbp)
jg     134d <test+0x23d>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
imul   $0xfffffffe,-0x8(%rbp),%eax
add    $0x7f1,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x7cf,%ecx
cmp    %ecx,%eax
jge    1181 <test+0x71>
imul   $0xfffffffe,-0x8(%rbp),%eax
add    $0x7f1,%eax
mov    %eax,-0x44(%rbp)
jmp    118f <test+0x7f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
sub    $0x7cf,%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x44(%rbp),%ecx
cmp    %ecx,%eax
jg     133a <test+0x22a>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
add    $0x7cf,%ecx
cmp    %ecx,%eax
jne    1269 <test+0x159>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
shl    $0x1,%edi
sub    $0x3e8,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
sub    $0x1f3,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
shl    $0x1,%edi
sub    $0x7cf,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
shl    $0x1,%edi
sub    $0x7cf,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
sub    $0x3e7,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
sub    $0x3e7,%edi
call   1030 <hash@plt>
cmpl   $0x1,-0xc(%rbp)
jne    1327 <test+0x217>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1322 <test+0x212>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0xc(%rbp),%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
sub    $0x3e7,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
sub    $0x3e7,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%eax
sub    $0x3e6,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%eax
sub    $0x3e6,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
jmp    1327 <test+0x217>
jmp    132c <test+0x21c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <test+0x37>
jmp    133f <test+0x22f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <test+0x23>
jmp    1352 <test+0x242>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test+0xf>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x1,%r14d
jmp    1141 <test+0x31>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    $0x2711,%r14d
je     1340 <test+0x230>
mov    $0x3e8,%ebx
mov    $0x21,%eax
xor    %ecx,%ecx
mov    %rcx,0x8(%rsp)
mov    $0x1,%edx
jmp    1186 <test+0x76>
nopl   0x0(%rax)
add    $0x1,%ebx
mov    0x14(%rsp),%eax
add    $0xfffffffe,%eax
mov    0x10(%rsp),%edx
add    $0x2,%edx
mov    0x8(%rsp),%rcx
add    $0xfffffffe,%ecx
mov    %rcx,0x8(%rsp)
cmp    $0x3f9,%ebx
je     1130 <test+0x20>
cmp    %edx,%eax
mov    %edx,0x10(%rsp)
mov    %edx,%ebp
mov    %eax,0x14(%rsp)
cmovl  %eax,%ebp
lea    (%rbx,%rbx,1),%ecx
mov    $0x7f1,%eax
mov    %ecx,0x4(%rsp)
sub    %ecx,%eax
lea    (%rbx,%rbx,1),%ecx
add    $0xfffff831,%ecx
cmp    %ecx,%eax
mov    %ecx,0x24(%rsp)
cmovae %ecx,%eax
test   %eax,%eax
jle    1160 <test+0x50>
neg    %ebp
addl   $0xfffffc18,0x4(%rsp)
ff
lea    -0x1f3(%rbx),%eax
mov    %eax,0x20(%rsp)
lea    -0x3e7(%rbx),%r15d
lea    0x2(%rbx),%eax
shr    %eax
mov    %eax,0x1c(%rsp)
lea    -0x3e6(%rbx),%eax
shr    %eax
mov    %eax,0x18(%rsp)
mov    $0x1,%r12d
jmp    1219 <test+0x109>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%r12,%rbp,1),%eax
add    $0x1,%eax
mov    %r12d,%ecx
add    $0x1,%ecx
mov    %ecx,%r12d
cmp    $0x1,%eax
je     1160 <test+0x50>
mov    0x8(%rsp),%rax
add    %r12d,%eax
cmp    $0x1,%eax
jne    12b8 <test+0x1a8>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    %r12d,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
mov    0x4(%rsp),%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
mov    0x20(%rsp),%edi
call   1030 <hash@plt>
mov    0x24(%rsp),%r13d
mov    %r13d,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
mov    %r13d,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
cmp    $0x1,%r12d
jne    1200 <test+0xf0>
mov    %ebx,%eax
and    $0x1,%eax
jne    1200 <test+0xf0>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x2,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
mov    0x1c(%rsp),%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %r14d,%edi
call   1030 <hash@plt>
mov    %r15d,%edi
call   1030 <hash@plt>
mov    %rbx,%r13
mov    0x18(%rsp),%ebx
mov    %ebx,%edi
call   1030 <hash@plt>
mov    %ebx,%edi
mov    %r13,%rbx
call   1030 <hash@plt>
jmp    1200 <test+0xf0>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 1, i32* %1
br label %16
16: ; preds = %136, %0
%17 = load i32, i32* %1
%18 = icmp sle i32 %17, 10000
br i1 %18, label %19, label %139
19: ; preds = %16
store i32 1000, i32* %2
br label %20
20: ; preds = %132, %19
%21 = load i32, i32* %2
%22 = icmp sle i32 %21, 1016
br i1 %22, label %23, label %135
23: ; preds = %20
store i32 1, i32* %3
br label %24
24: ; preds = %128, %23
%25 = load i32, i32* %3
%26 = load i32, i32* %2
%27 = mul nsw i32 -2, %26
%28 = add nsw i32 %27, 2033
%29 = load i32, i32* %2
%30 = mul nsw i32 2, %29
%31 = sub nsw i32 %30, 1999
%32 = icmp slt i32 %28, %31
br i1 %32, label %33, label %37
33: ; preds = %24
%34 = load i32, i32* %2
%35 = mul nsw i32 -2, %34
%36 = add nsw i32 %35, 2033
br label %41
37: ; preds = %24
%38 = load i32, i32* %2
%39 = mul nsw i32 2, %38
%40 = sub nsw i32 %39, 1999
br label %41
41: ; preds = %37, %33
%42 = phi i32 [ %36, %33 ], [ %40, %37 ]
%43 = icmp sle i32 %25, %42
br i1 %43, label %44, label %131
44: ; preds = %41
%45 = load i32, i32* %2
%46 = mul nsw i32 2, %45
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1999
%49 = icmp eq i32 %46, %48
br i1 %49, label %50, label %88
50: ; preds = %44
%51 = call i32 @hash(i32 2)
%52 = load i32, i32* %1
%53 = call i32 @hash(i32 %52)
%54 = load i32, i32* %2
%55 = call i32 @hash(i32 %54)
%56 = load i32, i32* %3
%57 = call i32 @hash(i32 %56)
%58 = call i32 @hash(i32 1)
%59 = load i32, i32* %1
%60 = call i32 @hash(i32 %59)
%61 = load i32, i32* %2
%62 = mul nsw i32 2, %61
%63 = sub nsw i32 %62, 1000
%64 = call i32 @hash(i32 %63)
%65 = call i32 @hash(i32 1)
%66 = call i32 @hash(i32 2)
%67 = load i32, i32* %1
%68 = call i32 @hash(i32 %67)
%69 = load i32, i32* %2
%70 = sub nsw i32 %69, 499
%71 = call i32 @hash(i32 %70)
%72 = load i32, i32* %2
%73 = mul nsw i32 2, %72
%74 = sub nsw i32 %73, 1999
%75 = call i32 @hash(i32 %74)
%76 = load i32, i32* %1
%77 = call i32 @hash(i32 %76)
%78 = load i32, i32* %2
%79 = mul nsw i32 2, %78
%80 = sub nsw i32 %79, 1999
%81 = call i32 @hash(i32 %80)
%82 = load i32, i32* %2
%83 = sub nsw i32 %82, 999
%84 = call i32 @hash(i32 %83)
%85 = load i32, i32* %2
%86 = sub nsw i32 %85, 999
%87 = call i32 @hash(i32 %86)
br label %88
88: ; preds = %50, %44
%89 = load i32, i32* %3
%90 = icmp eq i32 %89, 1
br i1 %90, label %91, label %127
91: ; preds = %88
%92 = load i32, i32* %2
%93 = srem i32 %92, 2
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %126
95: ; preds = %91
%96 = call i32 @hash(i32 1)
%97 = load i32, i32* %1
%98 = call i32 @hash(i32 %97)
%99 = load i32, i32* %2
%100 = call i32 @hash(i32 %99)
%101 = load i32, i32* %3
%102 = call i32 @hash(i32 %101)
%103 = call i32 @hash(i32 2)
%104 = load i32, i32* %1
%105 = call i32 @hash(i32 %104)
%106 = load i32, i32* %2
%107 = add nsw i32 %106, 2
%108 = sdiv i32 %107, 2
%109 = call i32 @hash(i32 %108)
%110 = load i32, i32* %2
%111 = sub nsw i32 %110, 999
%112 = call i32 @hash(i32 %111)
%113 = load i32, i32* %1
%114 = call i32 @hash(i32 %113)
%115 = load i32, i32* %2
%116 = sub nsw i32 %115, 999
%117 = call i32 @hash(i32 %116)
%118 = load i32, i32* %2
%119 = sub nsw i32 %118, 998
%120 = sdiv i32 %119, 2
%121 = call i32 @hash(i32 %120)
%122 = load i32, i32* %2
%123 = sub nsw i32 %122, 998
%124 = sdiv i32 %123, 2
%125 = call i32 @hash(i32 %124)
br label %126
126: ; preds = %95, %91
br label %127
127: ; preds = %126, %88
br label %128
128: ; preds = %127
%129 = load i32, i32* %3
%130 = add nsw i32 %129, 1
store i32 %130, i32* %3
br label %24
131: ; preds = %41
br label %132
132: ; preds = %131
%133 = load i32, i32* %2
%134 = add nsw i32 %133, 1
store i32 %134, i32* %2
br label %20
135: ; preds = %20
br label %136
136: ; preds = %135
%137 = load i32, i32* %1
%138 = add nsw i32 %137, 1
store i32 %138, i32* %1
br label %16
139: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @test() {
br label %1
1: ; preds = %0, %70
%2 = phi i32 [ 1, %0 ], [ %71, %70 ]
br label %3
3: ; preds = %1, %65
%4 = phi i32 [ 1, %1 ], [ %68, %65 ]
%5 = phi i32 [ 33, %1 ], [ %67, %65 ]
%6 = phi i32 [ 1000, %1 ], [ %66, %65 ]
%7 = call i32 @llvm.smin.i32(i32 %5, i32 %4)
%8 = mul nsw i32 %6, -2
%9 = add nsw i32 %8, 2033
%10 = shl nuw nsw i32 %6, 1
%11 = add nsw i32 %10, -1999
%12 = icmp ult i32 %9, %11
%13 = select i1 %12, i32 %9, i32 %11
%14 = icmp slt i32 %13, 1
br i1 %14, label %65, label %15
15: ; preds = %3
%16 = add nsw i32 %10, -1000
%17 = add nsw i32 %6, -499
%18 = add nsw i32 %6, -999
%19 = and i32 %6, 1
%20 = icmp eq i32 %19, 0
%21 = add nuw nsw i32 %6, 2
%22 = lshr i32 %21, 1
%23 = add nsw i32 %6, -998
%24 = lshr i32 %23, 1
br label %25
25: ; preds = %15, %62
%26 = phi i32 [ 1, %15 ], [ %63, %62 ]
%27 = add nuw nsw i32 %26, 1999
%28 = icmp eq i32 %10, %27
br i1 %28, label %29, label %46
29: ; preds = %25
%30 = tail call i32 @hash(i32 2)
%31 = tail call i32 @hash(i32 %2)
%32 = tail call i32 @hash(i32 %6)
%33 = tail call i32 @hash(i32 %26)
%34 = tail call i32 @hash(i32 1)
%35 = tail call i32 @hash(i32 %2)
%36 = tail call i32 @hash(i32 %16)
%37 = tail call i32 @hash(i32 1)
%38 = tail call i32 @hash(i32 2)
%39 = tail call i32 @hash(i32 %2)
%40 = tail call i32 @hash(i32 %17)
%41 = tail call i32 @hash(i32 %11)
%42 = tail call i32 @hash(i32 %2)
%43 = tail call i32 @hash(i32 %11)
%44 = tail call i32 @hash(i32 %18)
%45 = tail call i32 @hash(i32 %18)
br label %46
46: ; preds = %29, %25
%47 = icmp eq i32 %26, 1
%48 = select i1 %47, i1 %20, i1 false
br i1 %48, label %49, label %62
49: ; preds = %46
%50 = tail call i32 @hash(i32 1)
%51 = tail call i32 @hash(i32 %2)
%52 = tail call i32 @hash(i32 %6)
%53 = tail call i32 @hash(i32 1)
%54 = tail call i32 @hash(i32 2)
%55 = tail call i32 @hash(i32 %2)
%56 = tail call i32 @hash(i32 %22)
%57 = tail call i32 @hash(i32 %18)
%58 = tail call i32 @hash(i32 %2)
%59 = tail call i32 @hash(i32 %18)
%60 = tail call i32 @hash(i32 %24)
%61 = tail call i32 @hash(i32 %24)
br label %62
62: ; preds = %46, %49
%63 = add nuw nsw i32 %26, 1
%64 = icmp eq i32 %26, %7
br i1 %64, label %65, label %25
65: ; preds = %62, %3
%66 = add nuw nsw i32 %6, 1
%67 = add nsw i32 %5, -2
%68 = add nuw nsw i32 %4, 2
%69 = icmp eq i32 %66, 1017
br i1 %69, label %70, label %3
70: ; preds = %65
%71 = add nuw nsw i32 %2, 1
%72 = icmp eq i32 %71, 10001
br i1 %72, label %73, label %1
73: ; preds = %70
ret void
}