#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__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void findInOutFilesAppend(char **tokens, char *inputFile, char *outputFile) {
  int i;
  for (i = 0; tokens[i] != NULL; i++) {
    if (strcmp(tokens[i], ">>") == 0)
      strcpy(outputFile, tokens[i + 1]);
    if (strcmp(tokens[i], "<") == 0)
      strcpy(inputFile, tokens[i + 1]);
  }
}


x86 assembly (clang, -O0):
<findInOutFilesAppend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11d9 <findInOutFilesAppend+0xb9>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    118a <findInOutFilesAppend+0x6a>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe66(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c6 <findInOutFilesAppend+0xa6>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
jmp    11cb <findInOutFilesAppend+0xab>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <findInOutFilesAppend+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findInOutFilesAppend>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1192 <findInOutFilesAppend+0x72>
mov    %rdx,%r14
mov    %rsi,%r15
add    $0x8,%rbx
lea    0xebb(%rip),%r12
lea    0xeb7(%rip),%r13
jmp    115c <findInOutFilesAppend+0x3c>
xchg   %ax,%ax
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
je     1192 <findInOutFilesAppend+0x72>
mov    %r12,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1174 <findInOutFilesAppend+0x54>
mov    (%rbx),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    -0x8(%rbx),%rdi
mov    %r13,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1150 <findInOutFilesAppend+0x30>
mov    (%rbx),%rsi
mov    %r15,%rdi
call   1030 <strcpy@plt>
jmp    1150 <findInOutFilesAppend+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c">>\00"
@.str.1 = [2 x i8] c"<\00"
define void @findInOutFilesAppend(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 0, i32* %7
br label %8
8: ; preds = %50, %3
%9 = load i8**, i8*** %4
%10 = load i32, i32* %7
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8*, i8** %9, i64 %11
%13 = load i8*, i8** %12
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %53
15: ; preds = %8
%16 = load i8**, i8*** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %32
23: ; preds = %15
%24 = load i8*, i8** %6
%25 = load i8**, i8*** %4
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %25, i64 %28
%30 = load i8*, i8** %29
%31 = call i32 @strcpy(i8* %24, i8* %30)
br label %32
32: ; preds = %23, %15
%33 = load i8**, i8*** %4
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %49
40: ; preds = %32
%41 = load i8*, i8** %5
%42 = load i8**, i8*** %4
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %42, i64 %45
%47 = load i8*, i8** %46
%48 = call i32 @strcpy(i8* %41, i8* %47)
br label %49
49: ; preds = %40, %32
br label %50
50: ; preds = %49
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
store i32 %52, i32* %7
br label %8
53: ; preds = %8
ret void
}

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