#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 p, q;
  q = __VERIFIER_nondet_int();
  p = __VERIFIER_nondet_int();
  while (q > 0 && p > 0 && p != q) {
    if (q < p) {
      q = q - 1;
      p = __VERIFIER_nondet_int();
    } else {
      if (p < q) {
        p = p - 1;
        q = __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,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    115d <main+0x4d>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jle    115d <main+0x4d>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    116d <main+0x5d>
jmp    11ba <main+0xaa>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1191 <main+0x81>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
jmp    11b5 <main+0xa5>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b0 <main+0xa0>
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    11b5 <main+0xa5>
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,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %ebx,%ebx
jle    115c <main+0x4c>
mov    %eax,%ebp
jmp    1140 <main+0x30>
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebp
test   %ebx,%ebx
jle    115c <main+0x4c>
test   %ebp,%ebp
jle    115c <main+0x4c>
cmp    %ebx,%ebp
je     115c <main+0x4c>
cmp    %ebp,%ebx
jb     1130 <main+0x20>
jbe    113c <main+0x2c>
add    $0xffffffff,%ebp
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
jmp    113c <main+0x2c>
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* %3
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
br label %6
6: ; preds = %35, %0
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6
%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 ne i32 %13, %14
br label %16
16: ; preds = %12, %9, %6
%17 = phi i1 [ false, %9 ], [ false, %6 ], [ %15, %12 ]
br i1 %17, label %18, label %36
18: ; preds = %16
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, 1
store i32 %24, i32* %3
%25 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %25, i32* %2
br label %35
26: ; preds = %18
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %34
30: ; preds = %26
%31 = load i32, i32* %2
%32 = sub nsw i32 %31, 1
store i32 %32, i32* %2
%33 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %33, i32* %3
br label %34
34: ; preds = %30, %26
br label %35
35: ; preds = %34, %22
br label %6
36: ; 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 slt i32 %1, 1
%4 = icmp slt i32 %2, 1
%5 = select i1 %3, i1 true, i1 %4
%6 = icmp eq i32 %2, %1
%7 = select i1 %5, i1 true, i1 %6
br i1 %7, label %28, label %8
8: ; preds = %0, %20
%9 = phi i32 [ %22, %20 ], [ %1, %0 ]
%10 = phi i32 [ %21, %20 ], [ %2, %0 ]
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = add nsw i32 %9, -1
%14 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %20
15: ; preds = %8
%16 = icmp ult i32 %10, %9
br i1 %16, label %17, label %20
17: ; preds = %15
%18 = add nsw i32 %10, -1
%19 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %20
20: ; preds = %15, %17, %12
%21 = phi i32 [ %14, %12 ], [ %18, %17 ], [ %10, %15 ]
%22 = phi i32 [ %13, %12 ], [ %19, %17 ], [ %9, %15 ]
%23 = icmp slt i32 %22, 1
%24 = icmp slt i32 %21, 1
%25 = select i1 %23, i1 true, i1 %24
%26 = icmp eq i32 %21, %22
%27 = select i1 %25, i1 true, i1 %26
br i1 %27, label %28, label %8
28: ; preds = %20, %0
ret i32 0
}