#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 x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  int z = __VERIFIER_nondet_int();
  while (x > 0 && x < y) {
    int old_x = x;
    x = __VERIFIER_nondet_int();
    if (x <= 2 * old_x) {
      break;
    }
    y = z;
  }
  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)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jle    1158 <main+0x48>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1168 <main+0x58>
jmp    1199 <main+0x89>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jg     118e <main+0x7e>
jmp    1199 <main+0x89>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%r14d
test   %ebx,%ebx
jle    114a <main+0x3a>
cmp    %ebp,%ebx
jge    114a <main+0x3a>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
add    %ebx,%ebx
mov    %r14d,%ebp
cmp    %ebx,%eax
mov    %eax,%ebx
jg     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %2
%7 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %7, i32* %3
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %4
br label %9
9: ; preds = %26, %0
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp slt i32 %13, %14
br label %16
16: ; preds = %12, %9
%17 = phi i1 [ false, %9 ], [ %15, %12 ]
br i1 %17, label %18, label %28
18: ; preds = %16
%19 = load i32, i32* %2
store i32 %19, i32* %5
%20 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = load i32, i32* %5
%23 = mul nsw i32 2, %22
%24 = icmp sle i32 %21, %23
br i1 %24, label %25, label %26
25: ; preds = %18
br label %28
26: ; preds = %18
%27 = load i32, i32* %4
store i32 %27, i32* %3
br label %9
28: ; preds = %25, %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()
br label %4
4: ; preds = %10, %0
%5 = phi i32 [ %2, %0 ], [ %3, %10 ]
%6 = phi i32 [ %1, %0 ], [ %11, %10 ]
%7 = icmp sgt i32 %6, 0
%8 = icmp slt i32 %6, %5
%9 = select i1 %7, i1 %8, i1 false
br i1 %9, label %10, label %14
10: ; preds = %4
%11 = tail call i32 (...) @__VERIFIER_nondet_int()
%12 = shl nuw nsw i32 %6, 1
%13 = icmp sgt i32 %11, %12
br i1 %13, label %4, label %14
14: ; preds = %10, %4
ret i32 0
}