#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 */
struct tnode *addtree_line(char *, int, struct tnode *);
scalar_t__ isalnum(unsigned char);
struct tnode *process_line(char *line, int lineno, struct tnode *root) {
  char *word = line, *ptr, erased;
  while (*word != '\n' && *word != '\r') {
    while (*word != '\n' && *word != '\r' && *word != '\'' &&
           !isalnum((unsigned char)*word))
      word++;
    ptr = word;
    while (isalnum((unsigned char)*ptr) || *ptr == '\'') {
      ptr++;
    }
    if (ptr != word) {
      erased = *ptr;
      *ptr = '\0';
      root = addtree_line(word, lineno, root);
      *ptr = erased;
      word = ptr;
    }
  }
  return root;
}


x86 assembly (clang, -O0):
<process_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x2a(%rbp)
je     1160 <process_line+0x40>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
setne  %al
mov    %al,-0x2a(%rbp)
mov    -0x2a(%rbp),%al
test   $0x1,%al
jne    1170 <process_line+0x50>
jmp    128c <process_line+0x16c>
jmp    1175 <process_line+0x55>
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x2b(%rbp)
je     11cc <process_line+0xac>
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd,%ecx
mov    %al,-0x2b(%rbp)
je     11cc <process_line+0xac>
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x27,%ecx
mov    %al,-0x2b(%rbp)
je     11cc <process_line+0xac>
mov    -0x20(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x2b(%rbp)
mov    -0x2b(%rbp),%al
test   $0x1,%al
jne    11dc <process_line+0xbc>
jmp    11ed <process_line+0xcd>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1175 <process_line+0x55>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2c(%rbp)
jne    1223 <process_line+0x103>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x27,%eax
sete   %al
mov    %al,-0x2c(%rbp)
mov    -0x2c(%rbp),%al
test   $0x1,%al
jne    1233 <process_line+0x113>
jmp    1244 <process_line+0x124>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11f5 <process_line+0xd5>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1287 <process_line+0x167>
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x29(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <addtree_line@plt>
mov    %rax,-0x18(%rbp)
mov    -0x29(%rbp),%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    113b <process_line+0x1b>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_line>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %esi,0x4(%rsp)
mov    %rdi,%rbp
movabs $0x8000002400,%r12
nop
mov    0x0(%rbp),%al
cmp    $0xa,%al
je     11f0 <process_line+0xd0>
cmp    $0xd,%al
je     11f0 <process_line+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl %al,%edi
cmp    $0x27,%dil
ja     116f <process_line+0x4f>
bt     %rdi,%r12
jb     1190 <process_line+0x70>
call   1030 <isalnum@plt>
test   %rax,%rax
jne    1190 <process_line+0x70>
movzbl 0x1(%rbp),%eax
add    $0x1,%rbp
jmp    1160 <process_line+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %ebx,%ebx
jmp    11a4 <process_line+0x84>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
movzbl 0x0(%rbp,%rbx,1),%edi
call   1030 <isalnum@plt>
test   %rax,%rax
jne    11a0 <process_line+0x80>
movzbl 0x0(%rbp,%rbx,1),%r13d
cmp    $0x27,%r13b
je     11a0 <process_line+0x80>
test   %rbx,%rbx
je     1140 <process_line+0x20>
lea    (%rbx,%rbp,1),%r14
movb   $0x0,0x0(%rbp,%rbx,1)
mov    %rbp,%rdi
mov    0x4(%rsp),%esi
mov    %r15,%rdx
call   1040 <addtree_line@plt>
mov    %rax,%r15
mov    %r13b,0x0(%rbp,%rbx,1)
mov    %r14,%rbp
jmp    1140 <process_line+0x20>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tnode = type { i32 }
define %struct.tnode* @process_line(i8* %0, i32 %1, %struct.tnode* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.tnode*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.tnode* %2, %struct.tnode** %6
%10 = load i8*, i8** %4
store i8* %10, i8** %7
br label %11
11: ; preds = %82, %3
%12 = load i8*, i8** %7
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 10
br i1 %15, label %16, label %21
16: ; preds = %11
%17 = load i8*, i8** %7
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 13
br label %21
21: ; preds = %16, %11
%22 = phi i1 [ false, %11 ], [ %20, %16 ]
br i1 %22, label %23, label %83
23: ; preds = %21
br label %24
24: ; preds = %47, %23
%25 = load i8*, i8** %7
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp ne i32 %27, 10
br i1 %28, label %29, label %45
29: ; preds = %24
%30 = load i8*, i8** %7
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 13
br i1 %33, label %34, label %45
34: ; preds = %29
%35 = load i8*, i8** %7
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp ne i32 %37, 39
br i1 %38, label %39, label %45
39: ; preds = %34
%40 = load i8*, i8** %7
%41 = load i8, i8* %40
%42 = call i64 @isalnum(i8 zeroext %41)
%43 = icmp ne i64 %42, 0
%44 = xor i1 %43, true
br label %45
45: ; preds = %39, %34, %29, %24
%46 = phi i1 [ false, %34 ], [ false, %29 ], [ false, %24 ], [ %44, %39 ]
br i1 %46, label %47, label %50
47: ; preds = %45
%48 = load i8*, i8** %7
%49 = getelementptr inbounds i8, i8* %48, i32 1
store i8* %49, i8** %7
br label %24
50: ; preds = %45
%51 = load i8*, i8** %7
store i8* %51, i8** %8
br label %52
52: ; preds = %64, %50
%53 = load i8*, i8** %8
%54 = load i8, i8* %53
%55 = call i64 @isalnum(i8 zeroext %54)
%56 = icmp ne i64 %55, 0
br i1 %56, label %62, label %57
57: ; preds = %52
%58 = load i8*, i8** %8
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 39
br label %62
62: ; preds = %57, %52
%63 = phi i1 [ true, %52 ], [ %61, %57 ]
br i1 %63, label %64, label %67
64: ; preds = %62
%65 = load i8*, i8** %8
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %8
br label %52
67: ; preds = %62
%68 = load i8*, i8** %8
%69 = load i8*, i8** %7
%70 = icmp ne i8* %68, %69
br i1 %70, label %71, label %82
71: ; preds = %67
%72 = load i8*, i8** %8
%73 = load i8, i8* %72
store i8 %73, i8* %9
%74 = load i8*, i8** %8
store i8 0, i8* %74
%75 = load i8*, i8** %7
%76 = load i32, i32* %5
%77 = load %struct.tnode*, %struct.tnode** %6
%78 = call %struct.tnode* @addtree_line(i8* %75, i32 %76, %struct.tnode* %77)
store %struct.tnode* %78, %struct.tnode** %6
%79 = load i8, i8* %9
%80 = load i8*, i8** %8
store i8 %79, i8* %80
%81 = load i8*, i8** %8
store i8* %81, i8** %7
br label %82
82: ; preds = %71, %67
br label %11
83: ; preds = %21
%84 = load %struct.tnode*, %struct.tnode** %6
ret %struct.tnode* %84
}

LLVM IR (-O2):
%struct.tnode = type { i32 }
define %struct.tnode* @process_line(i8* %0, i32 %1, %struct.tnode* %2) {
br label %4
4: ; preds = %32, %3
%5 = phi i8* [ %21, %32 ], [ %0, %3 ]
%6 = phi %struct.tnode* [ %33, %32 ], [ %2, %3 ]
br label %7
7: ; preds = %4, %30
%8 = phi i8* [ %12, %30 ], [ %5, %4 ]
%9 = load i8, i8* %8
switch i8 %9, label %10 [
i8 10, label %34
i8 13, label %34
]
10: ; preds = %7, %17
%11 = phi i8 [ %19, %17 ], [ %9, %7 ]
%12 = phi i8* [ %18, %17 ], [ %8, %7 ]
switch i8 %11, label %13 [
i8 10, label %16
i8 13, label %16
i8 39, label %16
]
13: ; preds = %10
%14 = tail call i64 @isalnum(i8 zeroext %11)
%15 = icmp eq i64 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %10, %10, %10, %13
br label %20
17: ; preds = %13
%18 = getelementptr inbounds i8, i8* %12, i64 1
%19 = load i8, i8* %18
br label %10
20: ; preds = %16, %28
%21 = phi i8* [ %29, %28 ], [ %12, %16 ]
%22 = load i8, i8* %21
%23 = tail call i64 @isalnum(i8 zeroext %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = load i8, i8* %21
%27 = icmp eq i8 %26, 39
br i1 %27, label %28, label %30
28: ; preds = %20, %25
%29 = getelementptr inbounds i8, i8* %21, i64 1
br label %20
30: ; preds = %25
%31 = icmp eq i8* %21, %12
br i1 %31, label %7, label %32
32: ; preds = %30
store i8 0, i8* %21
%33 = tail call %struct.tnode* @addtree_line(i8* %12, i32 %1, %struct.tnode* %6)
store i8 %26, i8* %21
br label %4
34: ; preds = %7, %7
ret %struct.tnode* %6
}