#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 */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c)) {
    if (c == 166)
      return (c = 168);
    else if (c == 180)
      return (c = 184);
    else if (c == 188)
      return (c = 189);
    else if (c == 190)
      return (c = 255);
    else if (c == 223)
      return (c = 223);
    else
      return (c + 32);
  } else
    return (c);
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     11db <tolower+0xcb>
cmpl   $0xa6,-0x8(%rbp)
jne    114d <tolower+0x3d>
movl   $0xa8,-0x8(%rbp)
movl   $0xa8,-0x4(%rbp)
jmp    11e1 <tolower+0xd1>
cmpl   $0xb4,-0x8(%rbp)
jne    116d <tolower+0x5d>
movl   $0xb8,-0x8(%rbp)
movl   $0xb8,-0x4(%rbp)
jmp    11e1 <tolower+0xd1>
cmpl   $0xbc,-0x8(%rbp)
jne    118d <tolower+0x7d>
movl   $0xbd,-0x8(%rbp)
movl   $0xbd,-0x4(%rbp)
jmp    11e1 <tolower+0xd1>
cmpl   $0xbe,-0x8(%rbp)
jne    11ad <tolower+0x9d>
movl   $0xff,-0x8(%rbp)
movl   $0xff,-0x4(%rbp)
jmp    11e1 <tolower+0xd1>
cmpl   $0xdf,-0x8(%rbp)
jne    11cd <tolower+0xbd>
movl   $0xdf,-0x8(%rbp)
movl   $0xdf,-0x4(%rbp)
jmp    11e1 <tolower+0xd1>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    11e1 <tolower+0xd1>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
test   %rax,%rax
je     1156 <tolower+0x46>
lea    -0xa6(%rbx),%ecx
cmp    $0x18,%ecx
ja     1144 <tolower+0x34>
mov    $0xa8,%eax
lea    0xecc(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0xb8,%eax
pop    %rbx
ret
cmp    $0xdf,%ebx
jne    1153 <tolower+0x43>
mov    $0xdf,%eax
pop    %rbx
ret
add    $0x20,%ebx
mov    %ebx,%eax
pop    %rbx
ret
mov    $0xbd,%eax
pop    %rbx
ret
mov    $0xff,%eax
pop    %rbx
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
%5 = call i64 @isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %30
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 166
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 168, i32* %3
store i32 168, i32* %2
br label %32
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 180
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 184, i32* %3
store i32 184, i32* %2
br label %32
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 188
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 189, i32* %3
store i32 189, i32* %2
br label %32
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 190
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 255, i32* %3
store i32 255, i32* %2
br label %32
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 223
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 223, i32* %3
store i32 223, i32* %2
br label %32
27: ; preds = %23
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 32
store i32 %29, i32* %2
br label %32
30: ; preds = %1
%31 = load i32, i32* %3
store i32 %31, i32* %2
br label %32
32: ; preds = %30, %27, %26, %22, %18, %14, %10
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
switch i32 %0, label %9 [
i32 166, label %11
i32 180, label %5
i32 188, label %6
i32 190, label %7
i32 223, label %8
]
5: ; preds = %4
br label %11
6: ; preds = %4
br label %11
7: ; preds = %4
br label %11
8: ; preds = %4
br label %11
9: ; preds = %4
%10 = add nsw i32 %0, 32
br label %11
11: ; preds = %1, %4, %9, %8, %7, %6, %5
%12 = phi i32 [ 184, %5 ], [ 189, %6 ], [ 255, %7 ], [ 223, %8 ], [ %10, %9 ], [ 168, %4 ], [ %0, %1 ]
ret i32 %12
}