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

/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
scalar_t__ file_exists_with_prefix(char *, char *);
int /*<<< orphan*/ *fopen_file(char *, char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
char *get_full_path(char *, char *);
int /*<<< orphan*/ getcwd(char *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ *opendir(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
size_t strlen(char *);
int strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *get_process_pid_from_name(char *process_name) {
  DIR *tdir = NULL;
  struct dirent *cpu_dirent;
  FILE *fptr;
  char proc_name[256] = {0};
  char *dir_path;
  char cwd[256] = {0};
  char *dir_name;
  int cmp_result;
  int len1, len2;
  if (!getcwd(cwd, sizeof(cwd)))
    return NULL;
  chdir("/proc/");
  tdir = opendir("/proc/");
  if (!tdir) {
    fprintf(stdout, "Unable to open %s\n", "/proc/");
    return NULL;
  }
  dir_name = (char *)malloc(256);
  if (dir_name == NULL)
    return NULL;
  while ((cpu_dirent = readdir(tdir))) {
    strncpy(dir_name, cpu_dirent->d_name, strlen(cpu_dirent->d_name));
    dir_name[strlen(cpu_dirent->d_name)] = '\0';
    dir_path = get_full_path("/proc/", dir_name);
    if (file_exists_with_prefix(dir_path, "status")) {
      fptr = fopen_file(dir_path, "status", "r");
      if (fptr == NULL) {
        free(dir_path);
        return NULL;
      } else {
        fscanf(fptr, "Name:   %s", proc_name);
        len1 = strlen(process_name);
        len2 = strlen(proc_name);
        if (len1 != len2) {
          free(dir_path);
          continue;
        }
        cmp_result = strncmp(process_name, proc_name, len1);
        if (cmp_result == 0) {
          free(dir_path);
          break;
        }
      }
    }
    free(dir_path);
  }
  closedir(tdir);
  chdir(cwd);
  return dir_name;
}


x86 assembly (clang, -O0):
<get_process_pid_from_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   10b0 <memset@plt>
lea    -0x240(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   10b0 <memset@plt>
lea    -0x240(%rbp),%rdi
mov    $0x100,%esi
call   10d0 <getcwd@plt>
cmp    $0x0,%eax
jne    1264 <get_process_pid_from_name+0x64>
movq   $0x0,-0x8(%rbp)
jmp    14ab <get_process_pid_from_name+0x2ab>
lea    0xd95(%rip),%rdi
call   1090 <chdir@plt>
lea    0xd89(%rip),%rdi
call   1060 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    12b4 <get_process_pid_from_name+0xb4>
mov    0x2d4e(%rip),%rax
mov    (%rax),%edi
lea    0xd6c(%rip),%rsi
lea    0xd5e(%rip),%rdx
call   10f0 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    14ab <get_process_pid_from_name+0x2ab>
mov    $0x100,%edi
call   1110 <malloc@plt>
mov    %rax,-0x248(%rbp)
cmpq   $0x0,-0x248(%rbp)
jne    12e0 <get_process_pid_from_name+0xe0>
movq   $0x0,-0x8(%rbp)
jmp    14ab <get_process_pid_from_name+0x2ab>
jmp    12e5 <get_process_pid_from_name+0xe5>
mov    -0x18(%rbp),%rdi
call   1100 <readdir@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     148b <get_process_pid_from_name+0x28b>
mov    -0x248(%rbp),%rax
mov    %rax,-0x270(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x268(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1080 <strlen@plt>
mov    -0x270(%rbp),%rdi
mov    -0x268(%rbp),%rsi
mov    %rax,%rdx
call   1040 <strncpy@plt>
mov    -0x248(%rbp),%rax
mov    %rax,-0x260(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1080 <strlen@plt>
mov    %rax,%rcx
mov    -0x260(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x248(%rbp),%rsi
lea    0xc90(%rip),%rdi
call   10a0 <get_full_path@plt>
mov    %rax,-0x138(%rbp)
mov    -0x138(%rbp),%rdi
lea    0xc90(%rip),%rsi
call   1120 <file_exists_with_prefix@plt>
cmp    $0x0,%rax
je     147a <get_process_pid_from_name+0x27a>
mov    -0x138(%rbp),%rdi
lea    0xc73(%rip),%rsi
lea    0xc73(%rip),%rdx
call   1070 <fopen_file@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    13db <get_process_pid_from_name+0x1db>
mov    -0x138(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    14ab <get_process_pid_from_name+0x2ab>
mov    -0x28(%rbp),%rdi
lea    -0x130(%rbp),%rdx
lea    0xc36(%rip),%rsi
call   10c0 <fscanf@plt>
mov    -0x10(%rbp),%rdi
call   1080 <strlen@plt>
mov    %eax,-0x250(%rbp)
lea    -0x130(%rbp),%rdi
call   1080 <strlen@plt>
mov    %eax,-0x254(%rbp)
mov    -0x250(%rbp),%eax
cmp    -0x254(%rbp),%eax
je     1436 <get_process_pid_from_name+0x236>
mov    -0x138(%rbp),%rdi
call   1030 <free@plt>
jmp    12e5 <get_process_pid_from_name+0xe5>
mov    -0x10(%rbp),%rdi
lea    -0x130(%rbp),%rsi
mov    -0x250(%rbp),%edx
call   1050 <strncmp@plt>
mov    %eax,-0x24c(%rbp)
cmpl   $0x0,-0x24c(%rbp)
jne    1470 <get_process_pid_from_name+0x270>
mov    -0x138(%rbp),%rdi
call   1030 <free@plt>
jmp    148b <get_process_pid_from_name+0x28b>
jmp    1475 <get_process_pid_from_name+0x275>
jmp    147a <get_process_pid_from_name+0x27a>
mov    -0x138(%rbp),%rdi
call   1030 <free@plt>
jmp    12e5 <get_process_pid_from_name+0xe5>
mov    -0x18(%rbp),%rdi
call   10e0 <closedir@plt>
lea    -0x240(%rbp),%rdi
call   1090 <chdir@plt>
mov    -0x248(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_process_pid_from_name>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
mov    %rdi,0x8(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x200(%rsp)
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x100,%esi
call   10c0 <getcwd@plt>
test   %eax,%eax
je     147c <get_process_pid_from_name+0x28c>
lea    0xcee(%rip),%rbx
mov    %rbx,%rdi
call   1090 <chdir@plt>
mov    %rbx,%rdi
call   1060 <opendir@plt>
test   %rax,%rax
je     1460 <get_process_pid_from_name+0x270>
mov    %rax,%r15
mov    $0x100,%edi
call   1100 <malloc@plt>
test   %rax,%rax
je     147c <get_process_pid_from_name+0x28c>
mov    %rax,%r14
mov    %r15,%rdi
call   10f0 <readdir@plt>
test   %rax,%rax
je     144c <get_process_pid_from_name+0x25c>
mov    %rax,%rbp
lea    0xcbb(%rip),%r13
jmp    138c <get_process_pid_from_name+0x19c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   10f0 <readdir@plt>
mov    %rax,%rbp
test   %rax,%rax
je     144c <get_process_pid_from_name+0x25c>
mov    0x0(%rbp),%rbx
mov    %rbx,%rdi
call   1080 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <strncpy@plt>
mov    0x0(%rbp),%rdi
call   1080 <strlen@plt>
movb   $0x0,(%r14,%rax,1)
lea    0xc45(%rip),%rdi
mov    %r14,%rsi
call   10a0 <get_full_path@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r13,%rsi
call   1110 <file_exists_with_prefix@plt>
test   %rax,%rax
je     1370 <get_process_pid_from_name+0x180>
mov    %r12,%rdi
mov    %r13,%rsi
lea    0xc3e(%rip),%rdx
call   1070 <fopen_file@plt>
test   %rax,%rax
je     1494 <get_process_pid_from_name+0x2a4>
mov    %rax,%rdi
lea    0xc28(%rip),%rsi
lea    0x110(%rsp),%rbx
mov    %rbx,%rdx
call   10b0 <fscanf@plt>
mov    0x8(%rsp),%rdi
call   1080 <strlen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1080 <strlen@plt>
cmp    %eax,%ebp
jne    1370 <get_process_pid_from_name+0x180>
mov    0x8(%rsp),%rdi
lea    0x110(%rsp),%rsi
mov    %ebp,%edx
call   1050 <strncmp@plt>
test   %eax,%eax
jne    1370 <get_process_pid_from_name+0x180>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   10d0 <closedir@plt>
lea    0x10(%rsp),%rdi
call   1090 <chdir@plt>
jmp    147f <get_process_pid_from_name+0x28f>
mov    0x2b79(%rip),%rax
mov    (%rax),%edi
lea    0xb97(%rip),%rsi
lea    0xb89(%rip),%rdx
call   10e0 <fprintf@plt>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12,%rdi
call   1030 <free@plt>
jmp    147c <get_process_pid_from_name+0x28c>

LLVM IR (-O0):
%struct.dirent = type { i8* }
@.str = [7 x i8] c"/proc/\00"
@stdout = global i32 0
@.str.1 = [19 x i8] c"Unable to open %s\0A\00"
@.str.2 = [7 x i8] c"status\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [11 x i8] c"Name: %s\00"
define i8* @get_process_pid_from_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca %struct.dirent*
%6 = alloca i32*
%7 = alloca [256 x i8]
%8 = alloca i8*
%9 = alloca [256 x i8]
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %3
store i32* null, i32** %4
%14 = bitcast [256 x i8]* %7 to i8*
%15 = bitcast [256 x i8]* %9 to i8*
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%17 = call i32 @getcwd(i8* %16, i32 256)
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %1
store i8* null, i8** %2
br label %105
20: ; preds = %1
%21 = call i32 @chdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%22 = call i32* @opendir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32* %22, i32** %4
%23 = load i32*, i32** %4
%24 = icmp ne i32* %23, null
br i1 %24, label %28, label %25
25: ; preds = %20
%26 = load i32, i32* @stdout
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %2
br label %105
28: ; preds = %20
%29 = call i64 @malloc(i32 256)
%30 = inttoptr i64 %29 to i8*
store i8* %30, i8** %10
%31 = load i8*, i8** %10
%32 = icmp eq i8* %31, null
br i1 %32, label %33, label %34
33: ; preds = %28
store i8* null, i8** %2
br label %105
34: ; preds = %28
br label %35
35: ; preds = %96, %81, %34
%36 = load i32*, i32** %4
%37 = call %struct.dirent* @readdir(i32* %36)
store %struct.dirent* %37, %struct.dirent** %5
%38 = icmp ne %struct.dirent* %37, null
br i1 %38, label %39, label %99
39: ; preds = %35
%40 = load i8*, i8** %10
%41 = load %struct.dirent*, %struct.dirent** %5
%42 = getelementptr inbounds %struct.dirent, %struct.dirent* %41, i32 0, i32 0
%43 = load i8*, i8** %42
%44 = load %struct.dirent*, %struct.dirent** %5
%45 = getelementptr inbounds %struct.dirent, %struct.dirent* %44, i32 0, i32 0
%46 = load i8*, i8** %45
%47 = call i64 @strlen(i8* %46)
%48 = call i32 @strncpy(i8* %40, i8* %43, i64 %47)
%49 = load i8*, i8** %10
%50 = load %struct.dirent*, %struct.dirent** %5
%51 = getelementptr inbounds %struct.dirent, %struct.dirent* %50, i32 0, i32 0
%52 = load i8*, i8** %51
%53 = call i64 @strlen(i8* %52)
%54 = getelementptr inbounds i8, i8* %49, i64 %53
store i8 0, i8* %54
%55 = load i8*, i8** %10
%56 = call i8* @get_full_path(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %55)
store i8* %56, i8** %8
%57 = load i8*, i8** %8
%58 = call i64 @file_exists_with_prefix(i8* %57, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%59 = icmp ne i64 %58, 0
br i1 %59, label %60, label %96
60: ; preds = %39
%61 = load i8*, i8** %8
%62 = call i32* @fopen_file(i8* %61, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %62, i32** %6
%63 = load i32*, i32** %6
%64 = icmp eq i32* %63, null
br i1 %64, label %65, label %68
65: ; preds = %60
%66 = load i8*, i8** %8
%67 = call i32 @free(i8* %66)
store i8* null, i8** %2
br label %105
68: ; preds = %60
%69 = load i32*, i32** %6
%70 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%71 = call i32 @fscanf(i32* %69, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %70)
%72 = load i8*, i8** %3
%73 = call i64 @strlen(i8* %72)
%74 = trunc i64 %73 to i32
store i32 %74, i32* %12
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%76 = call i64 @strlen(i8* %75)
%77 = trunc i64 %76 to i32
store i32 %77, i32* %13
%78 = load i32, i32* %12
%79 = load i32, i32* %13
%80 = icmp ne i32 %78, %79
br i1 %80, label %81, label %84
81: ; preds = %68
%82 = load i8*, i8** %8
%83 = call i32 @free(i8* %82)
br label %35
84: ; preds = %68
%85 = load i8*, i8** %3
%86 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%87 = load i32, i32* %12
%88 = call i32 @strncmp(i8* %85, i8* %86, i32 %87)
store i32 %88, i32* %11
%89 = load i32, i32* %11
%90 = icmp eq i32 %89, 0
br i1 %90, label %91, label %94
91: ; preds = %84
%92 = load i8*, i8** %8
%93 = call i32 @free(i8* %92)
br label %99
94: ; preds = %84
br label %95
95: ; preds = %94
br label %96
96: ; preds = %95, %39
%97 = load i8*, i8** %8
%98 = call i32 @free(i8* %97)
br label %35
99: ; preds = %91, %35
%100 = load i32*, i32** %4
%101 = call i32 @closedir(i32* %100)
%102 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%103 = call i32 @chdir(i8* %102)
%104 = load i8*, i8** %10
store i8* %104, i8** %2
br label %105
105: ; preds = %99, %65, %33, %25, %19
%106 = load i8*, i8** %2
ret i8* %106
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [7 x i8] c"/proc/\00"
@stdout = global i32 0
@.str.1 = [19 x i8] c"Unable to open %s\0A\00"
@.str.2 = [7 x i8] c"status\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [11 x i8] c"Name: %s\00"
define i8* @get_process_pid_from_name(i8* %0) {
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = call i32 @getcwd(i8* %5, i32 256)
%7 = icmp eq i32 %6, 0
br i1 %7, label %58, label %8
8: ; preds = %1
%9 = call i32 @chdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32* @opendir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* @stdout
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %58
15: ; preds = %8
%16 = call i64 @malloc(i32 256)
%17 = inttoptr i64 %16 to i8*
%18 = icmp eq i64 %16, 0
br i1 %18, label %58, label %19
19: ; preds = %15
%20 = call %struct.dirent* @readdir(i32* %10)
%21 = icmp eq %struct.dirent* %20, null
br i1 %21, label %55, label %22
22: ; preds = %19, %46
%23 = phi %struct.dirent* [ %48, %46 ], [ %20, %19 ]
%24 = getelementptr inbounds %struct.dirent, %struct.dirent* %23, i64 0, i32 0
%25 = load i8*, i8** %24
%26 = call i64 @strlen(i8* dereferenceable(1) %25)
%27 = call i32 @strncpy(i8* %17, i8* %25, i64 %26)
%28 = load i8*, i8** %24
%29 = call i64 @strlen(i8* dereferenceable(1) %28)
%30 = getelementptr inbounds i8, i8* %17, i64 %29
store i8 0, i8* %30
%31 = call i8* @get_full_path(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %17)
%32 = call i64 @file_exists_with_prefix(i8* %31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %46, label %34
34: ; preds = %22
%35 = call i32* @fopen_file(i8* %31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @free(i8* %31)
br label %58
39: ; preds = %34
%40 = call i32 @fscanf(i32* %35, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%41 = call i64 @strlen(i8* dereferenceable(1) %0)
%42 = trunc i64 %41 to i32
%43 = call i64 @strlen(i8* %4)
%44 = trunc i64 %43 to i32
%45 = icmp eq i32 %42, %44
br i1 %45, label %50, label %46
46: ; preds = %39, %22, %50
%47 = call i32 @free(i8* %31)
%48 = call %struct.dirent* @readdir(i32* %10)
%49 = icmp eq %struct.dirent* %48, null
br i1 %49, label %55, label %22
50: ; preds = %39
%51 = call i32 @strncmp(i8* %0, i8* %4, i32 %42)
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %46
53: ; preds = %50
%54 = call i32 @free(i8* %31)
br label %55
55: ; preds = %46, %19, %53
%56 = call i32 @closedir(i32* %10)
%57 = call i32 @chdir(i8* %5)
br label %58
58: ; preds = %15, %1, %55, %37, %12
%59 = phi i8* [ null, %37 ], [ %17, %55 ], [ null, %12 ], [ null, %1 ], [ null, %15 ]
ret i8* %59
}