#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 */
char *strtok(char *, char *);
char *get_node_name(char *str) {
  char *word = strtok(str, " ");
  int count = 0;
  while ((word != NULL) && (++count)) {
    if (count == 9)
      break;
    word = strtok(NULL, " ");
  }
  return word;
}


x86 assembly (clang, -O0):
<get_node_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
je     1159 <get_node_name+0x49>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1169 <get_node_name+0x59>
jmp    1191 <get_node_name+0x81>
cmpl   $0x9,-0x14(%rbp)
jne    1178 <get_node_name+0x68>
jmp    1191 <get_node_name+0x81>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe7d(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
jmp    1137 <get_node_name+0x27>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_node_name>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strtok@plt>
test   %rax,%rax
je     11be <get_node_name+0xae>
lea    0xed3(%rip),%rsi
xor    %edi,%edi
call   1030 <strtok@plt>
test   %rax,%rax
je     11be <get_node_name+0xae>
lea    0xebc(%rip),%rsi
xor    %edi,%edi
call   1030 <strtok@plt>
test   %rax,%rax
je     11be <get_node_name+0xae>
lea    0xea9(%rip),%rsi
xor    %edi,%edi
call   1030 <strtok@plt>
test   %rax,%rax
je     11be <get_node_name+0xae>
lea    0xe96(%rip),%rsi
xor    %edi,%edi
call   1030 <strtok@plt>
test   %rax,%rax
je     11be <get_node_name+0xae>
lea    0xe83(%rip),%rsi
xor    %edi,%edi
call   1030 <strtok@plt>
test   %rax,%rax
je     11be <get_node_name+0xae>
lea    0xe70(%rip),%rsi
xor    %edi,%edi
call   1030 <strtok@plt>
test   %rax,%rax
je     11be <get_node_name+0xae>
lea    0xe5d(%rip),%rsi
xor    %edi,%edi
call   1030 <strtok@plt>
test   %rax,%rax
je     11be <get_node_name+0xae>
lea    0xe4a(%rip),%rsi
xor    %edi,%edi
pop    %rax
jmp    1030 <strtok@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i8* @get_node_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
store i32 0, i32* %4
br label %7
7: ; preds = %20, %1
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %10, %7
%15 = phi i1 [ false, %7 ], [ %13, %10 ]
br i1 %15, label %16, label %22
16: ; preds = %14
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 9
br i1 %18, label %19, label %20
19: ; preds = %16
br label %22
20: ; preds = %16
%21 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %21, i8** %3
br label %7
22: ; preds = %19, %14
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define i8* @get_node_name(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %27, label %4
4: ; preds = %1
%5 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %5, null
br i1 %6, label %27, label %7
7: ; preds = %4
%8 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %27, label %10
10: ; preds = %7
%11 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i8* %11, null
br i1 %12, label %27, label %13
13: ; preds = %10
%14 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %27, label %16
16: ; preds = %13
%17 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i8* %17, null
br i1 %18, label %27, label %19
19: ; preds = %16
%20 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i8* %20, null
br i1 %21, label %27, label %22
22: ; preds = %19
%23 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%24 = icmp eq i8* %23, null
br i1 %24, label %27, label %25
25: ; preds = %22
%26 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %27
27: ; preds = %25, %4, %7, %10, %13, %16, %19, %22, %1
%28 = phi i8* [ null, %1 ], [ null, %4 ], [ null, %7 ], [ null, %10 ], [ null, %13 ], [ null, %16 ], [ null, %19 ], [ null, %22 ], [ %26, %25 ]
ret i8* %28
}