#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 *ft_str_space_dup(char *);
char *ft_get_word(char *str) {
  char *copy;
  int i;
  i = 0;
  while (str[i] == ' ' || str[i] == '\t')
    i++;
  copy = ft_str_space_dup(str + i);
  return (copy);
}


x86 assembly (clang, -O0):
<ft_get_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x15(%rbp)
je     1152 <ft_get_word+0x42>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1162 <ft_get_word+0x52>
jmp    1170 <ft_get_word+0x60>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <ft_get_word+0x13>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
call   1030 <ft_str_space_dup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_get_word>:
xor    %eax,%eax
jmp    1124 <ft_get_word+0x14>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rax
movzbl (%rdi,%rax,1),%ecx
cmp    $0x20,%cl
je     1120 <ft_get_word+0x10>
cmp    $0x9,%cl
je     1120 <ft_get_word+0x10>
mov    %eax,%eax
add    %rax,%rdi
jmp    1030 <ft_str_space_dup@plt>

LLVM IR (-O0):
define i8* @ft_get_word(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
br label %5
5: ; preds = %23, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %21, label %13
13: ; preds = %5
%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, 9
br label %21
21: ; preds = %13, %5
%22 = phi i1 [ true, %5 ], [ %20, %13 ]
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %21
%27 = load i8*, i8** %2
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
%31 = call i8* @ft_str_space_dup(i8* %30)
store i8* %31, i8** %3
%32 = load i8*, i8** %3
ret i8* %32
}

LLVM IR (-O2):
define i8* @ft_get_word(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %2, %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2
%9 = and i64 %3, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = tail call i8* @ft_str_space_dup(i8* %10)
ret i8* %11
}