#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ _assert(char *, int, char *);
int /*<<< orphan*/ _debug(char *, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ fwrite(char *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ *getcwd(char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
char *strpbrk(char *, char *);
int /*<<< orphan*/ *strstr(char *, char *);
char *strtok(char *, char *);
void setTestData(char *queryString, FILE *testQuery) {
  char *token, *value, *pQuery;
  char cwd[1000] = {'\0'};
  char tempQuery[1000] = {'\0'};
  char testString[1000] = {'\0'};
  strcpy(tempQuery, queryString);
  if (strstr(queryString, "///") != NULL) {
    if (getcwd(cwd, 1000) == NULL)
      _debug("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/CS4098Group/Project/refs/heads/master/"
             "peos/os/virtual_repository/testSuites/testFSsearchSeek.c",
             101, 0, "error from getcwd()...");
    else {
      token = strtok(tempQuery, ":");
      _assert("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/CS4098Group/Project/refs/heads/master/"
              "peos/os/virtual_repository/testSuites/testFSsearchSeek.c",
              105, token);
      strcat(testString, token);
      strcat(testString, "://");
      strcat(testString, cwd);
      value = strpbrk(queryString, ":");
      _assert("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/CS4098Group/Project/refs/heads/master/"
              "peos/os/virtual_repository/testSuites/testFSsearchSeek.c",
              112, value);
      strcat(testString, value + 3);
    }
  } else
    strcpy(testString, queryString);
  fwrite(testString, sizeof(char), strlen(testString), testQuery);
}


x86 assembly (clang, -O0):
<setTestData>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc00,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1050 <memset@plt>
lea    -0x800(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1050 <memset@plt>
lea    -0xbf0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1050 <memset@plt>
lea    -0x800(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xde9(%rip),%rsi
call   10d0 <strstr@plt>
cmp    $0x0,%rax
je     1304 <setTestData+0x154>
lea    -0x410(%rbp),%rdi
mov    $0x3e8,%esi
call   1060 <getcwd@plt>
cmp    $0x0,%rax
jne    1260 <setTestData+0xb0>
lea    0xdbc(%rip),%rdi
mov    $0x65,%esi
xor    %edx,%edx
lea    0xe67(%rip),%rcx
call   1070 <_debug@plt>
jmp    12ff <setTestData+0x14f>
lea    -0x800(%rbp),%rdi
lea    0xe66(%rip),%rsi
call   1090 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
lea    0xd82(%rip),%rdi
mov    $0x69,%esi
call   10c0 <_assert@plt>
lea    -0xbf0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   10a0 <strcat@plt>
lea    -0xbf0(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   10a0 <strcat@plt>
lea    -0xbf0(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   10a0 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xe07(%rip),%rsi
call   1080 <strpbrk@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdx
lea    0xd23(%rip),%rdi
mov    $0x70,%esi
call   10c0 <_assert@plt>
lea    -0xbf0(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x3,%rsi
call   10a0 <strcat@plt>
jmp    1314 <setTestData+0x164>
lea    -0xbf0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xbf0(%rbp),%rax
mov    %rax,-0xbf8(%rbp)
lea    -0xbf0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0xbf8(%rbp),%rdi
mov    %eax,%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   10b0 <fwrite@plt>
add    $0xc00,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setTestData>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xbd0,%rsp
mov    %rsi,%r14
mov    %rdi,%r13
lea    0x3f0(%rsp),%rdi
mov    $0x3e8,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0x7e0(%rsp),%rbx
mov    $0x3e8,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
mov    %rsp,%rdi
mov    $0x3e8,%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
lea    0xdee(%rip),%rsi
mov    %r13,%rdi
call   10d0 <strstr@plt>
test   %rax,%rax
je     12ca <setTestData+0x11a>
lea    0x3f0(%rsp),%rdi
mov    $0x3e8,%esi
call   1070 <getcwd@plt>
test   %rax,%rax
je     12d7 <setTestData+0x127>
lea    0xe8f(%rip),%rsi
lea    0x7e0(%rsp),%rdi
call   1090 <strtok@plt>
mov    %rax,%rbx
lea    0xda8(%rip),%r15
mov    %r15,%rdi
mov    $0x69,%esi
mov    %rax,%rdx
call   10c0 <_assert@plt>
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rbx,%rsi
call   10a0 <strcat@plt>
lea    0xe55(%rip),%rsi
mov    %r12,%rdi
call   10a0 <strcat@plt>
lea    0x3f0(%rsp),%rsi
mov    %r12,%rdi
call   10a0 <strcat@plt>
mov    %r13,%rdi
mov    $0x3a,%esi
call   1050 <strchr@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    $0x70,%esi
mov    %rax,%rdx
call   10c0 <_assert@plt>
add    $0x3,%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   10a0 <strcat@plt>
jmp    12f1 <setTestData+0x141>
mov    %rsp,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
jmp    12f1 <setTestData+0x141>
lea    0xd26(%rip),%rdi
lea    0xdd8(%rip),%rcx
mov    $0x65,%esi
xor    %edx,%edx
call   1080 <_debug@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   10b0 <fwrite@plt>
add    $0xbd0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"///\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CS4098Group/Project/refs/heads/master/peos/os/virtual_repository/testSuites/testFSsearchSeek.c\00"
@.str.2 = [23 x i8] c"error from getcwd()...\00"
@.str.3 = [2 x i8] c":\00"
@.str.4 = [4 x i8] c"://\00"
define void @setTestData(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [1000 x i8]
%9 = alloca [1000 x i8]
%10 = alloca [1000 x i8]
store i8* %0, i8** %3
store i32* %1, i32** %4
%11 = bitcast [1000 x i8]* %8 to i8*
%12 = bitcast [1000 x i8]* %9 to i8*
%13 = bitcast [1000 x i8]* %10 to i8*
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %3
%18 = call i32* @strstr(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %48
20: ; preds = %2
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%22 = call i32* @getcwd(i8* %21, i32 1000)
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = call i32 @_debug(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 101, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %47
26: ; preds = %20
%27 = getelementptr inbounds [1000 x i8], [1000 x i8]* %9, i64 0, i64 0
%28 = call i8* @strtok(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %28, i8** %5
%29 = load i8*, i8** %5
%30 = call i32 @_assert(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 105, i8* %29)
%31 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%32 = load i8*, i8** %5
%33 = call i32 @strcat(i8* %31, i8* %32)
%34 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%35 = call i32 @strcat(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%36 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%37 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%38 = call i32 @strcat(i8* %36, i8* %37)
%39 = load i8*, i8** %3
%40 = call i8* @strpbrk(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %40, i8** %6
%41 = load i8*, i8** %6
%42 = call i32 @_assert(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 112, i8* %41)
%43 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%44 = load i8*, i8** %6
%45 = getelementptr inbounds i8, i8* %44, i64 3
%46 = call i32 @strcat(i8* %43, i8* %45)
br label %47
47: ; preds = %26, %24
br label %52
48: ; preds = %2
%49 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%50 = load i8*, i8** %3
%51 = call i32 @strcpy(i8* %49, i8* %50)
br label %52
52: ; preds = %48, %47
%53 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%54 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%55 = call i32 @strlen(i8* %54)
%56 = load i32*, i32** %4
%57 = call i32 @fwrite(i8* %53, i32 1, i32 %55, i32* %56)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"///\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CS4098Group/Project/refs/heads/master/peos/os/virtual_repository/testSuites/testFSsearchSeek.c\00"
@.str.2 = [23 x i8] c"error from getcwd()...\00"
@.str.3 = [2 x i8] c":\00"
@.str.4 = [4 x i8] c"://\00"
define void @setTestData(i8* %0, i32* nocapture %1) {
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
%5 = alloca [1000 x i8]
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%9 = call i32 @strcpy(i8* %7, i8* %0)
%10 = call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %27, label %12
12: ; preds = %2
%13 = call i32* @getcwd(i8* %6, i32 1000)
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @_debug(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 101, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %29
17: ; preds = %12
%18 = call i8* @strtok(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 @_assert(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 105, i8* %18)
%20 = call i32 @strcat(i8* %8, i8* %18)
%21 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 @strcat(i8* %8, i8* %6)
%23 = call i8* @strchr(i8* dereferenceable(1) %0, i32 58)
%24 = call i32 @_assert(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 112, i8* %23)
%25 = getelementptr inbounds i8, i8* %23, i64 3
%26 = call i32 @strcat(i8* %8, i8* %25)
br label %29
27: ; preds = %2
%28 = call i32 @strcpy(i8* %8, i8* %0)
br label %29
29: ; preds = %15, %17, %27
%30 = call i32 @strlen(i8* %8)
%31 = call i32 @fwrite(i8* %8, i32 1, i32 %30, i32* %1)
ret void
}