#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 */

/* Variables and functions */
int EOF;
int getword(char *, int);
scalar_t__ isalnum(char);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char nextword[50] = "";
  int nextchar;
  while ((nextchar = getword(nextword, 50)) != EOF)
    if (isalnum(nextword[0]))
      printf("%s\n", nextword);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1050 <memset@plt>
lea    -0x40(%rbp),%rdi
mov    $0x32,%esi
call   1060 <getword@plt>
mov    %eax,-0x44(%rbp)
mov    0x2e71(%rip),%rcx
cmp    (%rcx),%eax
je     11a7 <main+0x67>
movsbl -0x40(%rbp),%edi
call   1040 <isalnum@plt>
cmp    $0x0,%rax
je     11a2 <main+0x62>
lea    -0x40(%rbp),%rsi
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
jmp    115f <main+0x1f>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movw   $0x0,0x30(%rsp)
mov    %rsp,%rdi
mov    $0x32,%esi
call   1050 <getword@plt>
mov    0x2e83(%rip),%r15
cmp    (%r15),%eax
jne    1176 <main+0x46>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rsp,%rbx
lea    0xe80(%rip),%r14
jmp    11a2 <main+0x72>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x32,%esi
call   1050 <getword@plt>
cmp    (%r15),%eax
je     116a <main+0x3a>
movsbl (%rsp),%edi
call   1040 <isalnum@plt>
test   %rax,%rax
je     1190 <main+0x60>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1190 <main+0x60>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [50 x i8]* %2 to i8*
br label %5
5: ; preds = %18, %0
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = call i32 @getword(i8* %6, i32 50)
store i32 %7, i32* %3
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %5
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%12 = load i8, i8* %11
%13 = call i64 @isalnum(i8 signext %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %15, %10
br label %5
19: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @getword(i8* %2, i32 50)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %16, label %6
6: ; preds = %0, %12
%7 = load i8, i8* %2
%8 = call i64 @isalnum(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %12
12: ; preds = %10, %6
%13 = call i32 @getword(i8* %2, i32 50)
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %6
16: ; preds = %12, %0
ret i32 0
}