#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, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x > y && y >= 1 && y <= 2) {
    x = x - y;
    y = __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)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jle    115d <main+0x4d>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     115d <main+0x4d>
cmpl   $0x2,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116d <main+0x5d>
jmp    1185 <main+0x75>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%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>
cmp    %eax,%ebx
jle    1147 <main+0x37>
lea    -0x1(%rax),%ecx
cmp    $0x1,%ecx
ja     1147 <main+0x37>
nopl   (%rax)
sub    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    %eax,%ebx
jle    1147 <main+0x37>
mov    %eax,%ecx
add    $0xffffffff,%ecx
cmp    $0x2,%ecx
jb     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 = %18, %0
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 2
br label %16
16: ; preds = %13, %10, %6
%17 = phi i1 [ false, %10 ], [ false, %6 ], [ %15, %13 ]
br i1 %17, label %18, label %23
18: ; preds = %16
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %2
%22 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %22, i32* %3
br label %6
23: ; 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 = icmp sgt i32 %1, %2
%4 = add i32 %2, -1
%5 = icmp ult i32 %4, 2
%6 = and i1 %3, %5
br i1 %6, label %7, label %16
7: ; preds = %0, %7
%8 = phi i32 [ %11, %7 ], [ %2, %0 ]
%9 = phi i32 [ %10, %7 ], [ %1, %0 ]
%10 = sub nsw i32 %9, %8
%11 = tail call i32 (...) @__VERIFIER_nondet_int()
%12 = icmp sgt i32 %10, %11
%13 = add i32 %11, -1
%14 = icmp ult i32 %13, 2
%15 = and i1 %12, %14
br i1 %15, label %7, label %16
16: ; preds = %7, %0
ret i32 0
}