; LLVM IR from clibs/clib :: src/common (clib-package)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.clib_package_opts_t = type { i32, i32, i32, ptr, i32, ptr }
%struct.debug_t = type { ptr, i32, i32, ptr }
%struct.clib_package_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.list_node = type { ptr, ptr, ptr }

@opts = external hidden global %struct.clib_package_opts_t, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [1 x i8], align 1
@_debugger = external dso_local global %struct.debug_t, align 8
@.str.24 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [7 x i8], align 1
@visited_packages = external hidden global ptr, align 8
@.str.67 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @cc_fprintf(i32 noundef, ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #2

declare i32 @asprintf(ptr noundef, ptr noundef, ...) #1

declare i32 @debug_init(ptr noundef, ptr noundef) #1

declare void @debug(ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @clib_package_url(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @clib_package_install_executable(ptr noundef, ptr noundef, i32 noundef) #3

declare i32 @system(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @set_prefix(ptr noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @clib_package_install_dependencies(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind
declare ptr @getenv(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @clib_package_install(ptr noundef %0, ptr noundef %1, i32 noundef %2) #3 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 4096, ptr %15, align 8, !tbaa !11
  %23 = load ptr, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @opts, i32 0, i32 3), align 8, !tbaa !13
  %24 = icmp eq ptr null, %23
  br i1 %24, label %25, label %32

25:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %26 = call ptr @getenv(ptr noundef @.str.66) #5
  store ptr %26, ptr %16, align 8, !tbaa !5
  %27 = load ptr, ptr %16, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %31

29:                                               ; preds = %25
  %30 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %30, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @opts, i32 0, i32 3), align 8, !tbaa !13
  br label %31

31:                                               ; preds = %29, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %32

32:                                               ; preds = %31, %3
  %33 = load ptr, ptr @visited_packages, align 8, !tbaa !5
  %34 = icmp eq ptr null, %33
  br i1 %34, label %35, label %39

35:                                               ; preds = %32
  %36 = call ptr @kh_init_ptr()
  store ptr %36, ptr @visited_packages, align 8, !tbaa !5
  %37 = load ptr, ptr @visited_packages, align 8, !tbaa !5
  %38 = call noalias ptr @strdup(ptr noundef @.str.21) #5
  call void @hash_set(ptr noundef %37, ptr noundef %38, ptr noundef @.str.21)
  br label %39

39:                                               ; preds = %35, %32
  %40 = load i32, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @opts, i32 0, i32 1), align 4, !tbaa !15
  %41 = icmp eq i32 0, %40
  br i1 %41, label %42, label %59

42:                                               ; preds = %39
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %59

45:                                               ; preds = %42
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.clib_package_t, ptr %46, i32 0, i32 6
  %48 = load ptr, ptr %47, align 8, !tbaa !16
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %59

50:                                               ; preds = %45
  %51 = load ptr, ptr @visited_packages, align 8, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.clib_package_t, ptr %52, i32 0, i32 6
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = call i32 @hash_has(ptr noundef %51, ptr noundef %54)
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %50
  store i32 0, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %452

58:                                               ; preds = %50
  br label %59

59:                                               ; preds = %58, %45, %42, %39
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %65

62:                                               ; preds = %59
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %66, label %65

65:                                               ; preds = %62, %59
  store i32 -1, ptr %13, align 4, !tbaa !9
  br label %387

66:                                               ; preds = %62
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = load i64, ptr %15, align 8, !tbaa !11
  call void @set_prefix(ptr noundef %67, i64 noundef %68)
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.clib_package_t, ptr %70, i32 0, i32 6
  %72 = load ptr, ptr %71, align 8, !tbaa !16
  %73 = call ptr @path_join(ptr noundef %69, ptr noundef %72)
  store ptr %73, ptr %10, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %76, label %75

75:                                               ; preds = %66
  store i32 -1, ptr %13, align 4, !tbaa !9
  br label %387

76:                                               ; preds = %66
  %77 = load i32, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @opts, i32 0, i32 2), align 8, !tbaa !18
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %91, label %79

79:                                               ; preds = %76
  %80 = load ptr, ptr @_debugger, align 8, !tbaa !19
  %81 = icmp ne ptr %80, null
  br i1 %81, label %84, label %82

82:                                               ; preds = %79
  %83 = call i32 @debug_init(ptr noundef @_debugger, ptr noundef @.str.24)
  br label %84

84:                                               ; preds = %82, %79
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  call void (ptr, ptr, ...) @debug(ptr noundef @_debugger, ptr noundef @.str.67, ptr noundef %85)
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = call i32 @mkdirp(ptr noundef %86, i32 noundef 511)
  %88 = icmp eq i32 -1, %87
  br i1 %88, label %89, label %90

89:                                               ; preds = %84
  store i32 -1, ptr %13, align 4, !tbaa !9
  br label %387

90:                                               ; preds = %84
  br label %91

91:                                               ; preds = %90, %76
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.clib_package_t, ptr %92, i32 0, i32 9
  %94 = load ptr, ptr %93, align 8, !tbaa !21
  %95 = icmp eq ptr null, %94
  br i1 %95, label %96, label %115

96:                                               ; preds = %91
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.clib_package_t, ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !22
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.clib_package_t, ptr %100, i32 0, i32 8
  %102 = load ptr, ptr %101, align 8, !tbaa !23
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.clib_package_t, ptr %103, i32 0, i32 10
  %105 = load ptr, ptr %104, align 8, !tbaa !24
  %106 = call ptr @clib_package_url(ptr noundef %99, ptr noundef %102, ptr noundef %105)
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.clib_package_t, ptr %107, i32 0, i32 9
  store ptr %106, ptr %108, align 8, !tbaa !21
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.clib_package_t, ptr %109, i32 0, i32 9
  %111 = load ptr, ptr %110, align 8, !tbaa !21
  %112 = icmp eq ptr null, %111
  br i1 %112, label %113, label %114

113:                                              ; preds = %96
  store i32 -1, ptr %13, align 4, !tbaa !9
  br label %387

114:                                              ; preds = %96
  br label %115

115:                                              ; preds = %114, %91
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.clib_package_t, ptr %117, i32 0, i32 12
  %119 = load ptr, ptr %118, align 8, !tbaa !25
  %120 = call ptr @path_join(ptr noundef %116, ptr noundef %119)
  store ptr %120, ptr %9, align 8, !tbaa !5
  %121 = icmp ne ptr %120, null
  br i1 %121, label %123, label %122

122:                                              ; preds = %115
  store i32 -1, ptr %13, align 4, !tbaa !9
  br label %387

123:                                              ; preds = %115
  %124 = load i32, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @opts, i32 0, i32 2), align 8, !tbaa !18
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %160, label %126

126:                                              ; preds = %123
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.clib_package_t, ptr %127, i32 0, i32 17
  %129 = load ptr, ptr %128, align 8, !tbaa !26
  %130 = icmp ne ptr null, %129
  br i1 %130, label %131, label %160

131:                                              ; preds = %126
  %132 = load ptr, ptr @_debugger, align 8, !tbaa !19
  %133 = icmp ne ptr %132, null
  br i1 %133, label %136, label %134

134:                                              ; preds = %131
  %135 = call i32 @debug_init(ptr noundef @_debugger, ptr noundef @.str.24)
  br label %136

136:                                              ; preds = %134, %131
  %137 = load ptr, ptr %9, align 8, !tbaa !5
  call void (ptr, ptr, ...) @debug(ptr noundef @_debugger, ptr noundef @.str.68, ptr noundef %137)
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.clib_package_t, ptr %139, i32 0, i32 4
  %141 = load ptr, ptr %140, align 8, !tbaa !27
  %142 = call i32 @fs_write(ptr noundef %138, ptr noundef %141)
  %143 = icmp eq i32 -1, %142
  br i1 %143, label %144, label %159

144:                                              ; preds = %136
  %145 = load i32, ptr %7, align 4, !tbaa !9
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %158

147:                                              ; preds = %144
  %148 = load ptr, ptr @stderr, align 8, !tbaa !5
  %149 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 2, ptr noundef %148, ptr noundef @.str, ptr noundef @.str.1)
  %150 = load ptr, ptr @stderr, align 8, !tbaa !5
  %151 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %150, ptr noundef @.str.2) #5
  %152 = load ptr, ptr @stderr, align 8, !tbaa !5
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 9, ptr noundef %152, ptr noundef @.str.69, ptr noundef %153)
  %155 = load ptr, ptr @stderr, align 8, !tbaa !5
  %156 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %155, ptr noundef @.str.4) #5
  store i32 %156, ptr %18, align 4, !tbaa !9
  %157 = load i32, ptr %18, align 4, !tbaa !9
  br label %158

158:                                              ; preds = %147, %144
  store i32 -1, ptr %13, align 4, !tbaa !9
  br label %387

159:                                              ; preds = %136
  br label %160

160:                                              ; preds = %159, %126, %123
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.clib_package_t, ptr %161, i32 0, i32 6
  %163 = load ptr, ptr %162, align 8, !tbaa !16
  %164 = icmp ne ptr %163, null
  br i1 %164, label %165, label %179

165:                                              ; preds = %160
  %166 = load ptr, ptr @visited_packages, align 8, !tbaa !5
  %167 = load ptr, ptr %5, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.clib_package_t, ptr %167, i32 0, i32 6
  %169 = load ptr, ptr %168, align 8, !tbaa !16
  %170 = call i32 @hash_has(ptr noundef %166, ptr noundef %169)
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %178, label %172

172:                                              ; preds = %165
  %173 = load ptr, ptr @visited_packages, align 8, !tbaa !5
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.clib_package_t, ptr %174, i32 0, i32 6
  %176 = load ptr, ptr %175, align 8, !tbaa !16
  %177 = call noalias ptr @strdup(ptr noundef %176) #5
  call void @hash_set(ptr noundef %173, ptr noundef %177, ptr noundef @.str.70)
  br label %178

178:                                              ; preds = %172, %165
  br label %179

179:                                              ; preds = %178, %160
  %180 = load i32, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @opts, i32 0, i32 2), align 8, !tbaa !18
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %213, label %182

182:                                              ; preds = %179
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.clib_package_t, ptr %183, i32 0, i32 11
  %185 = load ptr, ptr %184, align 8, !tbaa !28
  %186 = icmp ne ptr %185, null
  br i1 %186, label %187, label %213

187:                                              ; preds = %182
  %188 = load ptr, ptr @_debugger, align 8, !tbaa !19
  %189 = icmp ne ptr %188, null
  br i1 %189, label %192, label %190

190:                                              ; preds = %187
  %191 = call i32 @debug_init(ptr noundef @_debugger, ptr noundef @.str.24)
  br label %192

192:                                              ; preds = %190, %187
  %193 = load ptr, ptr %5, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.clib_package_t, ptr %193, i32 0, i32 7
  %195 = load ptr, ptr %194, align 8, !tbaa !29
  %196 = load ptr, ptr %5, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.clib_package_t, ptr %196, i32 0, i32 11
  %198 = load ptr, ptr %197, align 8, !tbaa !28
  call void (ptr, ptr, ...) @debug(ptr noundef @_debugger, ptr noundef @.str.71, ptr noundef %195, ptr noundef %198)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store ptr null, ptr %19, align 8, !tbaa !5
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = load ptr, ptr %10, align 8, !tbaa !5
  %201 = load ptr, ptr %5, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.clib_package_t, ptr %201, i32 0, i32 11
  %203 = load ptr, ptr %202, align 8, !tbaa !28
  %204 = load i32, ptr %7, align 4, !tbaa !9
  %205 = call i32 @fetch_package_file(ptr noundef %199, ptr noundef %200, ptr noundef %203, i32 noundef %204, ptr noundef %19)
  store i32 %205, ptr %13, align 4, !tbaa !9
  %206 = load i32, ptr %13, align 4, !tbaa !9
  %207 = icmp ne i32 0, %206
  br i1 %207, label %208, label %209

208:                                              ; preds = %192
  store i32 2, ptr %17, align 4
  br label %210

209:                                              ; preds = %192
  store i32 0, ptr %17, align 4
  br label %210

210:                                              ; preds = %209, %208
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %211 = load i32, ptr %17, align 4
  switch i32 %211, label %452 [
    i32 0, label %212
    i32 2, label %387
  ]

212:                                              ; preds = %210
  br label %213

213:                                              ; preds = %212, %182, %179
  %214 = load i32, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @opts, i32 0, i32 2), align 8, !tbaa !18
  %215 = icmp ne i32 %214, 0
  br i1 %215, label %221, label %216

216:                                              ; preds = %213
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.clib_package_t, ptr %217, i32 0, i32 17
  %219 = load ptr, ptr %218, align 8, !tbaa !26
  %220 = icmp eq ptr null, %219
  br i1 %220, label %221, label %222

221:                                              ; preds = %216, %213
  br label %306

222:                                              ; preds = %216
  %223 = load ptr, ptr %5, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.clib_package_t, ptr %223, i32 0, i32 0
  %225 = load ptr, ptr %224, align 8, !tbaa !22
  %226 = load ptr, ptr %5, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.clib_package_t, ptr %226, i32 0, i32 6
  %228 = load ptr, ptr %227, align 8, !tbaa !16
  %229 = load ptr, ptr %5, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.clib_package_t, ptr %229, i32 0, i32 10
  %231 = load ptr, ptr %230, align 8, !tbaa !24
  %232 = call i32 @clib_cache_has_package(ptr noundef %225, ptr noundef %228, ptr noundef %231)
  %233 = icmp ne i32 %232, 0
  br i1 %233, label %234, label %279

234:                                              ; preds = %222
  %235 = load i32, ptr @opts, align 8, !tbaa !30
  %236 = icmp ne i32 %235, 0
  br i1 %236, label %237, label %248

237:                                              ; preds = %234
  %238 = load ptr, ptr %5, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.clib_package_t, ptr %238, i32 0, i32 0
  %240 = load ptr, ptr %239, align 8, !tbaa !22
  %241 = load ptr, ptr %5, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.clib_package_t, ptr %241, i32 0, i32 6
  %243 = load ptr, ptr %242, align 8, !tbaa !16
  %244 = load ptr, ptr %5, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.clib_package_t, ptr %244, i32 0, i32 10
  %246 = load ptr, ptr %245, align 8, !tbaa !24
  %247 = call i32 @clib_cache_delete_package(ptr noundef %240, ptr noundef %243, ptr noundef %246)
  br label %280

248:                                              ; preds = %234
  %249 = load ptr, ptr %5, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.clib_package_t, ptr %249, i32 0, i32 0
  %251 = load ptr, ptr %250, align 8, !tbaa !22
  %252 = load ptr, ptr %5, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.clib_package_t, ptr %252, i32 0, i32 6
  %254 = load ptr, ptr %253, align 8, !tbaa !16
  %255 = load ptr, ptr %5, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.clib_package_t, ptr %255, i32 0, i32 10
  %257 = load ptr, ptr %256, align 8, !tbaa !24
  %258 = load ptr, ptr %10, align 8, !tbaa !5
  %259 = call i32 @clib_cache_load_package(ptr noundef %251, ptr noundef %254, ptr noundef %257, ptr noundef %258)
  %260 = icmp ne i32 0, %259
  br i1 %260, label %261, label %262

261:                                              ; preds = %248
  br label %280

262:                                              ; preds = %248
  %263 = load i32, ptr %7, align 4, !tbaa !9
  %264 = icmp ne i32 %263, 0
  br i1 %264, label %265, label %278

265:                                              ; preds = %262
  %266 = load ptr, ptr @stdout, align 8, !tbaa !5
  %267 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 15, ptr noundef %266, ptr noundef @.str, ptr noundef @.str.72)
  %268 = load ptr, ptr @stdout, align 8, !tbaa !5
  %269 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %268, ptr noundef @.str.2) #5
  %270 = load ptr, ptr @stdout, align 8, !tbaa !5
  %271 = load ptr, ptr %5, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.clib_package_t, ptr %271, i32 0, i32 7
  %273 = load ptr, ptr %272, align 8, !tbaa !29
  %274 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 9, ptr noundef %270, ptr noundef %273)
  %275 = load ptr, ptr @stdout, align 8, !tbaa !5
  %276 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %275, ptr noundef @.str.4) #5
  store i32 %276, ptr %20, align 4, !tbaa !9
  %277 = load i32, ptr %20, align 4, !tbaa !9
  br label %278

278:                                              ; preds = %265, %262
  br label %306

279:                                              ; preds = %222
  br label %280

280:                                              ; preds = %279, %261, %237
  %281 = load ptr, ptr %5, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.clib_package_t, ptr %281, i32 0, i32 17
  %283 = load ptr, ptr %282, align 8, !tbaa !26
  %284 = call ptr @list_iterator_new(ptr noundef %283, i32 noundef 0)
  store ptr %284, ptr %8, align 8, !tbaa !5
  br label %285

285:                                              ; preds = %304, %280
  %286 = load ptr, ptr %8, align 8, !tbaa !5
  %287 = call ptr @list_iterator_next(ptr noundef %286)
  store ptr %287, ptr %21, align 8, !tbaa !5
  %288 = icmp ne ptr %287, null
  br i1 %288, label %289, label %305

289:                                              ; preds = %285
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  store ptr null, ptr %22, align 8, !tbaa !5
  %290 = load ptr, ptr %5, align 8, !tbaa !5
  %291 = load ptr, ptr %10, align 8, !tbaa !5
  %292 = load ptr, ptr %21, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.list_node, ptr %292, i32 0, i32 2
  %294 = load ptr, ptr %293, align 8, !tbaa !31
  %295 = load i32, ptr %7, align 4, !tbaa !9
  %296 = call i32 @fetch_package_file(ptr noundef %290, ptr noundef %291, ptr noundef %294, i32 noundef %295, ptr noundef %22)
  store i32 %296, ptr %13, align 4, !tbaa !9
  %297 = load i32, ptr %13, align 4, !tbaa !9
  %298 = icmp ne i32 0, %297
  br i1 %298, label %299, label %301

299:                                              ; preds = %289
  %300 = load ptr, ptr %8, align 8, !tbaa !5
  call void @list_iterator_destroy(ptr noundef %300)
  store ptr null, ptr %8, align 8, !tbaa !5
  store i32 -1, ptr %13, align 4, !tbaa !9
  store i32 2, ptr %17, align 4
  br label %302

301:                                              ; preds = %289
  store i32 0, ptr %17, align 4
  br label %302

302:                                              ; preds = %301, %299
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %303 = load i32, ptr %17, align 4
  switch i32 %303, label %452 [
    i32 0, label %304
    i32 2, label %387
  ]

304:                                              ; preds = %302
  br label %285, !llvm.loop !33

305:                                              ; preds = %285
  br label %306

306:                                              ; preds = %305, %278, %221
  %307 = load ptr, ptr %5, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.clib_package_t, ptr %307, i32 0, i32 3
  %309 = load ptr, ptr %308, align 8, !tbaa !35
  %310 = icmp ne ptr %309, null
  br i1 %310, label %311, label %336

311:                                              ; preds = %306
  %312 = load ptr, ptr %6, align 8, !tbaa !5
  %313 = load ptr, ptr %5, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.clib_package_t, ptr %313, i32 0, i32 6
  %315 = load ptr, ptr %314, align 8, !tbaa !16
  %316 = load ptr, ptr %5, align 8, !tbaa !5
  %317 = getelementptr inbounds %struct.clib_package_t, ptr %316, i32 0, i32 3
  %318 = load ptr, ptr %317, align 8, !tbaa !35
  %319 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %11, ptr noundef @.str.73, ptr noundef %312, ptr noundef %315, ptr noundef %318)
  store i32 %319, ptr %13, align 4, !tbaa !9
  %320 = load i32, ptr %13, align 4, !tbaa !9
  %321 = icmp eq i32 -1, %320
  br i1 %321, label %322, label %323

322:                                              ; preds = %311
  br label %387

323:                                              ; preds = %311
  %324 = load ptr, ptr @_debugger, align 8, !tbaa !19
  %325 = icmp ne ptr %324, null
  br i1 %325, label %328, label %326

326:                                              ; preds = %323
  %327 = call i32 @debug_init(ptr noundef @_debugger, ptr noundef @.str.24)
  br label %328

328:                                              ; preds = %326, %323
  %329 = load ptr, ptr %11, align 8, !tbaa !5
  call void (ptr, ptr, ...) @debug(ptr noundef @_debugger, ptr noundef @.str.74, ptr noundef %329)
  %330 = load ptr, ptr %11, align 8, !tbaa !5
  %331 = call i32 @system(ptr noundef %330)
  store i32 %331, ptr %13, align 4, !tbaa !9
  %332 = load i32, ptr %13, align 4, !tbaa !9
  %333 = icmp ne i32 0, %332
  br i1 %333, label %334, label %335

334:                                              ; preds = %328
  br label %387

335:                                              ; preds = %328
  br label %336

336:                                              ; preds = %335, %306
  %337 = load i32, ptr %13, align 4, !tbaa !9
  %338 = icmp eq i32 0, %337
  br i1 %338, label %339, label %349

339:                                              ; preds = %336
  %340 = load ptr, ptr %5, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct.clib_package_t, ptr %340, i32 0, i32 2
  %342 = load ptr, ptr %341, align 8, !tbaa !36
  %343 = icmp ne ptr %342, null
  br i1 %343, label %344, label %349

344:                                              ; preds = %339
  %345 = load ptr, ptr %5, align 8, !tbaa !5
  %346 = load ptr, ptr %6, align 8, !tbaa !5
  %347 = load i32, ptr %7, align 4, !tbaa !9
  %348 = call i32 @clib_package_install_executable(ptr noundef %345, ptr noundef %346, i32 noundef %347)
  store i32 %348, ptr %13, align 4, !tbaa !9
  br label %349

349:                                              ; preds = %344, %339, %336
  %350 = load i32, ptr %13, align 4, !tbaa !9
  %351 = icmp eq i32 0, %350
  br i1 %351, label %352, label %357

352:                                              ; preds = %349
  %353 = load ptr, ptr %5, align 8, !tbaa !5
  %354 = load ptr, ptr %6, align 8, !tbaa !5
  %355 = load i32, ptr %7, align 4, !tbaa !9
  %356 = call i32 @clib_package_install_dependencies(ptr noundef %353, ptr noundef %354, i32 noundef %355)
  store i32 %356, ptr %13, align 4, !tbaa !9
  br label %357

357:                                              ; preds = %352, %349
  %358 = load i32, ptr %13, align 4, !tbaa !9
  %359 = icmp eq i32 0, %358
  br i1 %359, label %360, label %386

360:                                              ; preds = %357
  %361 = load ptr, ptr %5, align 8, !tbaa !5
  %362 = getelementptr inbounds %struct.clib_package_t, ptr %361, i32 0, i32 0
  %363 = load ptr, ptr %362, align 8, !tbaa !22
  %364 = load ptr, ptr %5, align 8, !tbaa !5
  %365 = getelementptr inbounds %struct.clib_package_t, ptr %364, i32 0, i32 6
  %366 = load ptr, ptr %365, align 8, !tbaa !16
  %367 = load ptr, ptr %5, align 8, !tbaa !5
  %368 = getelementptr inbounds %struct.clib_package_t, ptr %367, i32 0, i32 10
  %369 = load ptr, ptr %368, align 8, !tbaa !24
  %370 = load ptr, ptr %10, align 8, !tbaa !5
  %371 = call i32 @clib_cache_save_package(ptr noundef %363, ptr noundef %366, ptr noundef %369, ptr noundef %370)
  %372 = load ptr, ptr @_debugger, align 8, !tbaa !19
  %373 = icmp ne ptr %372, null
  br i1 %373, label %376, label %374

374:                                              ; preds = %360
  %375 = call i32 @debug_init(ptr noundef @_debugger, ptr noundef @.str.24)
  br label %376

376:                                              ; preds = %374, %360
  %377 = load ptr, ptr %5, align 8, !tbaa !5
  %378 = getelementptr inbounds %struct.clib_package_t, ptr %377, i32 0, i32 0
  %379 = load ptr, ptr %378, align 8, !tbaa !22
  %380 = load ptr, ptr %5, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct.clib_package_t, ptr %380, i32 0, i32 6
  %382 = load ptr, ptr %381, align 8, !tbaa !16
  %383 = load ptr, ptr %5, align 8, !tbaa !5
  %384 = getelementptr inbounds %struct.clib_package_t, ptr %383, i32 0, i32 10
  %385 = load ptr, ptr %384, align 8, !tbaa !24
  call void (ptr, ptr, ...) @debug(ptr noundef @_debugger, ptr noundef @.str.75, ptr noundef %379, ptr noundef %382, ptr noundef %385)
  br label %386

386:                                              ; preds = %376, %357
  br label %387

387:                                              ; preds = %386, %334, %322, %302, %210, %158, %122, %113, %89, %75, %65
  %388 = load ptr, ptr %10, align 8, !tbaa !5
  %389 = icmp ne ptr %388, null
  br i1 %389, label %390, label %404

390:                                              ; preds = %387
  %391 = load i32, ptr %13, align 4, !tbaa !9
  %392 = icmp ne i32 0, %391
  br i1 %392, label %393, label %402

393:                                              ; preds = %390
  %394 = load ptr, ptr %10, align 8, !tbaa !5
  %395 = call i32 @rimraf(ptr noundef %394)
  %396 = load ptr, ptr @_debugger, align 8, !tbaa !19
  %397 = icmp ne ptr %396, null
  br i1 %397, label %400, label %398

398:                                              ; preds = %393
  %399 = call i32 @debug_init(ptr noundef @_debugger, ptr noundef @.str.24)
  br label %400

400:                                              ; preds = %398, %393
  %401 = load ptr, ptr %10, align 8, !tbaa !5
  call void (ptr, ptr, ...) @debug(ptr noundef @_debugger, ptr noundef @.str.76, ptr noundef %401)
  br label %402

402:                                              ; preds = %400, %390
  %403 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %403) #5
  br label %404

404:                                              ; preds = %402, %387
  %405 = load ptr, ptr %9, align 8, !tbaa !5
  %406 = icmp ne ptr %405, null
  br i1 %406, label %407, label %409

407:                                              ; preds = %404
  %408 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %408) #5
  br label %409

409:                                              ; preds = %407, %404
  %410 = load ptr, ptr %8, align 8, !tbaa !5
  %411 = icmp ne ptr %410, null
  br i1 %411, label %412, label %414

412:                                              ; preds = %409
  %413 = load ptr, ptr %8, align 8, !tbaa !5
  call void @list_iterator_destroy(ptr noundef %413)
  br label %414

414:                                              ; preds = %412, %409
  %415 = load ptr, ptr %11, align 8, !tbaa !5
  %416 = icmp ne ptr %415, null
  br i1 %416, label %417, label %419

417:                                              ; preds = %414
  %418 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %418) #5
  br label %419

419:                                              ; preds = %417, %414
  %420 = load i32, ptr %13, align 4, !tbaa !9
  %421 = icmp ne i32 0, %420
  br i1 %421, label %422, label %450

422:                                              ; preds = %419
  %423 = load ptr, ptr %5, align 8, !tbaa !5
  %424 = icmp ne ptr %423, null
  br i1 %424, label %425, label %450

425:                                              ; preds = %422
  %426 = load ptr, ptr %5, align 8, !tbaa !5
  %427 = getelementptr inbounds %struct.clib_package_t, ptr %426, i32 0, i32 0
  %428 = load ptr, ptr %427, align 8, !tbaa !22
  %429 = load ptr, ptr %5, align 8, !tbaa !5
  %430 = getelementptr inbounds %struct.clib_package_t, ptr %429, i32 0, i32 6
  %431 = load ptr, ptr %430, align 8, !tbaa !16
  %432 = load ptr, ptr %5, align 8, !tbaa !5
  %433 = getelementptr inbounds %struct.clib_package_t, ptr %432, i32 0, i32 10
  %434 = load ptr, ptr %433, align 8, !tbaa !24
  %435 = call i32 @clib_cache_delete_json(ptr noundef %428, ptr noundef %431, ptr noundef %434)
  %436 = load ptr, ptr @_debugger, align 8, !tbaa !19
  %437 = icmp ne ptr %436, null
  br i1 %437, label %440, label %438

438:                                              ; preds = %425
  %439 = call i32 @debug_init(ptr noundef @_debugger, ptr noundef @.str.24)
  br label %440

440:                                              ; preds = %438, %425
  %441 = load ptr, ptr %5, align 8, !tbaa !5
  %442 = getelementptr inbounds %struct.clib_package_t, ptr %441, i32 0, i32 0
  %443 = load ptr, ptr %442, align 8, !tbaa !22
  %444 = load ptr, ptr %5, align 8, !tbaa !5
  %445 = getelementptr inbounds %struct.clib_package_t, ptr %444, i32 0, i32 6
  %446 = load ptr, ptr %445, align 8, !tbaa !16
  %447 = load ptr, ptr %5, align 8, !tbaa !5
  %448 = getelementptr inbounds %struct.clib_package_t, ptr %447, i32 0, i32 10
  %449 = load ptr, ptr %448, align 8, !tbaa !24
  call void (ptr, ptr, ...) @debug(ptr noundef @_debugger, ptr noundef @.str.77, ptr noundef %443, ptr noundef %446, ptr noundef %449)
  br label %450

450:                                              ; preds = %440, %422, %419
  %451 = load i32, ptr %13, align 4, !tbaa !9
  store i32 %451, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %452

452:                                              ; preds = %450, %302, %210, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %453 = load i32, ptr %4, align 4
  ret i32 %453
}

declare void @hash_set(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @hash_has(ptr noundef, ptr noundef) #1

declare ptr @path_join(ptr noundef, ptr noundef) #1

declare i32 @mkdirp(ptr noundef, i32 noundef) #1

declare i32 @fs_write(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @fetch_package_file(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare i32 @clib_cache_has_package(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @clib_cache_delete_package(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @clib_cache_load_package(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare ptr @list_iterator_new(ptr noundef, i32 noundef) #1

declare ptr @list_iterator_next(ptr noundef) #1

declare void @list_iterator_destroy(ptr noundef) #1

declare i32 @clib_cache_save_package(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @rimraf(ptr noundef) #1

declare i32 @clib_cache_delete_json(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @kh_init_ptr() #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 16}
!14 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !10, i64 24, !6, i64 32}
!15 = !{!14, !10, i64 4}
!16 = !{!17, !6, i64 48}
!17 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !10, i64 152}
!18 = !{!14, !10, i64 8}
!19 = !{!20, !6, i64 0}
!20 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!21 = !{!17, !6, i64 72}
!22 = !{!17, !6, i64 0}
!23 = !{!17, !6, i64 64}
!24 = !{!17, !6, i64 80}
!25 = !{!17, !6, i64 96}
!26 = !{!17, !6, i64 136}
!27 = !{!17, !6, i64 32}
!28 = !{!17, !6, i64 88}
!29 = !{!17, !6, i64 56}
!30 = !{!14, !10, i64 0}
!31 = !{!32, !6, i64 16}
!32 = !{!"list_node", !6, i64 0, !6, i64 8, !6, i64 16}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!17, !6, i64 24}
!36 = !{!17, !6, i64 16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.clib_package_opts_t = type { i32, i32, i32, ptr, i32, ptr }
%struct.debug_t = type { ptr, i32, i32, ptr }

@opts = external hidden local_unnamed_addr global %struct.clib_package_opts_t, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.21 = external hidden unnamed_addr constant [1 x i8], align 1
@_debugger = external dso_local global %struct.debug_t, align 8
@.str.24 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [7 x i8], align 1
@visited_packages = external hidden local_unnamed_addr global ptr, align 8
@.str.67 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.74 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.75 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare i32 @cc_fprintf(i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #4

declare i32 @asprintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare i32 @debug_init(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @debug(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @clib_package_url(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare dso_local i32 @clib_package_install_executable(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree
declare noundef i32 @system(ptr nocapture noundef readonly) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare hidden void @set_prefix(ptr noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare dso_local i32 @clib_package_install_dependencies(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind memory(read)
declare noundef ptr @getenv(ptr nocapture noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
define dso_local i32 @clib_package_install(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #5 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  store ptr null, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8, !tbaa !9
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %12

9:                                                ; preds = %3
  %10 = tail call ptr @getenv(ptr noundef nonnull @.str.66) #9
  %.not = icmp eq ptr %10, null
  br i1 %.not, label %12, label %11

11:                                               ; preds = %9
  store ptr %10, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8, !tbaa !9
  br label %12

12:                                               ; preds = %9, %11, %3
  %13 = load ptr, ptr @visited_packages, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %18

15:                                               ; preds = %12
  %16 = tail call ptr @kh_init_ptr()
  store ptr %16, ptr @visited_packages, align 8, !tbaa !5
  %17 = tail call noalias ptr @strdup(ptr noundef nonnull @.str.21) #9
  tail call void @hash_set(ptr noundef %16, ptr noundef %17, ptr noundef nonnull @.str.21) #9
  br label %18

18:                                               ; preds = %15, %12
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @opts, i64 4), align 4, !tbaa !12
  %20 = icmp eq i32 %19, 0
  %21 = icmp ne ptr %0, null
  %or.cond = and i1 %21, %20
  br i1 %or.cond, label %22, label %28

22:                                               ; preds = %18
  %23 = getelementptr inbounds i8, ptr %0, i64 48
  %24 = load ptr, ptr %23, align 8, !tbaa !13
  %.not136 = icmp eq ptr %24, null
  br i1 %.not136, label %28, label %25

25:                                               ; preds = %22
  %26 = load ptr, ptr @visited_packages, align 8, !tbaa !5
  %27 = tail call i32 @hash_has(ptr noundef %26, ptr noundef nonnull %24) #9
  %.not137 = icmp eq i32 %27, 0
  br i1 %.not137, label %28, label %209

28:                                               ; preds = %25, %22, %18
  %29 = icmp ne ptr %1, null
  %or.cond3 = and i1 %21, %29
  br i1 %or.cond3, label %30, label %.thread224

30:                                               ; preds = %28
  tail call void @set_prefix(ptr noundef nonnull %0, i64 noundef 4096)
  %31 = getelementptr inbounds i8, ptr %0, i64 48
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  %33 = tail call ptr @path_join(ptr noundef nonnull %1, ptr noundef %32) #9
  %.not138 = icmp eq ptr %33, null
  br i1 %.not138, label %.thread224, label %34

34:                                               ; preds = %30
  %35 = load i32, ptr getelementptr inbounds (i8, ptr @opts, i64 8), align 8, !tbaa !15
  %.not139 = icmp eq i32 %35, 0
  br i1 %.not139, label %36, label %43

36:                                               ; preds = %34
  %37 = load ptr, ptr @_debugger, align 8, !tbaa !16
  %.not140 = icmp eq ptr %37, null
  br i1 %.not140, label %38, label %40

38:                                               ; preds = %36
  %39 = tail call i32 @debug_init(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.24) #9
  br label %40

40:                                               ; preds = %38, %36
  tail call void (ptr, ptr, ...) @debug(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.67, ptr noundef nonnull %33) #9
  %41 = tail call i32 @mkdirp(ptr noundef nonnull %33, i32 noundef 511) #9
  %42 = icmp eq i32 %41, -1
  br i1 %42, label %.thread203, label %43

43:                                               ; preds = %40, %34
  %44 = getelementptr inbounds i8, ptr %0, i64 72
  %45 = load ptr, ptr %44, align 8, !tbaa !18
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %55

47:                                               ; preds = %43
  %48 = load ptr, ptr %0, align 8, !tbaa !19
  %49 = getelementptr inbounds i8, ptr %0, i64 64
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = getelementptr inbounds i8, ptr %0, i64 80
  %52 = load ptr, ptr %51, align 8, !tbaa !21
  %53 = tail call ptr @clib_package_url(ptr noundef %48, ptr noundef %50, ptr noundef %52)
  store ptr %53, ptr %44, align 8, !tbaa !18
  %54 = icmp eq ptr %53, null
  br i1 %54, label %.thread203, label %55

55:                                               ; preds = %47, %43
  %56 = getelementptr inbounds i8, ptr %0, i64 96
  %57 = load ptr, ptr %56, align 8, !tbaa !22
  %58 = tail call ptr @path_join(ptr noundef nonnull %33, ptr noundef %57) #9
  %.not141 = icmp eq ptr %58, null
  br i1 %.not141, label %.thread203, label %59

59:                                               ; preds = %55
  %60 = load i32, ptr getelementptr inbounds (i8, ptr @opts, i64 8), align 8, !tbaa !15
  %.not142 = icmp eq i32 %60, 0
  br i1 %.not142, label %61, label %83

61:                                               ; preds = %59
  %62 = getelementptr inbounds i8, ptr %0, i64 136
  %63 = load ptr, ptr %62, align 8, !tbaa !23
  %.not143 = icmp eq ptr %63, null
  br i1 %.not143, label %83, label %64

64:                                               ; preds = %61
  %65 = load ptr, ptr @_debugger, align 8, !tbaa !16
  %.not144 = icmp eq ptr %65, null
  br i1 %.not144, label %66, label %68

66:                                               ; preds = %64
  %67 = tail call i32 @debug_init(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.24) #9
  br label %68

68:                                               ; preds = %66, %64
  tail call void (ptr, ptr, ...) @debug(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.68, ptr noundef nonnull %58) #9
  %69 = getelementptr inbounds i8, ptr %0, i64 32
  %70 = load ptr, ptr %69, align 8, !tbaa !24
  %71 = tail call i32 @fs_write(ptr noundef nonnull %58, ptr noundef %70) #9
  %72 = icmp eq i32 %71, -1
  br i1 %72, label %73, label %83

73:                                               ; preds = %68
  %.not145 = icmp eq i32 %2, 0
  br i1 %.not145, label %.thread203, label %74

74:                                               ; preds = %73
  %75 = load ptr, ptr @stderr, align 8, !tbaa !5
  %76 = tail call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 2, ptr noundef %75, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1) #9
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.2) #10
  %79 = load ptr, ptr @stderr, align 8, !tbaa !5
  %80 = tail call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 9, ptr noundef %79, ptr noundef nonnull @.str.69, ptr noundef nonnull %58) #9
  %81 = load ptr, ptr @stderr, align 8, !tbaa !5
  %82 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef nonnull @.str.4) #10
  br label %.thread203

83:                                               ; preds = %68, %61, %59
  %84 = load ptr, ptr %31, align 8, !tbaa !13
  %.not146 = icmp eq ptr %84, null
  br i1 %.not146, label %92, label %85

85:                                               ; preds = %83
  %86 = load ptr, ptr @visited_packages, align 8, !tbaa !5
  %87 = tail call i32 @hash_has(ptr noundef %86, ptr noundef nonnull %84) #9
  %.not147 = icmp eq i32 %87, 0
  br i1 %.not147, label %88, label %92

88:                                               ; preds = %85
  %89 = load ptr, ptr @visited_packages, align 8, !tbaa !5
  %90 = load ptr, ptr %31, align 8, !tbaa !13
  %91 = tail call noalias ptr @strdup(ptr noundef %90) #9
  tail call void @hash_set(ptr noundef %89, ptr noundef %91, ptr noundef nonnull @.str.70) #9
  br label %92

92:                                               ; preds = %85, %88, %83
  %93 = load i32, ptr getelementptr inbounds (i8, ptr @opts, i64 8), align 8, !tbaa !15
  %.not148 = icmp eq i32 %93, 0
  br i1 %.not148, label %94, label %.thread

94:                                               ; preds = %92
  %95 = getelementptr inbounds i8, ptr %0, i64 88
  %96 = load ptr, ptr %95, align 8, !tbaa !25
  %.not149 = icmp eq ptr %96, null
  br i1 %.not149, label %.thread231, label %97

97:                                               ; preds = %94
  %98 = load ptr, ptr @_debugger, align 8, !tbaa !16
  %.not150 = icmp eq ptr %98, null
  br i1 %.not150, label %99, label %101

99:                                               ; preds = %97
  %100 = tail call i32 @debug_init(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.24) #9
  %.pre = load ptr, ptr %95, align 8, !tbaa !25
  br label %101

101:                                              ; preds = %99, %97
  %102 = phi ptr [ %.pre, %99 ], [ %96, %97 ]
  %103 = getelementptr inbounds i8, ptr %0, i64 56
  %104 = load ptr, ptr %103, align 8, !tbaa !26
  tail call void (ptr, ptr, ...) @debug(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.71, ptr noundef %104, ptr noundef %102) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  store ptr null, ptr %5, align 8, !tbaa !5
  %105 = load ptr, ptr %95, align 8, !tbaa !25
  %106 = call i32 @fetch_package_file(ptr noundef nonnull %0, ptr noundef nonnull %33, ptr noundef %105, i32 noundef %2, ptr noundef nonnull %5)
  %.not151 = icmp eq i32 %106, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  br i1 %.not151, label %107, label %.thread203

107:                                              ; preds = %101
  %.pr.pre = load i32, ptr getelementptr inbounds (i8, ptr @opts, i64 8), align 8, !tbaa !15
  %.not152 = icmp eq i32 %.pr.pre, 0
  br i1 %.not152, label %.thread231, label %.thread

.thread231:                                       ; preds = %94, %107
  %108 = getelementptr inbounds i8, ptr %0, i64 136
  %109 = load ptr, ptr %108, align 8, !tbaa !23
  %110 = icmp eq ptr %109, null
  br i1 %110, label %.thread, label %111

111:                                              ; preds = %.thread231
  %112 = load ptr, ptr %0, align 8, !tbaa !19
  %113 = load ptr, ptr %31, align 8, !tbaa !13
  %114 = getelementptr inbounds i8, ptr %0, i64 80
  %115 = load ptr, ptr %114, align 8, !tbaa !21
  %116 = call i32 @clib_cache_has_package(ptr noundef %112, ptr noundef %113, ptr noundef %115) #9
  %.not153 = icmp eq i32 %116, 0
  br i1 %.not153, label %138, label %117

117:                                              ; preds = %111
  %118 = load i32, ptr @opts, align 8, !tbaa !27
  %.not154 = icmp eq i32 %118, 0
  %119 = load ptr, ptr %0, align 8, !tbaa !19
  %120 = load ptr, ptr %31, align 8, !tbaa !13
  %121 = load ptr, ptr %114, align 8, !tbaa !21
  br i1 %.not154, label %124, label %122

122:                                              ; preds = %117
  %123 = call i32 @clib_cache_delete_package(ptr noundef %119, ptr noundef %120, ptr noundef %121) #9
  br label %138

124:                                              ; preds = %117
  %125 = call i32 @clib_cache_load_package(ptr noundef %119, ptr noundef %120, ptr noundef %121, ptr noundef nonnull %33) #9
  %.not155 = icmp eq i32 %125, 0
  br i1 %.not155, label %126, label %138

126:                                              ; preds = %124
  %.not156 = icmp eq i32 %2, 0
  br i1 %.not156, label %.thread, label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr @stdout, align 8, !tbaa !5
  %129 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 15, ptr noundef %128, ptr noundef nonnull @.str, ptr noundef nonnull @.str.72) #9
  %130 = load ptr, ptr @stdout, align 8, !tbaa !5
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef nonnull @.str.2) #9
  %132 = load ptr, ptr @stdout, align 8, !tbaa !5
  %133 = getelementptr inbounds i8, ptr %0, i64 56
  %134 = load ptr, ptr %133, align 8, !tbaa !26
  %135 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 9, ptr noundef %132, ptr noundef %134) #9
  %136 = load ptr, ptr @stdout, align 8, !tbaa !5
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef nonnull @.str.4) #9
  br label %.thread

138:                                              ; preds = %111, %124, %122
  %139 = load ptr, ptr %108, align 8, !tbaa !23
  %140 = call ptr @list_iterator_new(ptr noundef %139, i32 noundef 0) #9
  %141 = call ptr @list_iterator_next(ptr noundef %140) #9
  %.not157229 = icmp eq ptr %141, null
  br i1 %.not157229, label %.thread, label %.lr.ph

.lr.ph:                                           ; preds = %138, %146
  %142 = phi ptr [ %147, %146 ], [ %141, %138 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  store ptr null, ptr %6, align 8, !tbaa !5
  %143 = getelementptr inbounds i8, ptr %142, i64 16
  %144 = load ptr, ptr %143, align 8, !tbaa !28
  %145 = call i32 @fetch_package_file(ptr noundef %0, ptr noundef nonnull %33, ptr noundef %144, i32 noundef %2, ptr noundef nonnull %6)
  %.not158 = icmp eq i32 %145, 0
  br i1 %.not158, label %146, label %.thread174

.thread174:                                       ; preds = %.lr.ph
  call void @list_iterator_destroy(ptr noundef %140) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  br label %.thread203

146:                                              ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  %147 = call ptr @list_iterator_next(ptr noundef %140) #9
  %.not157 = icmp eq ptr %147, null
  br i1 %.not157, label %.thread, label %.lr.ph

.thread:                                          ; preds = %146, %138, %92, %126, %127, %107, %.thread231
  %.2 = phi ptr [ null, %107 ], [ null, %.thread231 ], [ null, %127 ], [ null, %126 ], [ null, %92 ], [ %140, %138 ], [ %140, %146 ]
  %148 = getelementptr inbounds i8, ptr %0, i64 24
  %149 = load ptr, ptr %148, align 8, !tbaa !30
  %.not159 = icmp eq ptr %149, null
  br i1 %.not159, label %162, label %150

150:                                              ; preds = %.thread
  %151 = load ptr, ptr %31, align 8, !tbaa !13
  %152 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.73, ptr noundef nonnull %1, ptr noundef %151, ptr noundef nonnull %149) #9
  %153 = icmp eq i32 %152, -1
  br i1 %153, label %.thread203, label %154

154:                                              ; preds = %150
  %155 = load ptr, ptr @_debugger, align 8, !tbaa !16
  %.not160 = icmp eq ptr %155, null
  br i1 %.not160, label %156, label %158

156:                                              ; preds = %154
  %157 = call i32 @debug_init(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.24) #9
  br label %158

158:                                              ; preds = %156, %154
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, ptr, ...) @debug(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.74, ptr noundef %159) #9
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = call i32 @system(ptr noundef %160) #9
  %.not161 = icmp eq i32 %161, 0
  br i1 %.not161, label %162, label %.thread203

162:                                              ; preds = %.thread, %158
  %163 = getelementptr inbounds i8, ptr %0, i64 16
  %164 = load ptr, ptr %163, align 8, !tbaa !31
  %.not162 = icmp eq ptr %164, null
  br i1 %.not162, label %.thread179, label %165

165:                                              ; preds = %162
  %166 = call i32 @clib_package_install_executable(ptr noundef nonnull %0, ptr noundef nonnull %1, i32 noundef %2)
  %167 = icmp eq i32 %166, 0
  br i1 %167, label %.thread179, label %.thread203

.thread179:                                       ; preds = %162, %165
  %168 = call i32 @clib_package_install_dependencies(ptr noundef nonnull %0, ptr noundef nonnull %1, i32 noundef %2)
  %169 = icmp eq i32 %168, 0
  br i1 %169, label %170, label %.thread203

170:                                              ; preds = %.thread179
  %171 = load ptr, ptr %0, align 8, !tbaa !19
  %172 = load ptr, ptr %31, align 8, !tbaa !13
  %173 = getelementptr inbounds i8, ptr %0, i64 80
  %174 = load ptr, ptr %173, align 8, !tbaa !21
  %175 = call i32 @clib_cache_save_package(ptr noundef %171, ptr noundef %172, ptr noundef %174, ptr noundef nonnull %33) #9
  %176 = load ptr, ptr @_debugger, align 8, !tbaa !16
  %.not163 = icmp eq ptr %176, null
  br i1 %.not163, label %177, label %.thread181

177:                                              ; preds = %170
  %178 = call i32 @debug_init(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.24) #9
  br label %.thread181

.thread181:                                       ; preds = %170, %177
  %179 = load ptr, ptr %0, align 8, !tbaa !19
  %180 = load ptr, ptr %31, align 8, !tbaa !13
  %181 = load ptr, ptr %173, align 8, !tbaa !21
  call void (ptr, ptr, ...) @debug(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.75, ptr noundef %179, ptr noundef %180, ptr noundef %181) #9
  br label %187

.thread203:                                       ; preds = %165, %.thread174, %.thread179, %158, %150, %101, %40, %47, %55, %74, %73
  %.7189215 = phi i32 [ -1, %73 ], [ -1, %74 ], [ -1, %55 ], [ -1, %47 ], [ -1, %40 ], [ %106, %101 ], [ %166, %165 ], [ -1, %.thread174 ], [ %168, %.thread179 ], [ %161, %158 ], [ -1, %150 ]
  %.0110192211 = phi ptr [ %58, %73 ], [ %58, %74 ], [ null, %55 ], [ null, %47 ], [ null, %40 ], [ %58, %101 ], [ %58, %165 ], [ %58, %.thread174 ], [ %58, %.thread179 ], [ %58, %158 ], [ %58, %150 ]
  %.3194209 = phi ptr [ null, %73 ], [ null, %74 ], [ null, %55 ], [ null, %47 ], [ null, %40 ], [ null, %101 ], [ %.2, %165 ], [ null, %.thread174 ], [ %.2, %.thread179 ], [ %.2, %158 ], [ %.2, %150 ]
  %182 = call i32 @rimraf(ptr noundef nonnull %33) #9
  %183 = load ptr, ptr @_debugger, align 8, !tbaa !16
  %.not166 = icmp eq ptr %183, null
  br i1 %.not166, label %184, label %186

184:                                              ; preds = %.thread203
  %185 = call i32 @debug_init(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.24) #9
  br label %186

186:                                              ; preds = %184, %.thread203
  call void (ptr, ptr, ...) @debug(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.76, ptr noundef nonnull %33) #9
  br label %187

187:                                              ; preds = %.thread181, %186
  %.7189216 = phi i32 [ %.7189215, %186 ], [ 0, %.thread181 ]
  %.0110192212 = phi ptr [ %.0110192211, %186 ], [ %58, %.thread181 ]
  %.3194210 = phi ptr [ %.3194209, %186 ], [ %.2, %.thread181 ]
  call void @free(ptr noundef nonnull %33) #9
  %.not167 = icmp eq ptr %.0110192212, null
  br i1 %.not167, label %189, label %188

188:                                              ; preds = %187
  call void @free(ptr noundef nonnull %.0110192212) #9
  br label %189

189:                                              ; preds = %188, %187
  %.not168 = icmp eq ptr %.3194210, null
  br i1 %.not168, label %.thread224, label %190

190:                                              ; preds = %189
  call void @list_iterator_destroy(ptr noundef nonnull %.3194210) #9
  br label %.thread224

.thread224:                                       ; preds = %30, %28, %190, %189
  %.7190223228 = phi i32 [ %.7189216, %190 ], [ %.7189216, %189 ], [ -1, %28 ], [ -1, %30 ]
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %.not169 = icmp eq ptr %191, null
  br i1 %.not169, label %193, label %192

192:                                              ; preds = %.thread224
  call void @free(ptr noundef nonnull %191) #9
  br label %193

193:                                              ; preds = %192, %.thread224
  %194 = icmp ne i32 %.7190223228, 0
  %or.cond5 = and i1 %21, %194
  br i1 %or.cond5, label %195, label %209

195:                                              ; preds = %193
  %196 = load ptr, ptr %0, align 8, !tbaa !19
  %197 = getelementptr inbounds i8, ptr %0, i64 48
  %198 = load ptr, ptr %197, align 8, !tbaa !13
  %199 = getelementptr inbounds i8, ptr %0, i64 80
  %200 = load ptr, ptr %199, align 8, !tbaa !21
  %201 = call i32 @clib_cache_delete_json(ptr noundef %196, ptr noundef %198, ptr noundef %200) #9
  %202 = load ptr, ptr @_debugger, align 8, !tbaa !16
  %.not170 = icmp eq ptr %202, null
  br i1 %.not170, label %203, label %205

203:                                              ; preds = %195
  %204 = call i32 @debug_init(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.24) #9
  br label %205

205:                                              ; preds = %203, %195
  %206 = load ptr, ptr %0, align 8, !tbaa !19
  %207 = load ptr, ptr %197, align 8, !tbaa !13
  %208 = load ptr, ptr %199, align 8, !tbaa !21
  call void (ptr, ptr, ...) @debug(ptr noundef nonnull @_debugger, ptr noundef nonnull @.str.77, ptr noundef %206, ptr noundef %207, ptr noundef %208) #9
  br label %209

209:                                              ; preds = %193, %205, %25
  %.0 = phi i32 [ 0, %25 ], [ %.7190223228, %205 ], [ %.7190223228, %193 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  ret i32 %.0
}

declare void @hash_set(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @hash_has(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @path_join(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @mkdirp(ptr noundef, i32 noundef) local_unnamed_addr #1

declare i32 @fs_write(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @fetch_package_file(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

declare i32 @clib_cache_has_package(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @clib_cache_delete_package(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @clib_cache_load_package(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @list_iterator_new(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @list_iterator_next(ptr noundef) local_unnamed_addr #1

declare void @list_iterator_destroy(ptr noundef) local_unnamed_addr #1

declare i32 @clib_cache_save_package(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @rimraf(ptr noundef) local_unnamed_addr #1

declare i32 @clib_cache_delete_json(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @kh_init_ptr() local_unnamed_addr #8

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { cold nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !11, i64 24, !6, i64 32}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!14, !6, i64 48}
!14 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !11, i64 152}
!15 = !{!10, !11, i64 8}
!16 = !{!17, !6, i64 0}
!17 = !{!"", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16}
!18 = !{!14, !6, i64 72}
!19 = !{!14, !6, i64 0}
!20 = !{!14, !6, i64 64}
!21 = !{!14, !6, i64 80}
!22 = !{!14, !6, i64 96}
!23 = !{!14, !6, i64 136}
!24 = !{!14, !6, i64 32}
!25 = !{!14, !6, i64 88}
!26 = !{!14, !6, i64 56}
!27 = !{!10, !11, i64 0}
!28 = !{!29, !6, i64 16}
!29 = !{!"list_node", !6, i64 0, !6, i64 8, !6, i64 16}
!30 = !{!14, !6, i64 24}
!31 = !{!14, !6, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass