#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;
  int z;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (y > 0 && x > 0) {
    if (x > y) {
      z = y;
    } else {
      z = x;
    }
    if (__VERIFIER_nondet_int() != 0) {
      y = y + x;
      x = z - 1;
      z = y + z;
    } else {
      x = y + x;
      y = z - 1;
      z = x + 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)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jle    114c <main+0x3c>
cmpl   $0x0,-0x8(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115c <main+0x4c>
jmp    11c9 <main+0xb9>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1173 <main+0x63>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1179 <main+0x69>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     11a9 <main+0x99>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11c4 <main+0xb4>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <main+0x23>
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>
test   %eax,%eax
jle    115e <main+0x4e>
test   %ebx,%ebx
jle    115e <main+0x4e>
mov    %eax,%ebp
xchg   %ax,%ax
cmp    %ebp,%ebx
mov    %ebx,%r14d
cmova  %ebp,%r14d
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %ebp,%ecx
add    %ebx,%ecx
add    $0xffffffff,%r14d
test   %eax,%eax
mov    %r14d,%ebx
cmove  %ecx,%ebx
mov    %r14d,%ebp
cmovne %ecx,%ebp
test   %ebp,%ebp
jle    115e <main+0x4e>
test   %ebx,%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
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
br label %7
7: ; preds = %44, %0
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 0
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
br i1 %14, label %15, label %45
15: ; preds = %13
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i32, i32* %3
store i32 %20, i32* %4
br label %23
21: ; preds = %15
%22 = load i32, i32* %2
store i32 %22, i32* %4
br label %23
23: ; preds = %21, %19
%24 = call i32 (...) @__VERIFIER_nondet_int()
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %35
26: ; preds = %23
%27 = load i32, i32* %3
%28 = load i32, i32* %2
%29 = add nsw i32 %27, %28
store i32 %29, i32* %3
%30 = load i32, i32* %4
%31 = sub nsw i32 %30, 1
store i32 %31, i32* %2
%32 = load i32, i32* %3
%33 = load i32, i32* %4
%34 = add nsw i32 %32, %33
store i32 %34, i32* %4
br label %44
35: ; preds = %23
%36 = load i32, i32* %3
%37 = load i32, i32* %2
%38 = add nsw i32 %36, %37
store i32 %38, i32* %2
%39 = load i32, i32* %4
%40 = sub nsw i32 %39, 1
store i32 %40, i32* %3
%41 = load i32, i32* %2
%42 = load i32, i32* %4
%43 = add nsw i32 %41, %42
store i32 %43, i32* %4
br label %44
44: ; preds = %35, %26
br label %7
45: ; preds = %13
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 %2, 0
%4 = icmp sgt i32 %1, 0
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %6, label %20
6: ; preds = %0, %6
%7 = phi i32 [ %16, %6 ], [ %2, %0 ]
%8 = phi i32 [ %15, %6 ], [ %1, %0 ]
%9 = icmp ugt i32 %8, %7
%10 = select i1 %9, i32 %7, i32 %8
%11 = tail call i32 (...) @__VERIFIER_nondet_int()
%12 = icmp eq i32 %11, 0
%13 = add nuw nsw i32 %7, %8
%14 = add nsw i32 %10, -1
%15 = select i1 %12, i32 %13, i32 %14
%16 = select i1 %12, i32 %14, i32 %13
%17 = icmp sgt i32 %16, 0
%18 = icmp sgt i32 %15, 0
%19 = select i1 %17, i1 %18, i1 false
br i1 %19, label %6, label %20
20: ; preds = %6, %0
ret i32 0
}