#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 *);
int atoi(char *);
scalar_t__ getword(char *, int);
scalar_t__ isalpha(unsigned char);
scalar_t__ isdigit(unsigned char);
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ treeprint(struct tnode *);
int main(int argc, char *argv[]) {
  struct tnode *root;
  char word[100];
  int n = -1;
  if (argc == 2 && isdigit((unsigned char)argv[1][0])) {
    n = atoi(argv[1]);
  }
  if (n <= 0)
    n = 6;
  root = NULL;
  while (getword(word, 100) != EOF)
    if ((isalpha((unsigned char)word[0]) || word[0] == '_') &&
        !(!strcmp((word), "int") || !strcmp((word), "char") ||
          !strcmp((word), "float") || !strcmp((word), "double")) &&
        strlen(word) >= n)
      root = addtree(root, word);
  treeprint(root);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x84(%rbp)
ff ff ff
cmpl   $0x2,-0x8(%rbp)
jne    11da <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11da <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x84(%rbp)
cmpl   $0x0,-0x84(%rbp)
jg     11f1 <main+0x71>
movl   $0x6,-0x84(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x64,%esi
call   1070 <getword@plt>
mov    0x2dda(%rip),%rcx
cmp    (%rcx),%rax
je     12c6 <main+0x146>
movzbl -0x80(%rbp),%edi
call   1080 <isalpha@plt>
cmp    $0x0,%rax
jne    1237 <main+0xb7>
movsbl -0x80(%rbp),%eax
cmp    $0x5f,%eax
jne    12c1 <main+0x141>
lea    -0x80(%rbp),%rdi
lea    0xdbe(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     12c1 <main+0x141>
lea    -0x80(%rbp),%rdi
lea    0xda9(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     12c1 <main+0x141>
lea    -0x80(%rbp),%rdi
lea    0xd95(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     12c1 <main+0x141>
lea    -0x80(%rbp),%rdi
lea    0xd82(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
je     12c1 <main+0x141>
lea    -0x80(%rbp),%rdi
call   1050 <strlen@plt>
cmp    -0x84(%rbp),%eax
jl     12c1 <main+0x141>
mov    -0x18(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1090 <addtree@plt>
mov    %rax,-0x18(%rbp)
jmp    11f9 <main+0x79>
mov    -0x18(%rbp),%rdi
call   1040 <treeprint@plt>
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    $0x68,%rsp
cmp    $0x2,%edi
jne    11a7 <main+0x37>
mov    %rsi,%rbx
mov    0x8(%rsi),%rax
movzbl (%rax),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     11a7 <main+0x37>
mov    0x8(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r14d
test   %eax,%eax
jg     11ad <main+0x3d>
mov    $0x6,%r14d
mov    %rsp,%rdi
mov    $0x64,%esi
call   1060 <getword@plt>
mov    0x2e27(%rip),%rbx
cmp    (%rbx),%rax
jne    11e2 <main+0x72>
xor    %r15d,%r15d
mov    %r15,%rdi
call   1040 <treeprint@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r15d,%r15d
mov    %rsp,%rbp
mov    $0x72616863,%r12d
mov    $0x616f6c66,%r13d
jmp    1212 <main+0xa2>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0x64,%esi
call   1060 <getword@plt>
cmp    (%rbx),%rax
je     11c9 <main+0x59>
movzbl (%rsp),%edi
call   1070 <isalpha@plt>
test   %rax,%rax
sete   %al
cmpb   $0x5f,(%rsp)
setne  %cl
test   %cl,%al
jne    1200 <main+0x90>
cmpl   $0x746e69,(%rsp)
je     1200 <main+0x90>
mov    (%rsp),%eax
xor    %r12d,%eax
movzbl 0x4(%rsp),%ecx
or     %eax,%ecx
je     1200 <main+0x90>
mov    (%rsp),%eax
xor    %r13d,%eax
movzwl 0x4(%rsp),%ecx
xor    $0x74,%ecx
or     %eax,%ecx
je     1200 <main+0x90>
mov    (%rsp),%eax
mov    $0x62756f64,%ecx
xor    %ecx,%eax
mov    0x3(%rsp),%ecx
mov    $0x656c62,%edx
xor    %edx,%ecx
or     %eax,%ecx
je     1200 <main+0x90>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cmp    %r14d,%eax
jl     1200 <main+0x90>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1080 <addtree@plt>
mov    %rax,%r15
jmp    1200 <main+0x90>

LLVM IR (-O0):
%struct.tnode = type { i32 }
@EOF = global i64 0
@.str = [4 x i8] c"int\00"
@.str.1 = [5 x i8] c"char\00"
@.str.2 = [6 x i8] c"float\00"
@.str.3 = [7 x i8] c"double\00"
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]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %8
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %24
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = call i64 @isdigit(i8 zeroext %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %11
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %8
br label %24
24: ; preds = %19, %11, %2
%25 = load i32, i32* %8
%26 = icmp sle i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 6, i32* %8
br label %28
28: ; preds = %27, %24
store %struct.tnode* null, %struct.tnode** %6
br label %29
29: ; preds = %69, %28
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%31 = call i64 @getword(i8* %30, i32 100)
%32 = load i64, i64* @EOF
%33 = icmp ne i64 %31, %32
br i1 %33, label %34, label %70
34: ; preds = %29
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%36 = load i8, i8* %35
%37 = call i64 @isalpha(i8 zeroext %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %44, label %39
39: ; preds = %34
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 95
br i1 %43, label %44, label %69
44: ; preds = %39, %34
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%46 = call i32 @strcmp(i8* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %69
48: ; preds = %44
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%50 = call i32 @strcmp(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %69
52: ; preds = %48
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%54 = call i32 @strcmp(i8* %53, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %69
56: ; preds = %52
%57 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%58 = call i32 @strcmp(i8* %57, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %69
60: ; preds = %56
%61 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%62 = call i32 @strlen(i8* %61)
%63 = load i32, i32* %8
%64 = icmp sge i32 %62, %63
br i1 %64, label %65, label %69
65: ; preds = %60
%66 = load %struct.tnode*, %struct.tnode** %6
%67 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%68 = call %struct.tnode* @addtree(%struct.tnode* %66, i8* %67)
store %struct.tnode* %68, %struct.tnode** %6
br label %69
69: ; preds = %65, %60, %56, %52, %48, %44, %39
br label %29
70: ; preds = %29
%71 = load %struct.tnode*, %struct.tnode** %6
%72 = call i32 @treeprint(%struct.tnode* %71)
ret i32 0
}

LLVM IR (-O2):
%struct.tnode = type { i32 }
@EOF = global i64 0
@.str.1 = [5 x i8] c"char\00"
@.str.2 = [6 x i8] c"float\00"
@.str.3 = [7 x i8] c"double\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i8, i8* %8
%10 = tail call i64 @isdigit(i8 zeroext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %6
%13 = load i8*, i8** %7
%14 = tail call i32 @atoi(i8* %13)
%15 = icmp slt i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %2, %6, %12
br label %17
17: ; preds = %12, %16
%18 = phi i32 [ 6, %16 ], [ %14, %12 ]
%19 = call i64 @getword(i8* %4, i32 100)
%20 = load i64, i64* @EOF
%21 = icmp eq i64 %19, %20
br i1 %21, label %54, label %22
22: ; preds = %17
%23 = bitcast [100 x i8]* %3 to i32*
br label %24
24: ; preds = %22, %49
%25 = phi %struct.tnode* [ null, %22 ], [ %50, %49 ]
%26 = load i8, i8* %4
%27 = call i64 @isalpha(i8 zeroext %26)
%28 = icmp eq i64 %27, 0
%29 = load i8, i8* %4
%30 = icmp ne i8 %29, 95
%31 = select i1 %28, i1 %30, i1 false
%32 = load i32, i32* %23
%33 = icmp eq i32 %32, 7630441
%34 = select i1 %31, i1 true, i1 %33
br i1 %34, label %49, label %35
35: ; preds = %24
%36 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5)
%37 = icmp eq i32 %36, 0
br i1 %37, label %49, label %38
38: ; preds = %35
%39 = call i32 @bcmp(i8* dereferenceable(6) %4, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 6)
%40 = icmp eq i32 %39, 0
br i1 %40, label %49, label %41
41: ; preds = %38
%42 = call i32 @bcmp(i8* dereferenceable(7) %4, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i64 7)
%43 = icmp eq i32 %42, 0
br i1 %43, label %49, label %44
44: ; preds = %41
%45 = call i32 @strlen(i8* %4)
%46 = icmp slt i32 %45, %18
br i1 %46, label %49, label %47
47: ; preds = %44
%48 = call %struct.tnode* @addtree(%struct.tnode* %25, i8* %4)
br label %49
49: ; preds = %24, %47, %44, %41, %38, %35
%50 = phi %struct.tnode* [ %48, %47 ], [ %25, %44 ], [ %25, %41 ], [ %25, %38 ], [ %25, %35 ], [ %25, %24 ]
%51 = call i64 @getword(i8* %4, i32 100)
%52 = load i64, i64* @EOF
%53 = icmp eq i64 %51, %52
br i1 %53, label %54, label %24
54: ; preds = %49, %17
%55 = phi %struct.tnode* [ null, %17 ], [ %50, %49 ]
%56 = call i32 @treeprint(%struct.tnode* %55)
ret i32 0
}