#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 */
struct stat {
  int /*<<< orphan*/ st_mode;
};
struct dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
scalar_t__ db_addfile(char *, int, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *get_fakeroot();
char *getcwd(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ lstat(char *, struct stat *);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ printf(char *, char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
void register_in_db(char *dir, int pkgid) {
  DIR *dp;
  struct dirent *entry;
  struct stat statbuf;
  int i;
  if ((dp = opendir(dir)) == NULL) {
    fprintf(stderr, "cannot open directory: %s\n", dir);
    return;
  }
  chdir(dir);
  while ((entry = readdir(dp)) != NULL) {
    lstat(entry->d_name, &statbuf);
    if (S_ISDIR(statbuf.st_mode)) {
      if (strcmp(".", entry->d_name) == 0 || strcmp("..", entry->d_name) == 0)
        continue;
      register_in_db(entry->d_name, pkgid);
    } else {
      char path[512];
      char tmppath[512];
      char *fakeroot = get_fakeroot();
      strcpy(path, getcwd(NULL, 0));
      strcat(path, "/");
      strcat(path, entry->d_name);
      if (path[0] != '/') {
        strcpy(tmppath, path);
        strcpy(path, fakeroot);
        strcat(path, "/");
        strcat(path, tmppath);
      }
      strcpy(tmppath, path);
      size_t strlenfakeroot = strlen(fakeroot);
      for (i = strlenfakeroot; i < 512; ++i)
        path[i - strlenfakeroot] = tmppath[i];
      if (db_addfile(path, pkgid, fakeroot))
        printf("Unable to register %s\n", path);
    }
  }
  chdir("..");
  closedir(dp);
}


x86 assembly (clang, -O0):
<register_in_db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1247 <register_in_db+0x47>
mov    0x2db0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xdc3(%rip),%rsi
call   10e0 <fprintf@plt>
jmp    144e <register_in_db+0x24e>
mov    -0x8(%rbp),%rdi
call   1060 <chdir@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <readdir@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1439 <register_in_db+0x239>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    -0x28(%rbp),%rsi
call   10b0 <lstat@plt>
mov    -0x28(%rbp),%edi
call   1080 <S_ISDIR@plt>
cmp    $0x0,%rax
je     12dc <register_in_db+0xdc>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xd85(%rip),%rdi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
je     12c3 <register_in_db+0xc3>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xd67(%rip),%rdi
call   10d0 <strcmp@plt>
cmp    $0x0,%rax
jne    12c8 <register_in_db+0xc8>
jmp    1250 <register_in_db+0x50>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%esi
call   10c0 <register_in_db@plt>
jmp    1434 <register_in_db+0x234>
mov    $0x0,%al
call   1100 <get_fakeroot@plt>
mov    %rax,-0x438(%rbp)
lea    -0x230(%rbp),%rax
mov    %rax,-0x448(%rbp)
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1090 <getcwd@plt>
mov    -0x448(%rbp),%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    -0x230(%rbp),%rdi
lea    0xcfe(%rip),%rsi
call   1110 <strcat@plt>
lea    -0x230(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1110 <strcat@plt>
movsbl -0x230(%rbp),%eax
cmp    $0x2f,%eax
je     1394 <register_in_db+0x194>
lea    -0x430(%rbp),%rdi
lea    -0x230(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x230(%rbp),%rdi
mov    -0x438(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x230(%rbp),%rdi
lea    0xca2(%rip),%rsi
call   1110 <strcat@plt>
lea    -0x230(%rbp),%rdi
lea    -0x430(%rbp),%rsi
call   1110 <strcat@plt>
lea    -0x430(%rbp),%rdi
lea    -0x230(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x438(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x440(%rbp)
mov    -0x440(%rbp),%rax
mov    %eax,-0x2c(%rbp)
cmpl   $0x200,-0x2c(%rbp)
jge    13fc <register_in_db+0x1fc>
movslq -0x2c(%rbp),%rax
mov    -0x430(%rbp,%rax,1),%cl
movslq -0x2c(%rbp),%rax
sub    -0x440(%rbp),%rax
mov    %cl,-0x230(%rbp,%rax,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13c4 <register_in_db+0x1c4>
lea    -0x230(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x438(%rbp),%rdx
call   1120 <db_addfile@plt>
cmp    $0x0,%rax
je     142f <register_in_db+0x22f>
lea    -0x230(%rbp),%rsi
lea    0xbf6(%rip),%rdi
call   1070 <printf@plt>
jmp    1434 <register_in_db+0x234>
jmp    1250 <register_in_db+0x50>
lea    0xbdb(%rip),%rdi
call   1060 <chdir@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <closedir@plt>
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_in_db>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %esi,0x4(%rsp)
mov    %rdi,%rbp
call   1040 <opendir@plt>
test   %rax,%rax
je     13f7 <register_in_db+0x1e7>
mov    %rax,%r14
mov    %rbp,%rdi
call   1060 <chdir@plt>
mov    %r14,%rdi
call   1100 <readdir@plt>
test   %rax,%rax
mov    0x4(%rsp),%ebp
je     13d1 <register_in_db+0x1c1>
mov    %rax,%r13
lea    0x8(%rsp),%rbx
lea    0x210(%rsp),%r15
jmp    1284 <register_in_db+0x74>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1100 <readdir@plt>
mov    %rax,%r13
test   %rax,%rax
je     13d1 <register_in_db+0x1c1>
mov    0x0(%r13),%rdi
mov    %rbx,%rsi
call   10b0 <lstat@plt>
mov    0x8(%rsp),%edi
call   1080 <S_ISDIR@plt>
test   %rax,%rax
je     12e0 <register_in_db+0xd0>
mov    0x0(%r13),%rsi
lea    0xd73(%rip),%rdi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1270 <register_in_db+0x60>
mov    0x0(%r13),%rsi
lea    0xd5d(%rip),%rdi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1270 <register_in_db+0x60>
mov    0x0(%r13),%rdi
mov    %ebp,%esi
call   10c0 <register_in_db@plt>
jmp    1270 <register_in_db+0x60>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1110 <get_fakeroot@plt>
mov    %rax,%r12
xor    %edi,%edi
xor    %esi,%esi
call   1090 <getcwd@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
lea    0xd16(%rip),%rsi
call   1120 <strcat@plt>
mov    0x0(%r13),%rsi
mov    %r15,%rdi
call   1120 <strcat@plt>
cmpb   $0x2f,0x210(%rsp)
2f
je     1362 <register_in_db+0x152>
mov    %rbx,%rbp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
lea    0xcd3(%rip),%rsi
call   1120 <strcat@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %rbp,%rbx
mov    0x4(%rsp),%ebp
call   1120 <strcat@plt>
lea    0x10(%rsp),%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
call   1050 <strlen@plt>
cmp    $0x1ff,%eax
jg     13a7 <register_in_db+0x197>
movslq %eax,%rcx
lea    (%rsp,%rcx,1),%rsi
add    $0x10,%rsi
mov    $0x1ff,%edx
sub    %ecx,%edx
sub    %rax,%rcx
lea    (%rsp,%rcx,1),%rdi
add    $0x210,%rdi
add    $0x1,%rdx
call   10f0 <memcpy@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r12,%rdx
call   1130 <db_addfile@plt>
test   %rax,%rax
je     1270 <register_in_db+0x60>
lea    0xc5c(%rip),%rdi
mov    %r15,%rsi
call   1070 <printf@plt>
jmp    1270 <register_in_db+0x60>
lea    0xc43(%rip),%rdi
call   1060 <chdir@plt>
mov    %r14,%rdi
call   10a0 <closedir@plt>
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2be2(%rip),%rax
mov    (%rax),%edi
lea    0xbf9(%rip),%rsi
mov    %rbp,%rdx
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10e0 <fprintf@plt>

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [27 x i8] c"cannot open directory: %s\0A\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [23 x i8] c"Unable to register %s\0A\00"
define void @register_in_db(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.dirent*
%7 = alloca %struct.stat
%8 = alloca i32
%9 = alloca [512 x i8]
%10 = alloca [512 x i8]
%11 = alloca i8*
%12 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%13 = load i8*, i8** %3
%14 = call i32* @opendir(i8* %13)
store i32* %14, i32** %5
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %20
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8*, i8** %3
%19 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %121
20: ; preds = %2
%21 = load i8*, i8** %3
%22 = call i32 @chdir(i8* %21)
br label %23
23: ; preds = %116, %48, %20
%24 = load i32*, i32** %5
%25 = call %struct.dirent* @readdir(i32* %24)
store %struct.dirent* %25, %struct.dirent** %6
%26 = icmp ne %struct.dirent* %25, null
br i1 %26, label %27, label %117
27: ; preds = %23
%28 = load %struct.dirent*, %struct.dirent** %6
%29 = getelementptr inbounds %struct.dirent, %struct.dirent* %28, i32 0, i32 0
%30 = load i8*, i8** %29
%31 = call i32 @lstat(i8* %30, %struct.stat* %7)
%32 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%33 = load i32, i32* %32
%34 = call i64 @S_ISDIR(i32 %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %54
36: ; preds = %27
%37 = load %struct.dirent*, %struct.dirent** %6
%38 = getelementptr inbounds %struct.dirent, %struct.dirent* %37, i32 0, i32 0
%39 = load i8*, i8** %38
%40 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %39)
%41 = icmp eq i64 %40, 0
br i1 %41, label %48, label %42
42: ; preds = %36
%43 = load %struct.dirent*, %struct.dirent** %6
%44 = getelementptr inbounds %struct.dirent, %struct.dirent* %43, i32 0, i32 0
%45 = load i8*, i8** %44
%46 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %45)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %42, %36
br label %23
49: ; preds = %42
%50 = load %struct.dirent*, %struct.dirent** %6
%51 = getelementptr inbounds %struct.dirent, %struct.dirent* %50, i32 0, i32 0
%52 = load i8*, i8** %51
%53 = load i32, i32* %4
br label %116
54: ; preds = %27
%55 = call i8* (...) @get_fakeroot()
store i8* %55, i8** %11
%56 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%57 = call i8* @getcwd(i32* null, i32 0)
%58 = call i32 @strcpy(i8* %56, i8* %57)
%59 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%60 = call i32 @strcat(i8* %59, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%61 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%62 = load %struct.dirent*, %struct.dirent** %6
%63 = getelementptr inbounds %struct.dirent, %struct.dirent* %62, i32 0, i32 0
%64 = load i8*, i8** %63
%65 = call i32 @strcat(i8* %61, i8* %64)
%66 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp ne i32 %68, 47
br i1 %69, label %70, label %82
70: ; preds = %54
%71 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%72 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%73 = call i32 @strcpy(i8* %71, i8* %72)
%74 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%75 = load i8*, i8** %11
%76 = call i32 @strcpy(i8* %74, i8* %75)
%77 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%78 = call i32 @strcat(i8* %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%79 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%80 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%81 = call i32 @strcat(i8* %79, i8* %80)
br label %82
82: ; preds = %70, %54
%83 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%84 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%85 = call i32 @strcpy(i8* %83, i8* %84)
%86 = load i8*, i8** %11
%87 = call i64 @strlen(i8* %86)
store i64 %87, i64* %12
%88 = load i64, i64* %12
%89 = trunc i64 %88 to i32
store i32 %89, i32* %8
br label %90
90: ; preds = %103, %82
%91 = load i32, i32* %8
%92 = icmp slt i32 %91, 512
br i1 %92, label %93, label %106
93: ; preds = %90
%94 = load i32, i32* %8
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 %95
%97 = load i8, i8* %96
%98 = load i32, i32* %8
%99 = sext i32 %98 to i64
%100 = load i64, i64* %12
%101 = sub i64 %99, %100
%102 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 %101
store i8 %97, i8* %102
br label %103
103: ; preds = %93
%104 = load i32, i32* %8
%105 = add nsw i32 %104, 1
store i32 %105, i32* %8
br label %90
106: ; preds = %90
%107 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%108 = load i32, i32* %4
%109 = load i8*, i8** %11
%110 = call i64 @db_addfile(i8* %107, i32 %108, i8* %109)
%111 = icmp ne i64 %110, 0
br i1 %111, label %112, label %115
112: ; preds = %106
%113 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%114 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %113)
br label %115
115: ; preds = %112, %106
br label %116
116: ; preds = %115, %49
br label %23
117: ; preds = %23
%118 = call i32 @chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%119 = load i32*, i32** %5
%120 = call i32 @closedir(i32* %119)
br label %121
121: ; preds = %117, %16
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@stderr = global i32 0
@.str = [27 x i8] c"cannot open directory: %s\0A\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [23 x i8] c"Unable to register %s\0A\00"
define void @register_in_db(i8* %0, i32 %1) {
%3 = alloca %struct.stat
%4 = alloca [512 x i8]
%5 = alloca [512 x i8]
%6 = bitcast %struct.stat* %3 to i8*
%7 = tail call i32* @opendir(i8* %0)
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %78
12: ; preds = %2
%13 = tail call i32 @chdir(i8* %0)
%14 = call %struct.dirent* @readdir(i32* %7)
%15 = icmp eq %struct.dirent* %14, null
br i1 %15, label %75, label %16
16: ; preds = %12
%17 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%18 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
br label %20
20: ; preds = %16, %36
%21 = phi %struct.dirent* [ %14, %16 ], [ %37, %36 ]
%22 = getelementptr inbounds %struct.dirent, %struct.dirent* %21, i64 0, i32 0
%23 = load i8*, i8** %22
%24 = call i32 @lstat(i8* %23, %struct.stat* %3)
%25 = load i32, i32* %17
%26 = call i64 @S_ISDIR(i32 %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %41, label %28
28: ; preds = %20
%29 = load i8*, i8** %22
%30 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load i8*, i8** %22
%34 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %39, %74, %28, %32
%37 = call %struct.dirent* @readdir(i32* %7)
%38 = icmp eq %struct.dirent* %37, null
br i1 %38, label %75, label %20
39: ; preds = %32
%40 = load i8*, i8** %22
br label %36
41: ; preds = %20
%42 = call i8* (...) @get_fakeroot()
%43 = call i8* @getcwd(i32* null, i32 0)
%44 = call i32 @strcpy(i8* %18, i8* %43)
%45 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%46 = load i8*, i8** %22
%47 = call i32 @strcat(i8* %18, i8* %46)
%48 = load i8, i8* %18
%49 = icmp eq i8 %48, 47
br i1 %49, label %55, label %50
50: ; preds = %41
%51 = call i32 @strcpy(i8* %19, i8* %18)
%52 = call i32 @strcpy(i8* %18, i8* %42)
%53 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%54 = call i32 @strcat(i8* %18, i8* %19)
br label %55
55: ; preds = %50, %41
%56 = call i32 @strcpy(i8* %19, i8* %18)
%57 = call i64 @strlen(i8* dereferenceable(1) %42)
%58 = trunc i64 %57 to i32
%59 = icmp slt i32 %58, 512
br i1 %59, label %60, label %69
60: ; preds = %55
%61 = shl i64 %57, 32
%62 = ashr exact i64 %61, 32
%63 = sub i64 %62, %57
%64 = getelementptr [512 x i8], [512 x i8]* %4, i64 0, i64 %63
%65 = getelementptr [512 x i8], [512 x i8]* %5, i64 0, i64 %62
%66 = sub i64 511, %57
%67 = and i64 %66, 4294967295
%68 = add nuw nsw i64 %67, 1
br label %69
69: ; preds = %60, %55
%70 = call i64 @db_addfile(i8* %18, i32 %1, i8* %42)
%71 = icmp eq i64 %70, 0
br i1 %71, label %74, label %72
72: ; preds = %69
%73 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %18)
br label %74
74: ; preds = %72, %69
br label %36
75: ; preds = %36, %12
%76 = call i32 @chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%77 = call i32 @closedir(i32* %7)
br label %78
78: ; preds = %75, %9
ret void
}