#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() {
  char word[100];
  struct Tnode *root;
  root = NULL;
  while (getword(word, 100) != EOF) {
    if (isalpha(word[0]) || 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)
movq   $0x0,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1030 <getword@plt>
mov    0x2e79(%rip),%rcx
cmp    (%rcx),%rax
je     11ae <main+0x6e>
movsbl -0x70(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
jne    1198 <main+0x58>
movsbl -0x70(%rbp),%eax
cmp    $0x5f,%eax
jne    11a9 <main+0x69>
mov    -0x78(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1050 <addtree@plt>
mov    %rax,-0x78(%rbp)
jmp    115a <main+0x1a>
mov    -0x78(%rbp),%rdi
call   1060 <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   1030 <getword@plt>
mov    0x2e8b(%rip),%r15
cmp    (%r15),%rax
jne    1178 <main+0x38>
xor    %ebx,%ebx
mov    %rbx,%rdi
call   1060 <treePrint@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %ebx,%ebx
mov    %rsp,%r14
jmp    11a0 <main+0x60>
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <addtree@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x64,%esi
call   1030 <getword@plt>
cmp    (%r15),%rax
je     1164 <main+0x24>
movsbl (%rsp),%edi
call   1040 <isalpha@plt>
test   %rax,%rax
jne    1180 <main+0x40>
cmpb   $0x5f,(%rsp)
jne    118e <main+0x4e>
jmp    1180 <main+0x40>

LLVM IR (-O0):
%struct.Tnode = type { i32 }
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca %struct.Tnode*
store i32 0, i32* %1
store %struct.Tnode* null, %struct.Tnode** %3
br label %4
4: ; preds = %23, %0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = call i64 @getword(i8* %5, i32 100)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %24
9: ; preds = %4
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = load i8, i8* %10
%12 = call i64 @isalpha(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %9
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 95
br i1 %18, label %19, label %23
19: ; preds = %14, %9
%20 = load %struct.Tnode*, %struct.Tnode** %3
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%22 = call %struct.Tnode* @addtree(%struct.Tnode* %20, i8* %21)
store %struct.Tnode* %22, %struct.Tnode** %3
br label %23
23: ; preds = %19, %14
br label %4
24: ; preds = %4
%25 = load %struct.Tnode*, %struct.Tnode** %3
%26 = call i32 @treePrint(%struct.Tnode* %25)
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 %21, label %6
6: ; preds = %0, %16
%7 = phi %struct.Tnode* [ %17, %16 ], [ null, %0 ]
%8 = load i8, i8* %2
%9 = call i64 @isalpha(i8 signext %8)
%10 = icmp ne i64 %9, 0
%11 = load i8, i8* %2
%12 = icmp eq i8 %11, 95
%13 = select i1 %10, i1 true, i1 %12
br i1 %13, label %14, label %16
14: ; preds = %6
%15 = call %struct.Tnode* @addtree(%struct.Tnode* %7, i8* %2)
br label %16
16: ; preds = %6, %14
%17 = phi %struct.Tnode* [ %15, %14 ], [ %7, %6 ]
%18 = call i64 @getword(i8* %2, i32 100)
%19 = load i64, i64* @EOF
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %6
21: ; preds = %16, %0
%22 = phi %struct.Tnode* [ null, %0 ], [ %17, %16 ]
%23 = call i32 @treePrint(%struct.Tnode* %22)
ret i32 0
}