#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 dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ dirname2;
typedef int /*<<< orphan*/ dirname;
typedef int /*<<< orphan*/ base;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ device_list_insert(char *);
int /*<<< orphan*/ *opendir(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char const *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void scan_subsystem(const char *subsys) {
  char base[512];
  DIR *dir;
  struct dirent *dent;
  (strncpy(base, "/sys/", sizeof(base)), (base)[(sizeof(base)) - 1] = '\0');
  strncat(base, subsys, (sizeof(base)) - strlen(base) - 1);
  dir = opendir(base);
  if (dir != NULL) {
    for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
      char dirname[512];
      DIR *dir2;
      struct dirent *dent2;
      if (dent->d_name[0] == '.')
        continue;
      (strncpy(dirname, base, sizeof(dirname)),
       (dirname)[(sizeof(dirname)) - 1] = '\0');
      strncat(dirname, "/", (sizeof(dirname)) - strlen(dirname) - 1);
      strncat(dirname, dent->d_name, (sizeof(dirname)) - strlen(dirname) - 1);
      strncat(dirname, "/devices", (sizeof(dirname)) - strlen(dirname) - 1);
      dir2 = opendir(dirname);
      if (dir2 != NULL) {
        for (dent2 = readdir(dir2); dent2 != NULL; dent2 = readdir(dir2)) {
          char dirname2[512];
          if (dent2->d_name[0] == '.')
            continue;
          (strncpy(dirname2, dirname, sizeof(dirname2)),
           (dirname2)[(sizeof(dirname2)) - 1] = '\0');
          strncat(dirname2, "/", (sizeof(dirname2)) - strlen(dirname2) - 1);
          strncat(dirname2, dent2->d_name,
                  (sizeof(dirname2)) - strlen(dirname2) - 1);
          device_list_insert(dirname2);
        }
        closedir(dir2);
      }
    }
    closedir(dir);
  }
}


x86 assembly (clang, -O0):
<scan_subsystem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x680,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
lea    0xe73(%rip),%rsi
mov    $0x200,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x210(%rbp),%rax
mov    %rax,-0x640(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x638(%rbp)
lea    -0x210(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x640(%rbp),%rdi
mov    -0x638(%rbp),%rsi
movslq %eax,%rcx
mov    $0x200,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
call   1060 <strncat@plt>
lea    -0x210(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x218(%rbp)
cmpq   $0x0,-0x218(%rbp)
je     148d <scan_subsystem+0x31d>
mov    -0x218(%rbp),%rdi
call   1090 <readdir@plt>
mov    %rax,-0x220(%rbp)
cmpq   $0x0,-0x220(%rbp)
je     1481 <scan_subsystem+0x311>
mov    -0x220(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1241 <scan_subsystem+0xd1>
jmp    1469 <scan_subsystem+0x2f9>
lea    -0x420(%rbp),%rdi
lea    -0x210(%rbp),%rsi
mov    $0x200,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x221(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x660(%rbp)
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x660(%rbp),%rdi
movslq %eax,%rcx
mov    $0x200,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
lea    0xd6b(%rip),%rsi
call   1060 <strncat@plt>
lea    -0x420(%rbp),%rax
mov    %rax,-0x658(%rbp)
mov    -0x220(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x650(%rbp)
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x658(%rbp),%rdi
mov    -0x650(%rbp),%rsi
movslq %eax,%rcx
mov    $0x200,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
call   1060 <strncat@plt>
lea    -0x420(%rbp),%rax
mov    %rax,-0x648(%rbp)
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x648(%rbp),%rdi
movslq %eax,%rcx
mov    $0x200,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
lea    0xce0(%rip),%rsi
call   1060 <strncat@plt>
lea    -0x420(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x428(%rbp)
cmpq   $0x0,-0x428(%rbp)
je     1464 <scan_subsystem+0x2f4>
mov    -0x428(%rbp),%rdi
call   1090 <readdir@plt>
mov    %rax,-0x430(%rbp)
cmpq   $0x0,-0x430(%rbp)
je     1458 <scan_subsystem+0x2e8>
mov    -0x430(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1388 <scan_subsystem+0x218>
jmp    1440 <scan_subsystem+0x2d0>
lea    -0x630(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    $0x200,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x431(%rbp)
lea    -0x630(%rbp),%rax
mov    %rax,-0x678(%rbp)
lea    -0x630(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x678(%rbp),%rdi
movslq %eax,%rcx
mov    $0x200,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
lea    0xc24(%rip),%rsi
call   1060 <strncat@plt>
lea    -0x630(%rbp),%rax
mov    %rax,-0x670(%rbp)
mov    -0x430(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x668(%rbp)
lea    -0x630(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x670(%rbp),%rdi
mov    -0x668(%rbp),%rsi
movslq %eax,%rcx
mov    $0x200,%eax
sub    %rcx,%rax
sub    $0x1,%rax
mov    %eax,%edx
call   1060 <strncat@plt>
lea    -0x630(%rbp),%rdi
call   1080 <device_list_insert@plt>
mov    -0x428(%rbp),%rdi
call   1090 <readdir@plt>
mov    %rax,-0x430(%rbp)
jmp    135f <scan_subsystem+0x1ef>
mov    -0x428(%rbp),%rdi
call   1070 <closedir@plt>
jmp    1469 <scan_subsystem+0x2f9>
mov    -0x218(%rbp),%rdi
call   1090 <readdir@plt>
mov    %rax,-0x220(%rbp)
jmp    1218 <scan_subsystem+0xa8>
mov    -0x218(%rbp),%rdi
call   1070 <closedir@plt>
add    $0x680,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_subsystem>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x608,%rsp
mov    %rdi,%rbx
lea    0xe75(%rip),%rsi
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x200,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x1ff(%rsp)
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    $0x1ff,%edx
sub    %eax,%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1060 <strncat@plt>
mov    %rbp,%rdi
call   1040 <opendir@plt>
test   %rax,%rax
je     133d <scan_subsystem+0x1cd>
mov    %rax,%r14
mov    %rax,%rdi
call   1090 <readdir@plt>
test   %rax,%rax
je     1335 <scan_subsystem+0x1c5>
mov    %rax,%rbx
lea    0x400(%rsp),%r13
lea    0xe10(%rip),%r12
lea    0x200(%rsp),%rbp
jmp    121c <scan_subsystem+0xac>
xchg   %ax,%ax
mov    %r15,%rdi
call   1070 <closedir@plt>
mov    %r14,%rdi
call   1090 <readdir@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1335 <scan_subsystem+0x1c5>
mov    (%rbx),%rax
cmpb   $0x2e,(%rax)
je     1208 <scan_subsystem+0x98>
mov    %r13,%rdi
mov    %rsp,%rsi
mov    $0x200,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x5ff(%rsp)
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    $0x1ff,%edx
sub    %eax,%edx
mov    %r13,%rdi
mov    %r12,%rsi
call   1060 <strncat@plt>
mov    (%rbx),%rbx
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    $0x1ff,%edx
sub    %eax,%edx
mov    %r13,%rdi
mov    %rbx,%rsi
call   1060 <strncat@plt>
mov    %r13,%rdi
call   1050 <strlen@plt>
mov    $0x1ff,%edx
sub    %eax,%edx
mov    %r13,%rdi
lea    0xd7a(%rip),%rsi
call   1060 <strncat@plt>
mov    %r13,%rdi
call   1040 <opendir@plt>
test   %rax,%rax
je     1208 <scan_subsystem+0x98>
mov    %rax,%r15
mov    %rax,%rdi
call   1090 <readdir@plt>
test   %rax,%rax
je     1200 <scan_subsystem+0x90>
mov    %rax,%rbx
jmp    12d4 <scan_subsystem+0x164>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1090 <readdir@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1200 <scan_subsystem+0x90>
mov    (%rbx),%rax
cmpb   $0x2e,(%rax)
je     12c0 <scan_subsystem+0x150>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x200,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x3ff(%rsp)
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    $0x1ff,%edx
sub    %eax,%edx
mov    %rbp,%rdi
mov    %r12,%rsi
call   1060 <strncat@plt>
mov    (%rbx),%rbx
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    $0x1ff,%edx
sub    %eax,%edx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1060 <strncat@plt>
mov    %rbp,%rdi
call   1080 <device_list_insert@plt>
jmp    12c0 <scan_subsystem+0x150>
mov    %r14,%rdi
call   1070 <closedir@plt>
add    $0x608,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [6 x i8] c"/sys/\00"
@.str.1 = [2 x i8] c"/\00"
@.str.2 = [9 x i8] c"/devices\00"
define void @scan_subsystem(i8* %0) {
%2 = alloca [512 x i8]
%3 = alloca [512 x i8]
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%6 = call i32 @strncpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 512)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 511
store i8 0, i8* %7
%8 = call i32 @strlen(i8* %5)
%9 = sub i32 511, %8
%10 = call i32 @strncat(i8* %5, i8* %0, i32 %9)
%11 = call i32* @opendir(i8* %5)
%12 = icmp eq i32* %11, null
br i1 %12, label %70, label %13
13: ; preds = %1
%14 = call %struct.dirent* @readdir(i32* %11)
%15 = icmp eq %struct.dirent* %14, null
br i1 %15, label %68, label %16
16: ; preds = %13
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%18 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 511
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 511
br label %21
21: ; preds = %16, %65
%22 = phi %struct.dirent* [ %14, %16 ], [ %66, %65 ]
%23 = getelementptr inbounds %struct.dirent, %struct.dirent* %22, i64 0, i32 0
%24 = load i8*, i8** %23
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 46
br i1 %26, label %65, label %27
27: ; preds = %21
%28 = call i32 @strncpy(i8* %17, i8* %5, i32 512)
store i8 0, i8* %18
%29 = call i32 @strlen(i8* %17)
%30 = sub i32 511, %29
%31 = call i32 @strncat(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = load i8*, i8** %23
%33 = call i32 @strlen(i8* %17)
%34 = sub i32 511, %33
%35 = call i32 @strncat(i8* %17, i8* %32, i32 %34)
%36 = call i32 @strlen(i8* %17)
%37 = sub i32 511, %36
%38 = call i32 @strncat(i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = call i32* @opendir(i8* %17)
%40 = icmp eq i32* %39, null
br i1 %40, label %65, label %41
41: ; preds = %27
%42 = call %struct.dirent* @readdir(i32* %39)
%43 = icmp eq %struct.dirent* %42, null
br i1 %43, label %63, label %44
44: ; preds = %41, %60
%45 = phi %struct.dirent* [ %61, %60 ], [ %42, %41 ]
%46 = getelementptr inbounds %struct.dirent, %struct.dirent* %45, i64 0, i32 0
%47 = load i8*, i8** %46
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 46
br i1 %49, label %60, label %50
50: ; preds = %44
%51 = call i32 @strncpy(i8* %19, i8* %17, i32 512)
store i8 0, i8* %20
%52 = call i32 @strlen(i8* %19)
%53 = sub i32 511, %52
%54 = call i32 @strncat(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %53)
%55 = load i8*, i8** %46
%56 = call i32 @strlen(i8* %19)
%57 = sub i32 511, %56
%58 = call i32 @strncat(i8* %19, i8* %55, i32 %57)
%59 = call i32 @device_list_insert(i8* %19)
br label %60
60: ; preds = %44, %50
%61 = call %struct.dirent* @readdir(i32* %39)
%62 = icmp eq %struct.dirent* %61, null
br i1 %62, label %63, label %44
63: ; preds = %60, %41
%64 = call i32 @closedir(i32* %39)
br label %65
65: ; preds = %27, %63, %21
%66 = call %struct.dirent* @readdir(i32* %11)
%67 = icmp eq %struct.dirent* %66, null
br i1 %67, label %68, label %21
68: ; preds = %65, %13
%69 = call i32 @closedir(i32* %11)
br label %70
70: ; preds = %68, %1
ret void
}