#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, x, n, b, t;
  i = __VERIFIER_nondet_int();
  x = __VERIFIER_nondet_int();
  n = __VERIFIER_nondet_int();
  b = __VERIFIER_nondet_int();
  if (b >= 1) {
    t = 1;
  } else {
    t = -1;
  }
  while (x <= n) {
    if (b >= 1) {
      x = x + t;
    } else {
      x = x - t;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     115d <main+0x4d>
movl   $0x1,-0x18(%rbp)
jmp    1164 <main+0x54>
movl   $0xffffffff,-0x18(%rbp)
jmp    1169 <main+0x59>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     119b <main+0x8b>
cmpl   $0x1,-0x14(%rbp)
jl     118d <main+0x7d>
mov    -0xc(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1196 <main+0x86>
mov    -0xc(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1169 <main+0x59>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
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
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %2
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %3
%9 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %9, i32* %4
%10 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp sge i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 1, i32* %6
br label %15
14: ; preds = %0
store i32 -1, i32* %6
br label %15
15: ; preds = %14, %13
br label %16
16: ; preds = %31, %15
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %32
20: ; preds = %16
%21 = load i32, i32* %5
%22 = icmp sge i32 %21, 1
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load i32, i32* %3
%25 = load i32, i32* %6
%26 = add nsw i32 %24, %25
store i32 %26, i32* %3
br label %31
27: ; preds = %20
%28 = load i32, i32* %3
%29 = load i32, i32* %6
%30 = sub nsw i32 %28, %29
store i32 %30, i32* %3
br label %31
31: ; preds = %27, %23
br label %16
32: ; preds = %16
ret i32 0
}

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