#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 *extractToken(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strcat(char *, char *);
char *extractTokens(char *szLine, int argNo) {
  static char argBuf[512];
  char *buf;
  argBuf[0] = 0;
  buf = extractToken(szLine, argNo++);
  while (buf != NULL) {
    strcat(argBuf, buf);
    buf = extractToken(szLine, argNo++);
    strcat(argBuf, buf != NULL ? " " : "");
  }
  return argBuf;
}


x86 assembly (clang, -O0):
<extractTokens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,0x2f0a(%rip)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
call   1030 <extractToken@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11ac <extractTokens+0x8c>
mov    -0x18(%rbp),%rsi
lea    0x2edc(%rip),%rdi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
call   1030 <extractToken@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
lea    0xe75(%rip),%rsi
lea    0xe6d(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0x2e9e(%rip),%rdi
call   1040 <strcat@plt>
jmp    114e <extractTokens+0x2e>
lea    0x2e8d(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractTokens>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
movb   $0x0,0x2f09(%rip)
call   1030 <extractToken@plt>
test   %rax,%rax
je     1192 <extractTokens+0x72>
mov    %rax,%rbx
add    $0x1,%ebp
lea    0x2ef2(%rip),%r15
lea    0xeac(%rip),%r12
lea    0xea4(%rip),%r13
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <strcat@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <extractToken@plt>
mov    %rax,%rbx
test   %rax,%rax
mov    %r13,%rsi
cmove  %r12,%rsi
mov    %r15,%rdi
call   1040 <strcat@plt>
add    $0x1,%ebp
test   %rbx,%rbx
jne    1160 <extractTokens+0x40>
lea    0x2ea7(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@extractTokens.argBuf = internal global [512 x i8] zeroinitializer
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @extractTokens(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i8 0, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @extractTokens.argBuf, i64 0, i64 0)
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
store i32 %8, i32* %4
%9 = call i8* @extractToken(i8* %6, i32 %7)
store i8* %9, i8** %5
br label %10
10: ; preds = %13, %2
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %25
13: ; preds = %10
%14 = load i8*, i8** %5
%15 = call i32 @strcat(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @extractTokens.argBuf, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %3
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
%19 = call i8* @extractToken(i8* %16, i32 %17)
store i8* %19, i8** %5
%20 = load i8*, i8** %5
%21 = icmp ne i8* %20, null
%22 = zext i1 %21 to i64
%23 = select i1 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%24 = call i32 @strcat(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @extractTokens.argBuf, i64 0, i64 0), i8* %23)
br label %10
25: ; preds = %10
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @extractTokens.argBuf, i64 0, i64 0)
}

LLVM IR (-O2):
@extractTokens.argBuf = internal global [512 x i8] zeroinitializer
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @extractTokens(i8* %0, i32 %1) {
store i8 0, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @extractTokens.argBuf, i64 0, i64 0)
%3 = tail call i8* @extractToken(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %1, %2 ]
%7 = phi i8* [ %10, %5 ], [ %3, %2 ]
%8 = add nsw i32 %6, 1
%9 = tail call i32 @strcat(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @extractTokens.argBuf, i64 0, i64 0), i8* %7)
%10 = tail call i8* @extractToken(i8* %0, i32 %8)
%11 = icmp eq i8* %10, null
%12 = select i1 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%13 = tail call i32 @strcat(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @extractTokens.argBuf, i64 0, i64 0), i8* %12)
br i1 %11, label %14, label %5
14: ; preds = %5, %2
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @extractTokens.argBuf, i64 0, i64 0)
}