#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*/ __CRAB_assert(int);
int nd();
int main() {
  int x = 7;
  int y = 8;
  int v = nd();
  switch (v) {
  case 1:
    x = 0;
    y = 1;
    break;
  case 2:
    x = 1;
    y = 2;
    break;
  case 3:
    x = 2;
    y = 3;
    break;
  default:
    x = 5;
    y = 6;
  }
  __CRAB_assert(x >= 0 && x <= 7);
  __CRAB_assert(y >= 1 && y <= 8);
  __CRAB_assert(y >= x + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
xor    %eax,%eax
call   1030 <nd@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     117d <main+0x5d>
jmp    115b <main+0x3b>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     1190 <main+0x70>
jmp    116c <main+0x4c>
mov    -0x14(%rbp),%eax
sub    $0x3,%eax
je     11a3 <main+0x83>
jmp    11b6 <main+0x96>
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
jmp    11c4 <main+0xa4>
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
jmp    11c4 <main+0xa4>
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
jmp    11c4 <main+0xa4>
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x15(%rbp)
jl     11dd <main+0xbd>
cmpl   $0x7,-0x8(%rbp)
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x16(%rbp)
jl     1203 <main+0xe3>
cmpl   $0x8,-0xc(%rbp)
setle  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__CRAB_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <nd@plt>
mov    $0x1,%edi
call   1040 <__CRAB_assert@plt>
mov    $0x1,%edi
call   1040 <__CRAB_assert@plt>
mov    $0x1,%edi
call   1040 <__CRAB_assert@plt>
xor    %eax,%eax
pop    %rcx
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 7, i32* %2
store i32 8, i32* %3
%5 = call i32 (...) @nd()
store i32 %5, i32* %4
%6 = load i32, i32* %4
switch i32 %6, label %10 [
i32 1, label %7
i32 2, label %8
i32 3, label %9
]
7: ; preds = %0
store i32 0, i32* %2
store i32 1, i32* %3
br label %11
8: ; preds = %0
store i32 1, i32* %2
store i32 2, i32* %3
br label %11
9: ; preds = %0
store i32 2, i32* %2
store i32 3, i32* %3
br label %11
10: ; preds = %0
store i32 5, i32* %2
store i32 6, i32* %3
br label %11
11: ; preds = %10, %9, %8, %7
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 7
br label %17
17: ; preds = %14, %11
%18 = phi i1 [ false, %11 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
%20 = call i32 @__CRAB_assert(i32 %19)
%21 = load i32, i32* %3
%22 = icmp sge i32 %21, 1
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = load i32, i32* %3
%25 = icmp sle i32 %24, 8
br label %26
26: ; preds = %23, %17
%27 = phi i1 [ false, %17 ], [ %25, %23 ]
%28 = zext i1 %27 to i32
%29 = call i32 @__CRAB_assert(i32 %28)
%30 = load i32, i32* %3
%31 = load i32, i32* %2
%32 = add nsw i32 %31, 1
%33 = icmp sge i32 %30, %32
%34 = zext i1 %33 to i32
%35 = call i32 @__CRAB_assert(i32 %34)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nd()
%2 = tail call i32 @__CRAB_assert(i32 1)
%3 = tail call i32 @__CRAB_assert(i32 1)
%4 = tail call i32 @__CRAB_assert(i32 1)
ret i32 0
}