#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*/ assert(int);
int main() {
  int a = 0, b = 1;
  switch (b) {
  case 0:
    assert(0);
  case 1:
    a++;
  case 2:
    a++;
    break;
  case 3:
    assert(0);
  default:
    assert(0);
  }
  assert(a == 2);
  a = 0;
  switch (b) {
  case 0:
    assert(0);
  case 2:
    assert(0);
  default:
    a = 1;
  }
  assert(a == 1);
  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    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     1177 <main+0x67>
mov    -0x18(%rbp),%rax
lea    0xeb7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117e <main+0x6e>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
sete   %al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     11ba <main+0xaa>
jmp    11a9 <main+0x99>
mov    -0x1c(%rbp),%eax
sub    $0x2,%eax
je     11c1 <main+0xb1>
jmp    11c8 <main+0xb8>
xor    %edi,%edi
call   1030 <assert@plt>
xor    %edi,%edi
call   1030 <assert@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %15 [
i32 0, label %5
i32 1, label %7
i32 2, label %10
i32 3, label %13
]
5: ; preds = %0
%6 = call i32 @assert(i32 0)
br label %7
7: ; preds = %0, %5
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %0, %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %17
13: ; preds = %0
%14 = call i32 @assert(i32 0)
br label %15
15: ; preds = %0, %13
%16 = call i32 @assert(i32 0)
br label %17
17: ; preds = %15, %10
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 2
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
store i32 0, i32* %2
%22 = load i32, i32* %3
switch i32 %22, label %27 [
i32 0, label %23
i32 2, label %25
]
23: ; preds = %17
%24 = call i32 @assert(i32 0)
br label %25
25: ; preds = %17, %23
%26 = call i32 @assert(i32 0)
br label %27
27: ; preds = %17, %25
store i32 1, i32* %2
br label %28
28: ; preds = %27
%29 = load i32, i32* %2
%30 = icmp eq i32 %29, 1
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}