#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*/ printf(char *, ...);
int main(void) {
  int a;
  long long e;
  a = 1;
  switch (a) {
  case 1:
    printf("GOOD\n");
    break;
  case 2:
    printf("BAD\n");
    break;
  }
  switch (a) {
  case 0:
    printf("BAD\n");
    break;
  default:
    printf("GOOD\n");
    break;
  }
  a = 10;
  switch (a) {
  case 1:
    printf("BAD\n");
    break;
  case 2:
    printf("BAD\n");
    break;
  case 3:
    printf("BAD\n");
    break;
  case 5:
    printf("BAD\n");
    break;
  case 9:
    printf("BAD\n");
    break;
  case 10:
    printf("GOOD\n");
    break;
  case 11:
    printf("BAD\n");
    break;
  }
  switch (a) {
  case 1:
    printf("BAD\n");
    break;
  case 10:
    printf("GOOD\n");
    break;
  case 20:
    printf("BAD\n");
    break;
  case 1000:
    printf("BAD\n");
    break;
  case 2000:
    printf("BAD\n");
    break;
  case 5:
    printf("BAD\n");
    break;
  case 2:
    printf("BAD\n");
    break;
  default:
    printf("BAD\n");
    break;
  }
  e = 8589934592;
  switch (e) {
  case 8589934597:
    printf("BAD\n");
    break;
  case 8589934598:
    printf("BAD\n");
    break;
  case 8589934591:
    printf("BAD\n");
    break;
  case 8589934595:
    printf("BAD\n");
    break;
  case 8589934592:
    printf("GOOD\n");
    break;
  default:
    printf("BAD\n");
    break;
  }
  for (e = 34359738368;; e <<= 1) {
    switch (e) {
    case 68719476736:
      printf("case B\n");
      break;
    case 34359738368:
      printf("case A\n");
      break;
    case 549755813888:
      printf("case E\n");
      break;
    case 137438953472:
      printf("case C\n");
      break;
    case 274877906944:
      printf("case D\n");
      break;
    default:
      printf("switch OK!\n");
      goto done;
    }
  }
done:
  printf("%lld\n", e);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     114b <main+0x3b>
jmp    113a <main+0x2a>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     115e <main+0x4e>
jmp    116c <main+0x5c>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116c <main+0x5c>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
test   %eax,%eax
jne    118f <main+0x7f>
jmp    117c <main+0x6c>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119d <main+0x8d>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0xa,%eax
ja     124d <main+0x13d>
mov    -0x20(%rbp),%rax
lea    0xe3c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124d <main+0x13d>
lea    0xe0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x1,%eax
je     12cb <main+0x1bb>
jmp    1261 <main+0x151>
mov    -0x24(%rbp),%eax
sub    $0x2,%eax
je     133d <main+0x22d>
jmp    1272 <main+0x162>
mov    -0x24(%rbp),%eax
sub    $0x5,%eax
je     132a <main+0x21a>
jmp    1283 <main+0x173>
mov    -0x24(%rbp),%eax
sub    $0xa,%eax
je     12de <main+0x1ce>
jmp    1294 <main+0x184>
mov    -0x24(%rbp),%eax
sub    $0x14,%eax
je     12f1 <main+0x1e1>
jmp    12a5 <main+0x195>
mov    -0x24(%rbp),%eax
sub    $0x3e8,%eax
je     1304 <main+0x1f4>
jmp    12b8 <main+0x1a8>
mov    -0x24(%rbp),%eax
sub    $0x7d0,%eax
je     1317 <main+0x207>
jmp    1350 <main+0x240>
lea    0xd80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    135e <main+0x24e>
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    135e <main+0x24e>
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    135e <main+0x24e>
lea    0xd47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    135e <main+0x24e>
lea    0xd34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    135e <main+0x24e>
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    135e <main+0x24e>
lea    0xd0e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    135e <main+0x24e>
lea    0xcfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movabs $0x200000000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movabs $0xfffffffe00000001,%rcx
ff ff ff
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
sub    $0x7,%rax
ja     13fe <main+0x2ee>
mov    -0x30(%rbp),%rax
lea    0xc96(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xcac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    140c <main+0x2fc>
lea    0xc99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    140c <main+0x2fc>
lea    0xc86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    140c <main+0x2fc>
lea    0xc73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    140c <main+0x2fc>
lea    0xc5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    140c <main+0x2fc>
lea    0xc4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movabs $0x800000000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
movabs $0x800000000,%rcx
sub    %rcx,%rax
je     14bd <main+0x3ad>
jmp    143a <main+0x32a>
mov    -0x38(%rbp),%rax
movabs $0x1000000000,%rcx
sub    %rcx,%rax
je     14aa <main+0x39a>
jmp    1456 <main+0x346>
mov    -0x38(%rbp),%rax
movabs $0x2000000000,%rcx
sub    %rcx,%rax
je     14e3 <main+0x3d3>
jmp    1472 <main+0x362>
mov    -0x38(%rbp),%rax
movabs $0x4000000000,%rcx
sub    %rcx,%rax
je     14f6 <main+0x3e6>
jmp    148e <main+0x37e>
mov    -0x38(%rbp),%rax
movabs $0x8000000000,%rcx
sub    %rcx,%rax
je     14d0 <main+0x3c0>
jmp    1509 <main+0x3f9>
lea    0xba6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    151c <main+0x40c>
lea    0xb9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    151c <main+0x40c>
lea    0xb90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    151c <main+0x40c>
lea    0xb85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    151c <main+0x40c>
lea    0xb7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    151c <main+0x40c>
lea    0xb6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1532 <main+0x422>
jmp    1521 <main+0x411>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    141a <main+0x30a>
mov    -0x10(%rbp),%rsi
lea    0xb4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed4(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
movabs $0x800000000,%r14
movabs $0x1fffffffff,%r12
movabs $0x2000000000,%r15
movabs $0x4000000000,%rbp
lea    0xe90(%rip),%r13
mov    %r14,%rbx
jmp    11a8 <main+0x88>
lea    0xe8b(%rip),%rdi
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <puts@plt>
add    %rbx,%rbx
cmp    %r12,%rbx
jle    11d0 <main+0xb0>
cmp    %r15,%rbx
je     11ed <main+0xcd>
cmp    %rbp,%rbx
je     11f6 <main+0xd6>
movabs $0x8000000000,%rax
cmp    %rax,%rbx
jne    11ff <main+0xdf>
mov    %r13,%rdi
jmp    11a0 <main+0x80>
nopl   0x0(%rax,%rax,1)
cmp    %r14,%rbx
je     118e <main+0x6e>
lea    0xe4b(%rip),%rdi
movabs $0x1000000000,%rax
cmp    %rax,%rbx
je     11a0 <main+0x80>
jmp    11ff <main+0xdf>
lea    0xe1e(%rip),%rdi
jmp    11a0 <main+0x80>
lea    0xe0e(%rip),%rdi
jmp    11a0 <main+0x80>
lea    0xe28(%rip),%rdi
call   1030 <puts@plt>
lea    0xdee(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"GOOD\0A\00"
@.str.1 = [5 x i8] c"BAD\0A\00"
@.str.2 = [8 x i8] c"case B\0A\00"
@.str.3 = [8 x i8] c"case A\0A\00"
@.str.4 = [8 x i8] c"case E\0A\00"
@.str.5 = [8 x i8] c"case C\0A\00"
@.str.6 = [8 x i8] c"case D\0A\00"
@.str.7 = [12 x i8] c"switch OK!\0A\00"
@.str.8 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %7
]
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %0, %7, %5
%10 = load i32, i32* %2
switch i32 %10, label %13 [
i32 0, label %11
]
11: ; preds = %9
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %15
13: ; preds = %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
store i32 10, i32* %2
%16 = load i32, i32* %2
switch i32 %16, label %31 [
i32 1, label %17
i32 2, label %19
i32 3, label %21
i32 5, label %23
i32 9, label %25
i32 10, label %27
i32 11, label %29
]
17: ; preds = %15
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %31
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %31
21: ; preds = %15
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %31
23: ; preds = %15
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %31
25: ; preds = %15
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %31
27: ; preds = %15
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %31
29: ; preds = %15
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %15, %29, %27, %25, %23, %21, %19, %17
%32 = load i32, i32* %2
switch i32 %32, label %47 [
i32 1, label %33
i32 10, label %35
i32 20, label %37
i32 1000, label %39
i32 2000, label %41
i32 5, label %43
i32 2, label %45
]
33: ; preds = %31
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %49
35: ; preds = %31
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %49
37: ; preds = %31
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %49
39: ; preds = %31
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %49
41: ; preds = %31
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %49
43: ; preds = %31
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %49
45: ; preds = %31
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %49
47: ; preds = %31
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %49
49: ; preds = %47, %45, %43, %41, %39, %37, %35, %33
store i64 8589934592, i64* %3
%50 = load i64, i64* %3
switch i64 %50, label %61 [
i64 8589934597, label %51
i64 8589934598, label %53
i64 8589934591, label %55
i64 8589934595, label %57
i64 8589934592, label %59
]
51: ; preds = %49
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %63
53: ; preds = %49
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %63
55: ; preds = %49
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %63
57: ; preds = %49
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %63
59: ; preds = %49
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %63
61: ; preds = %49
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %63
63: ; preds = %61, %59, %57, %55, %53, %51
store i64 34359738368, i64* %3
br label %64
64: ; preds = %79, %63
%65 = load i64, i64* %3
switch i64 %65, label %76 [
i64 68719476736, label %66
i64 34359738368, label %68
i64 549755813888, label %70
i64 137438953472, label %72
i64 274877906944, label %74
]
66: ; preds = %64
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %78
68: ; preds = %64
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %78
70: ; preds = %64
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %78
72: ; preds = %64
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
br label %78
74: ; preds = %64
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %78
76: ; preds = %64
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
br label %82
78: ; preds = %74, %72, %70, %68, %66
br label %79
79: ; preds = %78
%80 = load i64, i64* %3
%81 = shl i64 %80, 1
store i64 %81, i64* %3
br label %64
82: ; preds = %76
%83 = load i64, i64* %3
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i64 %83)
ret i32 0
}

LLVM IR (-O2):
@.str.8 = [6 x i8] c"%lld\0A\00"
@str.12 = [5 x i8] c"GOOD\00"
@str.13 = [7 x i8] c"case D\00"
@str.14 = [7 x i8] c"case C\00"
@str.15 = [7 x i8] c"case E\00"
@str.16 = [7 x i8] c"case A\00"
@str.17 = [7 x i8] c"case B\00"
@str.18 = [11 x i8] c"switch OK!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.12, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.12, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.12, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.12, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.12, i64 0, i64 0))
br label %6
6: ; preds = %15, %0
%7 = phi i64 [ 34359738368, %0 ], [ %18, %15 ]
switch i64 %7, label %12 [
i64 68719476736, label %15
i64 34359738368, label %8
i64 549755813888, label %9
i64 137438953472, label %10
i64 274877906944, label %11
]
8: ; preds = %6
br label %15
9: ; preds = %6
br label %15
10: ; preds = %6
br label %15
11: ; preds = %6
br label %15
12: ; preds = %6
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.18, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i64 %7)
ret i32 0
15: ; preds = %6, %8, %9, %10, %11
%16 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.16, i64 0, i64 0), %8 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.15, i64 0, i64 0), %9 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.14, i64 0, i64 0), %10 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.13, i64 0, i64 0), %11 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.17, i64 0, i64 0), %6 ]
%17 = tail call i32 @puts(i8* dereferenceable(1) %16)
%18 = shl nuw nsw i64 %7, 1
br label %6
}