#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 */
char getchar();
int /*<<< orphan*/ printf(char *, char);
void main() {
  char c;
  do {
    c = getchar();
    if (c >= '0' && c <= '9') {
    } else if (c >= 'A' && c <= 'Z') {
      c += 32;
      printf("%c", c);
    } else {
      printf("%c", c);
    }
  } while (c != '\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1151 <main+0x31>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1151 <main+0x31>
jmp    119f <main+0x7f>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     118a <main+0x6a>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     118a <main+0x6a>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
lea    0xe84(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
jmp    119a <main+0x7a>
lea    0xe6f(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
jmp    119f <main+0x7f>
jmp    11a4 <main+0x84>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1128 <main+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
jmp    1135 <main+0x15>
nopl   (%rax)
cmp    $0xa,%bl
je     1163 <main+0x43>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
lea    -0x30(%rbx),%eax
cmp    $0xa,%al
jb     1130 <main+0x10>
lea    -0x41(%rbx),%eax
lea    0x20(%rbx),%ecx
cmp    $0x1a,%al
movzbl %bl,%eax
movzbl %cl,%ebx
cmovae %eax,%ebx
movsbl %bl,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
jmp    1130 <main+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca i8
br label %2
2: ; preds = %32, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
br label %31
12: ; preds = %7, %2
%13 = load i8, i8* %1
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %27
16: ; preds = %12
%17 = load i8, i8* %1
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = load i8, i8* %1
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 32
%24 = trunc i32 %23 to i8
store i8 %24, i8* %1
%25 = load i8, i8* %1
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %25)
br label %30
27: ; preds = %16, %12
%28 = load i8, i8* %1
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %28)
br label %30
30: ; preds = %27, %20
br label %31
31: ; preds = %30, %11
br label %32
32: ; preds = %31
%33 = load i8, i8* %1
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 10
br i1 %35, label %2, label %36
36: ; preds = %32
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @main() {
br label %1
1: ; preds = %11, %0
%2 = tail call signext i8 (...) @getchar()
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = add i8 %2, -65
%7 = icmp ult i8 %6, 26
%8 = add nuw nsw i8 %2, 32
%9 = select i1 %7, i8 %8, i8 %2
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
br label %11
11: ; preds = %5, %1
%12 = phi i8 [ %2, %1 ], [ %9, %5 ]
%13 = icmp eq i8 %12, 10
br i1 %13, label %14, label %1
14: ; preds = %11
ret void
}