main() {
  int i = 0;
  char s[] = {"qwer\1\2\3"}, c;
  while ((c = s[i++]) != '\0') {
    switch (c) {
    case 1:
      printf("in 1");
      break;
    case 2:
      printf("in 2");
      break;
    case 3:
      printf("in 3");
      break;
    default:
      printf("in default ");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cltq
mov    -0x10(%rbp,%rax,1),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     11d4 <main+0xc4>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     1188 <main+0x78>
jmp    1166 <main+0x56>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     119b <main+0x8b>
jmp    1177 <main+0x67>
mov    -0x18(%rbp),%eax
sub    $0x3,%eax
je     11ae <main+0x9e>
jmp    11c1 <main+0xb1>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11cf <main+0xbf>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11cf <main+0xbf>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11cf <main+0xbf>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1131 <main+0x21>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef7(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [8 x i8] c"qwer\01\02\03\00"
@.str = [5 x i8] c"in 1\00"
@.str.1 = [5 x i8] c"in 2\00"
@.str.2 = [5 x i8] c"in 3\00"
@.str.3 = [12 x i8] c"in default \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i8]
%4 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
%5 = bitcast [8 x i8]* %3 to i8*
br label %6
6: ; preds = %25, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
switch i32 %16, label %23 [
i32 1, label %17
i32 2, label %19
i32 3, label %21
]
17: ; preds = %14
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %25
19: ; preds = %14
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %25
21: ; preds = %14
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %25
23: ; preds = %14
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %21, %19, %17
br label %6
26: ; preds = %6
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [5 x i8] c"in 1\00"
@.str.1 = [5 x i8] c"in 2\00"
@.str.2 = [5 x i8] c"in 3\00"
@.str.3 = [12 x i8] c"in default \00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}