#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 word {
  int dummy;
};

/* Variables and functions */
struct word *addwordlen(char *, int, struct word *);
scalar_t__ isalnum(char);
struct word *processline(char *line, struct word *wlist) {
  char *thisword = NULL;
  for (; *line != 0; line++) {
    if (isalnum(*line)) {
      if (thisword == NULL)
        thisword = line;
    } else {
      if (thisword != NULL) {
        wlist = addwordlen(thisword, line - thisword, wlist);
        thisword = NULL;
      }
    }
  }
  return wlist;
}


x86 assembly (clang, -O0):
<processline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11c2 <processline+0xa2>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
je     1176 <processline+0x56>
cmpq   $0x0,-0x18(%rbp)
jne    1171 <processline+0x51>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    11ac <processline+0x8c>
cmpq   $0x0,-0x18(%rbp)
je     11a7 <processline+0x87>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <addwordlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
jmp    11ac <processline+0x8c>
jmp    11b1 <processline+0x91>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1138 <processline+0x18>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processline>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    (%rdi),%al
test   %al,%al
je     1180 <processline+0x60>
mov    %rdi,%rbx
xor    %r15d,%r15d
mov    %ebx,%ebp
jmp    1156 <processline+0x36>
nopw   0x0(%rax,%rax,1)
test   %r15,%r15
cmove  %rbx,%r15
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
add    $0x1,%ebp
test   %al,%al
je     1180 <processline+0x60>
movsbl %al,%edi
call   1030 <isalnum@plt>
test   %rax,%rax
jne    1140 <processline+0x20>
test   %r15,%r15
je     117b <processline+0x5b>
mov    %ebp,%esi
sub    %r15d,%esi
mov    %r15,%rdi
mov    %r14,%rdx
call   1040 <addwordlen@plt>
mov    %rax,%r14
xor    %r15d,%r15d
jmp    1147 <processline+0x27>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.word = type { i32 }
define %struct.word* @processline(i8* %0, %struct.word* %1) {
%3 = alloca i8*
%4 = alloca %struct.word*
%5 = alloca i8*
store i8* %0, i8** %3
store %struct.word* %1, %struct.word** %4
store i8* null, i8** %5
br label %6
6: ; preds = %37, %2
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %40
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = call i64 @isalnum(i8 signext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load i8*, i8** %3
store i8* %20, i8** %5
br label %21
21: ; preds = %19, %16
br label %36
22: ; preds = %11
%23 = load i8*, i8** %5
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %35
25: ; preds = %22
%26 = load i8*, i8** %5
%27 = load i8*, i8** %3
%28 = load i8*, i8** %5
%29 = ptrtoint i8* %27 to i64
%30 = ptrtoint i8* %28 to i64
%31 = sub i64 %29, %30
%32 = trunc i64 %31 to i32
%33 = load %struct.word*, %struct.word** %4
%34 = call %struct.word* @addwordlen(i8* %26, i32 %32, %struct.word* %33)
store %struct.word* %34, %struct.word** %4
store i8* null, i8** %5
br label %35
35: ; preds = %25, %22
br label %36
36: ; preds = %35, %21
br label %37
37: ; preds = %36
%38 = load i8*, i8** %3
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %3
br label %6
40: ; preds = %6
%41 = load %struct.word*, %struct.word** %4
ret %struct.word* %41
}

LLVM IR (-O2):
%struct.word = type { i32 }
define %struct.word* @processline(i8* %0, %struct.word* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %28, label %5
5: ; preds = %2, %22
%6 = phi i8 [ %26, %22 ], [ %3, %2 ]
%7 = phi i8* [ %24, %22 ], [ null, %2 ]
%8 = phi %struct.word* [ %23, %22 ], [ %1, %2 ]
%9 = phi i8* [ %25, %22 ], [ %0, %2 ]
%10 = tail call i64 @isalnum(i8 signext %6)
%11 = icmp eq i64 %10, 0
%12 = icmp eq i8* %7, null
br i1 %11, label %15, label %13
13: ; preds = %5
%14 = select i1 %12, i8* %9, i8* %7
br label %22
15: ; preds = %5
br i1 %12, label %22, label %16
16: ; preds = %15
%17 = ptrtoint i8* %9 to i64
%18 = ptrtoint i8* %7 to i64
%19 = sub i64 %17, %18
%20 = trunc i64 %19 to i32
%21 = tail call %struct.word* @addwordlen(i8* %7, i32 %20, %struct.word* %8)
br label %22
22: ; preds = %13, %16, %15
%23 = phi %struct.word* [ %21, %16 ], [ %8, %15 ], [ %8, %13 ]
%24 = phi i8* [ null, %16 ], [ null, %15 ], [ %14, %13 ]
%25 = getelementptr inbounds i8, i8* %9, i64 1
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 0
br i1 %27, label %28, label %5
28: ; preds = %22, %2
%29 = phi %struct.word* [ %1, %2 ], [ %23, %22 ]
ret %struct.word* %29
}