int main() {
  const int DDD_INDEX[8] = {61, 71, 11, 21, 32, 19, 27, 31};
  const char DESTINATION_INDEX[8][20] = {
      "Brasilia",     "Salvador", "Sao Paulo", "Rio de Janeiro",
      "Juiz de Fora", "Campinas", "Vitoria",   "Belo Horizonte",
  };
  int ddd;
  scanf("%d", &ddd);
  int i;
  for (i = 0; i < 8; i++) {
    if (ddd == DDD_INDEX[i]) {
      printf("%s\n", DESTINATION_INDEX[i]);
      i = 8;
    }
  }
  if (i == 8) {
    printf("DDD nao cadastrado\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeae(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0xd0(%rbp),%rdi
lea    0xea4(%rip),%rsi
mov    $0xa0,%edx
call   1040 <memcpy@plt>
lea    0xf33(%rip),%rdi
lea    -0xd4(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0xd8(%rbp)
cmpl   $0x8,-0xd8(%rbp)
jge    120f <main+0xdf>
mov    -0xd4(%rbp),%eax
movslq -0xd8(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jne    11f6 <main+0xc6>
movslq -0xd8(%rbp),%rax
lea    -0xd0(%rbp),%rsi
imul   $0x14,%rax,%rax
add    %rax,%rsi
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x8,-0xd8(%rbp)
jmp    11fb <main+0xcb>
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    11a5 <main+0x75>
cmpl   $0x8,-0xd8(%rbp)
jne    122a <main+0xfa>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xb0,%rsp
lea    0xfc1(%rip),%rsi
lea    0x10(%rsp),%rdi
mov    $0xa0,%edx
call   1040 <memcpy@plt>
lea    0x104b(%rip),%rdi
xor    %ebx,%ebx
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xfffffff5,%eax
cmp    $0x3c,%eax
ja     1186 <main+0x56>
lea    0xe8a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%ebx
jmp    11b7 <main+0x87>
lea    0x1016(%rip),%rdi
jmp    11c3 <main+0x93>
mov    $0x5,%ebx
jmp    11b7 <main+0x87>
mov    $0x3,%ebx
jmp    11b7 <main+0x87>
mov    $0x6,%ebx
jmp    11b7 <main+0x87>
mov    $0x7,%ebx
jmp    11b7 <main+0x87>
mov    $0x4,%ebx
jmp    11b7 <main+0x87>
mov    $0x1,%ebx
lea    (%rbx,%rbx,4),%rax
lea    (%rsp,%rax,4),%rdi
add    $0x10,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.DDD_INDEX = [8 x i32] [i32 61, i32 71, i32 11, i32 21, i32 32, i32 19, i32 27, i32 31]
@__const.main.DESTINATION_INDEX = [8 x [20 x i8]] [[20 x i8] c"Brasilia\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"Salvador\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"Sao Paulo\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"Rio de Janeiro\00\00\00\00\00\00", [20 x i8] c"Juiz de Fora\00\00\00\00\00\00\00\00", [20 x i8] c"Campinas\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"Vitoria\00\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"Belo Horizonte\00\00\00\00\00\00"]
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [20 x i8] c"DDD nao cadastrado\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca [8 x [20 x i8]]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [8 x i32]* %2 to i8*
%7 = bitcast [8 x [20 x i8]]* %3 to i8*
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 0, i32* %5
br label %9
9: ; preds = %26, %0
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 8
br i1 %11, label %12, label %29
12: ; preds = %9
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = icmp eq i32 %13, %17
br i1 %18, label %19, label %25
19: ; preds = %12
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %3, i64 0, i64 %21
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %22, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %23)
store i32 8, i32* %5
br label %25
25: ; preds = %19, %12
br label %26
26: ; preds = %25
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %9
29: ; preds = %9
%30 = load i32, i32* %5
%31 = icmp eq i32 %30, 8
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %34
34: ; preds = %32, %29
ret i32 0
}

LLVM IR (-O2):
@__const.main.DESTINATION_INDEX = [8 x [20 x i8]] [[20 x i8] c"Brasilia\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"Salvador\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"Sao Paulo\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"Rio de Janeiro\00\00\00\00\00\00", [20 x i8] c"Juiz de Fora\00\00\00\00\00\00\00\00", [20 x i8] c"Campinas\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"Vitoria\00\00\00\00\00\00\00\00\00\00\00\00\00", [20 x i8] c"Belo Horizonte\00\00\00\00\00\00"]
@.str = [3 x i8] c"%d\00"
@str = [19 x i8] c"DDD nao cadastrado\00"
define i32 @main() {
%1 = alloca [8 x [20 x i8]]
%2 = alloca i32
%3 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %1, i64 0, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
switch i32 %6, label %18 [
i32 61, label %14
i32 71, label %7
i32 11, label %8
i32 21, label %9
i32 32, label %10
i32 19, label %11
i32 27, label %12
i32 31, label %13
]
7: ; preds = %0
br label %14
8: ; preds = %0
br label %14
9: ; preds = %0
br label %14
10: ; preds = %0
br label %14
11: ; preds = %0
br label %14
12: ; preds = %0
br label %14
13: ; preds = %0
br label %14
14: ; preds = %0, %13, %12, %11, %10, %9, %8, %7
%15 = phi i64 [ 0, %0 ], [ 1, %7 ], [ 2, %8 ], [ 3, %9 ], [ 4, %10 ], [ 5, %11 ], [ 6, %12 ], [ 7, %13 ]
%16 = getelementptr inbounds [8 x [20 x i8]], [8 x [20 x i8]]* %1, i64 0, i64 %15, i64 0
%17 = call i32 @puts(i8* %16)
br label %20
18: ; preds = %0
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %20
20: ; preds = %14, %18
ret i32 0
}