#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 /*<<< orphan*/ hash(int /*<<< orphan*/);
int strlen(char *);
int /*<<< orphan*/ strndup(char *, int);
void get_word(char *word) {
  int index = 0;
  int sec_index = 0;
  int length = 0;
  length = strlen(word) - 7;
  for (index = 0, sec_index = 1; sec_index < length; sec_index++) {
    if (word[sec_index] == ' ') {
      hash(strndup(word + index, sec_index - index));
      index = sec_index + 1;
    }
  }
}


x86 assembly (clang, -O0):
<get_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x7,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c8 <get_word+0x98>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    11b5 <get_word+0x85>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%esi
sub    -0xc(%rbp),%esi
call   1050 <strndup@plt>
mov    %eax,%edi
call   1040 <hash@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ba <get_word+0x8a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    116e <get_word+0x3e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_word>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
cmp    $0x9,%eax
jl     1191 <get_word+0x61>
mov    %eax,%r14d
add    $0xfffffff9,%r14d
xor    %eax,%eax
mov    $0x1,%ebx
jmp    1181 <get_word+0x51>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cltq
lea    (%r15,%rax,1),%rdi
mov    %ebx,%esi
sub    %eax,%esi
call   1050 <strndup@plt>
mov    %eax,%edi
call   1040 <hash@plt>
add    $0x1,%rbx
mov    %ebx,%eax
cmp    %r14,%rbx
je     1191 <get_word+0x61>
cmpb   $0x20,(%r15,%rbx,1)
je     1160 <get_word+0x30>
add    $0x1,%rbx
cmp    %r14,%rbx
jne    1181 <get_word+0x51>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @get_word(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = sub nsw i32 %7, 7
store i32 %8, i32* %5
store i32 0, i32* %3
store i32 1, i32* %4
br label %9
9: ; preds = %34, %1
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %37
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 32
br i1 %20, label %21, label %33
21: ; preds = %13
%22 = load i8*, i8** %2
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = sub nsw i32 %26, %27
%29 = call i32 @strndup(i8* %25, i32 %28)
%30 = call i32 @hash(i32 %29)
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %33
33: ; preds = %21, %13
br label %34
34: ; preds = %33
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 1
store i32 %36, i32* %4
br label %9
37: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @get_word(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 8
br i1 %3, label %4, label %28
4: ; preds = %1
%5 = add nsw i32 %2, -7
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %24
%8 = phi i64 [ 1, %4 ], [ %25, %24 ]
%9 = phi i32 [ 0, %4 ], [ %26, %24 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 32
br i1 %12, label %15, label %13
13: ; preds = %7
%14 = add nuw nsw i64 %8, 1
br label %24
15: ; preds = %7
%16 = sext i32 %9 to i64
%17 = getelementptr inbounds i8, i8* %0, i64 %16
%18 = trunc i64 %8 to i32
%19 = sub nsw i32 %18, %9
%20 = tail call i32 @strndup(i8* %17, i32 %19)
%21 = tail call i32 @hash(i32 %20)
%22 = add nuw nsw i64 %8, 1
%23 = trunc i64 %22 to i32
br label %24
24: ; preds = %13, %15
%25 = phi i64 [ %14, %13 ], [ %22, %15 ]
%26 = phi i32 [ %9, %13 ], [ %23, %15 ]
%27 = icmp eq i64 %25, %6
br i1 %27, label %28, label %7
28: ; preds = %24, %1
ret void
}