#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*/ clearStr(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ rDictionaryLarger(char *, char *);
scalar_t__ rDictionarySmaller(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ upperToSmall(char *);
int main(void) {
  char inStr[40] = {0};
  char smallStr[40] = "z";
  char bigStr[40] = "a";
  while (true) {
    printf("Enter word: ");
    scanf("%s", inStr);
    printf("%s\n", inStr);
    if (inStr[3] != '\0' && inStr[4] == '\0') {
      if (smallStr[0] == 'z' || bigStr[0] == 'a') {
        printf("Please Don't Type Four Character Words for the first Input.\n");
        continue;
      } else {
        printf("Smallest word: %s\n", smallStr);
        printf("Largest word: %s\n", bigStr);
        break;
      }
    }
    if (upperToSmall(inStr)) {
      if (rDictionarySmaller(smallStr, inStr)) {
        clearStr(smallStr);
        strcpy(smallStr, inStr);
      }
      if (rDictionaryLarger(bigStr, inStr)) {
        clearStr(bigStr);
        strcpy(bigStr, inStr);
      }
      clearStr(inStr);
    } else {
      printf("Please Enter a valid Input.\n");
      continue;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
movb   $0x7a,-0x60(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1060 <memset@plt>
movb   $0x61,-0x90(%rbp)
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe24(%rip),%rdi
call   1090 <scanf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsbl -0x2d(%rbp),%eax
cmp    $0x0,%eax
je     1276 <main+0xf6>
movsbl -0x2c(%rbp),%eax
cmp    $0x0,%eax
jne    1276 <main+0xf6>
movsbl -0x60(%rbp),%eax
cmp    $0x7a,%eax
je     1237 <main+0xb7>
movsbl -0x90(%rbp),%eax
cmp    $0x61,%eax
jne    124a <main+0xca>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11d0 <main+0x50>
lea    -0x60(%rbp),%rsi
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x90(%rbp),%rsi
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1312 <main+0x192>
lea    -0x30(%rbp),%rdi
call   10a0 <upperToSmall@plt>
cmp    $0x0,%rax
je     12fa <main+0x17a>
lea    -0x60(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1070 <rDictionarySmaller@plt>
cmp    $0x0,%rax
je     12b6 <main+0x136>
lea    -0x60(%rbp),%rdi
call   1040 <clearStr@plt>
lea    -0x60(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1080 <rDictionaryLarger@plt>
cmp    $0x0,%rax
je     12ec <main+0x16c>
lea    -0x90(%rbp),%rdi
call   1040 <clearStr@plt>
lea    -0x90(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x30(%rbp),%rdi
call   1040 <clearStr@plt>
jmp    130d <main+0x18d>
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11d0 <main+0x50>
jmp    11d0 <main+0x50>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movq   $0x0,0x80(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movq   $0x0,0x50(%rsp)
movb   $0x7a,0x30(%rsp)
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movb   $0x61,(%rsp)
lea    0xe21(%rip),%r14
lea    0xe27(%rip),%r15
lea    0x60(%rsp),%rbx
lea    0xe5f(%rip),%r12
lea    0x30(%rsp),%rbp
mov    %rsp,%r13
jmp    1208 <main+0x88>
nopl   0x0(%rax)
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
cmpb   $0x0,0x63(%rsp)
je     1250 <main+0xd0>
cmpb   $0x0,0x64(%rsp)
jne    1250 <main+0xd0>
cmpb   $0x7a,0x30(%rsp)
je     1200 <main+0x80>
cmpb   $0x61,(%rsp)
je     1200 <main+0x80>
jmp    12c1 <main+0x141>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   10a0 <upperToSmall@plt>
test   %rax,%rax
je     12b0 <main+0x130>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <rDictionarySmaller@plt>
test   %rax,%rax
je     1280 <main+0x100>
mov    %rbp,%rdi
call   1050 <clearStr@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1080 <rDictionaryLarger@plt>
test   %rax,%rax
je     12a3 <main+0x123>
mov    %r13,%rdi
call   1050 <clearStr@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <clearStr@plt>
jmp    1208 <main+0x88>
lea    0xd7e(%rip),%rdi
call   1040 <puts@plt>
jmp    1208 <main+0x88>
lea    0xd48(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd48(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Enter word: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%s\0A\00"
@.str.3 = [61 x i8] c"Please Don't Type Four Character Words for the first Input.\0A\00"
@.str.4 = [19 x i8] c"Smallest word: %s\0A\00"
@.str.5 = [18 x i8] c"Largest word: %s\0A\00"
@.str.6 = [29 x i8] c"Please Enter a valid Input.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
%3 = alloca [40 x i8]
%4 = alloca [40 x i8]
store i32 0, i32* %1
%5 = bitcast [40 x i8]* %2 to i8*
%6 = bitcast [40 x i8]* %3 to i8*
%7 = bitcast i8* %6 to [40 x i8]*
%8 = getelementptr inbounds [40 x i8], [40 x i8]* %7, i32 0, i32 0
store i8 122, i8* %8
%9 = bitcast [40 x i8]* %4 to i8*
%10 = bitcast i8* %9 to [40 x i8]*
%11 = getelementptr inbounds [40 x i8], [40 x i8]* %10, i32 0, i32 0
store i8 97, i8* %11
br label %12
12: ; preds = %0, %37, %73, %75
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%14 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %44
22: ; preds = %12
%23 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 4
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %44
27: ; preds = %22
%28 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 122
br i1 %31, label %37, label %32
32: ; preds = %27
%33 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 97
br i1 %36, label %37, label %39
37: ; preds = %32, %27
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
br label %12
39: ; preds = %32
%40 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %40)
%42 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %42)
br label %76
44: ; preds = %22, %12
%45 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%46 = call i64 @upperToSmall(i8* %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %73
48: ; preds = %44
%49 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%50 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%51 = call i64 @rDictionarySmaller(i8* %49, i8* %50)
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %59
53: ; preds = %48
%54 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%55 = call i32 @clearStr(i8* %54)
%56 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%57 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%58 = call i32 @strcpy(i8* %56, i8* %57)
br label %59
59: ; preds = %53, %48
%60 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%61 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%62 = call i64 @rDictionaryLarger(i8* %60, i8* %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %70
64: ; preds = %59
%65 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%66 = call i32 @clearStr(i8* %65)
%67 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%68 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%69 = call i32 @strcpy(i8* %67, i8* %68)
br label %70
70: ; preds = %64, %59
%71 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%72 = call i32 @clearStr(i8* %71)
br label %75
73: ; preds = %44
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
br label %12
75: ; preds = %70
br label %12
76: ; preds = %39
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Enter word: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.4 = [19 x i8] c"Smallest word: %s\0A\00"
@.str.5 = [18 x i8] c"Largest word: %s\0A\00"
@str = [28 x i8] c"Please Enter a valid Input.\00"
@str.7 = [60 x i8] c"Please Don't Type Four Character Words for the first Input.\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = alloca [40 x i8]
%3 = alloca [40 x i8]
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
store i8 122, i8* %5
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
store i8 97, i8* %6
%7 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 3
%8 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 4
br label %9
9: ; preds = %26, %0
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%12 = call i32 @puts(i8* %4)
%13 = load i8, i8* %7
%14 = icmp ne i8 %13, 0
%15 = load i8, i8* %8
%16 = icmp eq i8 %15, 0
%17 = select i1 %14, i1 %16, i1 false
br i1 %17, label %18, label %30
18: ; preds = %9
%19 = load i8, i8* %5
%20 = icmp eq i8 %19, 122
%21 = load i8, i8* %6
%22 = icmp eq i8 %21, 97
%23 = select i1 %20, i1 true, i1 %22
br i1 %23, label %24, label %27
24: ; preds = %18
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.7, i64 0, i64 0))
br label %26
26: ; preds = %24, %47, %45
br label %9
27: ; preds = %18
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %5)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %6)
ret i32 0
30: ; preds = %9
%31 = call i64 @upperToSmall(i8* %4)
%32 = icmp eq i64 %31, 0
br i1 %32, label %47, label %33
33: ; preds = %30
%34 = call i64 @rDictionarySmaller(i8* %5, i8* %4)
%35 = icmp eq i64 %34, 0
br i1 %35, label %39, label %36
36: ; preds = %33
%37 = call i32 @clearStr(i8* %5)
%38 = call i32 @strcpy(i8* %5, i8* %4)
br label %39
39: ; preds = %36, %33
%40 = call i64 @rDictionaryLarger(i8* %6, i8* %4)
%41 = icmp eq i64 %40, 0
br i1 %41, label %45, label %42
42: ; preds = %39
%43 = call i32 @clearStr(i8* %6)
%44 = call i32 @strcpy(i8* %6, i8* %4)
br label %45
45: ; preds = %42, %39
%46 = call i32 @clearStr(i8* %4)
br label %26
47: ; preds = %30
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %26
}