#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 */
int /*<<< orphan*/ _assert(char *, int, char *);
int /*<<< orphan*/ _debug(char *, int, int, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strdup(char *);
char *strtok(char *, char *);
void setConfiguartionData(char *theLine, char *newLine, char *cwd,
                          char *searchDir) {
  char *lineType, *testLine;
  char fileTestSite[] = "/testDir";
  _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/testUpdateTestSite.c",
         185, 5, "cwd is %s", cwd);
  lineType = testLine = NULL;
  testLine = strdup(theLine);
  lineType = strtok(testLine, "=");
  _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/testUpdateTestSite.c",
          192, lineType);
  if ((strcmp("SEARCHDIR", lineType) == 0)) {
    sprintf(newLine, "%s%s%s\n", "SEARCHDIR=", cwd, fileTestSite);
    strcat(searchDir, cwd);
    strcat(searchDir, fileTestSite);
  } else if ((strcmp("MAILBOX", lineType) == 0))
    sprintf(newLine, "%s%s/%s\n", "MAILBOX=", cwd, "mailBox.dat");
  else
    strcpy(newLine, theLine);
  free(testLine);
}


x86 assembly (clang, -O0):
<setConfiguartionData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0xe51(%rip),%rax
mov    %rax,-0x39(%rbp)
mov    0xe4f(%rip),%al
mov    %al,-0x31(%rbp)
mov    -0x18(%rbp),%r8
lea    0xe42(%rip),%rdi
mov    $0xb9,%esi
mov    $0x5,%edx
lea    0xeec(%rip),%rcx
call   1060 <_debug@plt>
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   10b0 <strdup@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xee4(%rip),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdx
lea    0xdf0(%rip),%rdi
mov    $0xc0,%esi
call   10a0 <_assert@plt>
mov    -0x28(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    127b <setConfiguartionData+0xeb>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
lea    -0x39(%rbp),%r8
lea    0xe88(%rip),%rsi
lea    0xe89(%rip),%rdx
call   1090 <sprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    -0x39(%rbp),%rsi
call   1080 <strcat@plt>
jmp    12ce <setConfiguartionData+0x13e>
mov    -0x28(%rbp),%rsi
lea    0xe65(%rip),%rdi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12bc <setConfiguartionData+0x12c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
lea    0xe4f(%rip),%rsi
lea    0xe51(%rip),%rdx
lea    0xe53(%rip),%r8
call   1090 <sprintf@plt>
jmp    12c9 <setConfiguartionData+0x139>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
jmp    12ce <setConfiguartionData+0x13e>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setConfiguartionData>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,0x10(%rsp)
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
movabs $0x726944747365742f,%rax
44 69 72
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0xe43(%rip),%r12
lea    0xef7(%rip),%rcx
mov    %r12,%rdi
mov    $0xb9,%esi
mov    $0x5,%edx
mov    %r14,%r8
call   1060 <_debug@plt>
mov    %r13,%rdi
call   10b0 <strdup@plt>
mov    %rax,%rbx
lea    0xef5(%rip),%rsi
mov    %rax,%rdi
call   1070 <strtok@plt>
mov    %rax,%rbp
mov    %r12,%rdi
mov    $0xc0,%esi
mov    %rax,%rdx
call   10a0 <_assert@plt>
lea    0xeb8(%rip),%rdi
mov    %rbp,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1244 <setConfiguartionData+0xb4>
lea    0xec1(%rip),%rdi
mov    %rbp,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1280 <setConfiguartionData+0xf0>
mov    %r15,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
jmp    12a0 <setConfiguartionData+0x110>
lea    0xe8d(%rip),%rsi
lea    0xe8e(%rip),%rdx
mov    %rsp,%r12
mov    %r15,%rdi
mov    %r14,%rcx
mov    %r12,%r8
call   1090 <sprintf@plt>
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
call   1080 <strcat@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1080 <strcat@plt>
jmp    12a0 <setConfiguartionData+0x110>
lea    0xe6c(%rip),%rsi
lea    0xe6e(%rip),%rdx
lea    0xe70(%rip),%r8
mov    %r15,%rdi
mov    %r14,%rcx
call   1090 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.setConfiguartionData.fileTestSite = [9 x i8] c"/testDir\00"
@.str = [187 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/testUpdateTestSite.c\00"
@.str.1 = [10 x i8] c"cwd is %s\00"
@.str.2 = [2 x i8] c"=\00"
@.str.3 = [10 x i8] c"SEARCHDIR\00"
@.str.4 = [8 x i8] c"%s%s%s\0A\00"
@.str.5 = [11 x i8] c"SEARCHDIR=\00"
@.str.6 = [8 x i8] c"MAILBOX\00"
@.str.7 = [9 x i8] c"%s%s/%s\0A\00"
@.str.8 = [9 x i8] c"MAILBOX=\00"
@.str.9 = [12 x i8] c"mailBox.dat\00"
define void @setConfiguartionData(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [9 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%12 = bitcast [9 x i8]* %11 to i8*
%13 = load i8*, i8** %7
%14 = call i32 @_debug(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 185, i32 5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %13)
store i8* null, i8** %10
store i8* null, i8** %9
%15 = load i8*, i8** %5
%16 = call i8* @strdup(i8* %15)
store i8* %16, i8** %10
%17 = load i8*, i8** %10
%18 = call i8* @strtok(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i8* %18, i8** %9
%19 = load i8*, i8** %9
%20 = call i32 @_assert(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 192, i8* %19)
%21 = load i8*, i8** %9
%22 = call i64 @strcmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %35
24: ; preds = %4
%25 = load i8*, i8** %6
%26 = load i8*, i8** %7
%27 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 0
%28 = call i32 @sprintf(i8* %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %26, i8* %27)
%29 = load i8*, i8** %8
%30 = load i8*, i8** %7
%31 = call i32 @strcat(i8* %29, i8* %30)
%32 = load i8*, i8** %8
%33 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 0
%34 = call i32 @strcat(i8* %32, i8* %33)
br label %48
35: ; preds = %4
%36 = load i8*, i8** %9
%37 = call i64 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %36)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %35
%40 = load i8*, i8** %6
%41 = load i8*, i8** %7
%42 = call i32 @sprintf(i8* %40, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %41, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %47
43: ; preds = %35
%44 = load i8*, i8** %6
%45 = load i8*, i8** %5
%46 = call i32 @strcpy(i8* %44, i8* %45)
br label %47
47: ; preds = %43, %39
br label %48
48: ; preds = %47, %24
%49 = load i8*, i8** %10
%50 = call i32 @free(i8* %49)
ret void
}

LLVM IR (-O2):
@__const.setConfiguartionData.fileTestSite = [9 x i8] c"/testDir\00"
@.str = [187 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/testUpdateTestSite.c\00"
@.str.1 = [10 x i8] c"cwd is %s\00"
@.str.2 = [2 x i8] c"=\00"
@.str.3 = [10 x i8] c"SEARCHDIR\00"
@.str.4 = [8 x i8] c"%s%s%s\0A\00"
@.str.5 = [11 x i8] c"SEARCHDIR=\00"
@.str.6 = [8 x i8] c"MAILBOX\00"
@.str.7 = [9 x i8] c"%s%s/%s\0A\00"
@.str.8 = [9 x i8] c"MAILBOX=\00"
@.str.9 = [12 x i8] c"mailBox.dat\00"
define void @setConfiguartionData(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [9 x i8]
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%7 = tail call i32 @_debug(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 185, i32 5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = tail call i8* @strdup(i8* %0)
%9 = tail call i8* @strtok(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @_assert(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 192, i8* %9)
%11 = tail call i64 @strcmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i8* %2, i8* %6)
%15 = call i32 @strcat(i8* %3, i8* %2)
%16 = call i32 @strcat(i8* %3, i8* %6)
br label %24
17: ; preds = %4
%18 = tail call i64 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* %9)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %24
22: ; preds = %17
%23 = tail call i32 @strcpy(i8* %1, i8* %0)
br label %24
24: ; preds = %20, %22, %13
%25 = call i32 @free(i8* %8)
ret void
}