#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;
scalar_t__ strcmp(char *, char *);
int strlen(char *);
char *strtok(char *, char *);
char toupper(char);
int main() {
  char str[4000];
  char *word;
  fgets(str, 4000, stdin);
  if (strcmp(str, "\n") == 0) {
    printf("There is no box\n");
    return 0;
  }
  word = strtok(str, "\n ,.-");
  int i = 0;
  int wordUzunluk;
  while (word != NULL) {
    if (strcmp(word, "and") == 0 || strcmp(word, "the") == 0 ||
        strcmp(word, "of") == 0 || strcmp(word, "but") == 0) {
      wordUzunluk = strlen(word);
      if (word[wordUzunluk] == '\n' || i == 0) {
        word[0] = toupper(word[0]);
      }
      printf("%s ", word);
    } else {
      word[0] = toupper(word[0]);
      printf("%s ", word);
    }
    word = strtok(NULL, " ");
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xfb0(%rbp),%rdi
mov    0x2e68(%rip),%rax
mov    (%rax),%edx
mov    $0xfa0,%esi
call   1060 <fgets@plt>
lea    -0xfb0(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11c3 <main+0x63>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1338 <main+0x1d8>
lea    -0xfb0(%rbp),%rdi
lea    0xe40(%rip),%rsi
call   1080 <strtok@plt>
mov    %rax,-0xfb8(%rbp)
movl   $0x0,-0xfbc(%rbp)
cmpq   $0x0,-0xfb8(%rbp)
je     1331 <main+0x1d1>
mov    -0xfb8(%rbp),%rdi
lea    0xe14(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1269 <main+0x109>
mov    -0xfb8(%rbp),%rdi
lea    0xdfb(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1269 <main+0x109>
mov    -0xfb8(%rbp),%rdi
lea    0xde2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1269 <main+0x109>
mov    -0xfb8(%rbp),%rdi
lea    0xdc8(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12d7 <main+0x177>
mov    -0xfb8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xfc0(%rbp)
mov    -0xfb8(%rbp),%rax
movslq -0xfc0(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     12a3 <main+0x143>
cmpl   $0x0,-0xfbc(%rbp)
jne    12bd <main+0x15d>
mov    -0xfb8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0xfb8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xfb8(%rbp),%rsi
lea    0xd5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1306 <main+0x1a6>
mov    -0xfb8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0xfb8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xfb8(%rbp),%rsi
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xd17(%rip),%rsi
call   1080 <strtok@plt>
mov    %rax,-0xfb8(%rbp)
mov    -0xfbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfbc(%rbp)
jmp    11e7 <main+0x87>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xfc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xfa8,%rsp
mov    0x2e60(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xfa0,%esi
call   1070 <fgets@plt>
lea    0xe5f(%rip),%rsi
mov    %rbx,%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1291 <main+0x121>
lea    0xe49(%rip),%rsi
mov    %rsp,%rdi
call   1090 <strtok@plt>
test   %rax,%rax
je     129d <main+0x12d>
mov    %rax,%rbx
lea    0xe34(%rip),%r14
lea    0xe3c(%rip),%r15
lea    0xe37(%rip),%r13
lea    0xe23(%rip),%r12
xor    %ebp,%ebp
jmp    1220 <main+0xb0>
nopl   (%rax)
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %edi,%edi
mov    %r13,%rsi
call   1090 <strtok@plt>
mov    %rax,%rbx
add    $0xffffffff,%ebp
test   %rax,%rax
je     129d <main+0x12d>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1270 <main+0x100>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1270 <main+0x100>
mov    %rbx,%rdi
lea    0xdc6(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1270 <main+0x100>
mov    %rbx,%rdi
lea    0xdb5(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    11f0 <main+0x80>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <strlen@plt>
cltq
cmpb   $0xa,(%rbx,%rax,1)
je     11f0 <main+0x80>
test   %ebp,%ebp
jne    11fa <main+0x8a>
jmp    11f0 <main+0x80>
lea    0xd83(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xfa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [17 x i8] c"There is no box\0A\00"
@.str.2 = [6 x i8] c"\0A ,.-\00"
@.str.3 = [4 x i8] c"and\00"
@.str.4 = [4 x i8] c"the\00"
@.str.5 = [3 x i8] c"of\00"
@.str.6 = [4 x i8] c"but\00"
@.str.7 = [4 x i8] c"%s \00"
@.str.8 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4000 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [4000 x i8], [4000 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 4000, i32 %7)
%9 = getelementptr inbounds [4000 x i8], [4000 x i8]* %2, i64 0, i64 0
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %73
14: ; preds = %0
%15 = getelementptr inbounds [4000 x i8], [4000 x i8]* %2, i64 0, i64 0
%16 = call i8* @strtok(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i8* %16, i8** %3
store i32 0, i32* %4
br label %17
17: ; preds = %68, %14
%18 = load i8*, i8** %3
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %72
20: ; preds = %17
%21 = load i8*, i8** %3
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %36, label %24
24: ; preds = %20
%25 = load i8*, i8** %3
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %36, label %28
28: ; preds = %24
%29 = load i8*, i8** %3
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load i8*, i8** %3
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %59
36: ; preds = %32, %28, %24, %20
%37 = load i8*, i8** %3
%38 = call i32 @strlen(i8* %37)
store i32 %38, i32* %5
%39 = load i8*, i8** %3
%40 = load i32, i32* %5
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 10
br i1 %45, label %49, label %46
46: ; preds = %36
%47 = load i32, i32* %4
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %56
49: ; preds = %46, %36
%50 = load i8*, i8** %3
%51 = getelementptr inbounds i8, i8* %50, i64 0
%52 = load i8, i8* %51
%53 = call signext i8 @toupper(i8 signext %52)
%54 = load i8*, i8** %3
%55 = getelementptr inbounds i8, i8* %54, i64 0
store i8 %53, i8* %55
br label %56
56: ; preds = %49, %46
%57 = load i8*, i8** %3
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %57)
br label %68
59: ; preds = %32
%60 = load i8*, i8** %3
%61 = getelementptr inbounds i8, i8* %60, i64 0
%62 = load i8, i8* %61
%63 = call signext i8 @toupper(i8 signext %62)
%64 = load i8*, i8** %3
%65 = getelementptr inbounds i8, i8* %64, i64 0
store i8 %63, i8* %65
%66 = load i8*, i8** %3
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %66)
br label %68
68: ; preds = %59, %56
%69 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i8* %69, i8** %3
%70 = load i32, i32* %4
%71 = add nsw i32 %70, 1
store i32 %71, i32* %4
br label %17
72: ; preds = %17
store i32 0, i32* %1
br label %73
73: ; preds = %72, %12
%74 = load i32, i32* %1
ret i32 %74
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.2 = [6 x i8] c"\0A ,.-\00"
@.str.3 = [4 x i8] c"and\00"
@.str.4 = [4 x i8] c"the\00"
@.str.5 = [3 x i8] c"of\00"
@.str.6 = [4 x i8] c"but\00"
@.str.7 = [4 x i8] c"%s \00"
@.str.8 = [2 x i8] c" \00"
@str = [16 x i8] c"There is no box\00"
define i32 @main() {
%1 = alloca [4000 x i8]
%2 = getelementptr inbounds [4000 x i8], [4000 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 4000, i32 %3)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %42
9: ; preds = %0
%10 = call i8* @strtok(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %42, label %12
12: ; preds = %9, %37
%13 = phi i32 [ %40, %37 ], [ 0, %9 ]
%14 = phi i8* [ %39, %37 ], [ %10, %9 ]
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %26, label %17
17: ; preds = %12
%18 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %26, label %20
20: ; preds = %17
%21 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %34
26: ; preds = %23, %20, %17, %12
%27 = call i32 @strlen(i8* %14)
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %14, i64 %28
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 10
%32 = icmp eq i32 %13, 0
%33 = select i1 %31, i1 true, i1 %32
br i1 %33, label %34, label %37
34: ; preds = %23, %26
%35 = load i8, i8* %14
%36 = call signext i8 @toupper(i8 signext %35)
store i8 %36, i8* %14
br label %37
37: ; preds = %34, %26
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %14)
%39 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%40 = add nuw nsw i32 %13, 1
%41 = icmp eq i8* %39, null
br i1 %41, label %42, label %12
42: ; preds = %37, %9, %7
ret i32 0
}