#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 /*<<< orphan*/ treePrint(struct tnode *);
int main(int argc, char const *argv[]) {
  struct tnode *root;
  char word[100];
  root = NULL;
  while (getWord(word, 100) != EOF) {
    if (isalpha(word[0]))
      root = addTree(root, word);
  }
  treePrint(root);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x64,%esi
call   1050 <getWord@plt>
mov    0x2e72(%rip),%rcx
cmp    (%rcx),%rax
je     11a8 <main+0x68>
movsbl -0x80(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     11a3 <main+0x63>
mov    -0x18(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1060 <addTree@plt>
mov    %rax,-0x18(%rbp)
jmp    1161 <main+0x21>
mov    -0x18(%rbp),%rdi
call   1040 <treePrint@plt>
xor    %eax,%eax
add    $0x80,%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   1050 <getWord@plt>
mov    0x2e8b(%rip),%r15
cmp    (%r15),%rax
jne    1178 <main+0x38>
xor    %ebx,%ebx
mov    %rbx,%rdi
call   1040 <treePrint@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %ebx,%ebx
mov    %rsp,%r14
jmp    1192 <main+0x52>
nop
mov    %r14,%rdi
mov    $0x64,%esi
call   1050 <getWord@plt>
cmp    (%r15),%rax
je     1164 <main+0x24>
movsbl (%rsp),%edi
call   1030 <isalpha@plt>
test   %rax,%rax
je     1180 <main+0x40>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <addTree@plt>
mov    %rax,%rbx
jmp    1180 <main+0x40>

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

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