int tolower(int c) {
  switch (c) {
  case 'A':
    return 'a';
  case 'B':
    return 'b';
  case 'C':
    return 'c';
  case 'D':
    return 'd';
  case 'E':
    return 'e';
  case 'F':
    return 'f';
  case 'G':
    return 'g';
  case 'H':
    return 'h';
  case 'I':
    return 'i';
  case 'J':
    return 'j';
  case 'K':
    return 'k';
  case 'L':
    return 'l';
  case 'M':
    return 'm';
  case 'N':
    return 'n';
  case 'O':
    return 'o';
  case 'P':
    return 'p';
  case 'Q':
    return 'q';
  case 'R':
    return 'r';
  case 'S':
    return 's';
  case 'T':
    return 't';
  case 'U':
    return 'u';
  case 'V':
    return 'v';
  case 'W':
    return 'w';
  case 'X':
    return 'x';
  case 'Y':
    return 'y';
  case 'Z':
    return 'z';
  default:
    return c;
  }
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x19,%eax
ja     1268 <tolower+0x168>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x61,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x62,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x63,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x64,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x65,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x66,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x67,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x68,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x69,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x6a,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x6b,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x6c,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x6d,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x6e,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x6f,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x70,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x71,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x72,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x73,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x74,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x75,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x76,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x77,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x78,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x79,-0x4(%rbp)
jmp    126e <tolower+0x16e>
movl   $0x7a,-0x4(%rbp)
jmp    126e <tolower+0x16e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %31 [
i32 65, label %5
i32 66, label %6
i32 67, label %7
i32 68, label %8
i32 69, label %9
i32 70, label %10
i32 71, label %11
i32 72, label %12
i32 73, label %13
i32 74, label %14
i32 75, label %15
i32 76, label %16
i32 77, label %17
i32 78, label %18
i32 79, label %19
i32 80, label %20
i32 81, label %21
i32 82, label %22
i32 83, label %23
i32 84, label %24
i32 85, label %25
i32 86, label %26
i32 87, label %27
i32 88, label %28
i32 89, label %29
i32 90, label %30
]
5: ; preds = %1
store i32 97, i32* %2
br label %33
6: ; preds = %1
store i32 98, i32* %2
br label %33
7: ; preds = %1
store i32 99, i32* %2
br label %33
8: ; preds = %1
store i32 100, i32* %2
br label %33
9: ; preds = %1
store i32 101, i32* %2
br label %33
10: ; preds = %1
store i32 102, i32* %2
br label %33
11: ; preds = %1
store i32 103, i32* %2
br label %33
12: ; preds = %1
store i32 104, i32* %2
br label %33
13: ; preds = %1
store i32 105, i32* %2
br label %33
14: ; preds = %1
store i32 106, i32* %2
br label %33
15: ; preds = %1
store i32 107, i32* %2
br label %33
16: ; preds = %1
store i32 108, i32* %2
br label %33
17: ; preds = %1
store i32 109, i32* %2
br label %33
18: ; preds = %1
store i32 110, i32* %2
br label %33
19: ; preds = %1
store i32 111, i32* %2
br label %33
20: ; preds = %1
store i32 112, i32* %2
br label %33
21: ; preds = %1
store i32 113, i32* %2
br label %33
22: ; preds = %1
store i32 114, i32* %2
br label %33
23: ; preds = %1
store i32 115, i32* %2
br label %33
24: ; preds = %1
store i32 116, i32* %2
br label %33
25: ; preds = %1
store i32 117, i32* %2
br label %33
26: ; preds = %1
store i32 118, i32* %2
br label %33
27: ; preds = %1
store i32 119, i32* %2
br label %33
28: ; preds = %1
store i32 120, i32* %2
br label %33
29: ; preds = %1
store i32 121, i32* %2
br label %33
30: ; preds = %1
store i32 122, i32* %2
br label %33
31: ; preds = %1
%32 = load i32, i32* %3
store i32 %32, i32* %2
br label %33
33: ; preds = %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}