#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 */
typedef int /*<<< orphan*/ temp;
struct node201 {
  int dummy;
};
struct node20 {
  int dummy;
};

/* Variables and functions */
struct node20 *add_list20(struct node20 *, struct node20 *, char *);
struct node201 *compare_list20(struct node20 *, struct node20 *,
                               struct node201 *, struct node201 *);
struct node20 *create_list20(struct node20 *, struct node20 *, char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ frequency20(struct node20 *, struct node20 *,
                               struct node201 *, struct node201 *);
struct node201 *getHighest20(struct node201 *, struct node201 *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
int main() {
  struct node20 *head = NULL, *current;
  struct node201 *head1 = NULL, *current1;
  char string[1000], temp[1000] = "";
  int i, num;
  printf("Enter a series of words: ");
  fgets(string, 1000, stdin);
  string[strlen(string) - 1] = '\0';
  printf("The output is: ");
  for (i = 0; i < strlen(string); i++) {
    while (string[i] != ' ' && i < strlen(string)) {
      strncat(temp, &string[i], 1);
      i++;
    }
    if (head == NULL) {
      head = create_list20(head, current, temp);
      memset(temp, 0, sizeof(temp));
      continue;
    } else {
      head = add_list20(head, current, temp);
      memset(temp, 0, sizeof(temp));
    }
  }
  current = head;
  head1 = compare_list20(head, current, head1, current1);
  current1 = head1;
  frequency20(head, current, head1, current1);
  while (head1) {
    current1 = head1;
    head1 = getHighest20(current1, head1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x800(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1080 <memset@plt>
lea    0xe24(%rip),%rdi
call   1060 <printf@plt>
lea    -0x410(%rbp),%rdi
mov    0x2df9(%rip),%rax
mov    (%rax),%edx
mov    $0x3e8,%esi
call   10a0 <fgets@plt>
lea    -0x410(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x410(%rbp,%rax,1)
lea    0xdff(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x804(%rbp)
mov    -0x804(%rbp),%eax
mov    %eax,-0x80c(%rbp)
lea    -0x410(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x80c(%rbp),%eax
cmp    %ecx,%eax
jge    136a <main+0x1ca>
jmp    1257 <main+0xb7>
movslq -0x804(%rbp),%rax
movsbl -0x410(%rbp,%rax,1),%ecx
ff
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x80d(%rbp)
je     12a2 <main+0x102>
mov    -0x804(%rbp),%eax
mov    %eax,-0x814(%rbp)
lea    -0x410(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x814(%rbp),%eax
cmp    %ecx,%eax
setl   %al
mov    %al,-0x80d(%rbp)
mov    -0x80d(%rbp),%al
test   $0x1,%al
jne    12b5 <main+0x115>
jmp    12eb <main+0x14b>
lea    -0x800(%rbp),%rdi
movslq -0x804(%rbp),%rax
lea    -0x410(%rbp),%rsi
add    %rax,%rsi
mov    $0x1,%edx
call   1090 <strncat@plt>
mov    -0x804(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x804(%rbp)
jmp    1257 <main+0xb7>
cmpq   $0x0,-0x10(%rbp)
jne    1326 <main+0x186>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x800(%rbp),%rdx
call   1030 <create_list20@plt>
mov    %rax,-0x10(%rbp)
lea    -0x800(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1080 <memset@plt>
jmp    1356 <main+0x1b6>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x800(%rbp),%rdx
call   10c0 <add_list20@plt>
mov    %rax,-0x10(%rbp)
lea    -0x800(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1080 <memset@plt>
jmp    1356 <main+0x1b6>
mov    -0x804(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x804(%rbp)
jmp    122a <main+0x8a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <compare_list20@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1070 <frequency20@plt>
cmpq   $0x0,-0x20(%rbp)
je     13d1 <main+0x231>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10b0 <getHighest20@plt>
mov    %rax,-0x20(%rbp)
jmp    13a8 <main+0x208>
mov    -0x4(%rbp),%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x7e0,%rsp
lea    0x3f0(%rsp),%rdi
xor    %r13d,%r13d
mov    $0x3e8,%edx
xor    %esi,%esi
call   1080 <memset@plt>
lea    0xe32(%rip),%rdi
call   1060 <printf@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x3e8,%esi
call   10a0 <fgets@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%r14,1)
lea    0xe17(%rip),%rdi
call   1060 <printf@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    12ac <main+0x10c>
lea    0x3f0(%rsp),%r12
mov    %rsp,%r15
xor    %r14d,%r14d
jmp    1266 <main+0xc6>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%r13
test   %r14,%r14
je     12a0 <main+0x100>
mov    %r14,%rdi
mov    %r12,%rdx
call   10c0 <add_list20@plt>
mov    %rax,%r14
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1080 <memset@plt>
add    $0x1,%r13d
mov    %r15,%rdi
call   1050 <strlen@plt>
cmp    %eax,%r13d
jge    12af <main+0x10f>
movslq %r13d,%rbx
cmpb   $0x20,(%rsp,%rbx,1)
je     1233 <main+0x93>
nop
mov    %r15,%rdi
call   1050 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    1230 <main+0x90>
lea    (%rsp,%rbx,1),%rsi
mov    %r12,%rdi
mov    $0x1,%edx
call   1090 <strncat@plt>
lea    0x1(%rbx),%r13
cmpb   $0x20,0x1(%rsp,%rbx,1)
mov    %r13,%rbx
jne    1270 <main+0xd0>
jmp    1233 <main+0x93>
xor    %edi,%edi
mov    %r12,%rdx
call   1030 <create_list20@plt>
jmp    1243 <main+0xa3>
xor    %r14d,%r14d
mov    %r14,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <compare_list20@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
mov    %rax,%rcx
call   1070 <frequency20@plt>
test   %rbx,%rbx
je     12f3 <main+0x153>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %rbx,%rsi
call   10b0 <getHighest20@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    12e0 <main+0x140>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.node20 = type { i32 }
%struct.node201 = type { i32 }
@.str = [26 x i8] c"Enter a series of words: \00"
@stdin = global i32 0
@.str.1 = [16 x i8] c"The output is: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.node20*
%3 = alloca %struct.node20*
%4 = alloca %struct.node201*
%5 = alloca %struct.node201*
%6 = alloca [1000 x i8]
%7 = alloca [1000 x i8]
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store %struct.node20* null, %struct.node20** %2
store %struct.node201* null, %struct.node201** %4
%10 = bitcast [1000 x i8]* %7 to i8*
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32 @fgets(i8* %12, i32 1000, i32 %13)
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 %18
store i8 0, i8* %19
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %8
br label %21
21: ; preds = %67, %0
%22 = load i32, i32* %8
%23 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%24 = call i32 @strlen(i8* %23)
%25 = icmp slt i32 %22, %24
br i1 %25, label %26, label %70
26: ; preds = %21
br label %27
27: ; preds = %41, %26
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 32
br i1 %33, label %34, label %39
34: ; preds = %27
%35 = load i32, i32* %8
%36 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%37 = call i32 @strlen(i8* %36)
%38 = icmp slt i32 %35, %37
br label %39
39: ; preds = %34, %27
%40 = phi i1 [ false, %27 ], [ %38, %34 ]
br i1 %40, label %41, label %49
41: ; preds = %39
%42 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%43 = load i32, i32* %8
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 %44
%46 = call i32 @strncat(i8* %42, i8* %45, i32 1)
%47 = load i32, i32* %8
%48 = add nsw i32 %47, 1
store i32 %48, i32* %8
br label %27
49: ; preds = %39
%50 = load %struct.node20*, %struct.node20** %2
%51 = icmp eq %struct.node20* %50, null
br i1 %51, label %52, label %59
52: ; preds = %49
%53 = load %struct.node20*, %struct.node20** %2
%54 = load %struct.node20*, %struct.node20** %3
%55 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%56 = call %struct.node20* @create_list20(%struct.node20* %53, %struct.node20* %54, i8* %55)
store %struct.node20* %56, %struct.node20** %2
%57 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%58 = call i32 @memset(i8* %57, i32 0, i32 1000)
br label %67
59: ; preds = %49
%60 = load %struct.node20*, %struct.node20** %2
%61 = load %struct.node20*, %struct.node20** %3
%62 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%63 = call %struct.node20* @add_list20(%struct.node20* %60, %struct.node20* %61, i8* %62)
store %struct.node20* %63, %struct.node20** %2
%64 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%65 = call i32 @memset(i8* %64, i32 0, i32 1000)
br label %66
66: ; preds = %59
br label %67
67: ; preds = %66, %52
%68 = load i32, i32* %8
%69 = add nsw i32 %68, 1
store i32 %69, i32* %8
br label %21
70: ; preds = %21
%71 = load %struct.node20*, %struct.node20** %2
store %struct.node20* %71, %struct.node20** %3
%72 = load %struct.node20*, %struct.node20** %2
%73 = load %struct.node20*, %struct.node20** %3
%74 = load %struct.node201*, %struct.node201** %4
%75 = load %struct.node201*, %struct.node201** %5
%76 = call %struct.node201* @compare_list20(%struct.node20* %72, %struct.node20* %73, %struct.node201* %74, %struct.node201* %75)
store %struct.node201* %76, %struct.node201** %4
%77 = load %struct.node201*, %struct.node201** %4
store %struct.node201* %77, %struct.node201** %5
%78 = load %struct.node20*, %struct.node20** %2
%79 = load %struct.node20*, %struct.node20** %3
%80 = load %struct.node201*, %struct.node201** %4
%81 = load %struct.node201*, %struct.node201** %5
%82 = call i32 @frequency20(%struct.node20* %78, %struct.node20* %79, %struct.node201* %80, %struct.node201* %81)
br label %83
83: ; preds = %86, %70
%84 = load %struct.node201*, %struct.node201** %4
%85 = icmp ne %struct.node201* %84, null
br i1 %85, label %86, label %91
86: ; preds = %83
%87 = load %struct.node201*, %struct.node201** %4
store %struct.node201* %87, %struct.node201** %5
%88 = load %struct.node201*, %struct.node201** %5
%89 = load %struct.node201*, %struct.node201** %4
%90 = call %struct.node201* @getHighest20(%struct.node201* %88, %struct.node201* %89)
store %struct.node201* %90, %struct.node201** %4
br label %83
91: ; preds = %83
%92 = load i32, i32* %1
ret i32 %92
}

LLVM IR (-O2):
%struct.node20 = type { i32 }
%struct.node201 = type { i32 }
@.str = [26 x i8] c"Enter a series of words: \00"
@stdin = global i32 0
@.str.1 = [16 x i8] c"The output is: \00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %3, i32 1000, i32 %6)
%8 = call i32 @strlen(i8* %3)
%9 = add nsw i32 %8, -1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %10
store i8 0, i8* %11
%12 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @strlen(i8* %3)
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %50
15: ; preds = %0, %44
%16 = phi %struct.node20* [ %45, %44 ], [ null, %0 ]
%17 = phi i32 [ %47, %44 ], [ 0, %0 ]
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 32
br i1 %21, label %37, label %22
22: ; preds = %15, %28
%23 = phi i64 [ %30, %28 ], [ %18, %15 ]
%24 = phi i8* [ %31, %28 ], [ %19, %15 ]
%25 = call i32 @strlen(i8* %3)
%26 = sext i32 %25 to i64
%27 = icmp slt i64 %23, %26
br i1 %27, label %28, label %34
28: ; preds = %22
%29 = call i32 @strncat(i8* %4, i8* %24, i32 1)
%30 = add nsw i64 %23, 1
%31 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 32
br i1 %33, label %34, label %22
34: ; preds = %28, %22
%35 = phi i64 [ %23, %22 ], [ %30, %28 ]
%36 = trunc i64 %35 to i32
br label %37
37: ; preds = %34, %15
%38 = phi i32 [ %17, %15 ], [ %36, %34 ]
%39 = icmp eq %struct.node20* %16, null
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call %struct.node20* @create_list20(%struct.node20* null, %struct.node20* undef, i8* %4)
br label %44
42: ; preds = %37
%43 = call %struct.node20* @add_list20(%struct.node20* %16, %struct.node20* undef, i8* %4)
br label %44
44: ; preds = %42, %40
%45 = phi %struct.node20* [ %41, %40 ], [ %43, %42 ]
%46 = call i32 @memset(i8* %4, i32 0, i32 1000)
%47 = add nsw i32 %38, 1
%48 = call i32 @strlen(i8* %3)
%49 = icmp slt i32 %47, %48
br i1 %49, label %15, label %50
50: ; preds = %44, %0
%51 = phi %struct.node20* [ null, %0 ], [ %45, %44 ]
%52 = call %struct.node201* @compare_list20(%struct.node20* %51, %struct.node20* %51, %struct.node201* null, %struct.node201* undef)
%53 = call i32 @frequency20(%struct.node20* %51, %struct.node20* %51, %struct.node201* %52, %struct.node201* %52)
%54 = icmp eq %struct.node201* %52, null
br i1 %54, label %59, label %55
55: ; preds = %50, %55
%56 = phi %struct.node201* [ %57, %55 ], [ %52, %50 ]
%57 = call %struct.node201* @getHighest20(%struct.node201* %56, %struct.node201* %56)
%58 = icmp eq %struct.node201* %57, null
br i1 %58, label %59, label %55
59: ; preds = %55, %50
ret i32 0
}