main() {
  int x = nondet_int();
  int y = nondet_int();
  while (x > 0 && y > 0) {
    _Bool c = nondet_bool();
    if (c)
      x = x - 1;
    else {
      x = nondet_int();
      y = y - 1;
    }
  }
  assert(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xe(%rbp)
jle    116c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    117c <main+0x4c>
jmp    11be <main+0x8e>
mov    $0x0,%al
call   1050 <nondet_bool@plt>
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0xd(%rbp)
testb  $0x1,-0xd(%rbp)
je     11a6 <main+0x76>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11b9 <main+0x89>
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <main+0x23>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <nondet_int@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <nondet_int@plt>
test   %ebp,%ebp
jle    1176 <main+0x46>
mov    %eax,%ebx
jmp    1157 <main+0x27>
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
test   %ebp,%ebp
jle    1176 <main+0x46>
test   %ebx,%ebx
jle    1176 <main+0x46>
xor    %eax,%eax
call   1050 <nondet_bool@plt>
test   %eax,%eax
jne    1150 <main+0x20>
xor    %eax,%eax
call   1030 <nondet_int@plt>
mov    %eax,%ebp
add    $0xffffffff,%ebx
test   %ebp,%ebp
jg     1157 <main+0x27>
xor    %edi,%edi
xor    %eax,%eax
call   1040 <assert@plt>
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
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32 (...) @nondet_int()
store i32 %5, i32* %2
%6 = call i32 (...) @nondet_int()
store i32 %6, i32* %3
br label %7
7: ; preds = %28, %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%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 %29
15: ; preds = %13
%16 = call i32 (...) @nondet_bool()
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i8
store i8 %18, i8* %4
%19 = load i8, i8* %4
%20 = trunc i8 %19 to i1
br i1 %20, label %21, label %24
21: ; preds = %15
%22 = load i32, i32* %2
%23 = sub nsw i32 %22, 1
store i32 %23, i32* %2
br label %28
24: ; preds = %15
%25 = call i32 (...) @nondet_int()
store i32 %25, i32* %2
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %3
br label %28
28: ; preds = %24, %21
br label %7
29: ; preds = %13
%30 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
%31 = load i32, i32* %1
ret i32 %31
}

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