#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, tmp;
  x = __VERIFIER_nondet_int();
  tmp = __VERIFIER_nondet_int();
  while ((x > 0) && (x == 2 * tmp)) {
    x = x - 1;
    tmp = __VERIFIER_nondet_int();
  }
  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)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jle    1153 <main+0x43>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1163 <main+0x53>
jmp    117b <main+0x6b>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %ebx,%ebx
jle    1147 <main+0x37>
cs nopw 0x0(%rax,%rax,1)
nop
add    %eax,%eax
cmp    %eax,%ebx
jne    1147 <main+0x37>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x2,%ebx
jb     1147 <main+0x37>
add    $0xffffffff,%ebx
jmp    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
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
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
br label %6
6: ; preds = %16, %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = mul nsw i32 2, %11
%13 = icmp eq i32 %10, %12
br label %14
14: ; preds = %9, %6
%15 = phi i1 [ false, %6 ], [ %13, %9 ]
br i1 %15, label %16, label %20
16: ; preds = %14
%17 = load i32, i32* %2
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %2
%19 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %19, i32* %3
br label %6
20: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp sgt i32 %1, 0
%4 = shl nsw i32 %2, 1
%5 = icmp eq i32 %1, %4
%6 = select i1 %3, i1 %5, i1 false
br i1 %6, label %7, label %15
7: ; preds = %0, %7
%8 = phi i32 [ %9, %7 ], [ %1, %0 ]
%9 = add nsw i32 %8, -1
%10 = tail call i32 (...) @__VERIFIER_nondet_int()
%11 = icmp ugt i32 %8, 1
%12 = shl nsw i32 %10, 1
%13 = icmp eq i32 %9, %12
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %7, label %15
15: ; preds = %7, %0
ret i32 0
}