#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 */
unsigned char tolower(unsigned char);
unsigned char cctolower(unsigned char c) {
  if (c >= 'A' && c <= 'Z')
    return tolower(c);
  switch (c) {
  case 0x7d:
    return 0x7e;
  case 0x90:
    return 0x2a;
  case 0x91:
    return 0x5c;
  case 0x92:
    return 0x5f;
  case 0x93:
    return 0x60;
  case 0xa2:
    return 0x7b;
  case 0xa0:
    return 0x88;
  case 0xa3:
    return 0x8a;
  case 0xa1:
    return 0x8b;
  case 0xa4:
    return 0x8c;
  case 0xa7:
    return 0x8d;
  case 0xaa:
    return 0x8e;
  case 0xad:
    return 0x8f;
  case 0x94:
    return 0x95;
  case 0xa5:
    return 0xa6;
  case 0xa8:
    return 0xa9;
  case 0xab:
    return 0xac;
  case 0xb0:
    return 0xb1;
  case 0xb2:
    return 0x5e;
  case 0xb3:
    return 0xb4;
  case 0xb5:
    return 0xb6;
  case 0xb7:
    return 0xb8;
  case 0xc0:
    return 0xc1;
  case 0xc2:
    return 0xc3;
  case 0xc8:
    return 0xc9;
  case 0xca:
    return 0xcb;
  }
  return c;
}


x86 assembly (clang, -O0):
<cctolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1149 <cctolower+0x39>
movzbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1149 <cctolower+0x39>
movzbl -0x2(%rbp),%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movzbl -0x2(%rbp),%eax
add    $0xffffff83,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4d,%eax
ja     125d <cctolower+0x14d>
mov    -0x10(%rbp),%rax
lea    0xe96(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x7e,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x2a,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x5c,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x5f,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x60,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x7b,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x88,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x8a,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x8b,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x8c,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x8d,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x8e,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x8f,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x95,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xa6,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xa9,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xac,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xb1,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0x5e,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xb4,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xb6,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xb8,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xc1,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xc3,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xc9,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
movb   $0xcb,-0x1(%rbp)
jmp    1263 <cctolower+0x153>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cctolower>:
lea    -0x41(%rdi),%eax
cmp    $0x19,%al
ja     1120 <cctolower+0x10>
movzbl %dil,%edi
jmp    1030 <tolower@plt>
lea    0x70(%rdi),%ecx
cmp    $0xed,%cl
ja     114c <cctolower+0x3c>
mov    $0x7e,%al
movzbl %cl,%ecx
lea    0xecc(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x2a,%al
ret
mov    $0x5c,%al
ret
mov    $0x5f,%al
ret
mov    $0x60,%al
ret
mov    $0x95,%al
ret
mov    %edi,%eax
ret
mov    $0x88,%al
ret
mov    $0x8b,%al
ret
mov    $0x7b,%al
ret
mov    $0x8a,%al
ret
mov    $0x8c,%al
ret
mov    $0xa6,%al
ret
mov    $0x8d,%al
ret
mov    $0xa9,%al
ret
mov    $0x8e,%al
ret
mov    $0xac,%al
ret
mov    $0x8f,%al
ret
mov    $0xb1,%al
ret
mov    $0x5e,%al
ret
mov    $0xb4,%al
ret
mov    $0xb6,%al
ret
mov    $0xb8,%al
ret
mov    $0xc1,%al
ret
mov    $0xc3,%al
ret
mov    $0xc9,%al
ret
mov    $0xcb,%al
ret

LLVM IR (-O0):
define zeroext i8 @cctolower(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %14
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8, i8* %3
%13 = call zeroext i8 @tolower(i8 zeroext %12)
store i8 %13, i8* %2
br label %45
14: ; preds = %7, %1
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
switch i32 %16, label %43 [
i32 125, label %17
i32 144, label %18
i32 145, label %19
i32 146, label %20
i32 147, label %21
i32 162, label %22
i32 160, label %23
i32 163, label %24
i32 161, label %25
i32 164, label %26
i32 167, label %27
i32 170, label %28
i32 173, label %29
i32 148, label %30
i32 165, label %31
i32 168, label %32
i32 171, label %33
i32 176, label %34
i32 178, label %35
i32 179, label %36
i32 181, label %37
i32 183, label %38
i32 192, label %39
i32 194, label %40
i32 200, label %41
i32 202, label %42
]
17: ; preds = %14
store i8 126, i8* %2
br label %45
18: ; preds = %14
store i8 42, i8* %2
br label %45
19: ; preds = %14
store i8 92, i8* %2
br label %45
20: ; preds = %14
store i8 95, i8* %2
br label %45
21: ; preds = %14
store i8 96, i8* %2
br label %45
22: ; preds = %14
store i8 123, i8* %2
br label %45
23: ; preds = %14
store i8 -120, i8* %2
br label %45
24: ; preds = %14
store i8 -118, i8* %2
br label %45
25: ; preds = %14
store i8 -117, i8* %2
br label %45
26: ; preds = %14
store i8 -116, i8* %2
br label %45
27: ; preds = %14
store i8 -115, i8* %2
br label %45
28: ; preds = %14
store i8 -114, i8* %2
br label %45
29: ; preds = %14
store i8 -113, i8* %2
br label %45
30: ; preds = %14
store i8 -107, i8* %2
br label %45
31: ; preds = %14
store i8 -90, i8* %2
br label %45
32: ; preds = %14
store i8 -87, i8* %2
br label %45
33: ; preds = %14
store i8 -84, i8* %2
br label %45
34: ; preds = %14
store i8 -79, i8* %2
br label %45
35: ; preds = %14
store i8 94, i8* %2
br label %45
36: ; preds = %14
store i8 -76, i8* %2
br label %45
37: ; preds = %14
store i8 -74, i8* %2
br label %45
38: ; preds = %14
store i8 -72, i8* %2
br label %45
39: ; preds = %14
store i8 -63, i8* %2
br label %45
40: ; preds = %14
store i8 -61, i8* %2
br label %45
41: ; preds = %14
store i8 -55, i8* %2
br label %45
42: ; preds = %14
store i8 -53, i8* %2
br label %45
43: ; preds = %14
%44 = load i8, i8* %3
store i8 %44, i8* %2
br label %45
45: ; preds = %43, %42, %41, %40, %39, %38, %37, %36, %35, %34, %33, %32, %31, %30, %29, %28, %27, %26, %25, %24, %23, %22, %21, %20, %19, %18, %17, %11
%46 = load i8, i8* %2
ret i8 %46
}

LLVM IR (-O2):
define zeroext i8 @cctolower(i8 zeroext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call zeroext i8 @tolower(i8 zeroext %0)
br label %33
6: ; preds = %1
switch i8 %0, label %32 [
i8 125, label %33
i8 -112, label %7
i8 -111, label %8
i8 -110, label %9
i8 -109, label %10
i8 -94, label %11
i8 -96, label %12
i8 -93, label %13
i8 -95, label %14
i8 -92, label %15
i8 -89, label %16
i8 -86, label %17
i8 -83, label %18
i8 -108, label %19
i8 -91, label %20
i8 -88, label %21
i8 -85, label %22
i8 -80, label %23
i8 -78, label %24
i8 -77, label %25
i8 -75, label %26
i8 -73, label %27
i8 -64, label %28
i8 -62, label %29
i8 -56, label %30
i8 -54, label %31
]
7: ; preds = %6
br label %33
8: ; preds = %6
br label %33
9: ; preds = %6
br label %33
10: ; preds = %6
br label %33
11: ; preds = %6
br label %33
12: ; preds = %6
br label %33
13: ; preds = %6
br label %33
14: ; preds = %6
br label %33
15: ; preds = %6
br label %33
16: ; preds = %6
br label %33
17: ; preds = %6
br label %33
18: ; preds = %6
br label %33
19: ; preds = %6
br label %33
20: ; preds = %6
br label %33
21: ; preds = %6
br label %33
22: ; preds = %6
br label %33
23: ; preds = %6
br label %33
24: ; preds = %6
br label %33
25: ; preds = %6
br label %33
26: ; preds = %6
br label %33
27: ; preds = %6
br label %33
28: ; preds = %6
br label %33
29: ; preds = %6
br label %33
30: ; preds = %6
br label %33
31: ; preds = %6
br label %33
32: ; preds = %6
br label %33
33: ; preds = %6, %32, %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, %4
%34 = phi i8 [ %5, %4 ], [ %0, %32 ], [ -53, %31 ], [ -55, %30 ], [ -61, %29 ], [ -63, %28 ], [ -72, %27 ], [ -74, %26 ], [ -76, %25 ], [ 94, %24 ], [ -79, %23 ], [ -84, %22 ], [ -87, %21 ], [ -90, %20 ], [ -107, %19 ], [ -113, %18 ], [ -114, %17 ], [ -115, %16 ], [ -116, %15 ], [ -117, %14 ], [ -118, %13 ], [ -120, %12 ], [ 123, %11 ], [ 96, %10 ], [ 95, %9 ], [ 92, %8 ], [ 42, %7 ], [ 126, %6 ]
ret i8 %34
}