#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);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *extractTokenEx(char *szLine, int argNo, char *dir) {
  static char argBuf[512];
  char *p;
  p = extractToken(szLine, argNo);
  if (dir == NULL) {
    return p;
  }
  if (p) {
    strcpy(argBuf, dir);
    strcat(argBuf, "/");
    strcat(argBuf, p);
    return argBuf;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<extractTokenEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <extractToken@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116b <extractTokenEx+0x3b>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11c1 <extractTokenEx+0x91>
cmpq   $0x0,-0x28(%rbp)
je     11b9 <extractTokenEx+0x89>
mov    -0x20(%rbp),%rsi
lea    0x2ecf(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2ec3(%rip),%rdi
lea    0xe6c(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x28(%rbp),%rsi
lea    0x2eac(%rip),%rdi
call   1050 <strcat@plt>
lea    0x2ea0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11c1 <extractTokenEx+0x91>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extractTokenEx>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
call   1040 <extractToken@plt>
mov    %rax,%rbx
test   %r14,%r14
je     117d <extractTokenEx+0x4d>
test   %rbx,%rbx
je     117b <extractTokenEx+0x4b>
lea    0x2eff(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
lea    0xe9d(%rip),%rsi
mov    %r15,%rdi
call   1050 <strcat@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
mov    %r15,%rbx
jmp    117d <extractTokenEx+0x4d>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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