#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 */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
int toupper(char);
int main(void) {
  char name[100];
  fgets(name, 100, stdin);
  int a = strlen(name);
  for (int k = 0; k < a; k++) {
    if (k == 0) {
      printf("%c", toupper(name[k]));
    } else if (name[k] == ' ') {
      printf("%c", toupper(name[k + 1]));
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1060 <fgets@plt>
lea    -0x70(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0x74(%rbp),%eax
jge    1201 <main+0xc1>
cmpl   $0x0,-0x78(%rbp)
jne    11b5 <main+0x75>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   1030 <toupper@plt>
mov    %eax,%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11ee <main+0xae>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x20,%eax
jne    11e9 <main+0xa9>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x70(%rbp,%rax,1),%edi
call   1030 <toupper@plt>
mov    %eax,%esi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11ee <main+0xae>
jmp    11f3 <main+0xb3>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    117c <main+0x3c>
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    1183 <main+0x43>
mov    %eax,%ebx
movsbl (%rsp),%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
cmp    $0x1,%ebx
jne    1197 <main+0x57>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret
mov    %ebx,%r14d
mov    $0x1,%ebx
jmp    11b9 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r14
je     1183 <main+0x43>
cmpb   $0x20,(%rsp,%rbx,1)
jne    11b0 <main+0x70>
movsbl 0x1(%rsp,%rbx,1),%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    11b0 <main+0x70>

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 100, i32 %3)
%5 = call i32 @strlen(i8* %2)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = zext i32 %5 to i64
%9 = load i8, i8* %2
%10 = call i32 @toupper(i8 signext %9)
%11 = call i32 @putchar(i32 %10)
%12 = icmp eq i32 %5, 1
br i1 %12, label %13, label %15
13: ; preds = %26, %7, %0
%14 = call i32 @putchar(i32 10)
ret i32 0
15: ; preds = %7, %26
%16 = phi i64 [ %27, %26 ], [ 1, %7 ]
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 32
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = add nuw nsw i64 %16, 1
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = call i32 @toupper(i8 signext %23)
%25 = call i32 @putchar(i32 %24)
br label %26
26: ; preds = %20, %15
%27 = add nuw nsw i64 %16, 1
%28 = icmp eq i64 %27, %8
br i1 %28, label %13, label %15
}