#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 q, y;
  q = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (q > 0) {
    if (y > 0) {
      y = 0;
      q = __VERIFIER_nondet_int();
    } else {
      y = y - 1;
      q = q - 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)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1174 <main+0x64>
cmpl   $0x0,-0xc(%rbp)
jle    115d <main+0x4d>
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
jmp    116f <main+0x5f>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %ebp,%ebp
jle    114d <main+0x3d>
mov    %eax,%ebx
jmp    113f <main+0x2f>
nopl   0x0(%rax,%rax,1)
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
test   %ebp,%ebp
jle    114d <main+0x3d>
test   %ebx,%ebx
jg     1130 <main+0x20>
add    $0xffffffff,%ebx
add    $0xffffffff,%ebp
test   %ebp,%ebp
jg     113f <main+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
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 = %19, %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
store i32 0, i32* %3
%13 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %13, i32* %2
br label %19
14: ; preds = %9
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
store i32 %16, i32* %3
%17 = load i32, i32* %2
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %2
br label %19
19: ; preds = %14, %12
br label %6
20: ; preds = %6
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
br i1 %3, label %4, label %17
4: ; preds = %0, %13
%5 = phi i32 [ %15, %13 ], [ %2, %0 ]
%6 = phi i32 [ %14, %13 ], [ %1, %0 ]
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %13
10: ; preds = %4
%11 = add nsw i32 %5, -1
%12 = add nsw i32 %6, -1
br label %13
13: ; preds = %10, %8
%14 = phi i32 [ %9, %8 ], [ %12, %10 ]
%15 = phi i32 [ 0, %8 ], [ %11, %10 ]
%16 = icmp sgt i32 %14, 0
br i1 %16, label %4, label %17
17: ; preds = %13, %0
ret i32 0
}