#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*/ _debug(char *, int, int, char *, ...);
int /*<<< orphan*/ *getcwd(char *, int);
int main(void) {
  void setTimeValue(char *);
  void getConfiguartionData(char *, char *);
  char cwd[1000] = {'\0'};
  char searchDir[1000] = {'\0'};
  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/testUpdateTestSite.c",
           34, 0, "error from getcwd()...");
  else {
    getConfiguartionData(cwd, searchDir);
    _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",
           38, 5, "cwd is %s", cwd);
    _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",
           39, 5, "searchDir is %s", searchDir);
    setTimeValue(searchDir);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1040 <memset@plt>
lea    -0x7e0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1040 <memset@plt>
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getcwd@plt>
cmp    $0x0,%rax
jne    11c4 <main+0x74>
lea    0xe56(%rip),%rdi
mov    $0x22,%esi
xor    %edx,%edx
lea    0xf03(%rip),%rcx
mov    $0x0,%al
call   1070 <_debug@plt>
jmp    122f <main+0xdf>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1060 <getConfiguartionData@plt>
lea    -0x3f0(%rbp),%r8
lea    0xe1b(%rip),%rdi
mov    $0x26,%esi
mov    $0x5,%edx
lea    0xedc(%rip),%rcx
mov    $0x0,%al
call   1070 <_debug@plt>
lea    -0x7e0(%rbp),%r8
lea    0xdf5(%rip),%rdi
mov    $0x27,%esi
mov    $0x5,%edx
lea    0xec0(%rip),%rcx
mov    $0x0,%al
call   1070 <_debug@plt>
lea    -0x7e0(%rbp),%rdi
call   1030 <setTimeValue@plt>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x7e0,%rsp
lea    0x3f0(%rsp),%rbx
mov    $0x3e8,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rsp,%rdi
mov    $0x3e8,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getcwd@plt>
test   %rax,%rax
je     11f7 <main+0xa7>
lea    0x3f0(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <getConfiguartionData@plt>
lea    0xe4f(%rip),%r15
lea    0xf1a(%rip),%rcx
mov    %r15,%rdi
mov    $0x26,%esi
mov    $0x5,%edx
mov    %rbx,%r8
xor    %eax,%eax
call   1070 <_debug@plt>
lea    0xf06(%rip),%rcx
mov    %r15,%rdi
mov    $0x27,%esi
mov    $0x5,%edx
mov    %r14,%r8
xor    %eax,%eax
call   1070 <_debug@plt>
mov    %r14,%rdi
call   1030 <setTimeValue@plt>
jmp    1213 <main+0xc3>
lea    0xe02(%rip),%rdi
lea    0xeb6(%rip),%rcx
mov    $0x22,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1070 <_debug@plt>
xor    %eax,%eax
add    $0x7e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.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 = [23 x i8] c"error from getcwd()...\00"
@.str.2 = [10 x i8] c"cwd is %s\00"
@.str.3 = [16 x i8] c"searchDir is %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca [1000 x i8]
store i32 0, i32* %1
%4 = bitcast [1000 x i8]* %2 to i8*
%5 = bitcast [1000 x i8]* %3 to i8*
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i32* @getcwd(i8* %6, i32 1000)
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (i8*, i32, i32, i8*, ...) @_debug(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 34, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %19
11: ; preds = %0
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%15 = call i32 (i8*, i32, i32, i8*, ...) @_debug(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 38, i32 5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%17 = call i32 (i8*, i32, i32, i8*, ...) @_debug(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 39, i32 5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
br label %19
19: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@.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 = [23 x i8] c"error from getcwd()...\00"
@.str.2 = [10 x i8] c"cwd is %s\00"
@.str.3 = [16 x i8] c"searchDir is %s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32* @getcwd(i8* %3, i32 1000)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, i32, i32, i8*, ...) @_debug(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 34, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %12
9: ; preds = %0
%10 = call i32 (i8*, i32, i32, i8*, ...) @_debug(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 38, i32 5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%11 = call i32 (i8*, i32, i32, i8*, ...) @_debug(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 39, i32 5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %4)
br label %12
12: ; preds = %9, %7
ret i32 0
}