#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 */
struct tnode {
  int dummy;
};

/* Variables and functions */
scalar_t__ EOF;
struct tnode *addtree(struct tnode *, char *);
scalar_t__ getword(char *, int);
scalar_t__ isalpha(char);
int llsort(struct tnode *);
int /*<<< orphan*/ printlistp(int);
int main(void) {
  struct tnode *root;
  char word[100];
  int maxsize = 0;
  root = NULL;
  while (getword(word, 100) != EOF)
    if (isalpha(word[0]))
      root = addtree(root, word);
  maxsize = llsort(root);
  printlistp(maxsize);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x84(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x64,%esi
call   1040 <getword@plt>
mov    0x2e5f(%rip),%rcx
cmp    (%rcx),%rax
je     11bb <main+0x6b>
movsbl -0x80(%rbp),%edi
call   1050 <isalpha@plt>
cmp    $0x0,%rax
je     11b6 <main+0x66>
mov    -0x10(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1060 <addtree@plt>
mov    %rax,-0x10(%rbp)
jmp    1174 <main+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <llsort@plt>
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%edi
call   1070 <printlistp@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rdi
mov    $0x64,%esi
call   1040 <getword@plt>
mov    0x2e7b(%rip),%r15
cmp    (%r15),%rax
jne    118f <main+0x3f>
xor    %ebx,%ebx
mov    %rbx,%rdi
call   1030 <llsort@plt>
mov    %eax,%edi
call   1070 <printlistp@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %ebx,%ebx
mov    %rsp,%r14
jmp    11b2 <main+0x62>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x64,%esi
call   1040 <getword@plt>
cmp    (%r15),%rax
je     1174 <main+0x24>
movsbl (%rsp),%edi
call   1050 <isalpha@plt>
test   %rax,%rax
je     11a0 <main+0x50>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <addtree@plt>
mov    %rax,%rbx
jmp    11a0 <main+0x50>

LLVM IR (-O0):
%struct.tnode = type { i32 }
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tnode*
%3 = alloca [100 x i8]
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store %struct.tnode* null, %struct.tnode** %2
br label %5
5: ; preds = %19, %0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i64 @getword(i8* %6, i32 100)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %5
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = load i8, i8* %11
%13 = call i64 @isalpha(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = load %struct.tnode*, %struct.tnode** %2
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%18 = call %struct.tnode* @addtree(%struct.tnode* %16, i8* %17)
store %struct.tnode* %18, %struct.tnode** %2
br label %19
19: ; preds = %15, %10
br label %5
20: ; preds = %5
%21 = load %struct.tnode*, %struct.tnode** %2
%22 = call i32 @llsort(%struct.tnode* %21)
store i32 %22, i32* %4
%23 = load i32, i32* %4
%24 = call i32 @printlistp(i32 %23)
ret i32 0
}

LLVM IR (-O2):
%struct.tnode = type { i32 }
@EOF = global i64 0
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i64 @getword(i8* %2, i32 100)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %18, label %6
6: ; preds = %0, %13
%7 = phi %struct.tnode* [ %14, %13 ], [ null, %0 ]
%8 = load i8, i8* %2
%9 = call i64 @isalpha(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = call %struct.tnode* @addtree(%struct.tnode* %7, i8* %2)
br label %13
13: ; preds = %11, %6
%14 = phi %struct.tnode* [ %12, %11 ], [ %7, %6 ]
%15 = call i64 @getword(i8* %2, i32 100)
%16 = load i64, i64* @EOF
%17 = icmp eq i64 %15, %16
br i1 %17, label %18, label %6
18: ; preds = %13, %0
%19 = phi %struct.tnode* [ null, %0 ], [ %14, %13 ]
%20 = call i32 @llsort(%struct.tnode* %19)
%21 = call i32 @printlistp(i32 %20)
ret i32 0
}