#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 /*<<< orphan*/ putch(char);
main() {
  char as[] = "\\0\0";
  int i = 0;
  char ch = 'a';
  do {
    switch (as[i++]) {
    case '\\':
      printf("A");
      break;
    case 0:
      printf("B");
      break;
    default:
      printf("C");
      break;
    }
  } while (i < 3);
  printf("%d\n", 'a');
  switch (ch) {
  case 97:
    putch('a');
    break;
  case 98:
    putch('b');
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movb   $0x61,-0xd(%rbp)
movslq -0xc(%rbp),%rax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movsbl -0x8(%rbp,%rax,1),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1188 <main+0x68>
jmp    1164 <main+0x44>
mov    -0x14(%rbp),%eax
sub    $0x5c,%eax
jne    119b <main+0x7b>
jmp    1175 <main+0x55>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ae <main+0x8e>
cmpl   $0x3,-0xc(%rbp)
jl     1143 <main+0x23>
lea    0xe4b(%rip),%rdi
xor    %eax,%eax
mov    $0x61,%esi
call   1030 <printf@plt>
movsbl -0xd(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x61,%eax
je     11f1 <main+0xd1>
jmp    11e0 <main+0xc0>
mov    -0x18(%rbp),%eax
sub    $0x62,%eax
je     1200 <main+0xe0>
jmp    120a <main+0xea>
mov    $0x61,%edi
call   1040 <putch@plt>
jmp    120a <main+0xea>
mov    $0x62,%edi
call   1040 <putch@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x41,%edi
call   1030 <putchar@plt>
mov    $0x43,%edi
call   1030 <putchar@plt>
mov    $0x42,%edi
call   1030 <putchar@plt>
lea    0xeaa(%rip),%rdi
mov    $0x61,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x61,%edi
call   1050 <putch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.as = [4 x i8] c"\\0\00\00"
@.str = [2 x i8] c"A\00"
@.str.1 = [2 x i8] c"B\00"
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca i32
%4 = alloca i8
store i32 0, i32* %1
%5 = bitcast [4 x i8]* %2 to i8*
store i32 0, i32* %3
store i8 97, i8* %4
br label %6
6: ; preds = %20, %0
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
switch i32 %12, label %17 [
i32 92, label %13
i32 0, label %15
]
13: ; preds = %6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %19
15: ; preds = %6
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %19
17: ; preds = %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %15, %13
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 3
br i1 %22, label %6, label %23
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 97)
%25 = load i8, i8* %4
%26 = sext i8 %25 to i32
switch i32 %26, label %31 [
i32 97, label %27
i32 98, label %29
]
27: ; preds = %23
%28 = call i32 @putch(i8 signext 97)
br label %31
29: ; preds = %23
%30 = call i32 @putch(i8 signext 98)
br label %31
31: ; preds = %23, %29, %27
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @putchar(i32 65)
%2 = tail call i32 @putchar(i32 67)
%3 = tail call i32 @putchar(i32 66)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 97)
%5 = tail call i32 @putch(i8 signext 97)
ret i32 0
}