#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 __VERIFIER_nondet_int();
int main() {
  int i;
  int range;
  i = __VERIFIER_nondet_int();
  range = 20;
  while (-range <= i && i <= range) {
    if (range - i < 5 || range + i < 5) {
      i = i * (-1);
    } else {
      range = range + 1;
      i = i - 1;
      if (i == 0) {
        range = -1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     114f <main+0x3f>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115f <main+0x4f>
jmp    11b6 <main+0xa6>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    $0x5,%eax
jl     117d <main+0x6d>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x5,%eax
jge    1189 <main+0x79>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11b1 <main+0xa1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11ac <main+0x9c>
movl   $0xffffffff,-0xc(%rbp)
jmp    11b1 <main+0xa1>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
store i32 20, i32* %3
br label %5
5: ; preds = %38, %0
%6 = load i32, i32* %3
%7 = sub nsw i32 0, %6
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp sle i32 %11, %12
br label %14
14: ; preds = %10, %5
%15 = phi i1 [ false, %5 ], [ %13, %10 ]
br i1 %15, label %16, label %39
16: ; preds = %14
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = sub nsw i32 %17, %18
%20 = icmp slt i32 %19, 5
br i1 %20, label %26, label %21
21: ; preds = %16
%22 = load i32, i32* %3
%23 = load i32, i32* %2
%24 = add nsw i32 %22, %23
%25 = icmp slt i32 %24, 5
br i1 %25, label %26, label %29
26: ; preds = %21, %16
%27 = load i32, i32* %2
%28 = mul nsw i32 %27, -1
store i32 %28, i32* %2
br label %38
29: ; preds = %21
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
%32 = load i32, i32* %2
%33 = sub nsw i32 %32, 1
store i32 %33, i32* %2
%34 = load i32, i32* %2
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %29
store i32 -1, i32* %3
br label %37
37: ; preds = %36, %29
br label %38
38: ; preds = %37, %26
br label %5
39: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}