#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 rand();
scalar_t__ test__absvsi2(int);
int main() {
  if (test__absvsi2(0x00000000))
    return 1;
  if (test__absvsi2(0x00000001))
    return 1;
  if (test__absvsi2(0x00000002))
    return 1;
  if (test__absvsi2(0x7FFFFFFE))
    return 1;
  if (test__absvsi2(0x7FFFFFFF))
    return 1;
  if (test__absvsi2(0x80000001))
    return 1;
  if (test__absvsi2(0x80000002))
    return 1;
  if (test__absvsi2(0xFFFFFFFE))
    return 1;
  if (test__absvsi2(0xFFFFFFFF))
    return 1;
  int i;
  for (i = 0; i < 10000; ++i)
    if (test__absvsi2(rand()))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <test__absvsi2@plt>
cmp    $0x0,%rax
je     114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x17e>
mov    $0x1,%edi
call   1030 <test__absvsi2@plt>
cmp    $0x0,%rax
je     116c <main+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x17e>
mov    $0x2,%edi
call   1030 <test__absvsi2@plt>
cmp    $0x0,%rax
je     118c <main+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x17e>
mov    $0x7ffffffe,%edi
call   1030 <test__absvsi2@plt>
cmp    $0x0,%rax
je     11ac <main+0x8c>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x17e>
mov    $0x7fffffff,%edi
call   1030 <test__absvsi2@plt>
cmp    $0x0,%rax
je     11cc <main+0xac>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x17e>
mov    $0x80000001,%edi
call   1030 <test__absvsi2@plt>
cmp    $0x0,%rax
je     11ec <main+0xcc>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x17e>
mov    $0x80000002,%edi
call   1030 <test__absvsi2@plt>
cmp    $0x0,%rax
je     120c <main+0xec>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x17e>
mov    $0xfffffffe,%edi
call   1030 <test__absvsi2@plt>
cmp    $0x0,%rax
je     122c <main+0x10c>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x17e>
mov    $0xffffffff,%edi
call   1030 <test__absvsi2@plt>
cmp    $0x0,%rax
je     124c <main+0x12c>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x17e>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    1297 <main+0x177>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%edi
call   1030 <test__absvsi2@plt>
cmp    $0x0,%rax
je     1284 <main+0x164>
movl   $0x1,-0x4(%rbp)
jmp    129e <main+0x17e>
jmp    1289 <main+0x169>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1253 <main+0x133>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1030 <test__absvsi2@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <main+0x17>
pop    %rbx
ret
mov    $0x1,%edi
call   1030 <test__absvsi2@plt>
test   %rax,%rax
jne    11af <main+0x8f>
mov    $0x2,%edi
call   1030 <test__absvsi2@plt>
test   %rax,%rax
jne    11af <main+0x8f>
mov    $0x7ffffffe,%edi
call   1030 <test__absvsi2@plt>
test   %rax,%rax
jne    11af <main+0x8f>
mov    $0x7fffffff,%edi
call   1030 <test__absvsi2@plt>
test   %rax,%rax
jne    11af <main+0x8f>
mov    $0x80000001,%edi
call   1030 <test__absvsi2@plt>
test   %rax,%rax
jne    11af <main+0x8f>
mov    $0x80000002,%edi
call   1030 <test__absvsi2@plt>
test   %rax,%rax
jne    11af <main+0x8f>
mov    $0xfffffffe,%edi
call   1030 <test__absvsi2@plt>
test   %rax,%rax
jne    11af <main+0x8f>
mov    $0xffffffff,%edi
call   1030 <test__absvsi2@plt>
test   %rax,%rax
je     11b6 <main+0x96>
mov    $0x1,%eax
pop    %rbx
ret
mov    $0x2710,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%edi
call   1030 <test__absvsi2@plt>
test   %rax,%rax
jne    11af <main+0x8f>
xor    %eax,%eax
add    $0xffffffff,%ebx
jne    11bb <main+0x9b>
jmp    1135 <main+0x15>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 @test__absvsi2(i32 0)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 1, i32* %1
br label %52
6: ; preds = %0
%7 = call i64 @test__absvsi2(i32 1)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %1
br label %52
10: ; preds = %6
%11 = call i64 @test__absvsi2(i32 2)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 1, i32* %1
br label %52
14: ; preds = %10
%15 = call i64 @test__absvsi2(i32 2147483646)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 1, i32* %1
br label %52
18: ; preds = %14
%19 = call i64 @test__absvsi2(i32 2147483647)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 1, i32* %1
br label %52
22: ; preds = %18
%23 = call i64 @test__absvsi2(i32 -2147483647)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 1, i32* %1
br label %52
26: ; preds = %22
%27 = call i64 @test__absvsi2(i32 -2147483646)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %26
store i32 1, i32* %1
br label %52
30: ; preds = %26
%31 = call i64 @test__absvsi2(i32 -2)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %30
store i32 1, i32* %1
br label %52
34: ; preds = %30
%35 = call i64 @test__absvsi2(i32 -1)
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %34
store i32 1, i32* %1
br label %52
38: ; preds = %34
store i32 0, i32* %2
br label %39
39: ; preds = %48, %38
%40 = load i32, i32* %2
%41 = icmp slt i32 %40, 10000
br i1 %41, label %42, label %51
42: ; preds = %39
%43 = call i32 (...) @rand()
%44 = call i64 @test__absvsi2(i32 %43)
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %42
store i32 1, i32* %1
br label %52
47: ; preds = %42
br label %48
48: ; preds = %47
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
br label %39
51: ; preds = %39
store i32 0, i32* %1
br label %52
52: ; preds = %51, %46, %37, %33, %29, %25, %21, %17, %13, %9, %5
%53 = load i32, i32* %1
ret i32 %53
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @test__absvsi2(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %35
3: ; preds = %0
%4 = tail call i64 @test__absvsi2(i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %35
6: ; preds = %3
%7 = tail call i64 @test__absvsi2(i32 2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %35
9: ; preds = %6
%10 = tail call i64 @test__absvsi2(i32 2147483646)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %35
12: ; preds = %9
%13 = tail call i64 @test__absvsi2(i32 2147483647)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %35
15: ; preds = %12
%16 = tail call i64 @test__absvsi2(i32 -2147483647)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %35
18: ; preds = %15
%19 = tail call i64 @test__absvsi2(i32 -2147483646)
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %35
21: ; preds = %18
%22 = tail call i64 @test__absvsi2(i32 -2)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %35
24: ; preds = %21
%25 = tail call i64 @test__absvsi2(i32 -1)
%26 = icmp eq i64 %25, 0
br i1 %26, label %30, label %35
27: ; preds = %30
%28 = add nuw nsw i32 %31, 1
%29 = icmp eq i32 %28, 10000
br i1 %29, label %35, label %30
30: ; preds = %24, %27
%31 = phi i32 [ %28, %27 ], [ 0, %24 ]
%32 = tail call i32 (...) @rand()
%33 = tail call i64 @test__absvsi2(i32 %32)
%34 = icmp eq i64 %33, 0
br i1 %34, label %27, label %35
35: ; preds = %30, %27, %24, %21, %18, %15, %12, %9, %6, %3, %0
%36 = phi i32 [ 1, %0 ], [ 1, %3 ], [ 1, %6 ], [ 1, %9 ], [ 1, %12 ], [ 1, %15 ], [ 1, %18 ], [ 1, %21 ], [ 1, %24 ], [ 0, %27 ], [ 1, %30 ]
ret i32 %36
}