#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__ EOF;
char LowertoUpper(char);
scalar_t__ isLowercaseLetter(char);
int /*<<< orphan*/ printf(char *, char);
scalar_t__ scanf(char *, char *);
int main(int argc, char **argv) {
  char c;
  while (scanf("%c", &c) != EOF) {
    if (isLowercaseLetter(c)) {
      c = LowertoUpper(c);
      printf("%c", c);
    } else {
      printf("%c", c);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
lea    -0x11(%rbp),%rsi
call   1060 <scanf@plt>
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%rax
je     11bf <main+0x7f>
movsbl -0x11(%rbp),%edi
call   1030 <isLowercaseLetter@plt>
cmp    $0x0,%rax
je     11aa <main+0x6a>
movsbl -0x11(%rbp),%edi
call   1050 <LowertoUpper@plt>
mov    %al,-0x11(%rbp)
lea    0xe64(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1040 <printf@plt>
jmp    11ba <main+0x7a>
lea    0xe4f(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1040 <printf@plt>
jmp    1156 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeb0(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x2e87(%rip),%r15
cmp    (%r15),%rax
jne    1172 <main+0x32>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe87(%rip),%rbx
lea    0xf(%rsp),%r14
jmp    119b <main+0x5b>
movsbl %al,%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
cmp    (%r15),%rax
je     1166 <main+0x26>
movsbl 0xf(%rsp),%edi
call   1030 <isLowercaseLetter@plt>
mov    %rax,%rcx
movzbl 0xf(%rsp),%eax
test   %rcx,%rcx
je     1180 <main+0x40>
movsbl %al,%edi
call   1050 <LowertoUpper@plt>
mov    %al,0xf(%rsp)
jmp    1180 <main+0x40>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %23, %2
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8, i8* %6
%13 = call i64 @isLowercaseLetter(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %6
%17 = call signext i8 @LowertoUpper(i8 signext %16)
store i8 %17, i8* %6
%18 = load i8, i8* %6
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %18)
br label %23
20: ; preds = %11
%21 = load i8, i8* %6
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %21)
br label %23
23: ; preds = %20, %15
br label %7
24: ; preds = %7
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %20, label %7
7: ; preds = %2, %14
%8 = load i8, i8* %3
%9 = call i64 @isLowercaseLetter(i8 signext %8)
%10 = icmp eq i64 %9, 0
%11 = load i8, i8* %3
br i1 %10, label %14, label %12
12: ; preds = %7
%13 = call signext i8 @LowertoUpper(i8 signext %11)
store i8 %13, i8* %3
br label %14
14: ; preds = %7, %12
%15 = phi i8 [ %13, %12 ], [ %11, %7 ]
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %15)
%17 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%18 = load i64, i64* @EOF
%19 = icmp eq i64 %17, %18
br i1 %19, label %20, label %7
20: ; preds = %14, %2
ret i32 0
}