#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 /*<<< orphan*/ __VERIFIER_error();
int nd();
int main() {
  int x = 0;
  int y = 1;
  while (nd()) {
    int fid = nd();
    int nx = x;
    int ny = y;
    int err = 0;
    switch (fid) {
    case 0:
      if (nx < 32) {
        nx += 2;
        ny += 2;
      } else {
        nx++;
        err = 1;
      }
      break;
    default:;
      ;
    }
    if (err == 0) {
      x = nx;
      y = ny;
    }
  }
  if (!(x <= y)) {
    __VERIFIER_error();
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    $0x0,%al
call   1030 <nd@plt>
cmp    $0x0,%eax
je     11d0 <main+0xb0>
xor    %eax,%eax
call   1030 <nd@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
test   %eax,%eax
jne    11b0 <main+0x90>
jmp    117a <main+0x5a>
cmpl   $0x20,-0x14(%rbp)
jge    119b <main+0x7b>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    11ab <main+0x8b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    11b5 <main+0x95>
jmp    11b5 <main+0x95>
cmpl   $0x0,-0x1c(%rbp)
jne    11cb <main+0xab>
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11e3 <main+0xc3>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
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 <nd@plt>
test   %eax,%eax
je     1180 <main+0x60>
mov    $0x1,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %ebp,%r14d
mov    %ebx,%r15d
xor    %eax,%eax
call   1030 <nd@plt>
test   %eax,%eax
sete   %al
cmp    $0x20,%ebx
setl   %cl
lea    0x2(%r15),%ebx
lea    0x2(%r14),%ebp
test   %cl,%al
cmove  %r14d,%ebp
cmove  %r15d,%ebx
xor    %eax,%eax
call   1030 <nd@plt>
test   %eax,%eax
jne    1140 <main+0x20>
cmp    %ebp,%ebx
jle    1180 <main+0x60>
xor    %eax,%eax
call   1040 <__VERIFIER_error@plt>
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
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %8
8: ; preds = %35, %0
%9 = call i32 (...) @nd()
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %36
11: ; preds = %8
%12 = call i32 (...) @nd()
store i32 %12, i32* %4
%13 = load i32, i32* %2
store i32 %13, i32* %5
%14 = load i32, i32* %3
store i32 %14, i32* %6
store i32 0, i32* %7
%15 = load i32, i32* %4
switch i32 %15, label %28 [
i32 0, label %16
]
16: ; preds = %11
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 32
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 2
store i32 %21, i32* %5
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 2
store i32 %23, i32* %6
br label %27
24: ; preds = %16
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
store i32 1, i32* %7
br label %27
27: ; preds = %24, %19
br label %29
28: ; preds = %11
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %7
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32, i32* %5
store i32 %33, i32* %2
%34 = load i32, i32* %6
store i32 %34, i32* %3
br label %35
35: ; preds = %32, %29
br label %8
36: ; preds = %8
%37 = load i32, i32* %2
%38 = load i32, i32* %3
%39 = icmp sle i32 %37, %38
br i1 %39, label %42, label %40
40: ; preds = %36
%41 = call i32 (...) @__VERIFIER_error()
br label %42
42: ; preds = %40, %36
ret i32 0
}

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