#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 capital(char);
scalar_t__ is_lower(char);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ scanf(char *, char *);
int main(int argc, const char *argv[]) {
  int i;
  char in[100];
  char end = '\0';
  while (scanf("%s", in) != EOF) {
    i = 0;
    while (in[i] != end) {
      if (is_lower(in[i]))
        in[i] = capital(in[i]);
      i++;
    }
    printf("%s\n", in);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x81(%rbp)
lea    -0x80(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e71(%rip),%rcx
cmp    (%rcx),%rax
je     11f2 <main+0xb2>
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
movsbl -0x81(%rbp),%ecx
cmp    %ecx,%eax
je     11dd <main+0x9d>
movslq -0x14(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%edi
call   1030 <is_lower@plt>
cmp    $0x0,%rax
je     11cf <main+0x8f>
movslq -0x14(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%edi
call   1050 <capital@plt>
mov    %al,%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1187 <main+0x47>
lea    -0x80(%rbp),%rsi
lea    0xe1b(%rip),%rdi
call   1040 <printf@plt>
jmp    1160 <main+0x20>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x70,%rsp
lea    0xeac(%rip),%rdi
mov    %rsp,%r13
mov    %r13,%rsi
call   1060 <scanf@plt>
mov    0x2e82(%rip),%r12
cmp    (%r12),%rax
jne    117c <main+0x3c>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xe80(%rip),%r14
lea    0xe76(%rip),%r15
jmp    11ac <main+0x6c>
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r13,%rsi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1060 <scanf@plt>
cmp    (%r12),%rax
je     116c <main+0x2c>
mov    (%rsp),%al
test   %al,%al
je     1190 <main+0x50>
mov    %r13,%rbx
jmp    11cc <main+0x8c>
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1190 <main+0x50>
movsbl %al,%edi
call   1030 <is_lower@plt>
test   %rax,%rax
je     11c0 <main+0x80>
movsbl (%rbx),%edi
call   1050 <capital@plt>
mov    %al,(%rbx)
jmp    11c0 <main+0x80>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [100 x i8]
%8 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 0, i8* %8
br label %9
9: ; preds = %43, %2
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%11 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i64, i64* @EOF
%13 = icmp ne i64 %11, %12
br i1 %13, label %14, label %46
14: ; preds = %9
store i32 0, i32* %6
br label %15
15: ; preds = %40, %14
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i8, i8* %8
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %20, %22
br i1 %23, label %24, label %43
24: ; preds = %15
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = call i64 @is_lower(i8 signext %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %40
31: ; preds = %24
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = call signext i8 @capital(i8 signext %35)
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %38
store i8 %36, i8* %39
br label %40
40: ; preds = %31, %24
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %15
43: ; preds = %15
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%45 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %44)
br label %9
46: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %30, label %8
8: ; preds = %2, %25
%9 = load i8, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %25, label %11
11: ; preds = %8, %20
%12 = phi i64 [ %21, %20 ], [ 0, %8 ]
%13 = phi i8 [ %23, %20 ], [ %9, %8 ]
%14 = phi i8* [ %22, %20 ], [ %4, %8 ]
%15 = call i64 @is_lower(i8 signext %13)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %11
%18 = load i8, i8* %14
%19 = call signext i8 @capital(i8 signext %18)
store i8 %19, i8* %14
br label %20
20: ; preds = %17, %11
%21 = add nuw i64 %12, 1
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 0
br i1 %24, label %25, label %11
25: ; preds = %20, %8
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%27 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%28 = load i64, i64* @EOF
%29 = icmp eq i64 %27, %28
br i1 %29, label %30, label %8
30: ; preds = %25, %2
ret i32 0
}