#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 */
scalar_t__ isspace(char);
char *Get_token(char *ln, char *tk) {
  char c;
  while (*ln && isspace(*ln))
    ++ln;
  do {
    c = *ln++;
    if (c == ' ' || c == 0)
      break;
    *tk++ = c;
  } while (1);
  *tk = 0;
  return (ln);
}


x86 assembly (clang, -O0):
<Get_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     114b <Get_token+0x3b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    115b <Get_token+0x4b>
jmp    116c <Get_token+0x5c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <Get_token+0x10>
jmp    1171 <Get_token+0x61>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x20,%eax
je     119f <Get_token+0x8f>
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    11a4 <Get_token+0x94>
jmp    11c7 <Get_token+0xb7>
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    $0x1,%al
test   $0x1,%al
jne    1171 <Get_token+0x61>
jmp    11c7 <Get_token+0xb7>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_token>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     114c <Get_token+0x3c>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     115f <Get_token+0x4f>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <Get_token+0x20>
add    $0xffffffffffffffff,%rbx
add    $0x1,%rbx
movb   $0x0,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    -0x1(%rbx),%al
test   $0xdf,%al
je     1150 <Get_token+0x40>
cs nopw 0x0(%rax,%rax,1)
mov    %al,(%r14)
add    $0x1,%r14
movzbl (%rbx),%eax
add    $0x1,%rbx
test   $0xdf,%al
jne    1170 <Get_token+0x60>
jmp    1150 <Get_token+0x40>

LLVM IR (-O0):
define i8* @Get_token(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %6
6: ; preds = %18, %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 %16
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = call i64 @isspace(i8 signext %13)
%15 = icmp ne i64 %14, 0
br label %16
16: ; preds = %11, %6
%17 = phi i1 [ false, %6 ], [ %15, %11 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %6
21: ; preds = %16
br label %22
22: ; preds = %38, %21
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
%25 = load i8, i8* %23
store i8 %25, i8* %5
%26 = load i8, i8* %5
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 32
br i1 %28, label %33, label %29
29: ; preds = %22
%30 = load i8, i8* %5
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %29, %22
br label %39
34: ; preds = %29
%35 = load i8, i8* %5
%36 = load i8*, i8** %4
%37 = getelementptr inbounds i8, i8* %36, i32 1
store i8* %37, i8** %4
store i8 %35, i8* %36
br label %38
38: ; preds = %34
br i1 true, label %22, label %39
39: ; preds = %38, %33
%40 = load i8*, i8** %4
store i8 0, i8* %40
%41 = load i8*, i8** %3
ret i8* %41
}

LLVM IR (-O2):
define i8* @Get_token(i8* %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = tail call i64 @isspace(i8 signext %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ]
%16 = getelementptr inbounds i8, i8* %15, i64 1
br label %31
17: ; preds = %5
%18 = load i8, i8* %7
%19 = getelementptr inbounds i8, i8* %7, i64 1
%20 = and i8 %18, -33
%21 = icmp eq i8 %20, 0
br i1 %21, label %31, label %22
22: ; preds = %17, %22
%23 = phi i8 [ %28, %22 ], [ %18, %17 ]
%24 = phi i8* [ %27, %22 ], [ %19, %17 ]
%25 = phi i8* [ %26, %22 ], [ %1, %17 ]
%26 = getelementptr inbounds i8, i8* %25, i64 1
store i8 %23, i8* %25
%27 = getelementptr inbounds i8, i8* %24, i64 1
%28 = load i8, i8* %24
%29 = and i8 %28, -33
%30 = icmp eq i8 %29, 0
br i1 %30, label %31, label %22
31: ; preds = %22, %14, %17
%32 = phi i8* [ %1, %17 ], [ %1, %14 ], [ %26, %22 ]
%33 = phi i8* [ %19, %17 ], [ %16, %14 ], [ %27, %22 ]
store i8 0, i8* %32
ret i8* %33
}