#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 y = 0, m = __VERIFIER_nondet_int(), x = m;
  while (x >= 0 && y >= 0) {
    if (__VERIFIER_nondet_int()) {
      while (y <= m && __VERIFIER_nondet_int()) {
        y++;
      }
      x--;
    }
    y--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jl     114f <main+0x3f>
cmpl   $0x0,-0x8(%rbp)
setge  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115f <main+0x4f>
jmp    11ca <main+0xba>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     11bc <main+0xac>
jmp    1174 <main+0x64>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x12(%rbp)
jg     1195 <main+0x85>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    11a5 <main+0x95>
jmp    11b3 <main+0xa3>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <main+0x64>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x26>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     1166 <main+0x56>
mov    %eax,%r14d
lea    0x1(%r14),%ebp
mov    %eax,%r15d
xor    %ebx,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
je     1158 <main+0x48>
cmp    %r14d,%ebx
jg     1154 <main+0x44>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
je     1154 <main+0x44>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1140 <main+0x30>
mov    %ebp,%ebx
add    $0xffffffff,%r15d
test   %r15d,%r15d
js     1166 <main+0x56>
lea    -0x1(%rbx),%eax
test   %ebx,%ebx
mov    %eax,%ebx
jg     1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
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
store i32 0, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = load i32, i32* %3
store i32 %6, i32* %4
br label %7
7: ; preds = %34, %0
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 0
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
br i1 %14, label %15, label %37
15: ; preds = %13
%16 = call i32 (...) @__VERIFIER_nondet_int()
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %34
18: ; preds = %15
br label %19
19: ; preds = %28, %18
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = icmp sle i32 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = call i32 (...) @__VERIFIER_nondet_int()
%25 = icmp ne i32 %24, 0
br label %26
26: ; preds = %23, %19
%27 = phi i1 [ false, %19 ], [ %25, %23 ]
br i1 %27, label %28, label %31
28: ; preds = %26
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %19
31: ; preds = %26
%32 = load i32, i32* %4
%33 = add nsw i32 %32, -1
store i32 %33, i32* %4
br label %34
34: ; preds = %31, %15
%35 = load i32, i32* %2
%36 = add nsw i32 %35, -1
store i32 %36, i32* %2
br label %7
37: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, -1
br i1 %2, label %3, label %29
3: ; preds = %0
%4 = add nuw i32 %1, 1
br label %5
5: ; preds = %3, %22
%6 = phi i32 [ %24, %22 ], [ %1, %3 ]
%7 = phi i32 [ %25, %22 ], [ 0, %3 ]
%8 = tail call i32 (...) @__VERIFIER_nondet_int()
%9 = icmp eq i32 %8, 0
br i1 %9, label %22, label %10
10: ; preds = %5
%11 = icmp sgt i32 %7, %1
br i1 %11, label %19, label %12
12: ; preds = %10, %16
%13 = phi i32 [ %17, %16 ], [ %7, %10 ]
%14 = tail call i32 (...) @__VERIFIER_nondet_int()
%15 = icmp eq i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %12
%17 = add i32 %13, 1
%18 = icmp eq i32 %13, %1
br i1 %18, label %19, label %12
19: ; preds = %12, %16, %10
%20 = phi i32 [ %7, %10 ], [ %4, %16 ], [ %13, %12 ]
%21 = add nsw i32 %6, -1
br label %22
22: ; preds = %19, %5
%23 = phi i32 [ %20, %19 ], [ %7, %5 ]
%24 = phi i32 [ %21, %19 ], [ %6, %5 ]
%25 = add nsw i32 %23, -1
%26 = icmp sgt i32 %24, -1
%27 = icmp sgt i32 %23, 0
%28 = select i1 %26, i1 %27, i1 false
br i1 %28, label %5, label %29
29: ; preds = %22, %0
ret i32 0
}