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

/* Variables and functions */
scalar_t__ dirExists(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ realloc(char *, int);
int /*<<< orphan*/ remove(char *);
int rmdir(char *);
int /*<<< orphan*/ strncat(char *, char const *, int);
scalar_t__ strncmp(char *, char const *, int);
char *strtok(char *, char *);
void removeDirectory(const char *path, const char *directoryName) {
  if (path == NULL || directoryName == NULL) {
    printf("ERROR: Could not read filesystem\n");
    return;
  }
  char directoryPath[255];
  strncat(directoryPath, path, 255);
  strncat(directoryPath, directoryName, 255);
  if (dirExists(directoryPath)) {
    char name[255];
    name[0] = 0;
    strncat(name, path, 255);
    strncat(name, ".list", 6);
    int multiplier = 1;
    char *listFileContents = (char *)malloc(sizeof(char) * 255);
    listFileContents[0] = 0;
    FILE *listFile = fopen(name, "r");
    char line[255];
    while (fgets(line, 255, listFile)) {
      char *l = strtok(line, "\n");
      if (strncmp(l, directoryName, 255) != 0) {
        multiplier++;
        listFileContents =
            (char *)realloc(listFileContents, sizeof(char) * 255 * multiplier);
        strncat(listFileContents, l, 255);
        strncat(listFileContents, "\n", 1);
      }
    }
    fclose(listFile);
    FILE *newListFile = fopen(name, "w");
    fprintf(newListFile, "%s", listFileContents);
    fclose(newListFile);
    free(listFileContents);
    char filePath[255];
    filePath[0] = 0;
    strncat(filePath, path, 255);
    strncat(filePath, directoryName, 255);
    char tmpList[255];
    tmpList[0] = 0;
    strncat(tmpList, filePath, 255);
    strncat(tmpList, "/.list", 7);
    FILE *tmpListFile = fopen(tmpList, "r");
    char isEmpty = 1;
    char li[255];
    while (fgets(li, 255, tmpListFile)) {
      isEmpty = 0;
      break;
    }
    fclose(tmpListFile);
    if (isEmpty == 0) {
      printf("ERROR: Cannot delete directory since it is not empty\n");
      return;
    } else {
      remove(tmpList);
    }
    int e = rmdir(filePath);
  } else {
    printf("ERROR: Cannot delete directory that does not exist\n");
  }
}


x86 assembly (clang, -O0):
<removeDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x660,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1209 <removeDirectory+0x29>
cmpq   $0x0,-0x10(%rbp)
jne    121a <removeDirectory+0x3a>
lea    0xdf0(%rip),%rdi
call   1090 <printf@plt>
jmp    14f5 <removeDirectory+0x315>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xff,%edx
call   10a0 <strncat@plt>
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xff,%edx
call   10a0 <strncat@plt>
lea    -0x110(%rbp),%rdi
call   1060 <dirExists@plt>
cmp    $0x0,%rax
je     14e9 <removeDirectory+0x309>
movb   $0x0,-0x210(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xff,%edx
call   10a0 <strncat@plt>
lea    -0x210(%rbp),%rdi
lea    0xda6(%rip),%rsi
mov    $0x6,%edx
call   10a0 <strncat@plt>
movl   $0x1,-0x214(%rbp)
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x220(%rbp)
mov    -0x220(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x210(%rbp),%rdi
lea    0xd61(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x228(%rbp)
lea    -0x330(%rbp),%rdi
mov    -0x228(%rbp),%rdx
mov    $0xff,%esi
call   10b0 <fgets@plt>
cmp    $0x0,%rax
je     138f <removeDirectory+0x1af>
lea    -0x330(%rbp),%rdi
lea    0xd23(%rip),%rsi
call   1100 <strtok@plt>
mov    %rax,-0x338(%rbp)
mov    -0x338(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xff,%edx
call   1050 <strncmp@plt>
cmp    $0x0,%rax
je     138a <removeDirectory+0x1aa>
mov    -0x214(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x214(%rbp)
mov    -0x220(%rbp),%rdi
movslq -0x214(%rbp),%rax
imul   $0xff,%rax,%rax
mov    %eax,%esi
call   10e0 <realloc@plt>
mov    %rax,-0x220(%rbp)
mov    -0x220(%rbp),%rdi
mov    -0x338(%rbp),%rsi
mov    $0xff,%edx
call   10a0 <strncat@plt>
mov    -0x220(%rbp),%rdi
lea    0xca0(%rip),%rsi
mov    $0x1,%edx
call   10a0 <strncat@plt>
jmp    12cd <removeDirectory+0xed>
mov    -0x228(%rbp),%rdi
call   1070 <fclose@plt>
lea    -0x210(%rbp),%rdi
lea    0xc7b(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x340(%rbp)
mov    -0x340(%rbp),%rdi
mov    -0x220(%rbp),%rdx
lea    0xc5c(%rip),%rsi
call   10c0 <fprintf@plt>
mov    -0x340(%rbp),%rdi
call   1070 <fclose@plt>
mov    -0x220(%rbp),%rdi
call   1030 <free@plt>
movb   $0x0,-0x440(%rbp)
lea    -0x440(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0xff,%edx
call   10a0 <strncat@plt>
lea    -0x440(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xff,%edx
call   10a0 <strncat@plt>
movb   $0x0,-0x540(%rbp)
lea    -0x540(%rbp),%rdi
lea    -0x440(%rbp),%rsi
mov    $0xff,%edx
call   10a0 <strncat@plt>
lea    -0x540(%rbp),%rdi
lea    0xbe4(%rip),%rsi
mov    $0x7,%edx
call   10a0 <strncat@plt>
lea    -0x540(%rbp),%rdi
lea    0xbc5(%rip),%rsi
call   10f0 <fopen@plt>
mov    %rax,-0x548(%rbp)
movb   $0x1,-0x549(%rbp)
lea    -0x650(%rbp),%rdi
mov    -0x548(%rbp),%rdx
mov    $0xff,%esi
call   10b0 <fgets@plt>
cmp    $0x0,%rax
je     1499 <removeDirectory+0x2b9>
movb   $0x0,-0x549(%rbp)
mov    -0x548(%rbp),%rdi
call   1070 <fclose@plt>
movsbl -0x549(%rbp),%eax
cmp    $0x0,%eax
jne    14c6 <removeDirectory+0x2e6>
lea    0xb74(%rip),%rdi
call   1090 <printf@plt>
jmp    14f5 <removeDirectory+0x315>
lea    -0x540(%rbp),%rdi
call   1040 <remove@plt>
lea    -0x440(%rbp),%rdi
call   1080 <rmdir@plt>
mov    %eax,-0x654(%rbp)
jmp    14f5 <removeDirectory+0x315>
lea    0xb76(%rip),%rdi
call   1090 <printf@plt>
add    $0x660,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeDirectory>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x618,%rsp
test   %rdi,%rdi
je     1353 <removeDirectory+0x173>
mov    %rsi,%rbp
test   %rsi,%rsi
je     1353 <removeDirectory+0x173>
mov    %rdi,%rbx
lea    0x510(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xff,%edx
call   10b0 <strncat@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    $0xff,%edx
call   10b0 <strncat@plt>
mov    %r14,%rdi
call   1070 <dirExists@plt>
test   %rax,%rax
je     144b <removeDirectory+0x26b>
mov    %rbp,(%rsp)
movb   $0x0,0x210(%rsp)
lea    0x210(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,0x8(%rsp)
mov    %rbx,%rsi
mov    $0xff,%edx
call   10b0 <strncat@plt>
lea    0xd95(%rip),%rsi
mov    %rbp,%rdi
mov    $0x6,%edx
call   10b0 <strncat@plt>
mov    $0xff,%edi
call   10d0 <malloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax)
lea    0xd6a(%rip),%rsi
mov    %rbp,%rdi
call   10f0 <fopen@plt>
mov    %rax,%r12
lea    0x310(%rsp),%rdi
mov    $0xff,%esi
mov    %rax,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     1370 <removeDirectory+0x190>
mov    $0x1,%r15d
lea    0xd36(%rip),%r13
lea    0x310(%rsp),%rbp
jmp    12f5 <removeDirectory+0x115>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0xff,%esi
mov    %r12,%rdx
call   10c0 <fgets@plt>
test   %rax,%rax
je     1370 <removeDirectory+0x190>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1100 <strtok@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    (%rsp),%rsi
mov    $0xff,%edx
call   1050 <strncmp@plt>
test   %rax,%rax
je     12e0 <removeDirectory+0x100>
add    $0x1,%r15d
mov    %r15d,%esi
shl    $0x8,%esi
sub    %r15d,%esi
mov    %rbx,%rdi
call   10e0 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0xff,%edx
call   10b0 <strncat@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x1,%edx
call   10b0 <strncat@plt>
jmp    12e0 <removeDirectory+0x100>
lea    0xd1b(%rip),%rdi
add    $0x618,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <puts@plt>
mov    %r12,%rdi
call   1080 <fclose@plt>
lea    0xc85(%rip),%rsi
lea    0x210(%rsp),%rdi
call   10f0 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
call   10a0 <fputs@plt>
mov    %rbp,%rdi
call   1080 <fclose@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
movb   $0x0,0x110(%rsp)
lea    0x110(%rsp),%rbx
mov    %rbx,%rdi
mov    0x8(%rsp),%rsi
mov    $0xff,%edx
call   10b0 <strncat@plt>
mov    %rbx,%rdi
mov    (%rsp),%rsi
mov    $0xff,%edx
call   10b0 <strncat@plt>
movb   $0x0,0x10(%rsp)
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0xff,%edx
call   10b0 <strncat@plt>
lea    0xc08(%rip),%rsi
mov    %rbp,%rdi
mov    $0x7,%edx
call   10b0 <strncat@plt>
lea    0xbee(%rip),%rsi
mov    %rbp,%rdi
call   10f0 <fopen@plt>
mov    %rax,%rbx
lea    0x410(%rsp),%rdi
mov    $0xff,%esi
mov    %rax,%rdx
call   10c0 <fgets@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
call   1080 <fclose@plt>
test   %rbp,%rbp
je     1459 <removeDirectory+0x279>
lea    0xbf7(%rip),%rdi
jmp    1452 <removeDirectory+0x272>
lea    0xbbb(%rip),%rdi
call   1060 <puts@plt>
jmp    1470 <removeDirectory+0x290>
lea    0x10(%rsp),%rdi
call   1040 <remove@plt>
lea    0x110(%rsp),%rdi
call   1090 <rmdir@plt>
add    $0x618,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"ERROR: Could not read filesystem\0A\00"
@.str.1 = [6 x i8] c".list\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [7 x i8] c"/.list\00"
@.str.7 = [54 x i8] c"ERROR: Cannot delete directory since it is not empty\0A\00"
@.str.8 = [52 x i8] c"ERROR: Cannot delete directory that does not exist\0A\00"
define void @removeDirectory(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [255 x i8]
%6 = alloca [255 x i8]
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca [255 x i8]
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca [255 x i8]
%14 = alloca [255 x i8]
%15 = alloca i32*
%16 = alloca i8
%17 = alloca [255 x i8]
%18 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%19 = load i8*, i8** %3
%20 = icmp eq i8* %19, null
br i1 %20, label %24, label %21
21: ; preds = %2
%22 = load i8*, i8** %4
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %26
24: ; preds = %21, %2
%25 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %126
26: ; preds = %21
%27 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%28 = load i8*, i8** %3
%29 = call i32 @strncat(i8* %27, i8* %28, i32 255)
%30 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%31 = load i8*, i8** %4
%32 = call i32 @strncat(i8* %30, i8* %31, i32 255)
%33 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%34 = call i64 @dirExists(i8* %33)
%35 = icmp ne i64 %34, 0
br i1 %35, label %36, label %124
36: ; preds = %26
%37 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
store i8 0, i8* %37
%38 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%39 = load i8*, i8** %3
%40 = call i32 @strncat(i8* %38, i8* %39, i32 255)
%41 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%42 = call i32 @strncat(i8* %41, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 6)
store i32 1, i32* %7
%43 = call i64 @malloc(i32 255)
%44 = inttoptr i64 %43 to i8*
store i8* %44, i8** %8
%45 = load i8*, i8** %8
%46 = getelementptr inbounds i8, i8* %45, i64 0
store i8 0, i8* %46
%47 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%48 = call i32* @fopen(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %48, i32** %9
br label %49
49: ; preds = %76, %36
%50 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%51 = load i32*, i32** %9
%52 = call i64 @fgets(i8* %50, i32 255, i32* %51)
%53 = icmp ne i64 %52, 0
br i1 %53, label %54, label %77
54: ; preds = %49
%55 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%56 = call i8* @strtok(i8* %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i8* %56, i8** %11
%57 = load i8*, i8** %11
%58 = load i8*, i8** %4
%59 = call i64 @strncmp(i8* %57, i8* %58, i32 255)
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %76
61: ; preds = %54
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
store i32 %63, i32* %7
%64 = load i8*, i8** %8
%65 = load i32, i32* %7
%66 = sext i32 %65 to i64
%67 = mul i64 255, %66
%68 = trunc i64 %67 to i32
%69 = call i64 @realloc(i8* %64, i32 %68)
%70 = inttoptr i64 %69 to i8*
store i8* %70, i8** %8
%71 = load i8*, i8** %8
%72 = load i8*, i8** %11
%73 = call i32 @strncat(i8* %71, i8* %72, i32 255)
%74 = load i8*, i8** %8
%75 = call i32 @strncat(i8* %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
br label %76
76: ; preds = %61, %54
br label %49
77: ; preds = %49
%78 = load i32*, i32** %9
%79 = call i32 @fclose(i32* %78)
%80 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%81 = call i32* @fopen(i8* %80, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %81, i32** %12
%82 = load i32*, i32** %12
%83 = load i8*, i8** %8
%84 = call i32 @fprintf(i32* %82, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %83)
%85 = load i32*, i32** %12
%86 = call i32 @fclose(i32* %85)
%87 = load i8*, i8** %8
%88 = call i32 @free(i8* %87)
%89 = getelementptr inbounds [255 x i8], [255 x i8]* %13, i64 0, i64 0
store i8 0, i8* %89
%90 = getelementptr inbounds [255 x i8], [255 x i8]* %13, i64 0, i64 0
%91 = load i8*, i8** %3
%92 = call i32 @strncat(i8* %90, i8* %91, i32 255)
%93 = getelementptr inbounds [255 x i8], [255 x i8]* %13, i64 0, i64 0
%94 = load i8*, i8** %4
%95 = call i32 @strncat(i8* %93, i8* %94, i32 255)
%96 = getelementptr inbounds [255 x i8], [255 x i8]* %14, i64 0, i64 0
store i8 0, i8* %96
%97 = getelementptr inbounds [255 x i8], [255 x i8]* %14, i64 0, i64 0
%98 = getelementptr inbounds [255 x i8], [255 x i8]* %13, i64 0, i64 0
%99 = call i32 @strncat(i8* %97, i8* %98, i32 255)
%100 = getelementptr inbounds [255 x i8], [255 x i8]* %14, i64 0, i64 0
%101 = call i32 @strncat(i8* %100, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 7)
%102 = getelementptr inbounds [255 x i8], [255 x i8]* %14, i64 0, i64 0
%103 = call i32* @fopen(i8* %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %103, i32** %15
store i8 1, i8* %16
br label %104
104: ; preds = %77
%105 = getelementptr inbounds [255 x i8], [255 x i8]* %17, i64 0, i64 0
%106 = load i32*, i32** %15
%107 = call i64 @fgets(i8* %105, i32 255, i32* %106)
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %110
109: ; preds = %104
store i8 0, i8* %16
br label %110
110: ; preds = %109, %104
%111 = load i32*, i32** %15
%112 = call i32 @fclose(i32* %111)
%113 = load i8, i8* %16
%114 = sext i8 %113 to i32
%115 = icmp eq i32 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %110
%117 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.7, i64 0, i64 0))
br label %126
118: ; preds = %110
%119 = getelementptr inbounds [255 x i8], [255 x i8]* %14, i64 0, i64 0
%120 = call i32 @remove(i8* %119)
br label %121
121: ; preds = %118
%122 = getelementptr inbounds [255 x i8], [255 x i8]* %13, i64 0, i64 0
%123 = call i32 @rmdir(i8* %122)
store i32 %123, i32* %18
br label %126
124: ; preds = %26
%125 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.8, i64 0, i64 0))
br label %126
126: ; preds = %24, %116, %124, %121
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c".list\00"
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [2 x i8] c"w\00"
@.str.6 = [7 x i8] c"/.list\00"
@str = [51 x i8] c"ERROR: Cannot delete directory that does not exist\00"
@str.9 = [53 x i8] c"ERROR: Cannot delete directory since it is not empty\00"
@str.10 = [33 x i8] c"ERROR: Could not read filesystem\00"
define void @removeDirectory(i8* %0, i8* %1) {
%3 = alloca [255 x i8]
%4 = alloca [255 x i8]
%5 = alloca [255 x i8]
%6 = alloca [255 x i8]
%7 = alloca [255 x i8]
%8 = alloca [255 x i8]
%9 = icmp eq i8* %0, null
%10 = icmp eq i8* %1, null
%11 = or i1 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.10, i64 0, i64 0))
br label %75
14: ; preds = %2
%15 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%16 = call i32 @strncat(i8* %15, i8* %0, i32 255)
%17 = call i32 @strncat(i8* %15, i8* %1, i32 255)
%18 = call i64 @dirExists(i8* %15)
%19 = icmp eq i64 %18, 0
br i1 %19, label %72, label %20
20: ; preds = %14
%21 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
store i8 0, i8* %21
%22 = call i32 @strncat(i8* %21, i8* %0, i32 255)
%23 = call i32 @strncat(i8* %21, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 6)
%24 = call i64 @malloc(i32 255)
%25 = inttoptr i64 %24 to i8*
store i8 0, i8* %25
%26 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%27 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%28 = call i64 @fgets(i8* %27, i32 255, i32* %26)
%29 = icmp eq i64 %28, 0
br i1 %29, label %48, label %30
30: ; preds = %20, %43
%31 = phi i32 [ %45, %43 ], [ 1, %20 ]
%32 = phi i8* [ %44, %43 ], [ %25, %20 ]
%33 = call i8* @strtok(i8* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%34 = call i64 @strncmp(i8* %33, i8* %1, i32 255)
%35 = icmp eq i64 %34, 0
br i1 %35, label %43, label %36
36: ; preds = %30
%37 = add nsw i32 %31, 1
%38 = mul i32 %37, 255
%39 = call i64 @realloc(i8* %32, i32 %38)
%40 = inttoptr i64 %39 to i8*
%41 = call i32 @strncat(i8* %40, i8* %33, i32 255)
%42 = call i32 @strncat(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
br label %43
43: ; preds = %36, %30
%44 = phi i8* [ %40, %36 ], [ %32, %30 ]
%45 = phi i32 [ %37, %36 ], [ %31, %30 ]
%46 = call i64 @fgets(i8* %27, i32 255, i32* %26)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %30
48: ; preds = %43, %20
%49 = phi i8* [ %25, %20 ], [ %44, %43 ]
%50 = call i32 @fclose(i32* %26)
%51 = call i32* @fopen(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%52 = call i32 @fputs(i8* %49, i32* %51)
%53 = call i32 @fclose(i32* %51)
%54 = call i32 @free(i8* %49)
%55 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
store i8 0, i8* %55
%56 = call i32 @strncat(i8* %55, i8* %0, i32 255)
%57 = call i32 @strncat(i8* %55, i8* %1, i32 255)
%58 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
store i8 0, i8* %58
%59 = call i32 @strncat(i8* %58, i8* %55, i32 255)
%60 = call i32 @strncat(i8* %58, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 7)
%61 = call i32* @fopen(i8* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%62 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%63 = call i64 @fgets(i8* %62, i32 255, i32* %61)
%64 = icmp eq i64 %63, 0
%65 = call i32 @fclose(i32* %61)
br i1 %64, label %68, label %66
66: ; preds = %48
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.9, i64 0, i64 0))
br label %71
68: ; preds = %48
%69 = call i32 @remove(i8* %58)
%70 = call i32 @rmdir(i8* %55)
br label %71
71: ; preds = %68, %66
br label %74
72: ; preds = %14
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
br label %74
74: ; preds = %71, %72
br label %75
75: ; preds = %74, %12
ret void
}