a_func(what) {
  other_func();
  switch (what) {
  case 10:
    echo("One");
    break;
  default:
    echo("Default");
  case 20:
    echo("Two");
    break;
  case 30:
    echo("Three");
    break;
  }
}


x86 assembly (clang, -O0):
<a_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
call   1040 <other_func@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xa,%eax
je     1168 <a_func+0x48>
jmp    1146 <a_func+0x26>
mov    -0xc(%rbp),%eax
sub    $0x14,%eax
je     1189 <a_func+0x69>
jmp    1157 <a_func+0x37>
mov    -0xc(%rbp),%eax
sub    $0x1e,%eax
je     119c <a_func+0x7c>
jmp    117b <a_func+0x5b>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <echo@plt>
jmp    11aa <a_func+0x8a>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <echo@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <echo@plt>
jmp    11aa <a_func+0x8a>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_func>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <other_func@plt>
cmp    $0xa,%ebx
je     1142 <a_func+0x22>
cmp    $0x14,%ebx
je     1159 <a_func+0x39>
cmp    $0x1e,%ebx
jne    114b <a_func+0x2b>
lea    0xed0(%rip),%rdi
jmp    1160 <a_func+0x40>
lea    0xeb7(%rip),%rdi
jmp    1160 <a_func+0x40>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1030 <echo@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <echo@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"One\00"
@.str.1 = [8 x i8] c"Default\00"
@.str.2 = [4 x i8] c"Two\00"
@.str.3 = [6 x i8] c"Three\00"
define i32 @a_func(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @other_func()
%5 = load i32, i32* %3
switch i32 %5, label %8 [
i32 10, label %6
i32 20, label %10
i32 30, label %12
]
6: ; preds = %1
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @echo to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %14
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @echo to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %1, %8
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @echo to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %1
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @echo to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %12, %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"One\00"
@.str.1 = [8 x i8] c"Default\00"
@.str.2 = [4 x i8] c"Two\00"
@.str.3 = [6 x i8] c"Three\00"
define i32 @a_func(i32 %0) {
%2 = tail call i32 (...) @other_func()
switch i32 %0, label %3 [
i32 10, label %7
i32 20, label %5
i32 30, label %6
]
3: ; preds = %1
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @echo to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5
%8 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %1 ]
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @echo to i32 (i8*, ...)*)(i8* %8)
ret i32 undef
}