void test_switch() {
  int a = 0;
  switch (1 + 2) {
  case 0:
    ffail("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          140, "0");
  case 3:
    a = 3;
    break;
  case 1:
    ffail("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          142, "1");
  }
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          144, a, 3);
  ;
  a = 0;
  switch (1) {
  case 0:
    a++;
  case 1:
    a++;
  case 2:
    a++;
  case 3:
    a++;
  }
  a = 3;
  a = 0;
  switch (100) {
  case 0:
    a++;
  default:
    a = 55;
  }
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          160, a, 55);
  ;
  a = 0;
  switch (100) {
  case 0:
    a++;
  }
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          166, a, 0);
  ;
  a = 5;
  switch (3) { a++; }
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          172, a, 5);
  ;
  switch (7) {
  case 1 ... 2:
    ffail("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          175, "switch");
  case 3:
    ffail("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          176, "switch");
  case 5 ... 10:
    break;
  default:
    ffail("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          178, "switch");
  }
  a = 0;
  int count = 27;
  switch (count % 8) {
  case 0:
    do {
      a++;
    case 7:
      a++;
    case 6:
      a++;
    case 5:
      a++;
    case 4:
      a++;
    case 3:
      a++;
    case 2:
      a++;
    case 1:
      a++;
    } while ((count -= 8) > 0);
  }
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c",
          194, 27, a);
  ;
  switch (1)
    ;
}


x86 assembly (clang, -O0):
<test_switch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xee0(%rip),%rdi
mov    %rdi,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x90,%esi
mov    $0x3,%ecx
call   1040 <fexpect@plt>
mov    -0x18(%rbp),%rdi
mov    -0x9(%rbp),%al
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
movl   $0x3,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
movl   $0x37,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xa0,%esi
mov    $0x37,%ecx
call   1040 <fexpect@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rdi
mov    -0x9(%rbp),%al
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xa6,%esi
call   1040 <fexpect@plt>
mov    -0x18(%rbp),%rdi
mov    -0x9(%rbp),%al
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xac,%esi
mov    $0x5,%ecx
call   1040 <fexpect@plt>
mov    -0x9(%rbp),%al
test   %al,%al
jne    1217 <test_switch+0xf7>
jmp    11f9 <test_switch+0xd9>
xor    %eax,%eax
test   %al,%al
jne    1231 <test_switch+0x111>
jmp    1208 <test_switch+0xe8>
mov    $0x1,%al
test   %al,%al
jne    124b <test_switch+0x12b>
jmp    1250 <test_switch+0x130>
lea    0xe02(%rip),%rdi
mov    $0xaf,%esi
lea    0xe78(%rip),%rdx
mov    $0x0,%al
call   1030 <ffail@plt>
lea    0xde8(%rip),%rdi
mov    $0xb0,%esi
lea    0xe5e(%rip),%rdx
mov    $0x0,%al
call   1030 <ffail@plt>
jmp    126a <test_switch+0x14a>
lea    0xdc9(%rip),%rdi
mov    $0xb2,%esi
lea    0xe3f(%rip),%rdx
mov    $0x0,%al
call   1030 <ffail@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1b,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%edx
add    $0x7,%edx
test   %eax,%eax
mov    %eax,%ecx
cmovs  %edx,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x7,%eax
ja     1313 <test_switch+0x1f3>
mov    -0x28(%rbp),%rax
lea    0xd5a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    12b4 <test_switch+0x194>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jg     12b4 <test_switch+0x194>
jmp    1313 <test_switch+0x1f3>
mov    -0x4(%rbp),%ecx
lea    0xd03(%rip),%rdi
mov    $0xc2,%esi
mov    $0x1b,%edx
mov    $0x0,%al
call   1040 <fexpect@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_switch>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x90,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0xa0,%esi
mov    $0x37,%edx
mov    $0x37,%ecx
xor    %eax,%eax
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0xa6,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0xac,%esi
mov    $0x5,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0xc2,%esi
mov    $0x1b,%edx
mov    $0x1b,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c\00"
@.str.1 = [7 x i8] c"switch\00"
define void @test_switch() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 144, i32 %3, i32 3)
store i32 0, i32* %1
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
store i32 3, i32* %1
store i32 0, i32* %1
store i32 55, i32* %1
%11 = load i32, i32* %1
%12 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 160, i32 %11, i32 55)
store i32 0, i32* %1
%13 = load i32, i32* %1
%14 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 166, i32 %13, i32 0)
store i32 5, i32* %1
%15 = load i32, i32* %1
%16 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 172, i32 %15, i32 5)
switch i32 7, label %22 [
i32 1, label %17
i32 2, label %17
i32 3, label %19
i32 5, label %21
i32 6, label %21
i32 7, label %21
i32 8, label %21
i32 9, label %21
i32 10, label %21
]
17: ; preds = %0, %0
%18 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @ffail to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 175, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %0, %17
%20 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @ffail to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 176, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %0, %0, %0, %0, %0, %0, %19
br label %24
22: ; preds = %0
%23 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @ffail to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 178, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %21
store i32 0, i32* %1
store i32 27, i32* %2
%25 = load i32, i32* %2
%26 = srem i32 %25, 8
switch i32 %26, label %57 [
i32 0, label %27
i32 7, label %31
i32 6, label %34
i32 5, label %37
i32 4, label %40
i32 3, label %43
i32 2, label %46
i32 1, label %49
]
27: ; preds = %24
br label %28
28: ; preds = %52, %27
%29 = load i32, i32* %1
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
br label %31
31: ; preds = %24, %28
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 1
store i32 %33, i32* %1
br label %34
34: ; preds = %24, %31
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 1
store i32 %36, i32* %1
br label %37
37: ; preds = %24, %34
%38 = load i32, i32* %1
%39 = add nsw i32 %38, 1
store i32 %39, i32* %1
br label %40
40: ; preds = %24, %37
%41 = load i32, i32* %1
%42 = add nsw i32 %41, 1
store i32 %42, i32* %1
br label %43
43: ; preds = %24, %40
%44 = load i32, i32* %1
%45 = add nsw i32 %44, 1
store i32 %45, i32* %1
br label %46
46: ; preds = %24, %43
%47 = load i32, i32* %1
%48 = add nsw i32 %47, 1
store i32 %48, i32* %1
br label %49
49: ; preds = %24, %46
%50 = load i32, i32* %1
%51 = add nsw i32 %50, 1
store i32 %51, i32* %1
br label %52
52: ; preds = %49
%53 = load i32, i32* %2
%54 = sub nsw i32 %53, 8
store i32 %54, i32* %2
%55 = icmp sgt i32 %54, 0
br i1 %55, label %28, label %56
56: ; preds = %52
br label %57
57: ; preds = %56, %24
%58 = load i32, i32* %1
%59 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 194, i32 27, i32 %58)
ret void
}

LLVM IR (-O2):
@.str = [130 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/control.c\00"
define void @test_switch() {
%1 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 144, i32 3, i32 3)
%2 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 160, i32 55, i32 55)
%3 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 166, i32 0, i32 0)
%4 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 172, i32 5, i32 5)
%5 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 194, i32 27, i32 27)
ret void
}