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

; 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.options = type { ptr, ptr, i32, i32, i32, i32, i32, ptr, 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 }
%struct.clib_package_dependency_t = type { ptr, ptr, ptr }

@package_opts = external dso_local global %struct.clib_package_opts_t, align 8
@root_package = external dso_local global ptr, align 8
@debugger = external dso_local global %struct.debug_t, align 8
@built = external dso_local global ptr, align 8
@rest_argv = external dso_local global ptr, align 8
@rest_argc = external dso_local global i32, align 4
@opts = external dso_local global %struct.options, align 8
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@stdout = external global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @build_package_with_manifest_name(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  store i64 4096, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call ptr @path_join(ptr noundef %37, ptr noundef %38)
  store ptr %39, ptr %11, align 8, !tbaa !5
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = icmp eq ptr null, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %2
  store i32 -12, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %402

43:                                               ; preds = %2
  %44 = load ptr, ptr @built, align 8, !tbaa !5
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = call i32 @hash_has(ptr noundef %44, ptr noundef %45)
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %43
  br label %381

49:                                               ; preds = %43
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = call i32 @fs_exists(ptr noundef %50)
  %52 = icmp eq i32 0, %51
  br i1 %52, label %53, label %57

53:                                               ; preds = %49
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  call void (ptr, ptr, ...) @debug(ptr noundef @debugger, ptr noundef @.str.1, ptr noundef %54)
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = call ptr @fs_read(ptr noundef %55)
  store ptr %56, ptr %7, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %53, %49
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = icmp ne ptr null, %58
  br i1 %59, label %60, label %63

60:                                               ; preds = %57
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = call ptr @clib_package_new(ptr noundef %61, i32 noundef 0)
  store ptr %62, ptr %6, align 8, !tbaa !5
  br label %66

63:                                               ; preds = %57
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = call ptr @clib_package_new_from_slug(ptr noundef %64, i32 noundef 0)
  store ptr %65, ptr %6, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %63, %60
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = icmp eq ptr null, %67
  br i1 %68, label %69, label %70

69:                                               ; preds = %66
  store i32 -12, ptr %9, align 4, !tbaa !9
  br label %381

70:                                               ; preds = %66
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.clib_package_t, ptr %71, i32 0, i32 11
  %73 = load ptr, ptr %72, align 8, !tbaa !13
  %74 = icmp ne ptr null, %73
  br i1 %74, label %75, label %238

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.clib_package_t, ptr %77, i32 0, i32 11
  %79 = load ptr, ptr %78, align 8, !tbaa !13
  %80 = call ptr @path_join(ptr noundef %76, ptr noundef %79)
  store ptr %80, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %81 = load i32, ptr @rest_argc, align 4, !tbaa !9
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %83, label %87

83:                                               ; preds = %75
  %84 = load ptr, ptr @rest_argv, align 8, !tbaa !5
  %85 = load i32, ptr @rest_argc, align 4, !tbaa !9
  %86 = call ptr @str_flatten(ptr noundef %84, i32 noundef 0, i32 noundef %85)
  br label %88

87:                                               ; preds = %75
  br label %88

88:                                               ; preds = %87, %83
  %89 = phi ptr [ %86, %83 ], [ @.str.2, %87 ]
  store ptr %89, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  store ptr null, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %90 = call ptr @getenv(ptr noundef @.str.3) #9
  store ptr %90, ptr %18, align 8, !tbaa !5
  %91 = load ptr, ptr %18, align 8, !tbaa !5
  %92 = icmp ne ptr %91, null
  br i1 %92, label %93, label %97

93:                                               ; preds = %88
  %94 = load ptr, ptr %18, align 8, !tbaa !5
  %95 = load ptr, ptr @opts, align 8, !tbaa !15
  %96 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %17, ptr noundef @.str.4, ptr noundef %94, ptr noundef %95)
  br label %100

97:                                               ; preds = %88
  %98 = load ptr, ptr @opts, align 8, !tbaa !15
  %99 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %17, ptr noundef @.str.5, ptr noundef %98)
  br label %100

100:                                              ; preds = %97, %93
  %101 = load ptr, ptr @root_package, align 8, !tbaa !5
  %102 = icmp ne ptr %101, null
  br i1 %102, label %103, label %114

103:                                              ; preds = %100
  %104 = load ptr, ptr @root_package, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.clib_package_t, ptr %104, i32 0, i32 14
  %106 = load ptr, ptr %105, align 8, !tbaa !17
  %107 = icmp ne ptr %106, null
  br i1 %107, label %108, label %114

108:                                              ; preds = %103
  %109 = load ptr, ptr @root_package, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.clib_package_t, ptr %109, i32 0, i32 14
  %111 = load ptr, ptr %110, align 8, !tbaa !17
  store ptr %111, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @package_opts, i32 0, i32 3), align 8, !tbaa !18
  call void @clib_package_set_opts(ptr noundef byval(%struct.clib_package_opts_t) align 8 @package_opts)
  %112 = load ptr, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @package_opts, i32 0, i32 3), align 8, !tbaa !18
  %113 = call i32 @setenv(ptr noundef @.str.6, ptr noundef %112, i32 noundef 1) #9
  br label %158

114:                                              ; preds = %103, %100
  %115 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 1), align 8, !tbaa !20
  %116 = icmp ne ptr %115, null
  br i1 %116, label %117, label %120

117:                                              ; preds = %114
  %118 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 1), align 8, !tbaa !20
  %119 = call i32 @setenv(ptr noundef @.str.6, ptr noundef %118, i32 noundef 1) #9
  br label %157

120:                                              ; preds = %114
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.clib_package_t, ptr %121, i32 0, i32 14
  %123 = load ptr, ptr %122, align 8, !tbaa !17
  %124 = icmp ne ptr %123, null
  br i1 %124, label %125, label %156

125:                                              ; preds = %120
  %126 = load i64, ptr %10, align 8, !tbaa !11
  %127 = call ptr @llvm.stacksave.p0()
  store ptr %127, ptr %19, align 8
  %128 = alloca i8, i64 %126, align 16
  store i64 %126, ptr %20, align 8
  %129 = load i64, ptr %10, align 8, !tbaa !11
  call void @llvm.memset.p0.i64(ptr align 16 %128, i8 0, i64 %129, i1 false)
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.clib_package_t, ptr %130, i32 0, i32 14
  %132 = load ptr, ptr %131, align 8, !tbaa !17
  %133 = call ptr @realpath(ptr noundef %132, ptr noundef %128) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %134 = call i64 @strlen(ptr noundef %128) #10
  %135 = add i64 %134, 1
  store i64 %135, ptr %21, align 8, !tbaa !11
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.clib_package_t, ptr %136, i32 0, i32 14
  %138 = load ptr, ptr %137, align 8, !tbaa !17
  call void @free(ptr noundef %138) #9
  %139 = load i64, ptr %21, align 8, !tbaa !11
  %140 = call noalias ptr @malloc(i64 noundef %139) #11
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.clib_package_t, ptr %141, i32 0, i32 14
  store ptr %140, ptr %142, align 8, !tbaa !17
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.clib_package_t, ptr %143, i32 0, i32 14
  %145 = load ptr, ptr %144, align 8, !tbaa !17
  %146 = load i64, ptr %21, align 8, !tbaa !11
  call void @llvm.memset.p0.i64(ptr align 1 %145, i8 0, i64 %146, i1 false)
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.clib_package_t, ptr %147, i32 0, i32 14
  %149 = load ptr, ptr %148, align 8, !tbaa !17
  %150 = load i64, ptr %21, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %149, ptr align 16 %128, i64 %150, i1 false)
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.clib_package_t, ptr %151, i32 0, i32 14
  %153 = load ptr, ptr %152, align 8, !tbaa !17
  %154 = call i32 @setenv(ptr noundef @.str.6, ptr noundef %153, i32 noundef 1) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  %155 = load ptr, ptr %19, align 8
  call void @llvm.stackrestore.p0(ptr %155)
  br label %156

156:                                              ; preds = %125, %120
  br label %157

157:                                              ; preds = %156, %117
  br label %158

158:                                              ; preds = %157, %108
  %159 = load ptr, ptr %17, align 8, !tbaa !5
  %160 = call i32 @setenv(ptr noundef @.str.3, ptr noundef %159, i32 noundef 1) #9
  %161 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 7), align 8, !tbaa !21
  %162 = icmp ne ptr %161, null
  br i1 %162, label %163, label %168

163:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  store ptr null, ptr %22, align 8, !tbaa !5
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = load ptr, ptr %13, align 8, !tbaa !5
  %166 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 7), align 8, !tbaa !21
  %167 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %22, ptr noundef @.str.7, ptr noundef %164, ptr noundef %165, ptr noundef %166)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  br label %168

168:                                              ; preds = %163, %158
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  store ptr null, ptr %23, align 8, !tbaa !5
  %169 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 8), align 8, !tbaa !22
  %170 = icmp ne ptr %169, null
  br i1 %170, label %171, label %179

171:                                              ; preds = %168
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = load ptr, ptr %13, align 8, !tbaa !5
  %174 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 8), align 8, !tbaa !22
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = load ptr, ptr %13, align 8, !tbaa !5
  %177 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 8), align 8, !tbaa !22
  %178 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %23, ptr noundef @.str.8, ptr noundef %172, ptr noundef %173, ptr noundef %174, ptr noundef %175, ptr noundef %176, ptr noundef %177)
  br label %185

179:                                              ; preds = %168
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = load ptr, ptr %13, align 8, !tbaa !5
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = load ptr, ptr %13, align 8, !tbaa !5
  %184 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %23, ptr noundef @.str.9, ptr noundef %180, ptr noundef %181, ptr noundef %182, ptr noundef %183)
  br label %185

185:                                              ; preds = %179, %171
  %186 = load ptr, ptr %16, align 8, !tbaa !5
  %187 = icmp ne ptr %186, null
  br i1 %187, label %188, label %190

188:                                              ; preds = %185
  %189 = load ptr, ptr %16, align 8, !tbaa !5
  br label %191

190:                                              ; preds = %185
  br label %191

191:                                              ; preds = %190, %188
  %192 = phi ptr [ %189, %188 ], [ @.str.11, %190 ]
  %193 = load ptr, ptr %23, align 8, !tbaa !5
  %194 = load i32, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 2), align 8, !tbaa !23
  %195 = icmp ne i32 %194, 0
  %196 = zext i1 %195 to i64
  %197 = select i1 %195, ptr @.str.12, ptr @.str.2
  %198 = load ptr, ptr %15, align 8, !tbaa !5
  %199 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %14, ptr noundef @.str.10, ptr noundef %192, ptr noundef %193, ptr noundef %197, ptr noundef %198)
  %200 = load i32, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 3), align 4, !tbaa !24
  %201 = icmp ne i32 0, %200
  br i1 %201, label %202, label %218

202:                                              ; preds = %191
  %203 = load ptr, ptr @stdout, align 8, !tbaa !5
  %204 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 4, ptr noundef %203, ptr noundef @.str.13, ptr noundef @.str.14)
  %205 = load ptr, ptr @stdout, align 8, !tbaa !5
  %206 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %205, ptr noundef @.str.15) #9
  %207 = load ptr, ptr @stdout, align 8, !tbaa !5
  %208 = load ptr, ptr %6, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.clib_package_t, ptr %208, i32 0, i32 6
  %210 = load ptr, ptr %209, align 8, !tbaa !25
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.clib_package_t, ptr %211, i32 0, i32 11
  %213 = load ptr, ptr %212, align 8, !tbaa !13
  %214 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 9, ptr noundef %207, ptr noundef @.str.16, ptr noundef %210, ptr noundef %213)
  %215 = load ptr, ptr @stdout, align 8, !tbaa !5
  %216 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %215, ptr noundef @.str.17) #9
  store i32 %216, ptr %24, align 4, !tbaa !9
  %217 = load i32, ptr %24, align 4, !tbaa !9
  br label %218

218:                                              ; preds = %202, %191
  %219 = load ptr, ptr %14, align 8, !tbaa !5
  call void (ptr, ptr, ...) @debug(ptr noundef @debugger, ptr noundef @.str.18, ptr noundef %219)
  %220 = load ptr, ptr %14, align 8, !tbaa !5
  %221 = call i32 @system(ptr noundef %220)
  store i32 %221, ptr %9, align 4, !tbaa !9
  %222 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %222) #9
  %223 = load ptr, ptr %16, align 8, !tbaa !5
  %224 = icmp ne ptr %223, null
  br i1 %224, label %225, label %227

225:                                              ; preds = %218
  %226 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %226) #9
  br label %227

227:                                              ; preds = %225, %218
  %228 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %228) #9
  %229 = load ptr, ptr %23, align 8, !tbaa !5
  call void @free(ptr noundef %229) #9
  %230 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %230) #9
  %231 = load i32, ptr @rest_argc, align 4, !tbaa !9
  %232 = icmp sgt i32 %231, 0
  br i1 %232, label %233, label %235

233:                                              ; preds = %227
  %234 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %234) #9
  br label %235

235:                                              ; preds = %233, %227
  store ptr null, ptr %14, align 8, !tbaa !5
  %236 = load ptr, ptr @built, align 8, !tbaa !5
  %237 = load ptr, ptr %11, align 8, !tbaa !5
  call void @hash_set(ptr noundef %236, ptr noundef %237, ptr noundef @.str.19)
  store i32 1, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  br label %241

238:                                              ; preds = %70
  %239 = load ptr, ptr @built, align 8, !tbaa !5
  %240 = load ptr, ptr %11, align 8, !tbaa !5
  call void @hash_set(ptr noundef %239, ptr noundef %240, ptr noundef @.str.20)
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %241

241:                                              ; preds = %238, %235
  %242 = load i32, ptr %9, align 4, !tbaa !9
  %243 = icmp ne i32 0, %242
  br i1 %243, label %244, label %245

244:                                              ; preds = %241
  br label %381

245:                                              ; preds = %241
  %246 = load ptr, ptr %6, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.clib_package_t, ptr %246, i32 0, i32 15
  %248 = load ptr, ptr %247, align 8, !tbaa !26
  %249 = icmp ne ptr null, %248
  br i1 %249, label %250, label %317

250:                                              ; preds = %245
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  store ptr null, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  store ptr null, ptr %26, align 8, !tbaa !5
  %251 = load ptr, ptr %6, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.clib_package_t, ptr %251, i32 0, i32 15
  %253 = load ptr, ptr %252, align 8, !tbaa !26
  %254 = call ptr @list_iterator_new(ptr noundef %253, i32 noundef 0)
  store ptr %254, ptr %25, align 8, !tbaa !5
  br label %255

255:                                              ; preds = %307, %250
  %256 = load ptr, ptr %25, align 8, !tbaa !5
  %257 = call ptr @list_iterator_next(ptr noundef %256)
  store ptr %257, ptr %26, align 8, !tbaa !5
  %258 = icmp ne ptr %257, null
  br i1 %258, label %259, label %308

259:                                              ; preds = %255
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %260 = load ptr, ptr %26, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.list_node, ptr %260, i32 0, i32 2
  %262 = load ptr, ptr %261, align 8, !tbaa !27
  store ptr %262, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  store ptr null, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  store ptr null, ptr %29, align 8, !tbaa !5
  %263 = load ptr, ptr %27, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.clib_package_dependency_t, ptr %263, i32 0, i32 1
  %265 = load ptr, ptr %264, align 8, !tbaa !29
  %266 = load ptr, ptr %27, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.clib_package_dependency_t, ptr %266, i32 0, i32 0
  %268 = load ptr, ptr %267, align 8, !tbaa !31
  %269 = load ptr, ptr %27, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.clib_package_dependency_t, ptr %269, i32 0, i32 2
  %271 = load ptr, ptr %270, align 8, !tbaa !32
  %272 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %28, ptr noundef @.str.21, ptr noundef %265, ptr noundef %268, ptr noundef %271)
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  %273 = load ptr, ptr %28, align 8, !tbaa !5
  %274 = call ptr @clib_package_new_from_slug(ptr noundef %273, i32 noundef 0)
  store ptr %274, ptr %30, align 8, !tbaa !5
  %275 = load ptr, ptr @opts, align 8, !tbaa !15
  %276 = icmp ne ptr %275, null
  br i1 %276, label %277, label %291

277:                                              ; preds = %259
  %278 = load ptr, ptr %30, align 8, !tbaa !5
  %279 = icmp ne ptr %278, null
  br i1 %279, label %280, label %291

280:                                              ; preds = %277
  %281 = load ptr, ptr %30, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.clib_package_t, ptr %281, i32 0, i32 6
  %283 = load ptr, ptr %282, align 8, !tbaa !25
  %284 = icmp ne ptr %283, null
  br i1 %284, label %285, label %291

285:                                              ; preds = %280
  %286 = load ptr, ptr @opts, align 8, !tbaa !15
  %287 = load ptr, ptr %30, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.clib_package_t, ptr %287, i32 0, i32 6
  %289 = load ptr, ptr %288, align 8, !tbaa !25
  %290 = call ptr @path_join(ptr noundef %286, ptr noundef %289)
  store ptr %290, ptr %29, align 8, !tbaa !5
  br label %291

291:                                              ; preds = %285, %280, %277, %259
  %292 = load ptr, ptr %28, align 8, !tbaa !5
  call void @free(ptr noundef %292) #9
  %293 = load ptr, ptr %30, align 8, !tbaa !5
  call void @clib_package_free(ptr noundef %293)
  %294 = load ptr, ptr %29, align 8, !tbaa !5
  %295 = icmp eq ptr null, %294
  br i1 %295, label %296, label %297

296:                                              ; preds = %291
  store i32 -12, ptr %9, align 4, !tbaa !9
  store i32 2, ptr %12, align 4
  br label %305

297:                                              ; preds = %291
  %298 = load ptr, ptr %29, align 8, !tbaa !5
  %299 = call i32 @build_package(ptr noundef %298)
  store i32 %299, ptr %9, align 4, !tbaa !9
  %300 = load ptr, ptr %29, align 8, !tbaa !5
  call void @free(ptr noundef %300) #9
  %301 = load i32, ptr %9, align 4, !tbaa !9
  %302 = icmp ne i32 0, %301
  br i1 %302, label %303, label %304

303:                                              ; preds = %297
  store i32 2, ptr %12, align 4
  br label %305

304:                                              ; preds = %297
  store i32 0, ptr %12, align 4
  br label %305

305:                                              ; preds = %304, %303, %296
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  %306 = load i32, ptr %12, align 4
  switch i32 %306, label %314 [
    i32 0, label %307
  ]

307:                                              ; preds = %305
  br label %255, !llvm.loop !33

308:                                              ; preds = %255
  %309 = load ptr, ptr %25, align 8, !tbaa !5
  %310 = icmp ne ptr null, %309
  br i1 %310, label %311, label %313

311:                                              ; preds = %308
  %312 = load ptr, ptr %25, align 8, !tbaa !5
  call void @list_iterator_destroy(ptr noundef %312)
  br label %313

313:                                              ; preds = %311, %308
  store i32 0, ptr %12, align 4
  br label %314

314:                                              ; preds = %313, %305
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  %315 = load i32, ptr %12, align 4
  switch i32 %315, label %402 [
    i32 0, label %316
    i32 2, label %381
  ]

316:                                              ; preds = %314
  br label %317

317:                                              ; preds = %316, %245
  %318 = load i32, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 4), align 8, !tbaa !35
  %319 = icmp ne i32 %318, 0
  br i1 %319, label %320, label %380

320:                                              ; preds = %317
  %321 = load ptr, ptr %6, align 8, !tbaa !5
  %322 = getelementptr inbounds %struct.clib_package_t, ptr %321, i32 0, i32 16
  %323 = load ptr, ptr %322, align 8, !tbaa !36
  %324 = icmp ne ptr null, %323
  br i1 %324, label %325, label %380

325:                                              ; preds = %320
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #9
  store ptr null, ptr %31, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #9
  store ptr null, ptr %32, align 8, !tbaa !5
  %326 = load ptr, ptr %6, align 8, !tbaa !5
  %327 = getelementptr inbounds %struct.clib_package_t, ptr %326, i32 0, i32 16
  %328 = load ptr, ptr %327, align 8, !tbaa !36
  %329 = call ptr @list_iterator_new(ptr noundef %328, i32 noundef 0)
  store ptr %329, ptr %31, align 8, !tbaa !5
  br label %330

330:                                              ; preds = %370, %325
  %331 = load ptr, ptr %31, align 8, !tbaa !5
  %332 = call ptr @list_iterator_next(ptr noundef %331)
  store ptr %332, ptr %32, align 8, !tbaa !5
  %333 = icmp ne ptr %332, null
  br i1 %333, label %334, label %371

334:                                              ; preds = %330
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #9
  %335 = load ptr, ptr %32, align 8, !tbaa !5
  %336 = getelementptr inbounds %struct.list_node, ptr %335, i32 0, i32 2
  %337 = load ptr, ptr %336, align 8, !tbaa !27
  store ptr %337, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #9
  store ptr null, ptr %34, align 8, !tbaa !5
  %338 = load ptr, ptr %33, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct.clib_package_dependency_t, ptr %338, i32 0, i32 1
  %340 = load ptr, ptr %339, align 8, !tbaa !29
  %341 = load ptr, ptr %33, align 8, !tbaa !5
  %342 = getelementptr inbounds %struct.clib_package_dependency_t, ptr %341, i32 0, i32 0
  %343 = load ptr, ptr %342, align 8, !tbaa !31
  %344 = load ptr, ptr %33, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.clib_package_dependency_t, ptr %344, i32 0, i32 2
  %346 = load ptr, ptr %345, align 8, !tbaa !32
  %347 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef %34, ptr noundef @.str.21, ptr noundef %340, ptr noundef %343, ptr noundef %346)
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #9
  %348 = load ptr, ptr %34, align 8, !tbaa !5
  %349 = call ptr @clib_package_new_from_slug(ptr noundef %348, i32 noundef 0)
  store ptr %349, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #9
  %350 = load ptr, ptr @opts, align 8, !tbaa !15
  %351 = load ptr, ptr %35, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct.clib_package_t, ptr %351, i32 0, i32 6
  %353 = load ptr, ptr %352, align 8, !tbaa !25
  %354 = call ptr @path_join(ptr noundef %350, ptr noundef %353)
  store ptr %354, ptr %36, align 8, !tbaa !5
  %355 = load ptr, ptr %34, align 8, !tbaa !5
  call void @free(ptr noundef %355) #9
  %356 = load ptr, ptr %35, align 8, !tbaa !5
  call void @clib_package_free(ptr noundef %356)
  %357 = load ptr, ptr %36, align 8, !tbaa !5
  %358 = icmp eq ptr null, %357
  br i1 %358, label %359, label %360

359:                                              ; preds = %334
  store i32 -12, ptr %9, align 4, !tbaa !9
  store i32 2, ptr %12, align 4
  br label %368

360:                                              ; preds = %334
  %361 = load ptr, ptr %36, align 8, !tbaa !5
  %362 = call i32 @build_package(ptr noundef %361)
  store i32 %362, ptr %9, align 4, !tbaa !9
  %363 = load ptr, ptr %36, align 8, !tbaa !5
  call void @free(ptr noundef %363) #9
  %364 = load i32, ptr %9, align 4, !tbaa !9
  %365 = icmp ne i32 0, %364
  br i1 %365, label %366, label %367

366:                                              ; preds = %360
  store i32 2, ptr %12, align 4
  br label %368

367:                                              ; preds = %360
  store i32 0, ptr %12, align 4
  br label %368

368:                                              ; preds = %367, %366, %359
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #9
  %369 = load i32, ptr %12, align 4
  switch i32 %369, label %377 [
    i32 0, label %370
  ]

370:                                              ; preds = %368
  br label %330, !llvm.loop !37

371:                                              ; preds = %330
  %372 = load ptr, ptr %31, align 8, !tbaa !5
  %373 = icmp ne ptr null, %372
  br i1 %373, label %374, label %376

374:                                              ; preds = %371
  %375 = load ptr, ptr %31, align 8, !tbaa !5
  call void @list_iterator_destroy(ptr noundef %375)
  br label %376

376:                                              ; preds = %374, %371
  store i32 0, ptr %12, align 4
  br label %377

377:                                              ; preds = %376, %368
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #9
  %378 = load i32, ptr %12, align 4
  switch i32 %378, label %402 [
    i32 0, label %379
    i32 2, label %381
  ]

379:                                              ; preds = %377
  br label %380

380:                                              ; preds = %379, %320, %317
  br label %381

381:                                              ; preds = %380, %377, %314, %244, %69, %48
  %382 = load ptr, ptr %6, align 8, !tbaa !5
  %383 = icmp ne ptr null, %382
  br i1 %383, label %384, label %386

384:                                              ; preds = %381
  %385 = load ptr, ptr %6, align 8, !tbaa !5
  call void @clib_package_free(ptr noundef %385)
  br label %386

386:                                              ; preds = %384, %381
  %387 = load ptr, ptr %7, align 8, !tbaa !5
  %388 = icmp ne ptr null, %387
  br i1 %388, label %389, label %391

389:                                              ; preds = %386
  %390 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %390) #9
  br label %391

391:                                              ; preds = %389, %386
  %392 = load i32, ptr %8, align 4, !tbaa !9
  %393 = icmp eq i32 0, %392
  br i1 %393, label %394, label %400

394:                                              ; preds = %391
  %395 = load ptr, ptr %11, align 8, !tbaa !5
  %396 = icmp ne ptr null, %395
  br i1 %396, label %397, label %399

397:                                              ; preds = %394
  %398 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %398) #9
  br label %399

399:                                              ; preds = %397, %394
  br label %400

400:                                              ; preds = %399, %391
  %401 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %401, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %402

402:                                              ; preds = %400, %377, %314, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  %403 = load i32, ptr %3, align 4
  ret i32 %403
}

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

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

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

declare i32 @fs_exists(ptr noundef) #2

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

declare ptr @fs_read(ptr noundef) #2

declare ptr @clib_package_new(ptr noundef, i32 noundef) #2

declare ptr @clib_package_new_from_slug(ptr noundef, i32 noundef) #2

declare ptr @str_flatten(ptr noundef, i32 noundef, i32 noundef) #2

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

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

declare void @clib_package_set_opts(ptr noundef byval(%struct.clib_package_opts_t) align 8) #2

; Function Attrs: nounwind
declare i32 @setenv(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: nounwind
declare ptr @realpath(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #6

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #7

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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

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

declare i32 @system(ptr noundef) #2

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

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

declare ptr @list_iterator_next(ptr noundef) #2

declare void @clib_package_free(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @build_package(ptr noundef) #0

declare void @list_iterator_destroy(ptr noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 "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 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind willreturn 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 #7 = { nounwind allocsize(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 #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { nounwind allocsize(0) }

!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 88}
!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, !10, i64 152}
!15 = !{!16, !6, i64 0}
!16 = !{!"options", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40, !6, i64 48}
!17 = !{!14, !6, i64 112}
!18 = !{!19, !6, i64 16}
!19 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !10, i64 24, !6, i64 32}
!20 = !{!16, !6, i64 8}
!21 = !{!16, !6, i64 40}
!22 = !{!16, !6, i64 48}
!23 = !{!16, !10, i64 16}
!24 = !{!16, !10, i64 20}
!25 = !{!14, !6, i64 48}
!26 = !{!14, !6, i64 120}
!27 = !{!28, !6, i64 16}
!28 = !{!"list_node", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!30, !6, i64 8}
!30 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!31 = !{!30, !6, i64 0}
!32 = !{!30, !6, i64 16}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!16, !10, i64 24}
!36 = !{!14, !6, i64 128}
!37 = distinct !{!37, !34}


; 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 }
%struct.options = type { ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr }

@package_opts = external dso_local global %struct.clib_package_opts_t, align 8
@root_package = external dso_local local_unnamed_addr global ptr, align 8
@debugger = external dso_local global %struct.debug_t, align 8
@built = external dso_local local_unnamed_addr global ptr, align 8
@rest_argv = external dso_local local_unnamed_addr global ptr, align 8
@rest_argc = external dso_local local_unnamed_addr global i32, align 4
@opts = external dso_local local_unnamed_addr global %struct.options, align 8
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @build_package_with_manifest_name(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = tail call ptr @path_join(ptr noundef %0, ptr noundef %1) #13
  %10 = icmp eq ptr %9, null
  br i1 %10, label %173, label %11

11:                                               ; preds = %2
  %12 = load ptr, ptr @built, align 8, !tbaa !5
  %13 = tail call i32 @hash_has(ptr noundef %12, ptr noundef nonnull %9) #13
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %.thread210

14:                                               ; preds = %11
  %15 = tail call i32 @fs_exists(ptr noundef nonnull %9) #13
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %.thread228

17:                                               ; preds = %14
  tail call void (ptr, ptr, ...) @debug(ptr noundef nonnull @debugger, ptr noundef nonnull @.str.1, ptr noundef nonnull %9) #13
  %18 = tail call ptr @fs_read(ptr noundef nonnull %9) #13
  %.not134 = icmp eq ptr %18, null
  br i1 %.not134, label %.thread228, label %19

19:                                               ; preds = %17
  %20 = tail call ptr @clib_package_new(ptr noundef nonnull %18, i32 noundef 0) #13
  %21 = icmp eq ptr %20, null
  br i1 %21, label %.thread219, label %24

.thread228:                                       ; preds = %17, %14
  %22 = tail call ptr @clib_package_new_from_slug(ptr noundef %0, i32 noundef 0) #13
  %23 = icmp eq ptr %22, null
  br i1 %23, label %.thread210, label %24

24:                                               ; preds = %.thread228, %19
  %.0100233 = phi ptr [ %22, %.thread228 ], [ %20, %19 ]
  %.0101165232 = phi ptr [ null, %.thread228 ], [ %18, %19 ]
  %25 = getelementptr inbounds i8, ptr %.0100233, i64 88
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %.not135 = icmp eq ptr %26, null
  br i1 %.not135, label %.thread167, label %27

27:                                               ; preds = %24
  %28 = tail call ptr @path_join(ptr noundef %0, ptr noundef nonnull %26) #13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #13
  store ptr null, ptr %3, align 8, !tbaa !5
  %29 = load i32, ptr @rest_argc, align 4, !tbaa !12
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %31, label %34

31:                                               ; preds = %27
  %32 = load ptr, ptr @rest_argv, align 8, !tbaa !5
  %33 = tail call ptr @str_flatten(ptr noundef %32, i32 noundef 0, i32 noundef %29) #13
  br label %34

34:                                               ; preds = %27, %31
  %35 = phi ptr [ %33, %31 ], [ @.str.2, %27 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #13
  store ptr null, ptr %4, align 8, !tbaa !5
  %36 = tail call ptr @getenv(ptr noundef nonnull @.str.3) #13
  %.not136 = icmp eq ptr %36, null
  %37 = load ptr, ptr @opts, align 8, !tbaa !13
  br i1 %.not136, label %40, label %38

38:                                               ; preds = %34
  %39 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.4, ptr noundef nonnull %36, ptr noundef %37) #13
  br label %42

40:                                               ; preds = %34
  %41 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.5, ptr noundef %37) #13
  br label %42

42:                                               ; preds = %40, %38
  %43 = load ptr, ptr @root_package, align 8, !tbaa !5
  %.not137 = icmp eq ptr %43, null
  br i1 %.not137, label %50, label %44

44:                                               ; preds = %42
  %45 = getelementptr inbounds i8, ptr %43, i64 112
  %46 = load ptr, ptr %45, align 8, !tbaa !15
  %.not138 = icmp eq ptr %46, null
  br i1 %.not138, label %50, label %47

47:                                               ; preds = %44
  store ptr %46, ptr getelementptr inbounds (i8, ptr @package_opts, i64 16), align 8, !tbaa !16
  call void @clib_package_set_opts(ptr noundef nonnull byval(%struct.clib_package_opts_t) align 8 @package_opts) #13
  %48 = load ptr, ptr getelementptr inbounds (i8, ptr @package_opts, i64 16), align 8, !tbaa !16
  %49 = call i32 @setenv(ptr noundef nonnull @.str.6, ptr noundef %48, i32 noundef 1) #13
  br label %67

50:                                               ; preds = %44, %42
  %51 = load ptr, ptr getelementptr inbounds (i8, ptr @opts, i64 8), align 8, !tbaa !18
  %.not139 = icmp eq ptr %51, null
  br i1 %.not139, label %54, label %52

52:                                               ; preds = %50
  %53 = call i32 @setenv(ptr noundef nonnull @.str.6, ptr noundef nonnull %51, i32 noundef 1) #13
  br label %67

54:                                               ; preds = %50
  %55 = getelementptr inbounds i8, ptr %.0100233, i64 112
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %.not140 = icmp eq ptr %56, null
  br i1 %.not140, label %67, label %57

57:                                               ; preds = %54
  %58 = call ptr @llvm.stacksave.p0()
  %59 = alloca [4096 x i8], align 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4096) %59, i8 0, i64 4096, i1 false)
  %60 = load ptr, ptr %55, align 8, !tbaa !15
  %61 = call ptr @realpath(ptr noundef %60, ptr noundef nonnull %59) #13
  %62 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %59) #14
  %63 = add i64 %62, 1
  %64 = load ptr, ptr %55, align 8, !tbaa !15
  call void @free(ptr noundef %64) #13
  %calloc = call ptr @calloc(i64 1, i64 %63)
  store ptr %calloc, ptr %55, align 8, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %calloc, ptr nonnull align 16 %59, i64 %63, i1 false)
  %65 = load ptr, ptr %55, align 8, !tbaa !15
  %66 = call i32 @setenv(ptr noundef nonnull @.str.6, ptr noundef %65, i32 noundef 1) #13
  call void @llvm.stackrestore.p0(ptr %58)
  br label %67

67:                                               ; preds = %52, %57, %54, %47
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = call i32 @setenv(ptr noundef nonnull @.str.3, ptr noundef %68, i32 noundef 1) #13
  %70 = load ptr, ptr getelementptr inbounds (i8, ptr @opts, i64 40), align 8, !tbaa !19
  %.not141 = icmp eq ptr %70, null
  br i1 %.not141, label %73, label %71

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #13
  store ptr null, ptr %5, align 8, !tbaa !5
  %72 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %5, ptr noundef nonnull @.str.7, ptr noundef %0, ptr noundef %28, ptr noundef nonnull %70) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #13
  br label %73

73:                                               ; preds = %71, %67
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #13
  store ptr null, ptr %6, align 8, !tbaa !5
  %74 = load ptr, ptr getelementptr inbounds (i8, ptr @opts, i64 48), align 8, !tbaa !20
  %.not142 = icmp eq ptr %74, null
  br i1 %.not142, label %77, label %75

75:                                               ; preds = %73
  %76 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %6, ptr noundef nonnull @.str.8, ptr noundef %0, ptr noundef %28, ptr noundef nonnull %74, ptr noundef %0, ptr noundef %28, ptr noundef nonnull %74) #13
  br label %79

77:                                               ; preds = %73
  %78 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %6, ptr noundef nonnull @.str.9, ptr noundef %0, ptr noundef %28, ptr noundef %0, ptr noundef %28) #13
  br label %79

79:                                               ; preds = %77, %75
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = load i32, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8, !tbaa !21
  %.not143 = icmp eq i32 %81, 0
  %82 = select i1 %.not143, ptr @.str.2, ptr @.str.12
  %83 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %3, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.11, ptr noundef %80, ptr noundef nonnull %82, ptr noundef %35) #13
  %84 = load i32, ptr getelementptr inbounds (i8, ptr @opts, i64 20), align 4, !tbaa !22
  %.not144 = icmp eq i32 %84, 0
  br i1 %.not144, label %97, label %85

85:                                               ; preds = %79
  %86 = load ptr, ptr @stdout, align 8, !tbaa !5
  %87 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 4, ptr noundef %86, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.14) #13
  %88 = load ptr, ptr @stdout, align 8, !tbaa !5
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef nonnull @.str.15) #13
  %90 = load ptr, ptr @stdout, align 8, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %.0100233, i64 48
  %92 = load ptr, ptr %91, align 8, !tbaa !23
  %93 = load ptr, ptr %25, align 8, !tbaa !9
  %94 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 9, ptr noundef %90, ptr noundef nonnull @.str.16, ptr noundef %92, ptr noundef %93) #13
  %95 = load ptr, ptr @stdout, align 8, !tbaa !5
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef nonnull @.str.17) #13
  br label %97

97:                                               ; preds = %85, %79
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  call void (ptr, ptr, ...) @debug(ptr noundef nonnull @debugger, ptr noundef nonnull @.str.18, ptr noundef %98) #13
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = call i32 @system(ptr noundef %99) #13
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  call void @free(ptr noundef %101) #13
  call void @free(ptr noundef %28) #13
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free(ptr noundef %102) #13
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %103) #13
  %104 = load i32, ptr @rest_argc, align 4, !tbaa !12
  %105 = icmp sgt i32 %104, 0
  br i1 %105, label %106, label %108

106:                                              ; preds = %97
  call void @free(ptr noundef %35) #13
  br label %108

.thread167:                                       ; preds = %24
  %107 = load ptr, ptr @built, align 8, !tbaa !5
  tail call void @hash_set(ptr noundef %107, ptr noundef nonnull %9, ptr noundef nonnull @.str.20) #13
  br label %110

108:                                              ; preds = %97, %106
  store ptr null, ptr %3, align 8, !tbaa !5
  %109 = load ptr, ptr @built, align 8, !tbaa !5
  call void @hash_set(ptr noundef %109, ptr noundef nonnull %9, ptr noundef nonnull @.str.19) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #13
  %.not145 = icmp eq i32 %100, 0
  br i1 %.not145, label %110, label %.thread198

110:                                              ; preds = %.thread167, %108
  %111 = getelementptr inbounds i8, ptr %.0100233, i64 120
  %112 = load ptr, ptr %111, align 8, !tbaa !24
  %.not146 = icmp eq ptr %112, null
  br i1 %.not146, label %.thread174, label %113

113:                                              ; preds = %110
  %114 = call ptr @list_iterator_new(ptr noundef nonnull %112, i32 noundef 0) #13
  br label %115

115:                                              ; preds = %139, %113
  %116 = call ptr @list_iterator_next(ptr noundef %114) #13
  %.not147 = icmp eq ptr %116, null
  br i1 %.not147, label %141, label %117

117:                                              ; preds = %115
  %118 = getelementptr inbounds i8, ptr %116, i64 16
  %119 = load ptr, ptr %118, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #13
  store ptr null, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds i8, ptr %119, i64 8
  %121 = load ptr, ptr %120, align 8, !tbaa !27
  %122 = load ptr, ptr %119, align 8, !tbaa !29
  %123 = getelementptr inbounds i8, ptr %119, i64 16
  %124 = load ptr, ptr %123, align 8, !tbaa !30
  %125 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.21, ptr noundef %121, ptr noundef %122, ptr noundef %124) #13
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = call ptr @clib_package_new_from_slug(ptr noundef %126, i32 noundef 0) #13
  %128 = load ptr, ptr @opts, align 8, !tbaa !13
  %129 = icmp ne ptr %128, null
  %130 = icmp ne ptr %127, null
  %or.cond = select i1 %129, i1 %130, i1 false
  br i1 %or.cond, label %131, label %136

131:                                              ; preds = %117
  %132 = getelementptr inbounds i8, ptr %127, i64 48
  %133 = load ptr, ptr %132, align 8, !tbaa !23
  %.not149 = icmp eq ptr %133, null
  br i1 %.not149, label %136, label %134

134:                                              ; preds = %131
  %135 = call ptr @path_join(ptr noundef nonnull %128, ptr noundef nonnull %133) #13
  br label %136

136:                                              ; preds = %134, %131, %117
  %.0105 = phi ptr [ %135, %134 ], [ null, %131 ], [ null, %117 ]
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %137) #13
  call void @clib_package_free(ptr noundef %127) #13
  %138 = icmp eq ptr %.0105, null
  br i1 %138, label %.thread177, label %139

.thread177:                                       ; preds = %136
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #13
  br label %.thread198

139:                                              ; preds = %136
  %140 = call i32 @build_package(ptr noundef nonnull %.0105)
  call void @free(ptr noundef nonnull %.0105) #13
  %.not150 = icmp eq i32 %140, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #13
  br i1 %.not150, label %115, label %.thread198, !llvm.loop !31

141:                                              ; preds = %115
  %.not148 = icmp eq ptr %114, null
  br i1 %.not148, label %.thread174, label %142

142:                                              ; preds = %141
  call void @list_iterator_destroy(ptr noundef nonnull %114) #13
  br label %.thread174

.thread174:                                       ; preds = %141, %142, %110
  %143 = load i32, ptr getelementptr inbounds (i8, ptr @opts, i64 24), align 8, !tbaa !33
  %.not151 = icmp eq i32 %143, 0
  br i1 %.not151, label %.thread198, label %144

144:                                              ; preds = %.thread174
  %145 = getelementptr inbounds i8, ptr %.0100233, i64 128
  %146 = load ptr, ptr %145, align 8, !tbaa !34
  %.not152 = icmp eq ptr %146, null
  br i1 %.not152, label %.thread198, label %147

147:                                              ; preds = %144
  %148 = call ptr @list_iterator_new(ptr noundef nonnull %146, i32 noundef 0) #13
  br label %149

149:                                              ; preds = %168, %147
  %150 = call ptr @list_iterator_next(ptr noundef %148) #13
  %.not153 = icmp eq ptr %150, null
  br i1 %.not153, label %170, label %151

151:                                              ; preds = %149
  %152 = getelementptr inbounds i8, ptr %150, i64 16
  %153 = load ptr, ptr %152, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #13
  store ptr null, ptr %8, align 8, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %153, i64 8
  %155 = load ptr, ptr %154, align 8, !tbaa !27
  %156 = load ptr, ptr %153, align 8, !tbaa !29
  %157 = getelementptr inbounds i8, ptr %153, i64 16
  %158 = load ptr, ptr %157, align 8, !tbaa !30
  %159 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.21, ptr noundef %155, ptr noundef %156, ptr noundef %158) #13
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = call ptr @clib_package_new_from_slug(ptr noundef %160, i32 noundef 0) #13
  %162 = load ptr, ptr @opts, align 8, !tbaa !13
  %163 = getelementptr inbounds i8, ptr %161, i64 48
  %164 = load ptr, ptr %163, align 8, !tbaa !23
  %165 = call ptr @path_join(ptr noundef %162, ptr noundef %164) #13
  %166 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %166) #13
  call void @clib_package_free(ptr noundef %161) #13
  %167 = icmp eq ptr %165, null
  br i1 %167, label %.thread180, label %168

.thread180:                                       ; preds = %151
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #13
  br label %.thread198

168:                                              ; preds = %151
  %169 = call i32 @build_package(ptr noundef nonnull %165)
  call void @free(ptr noundef nonnull %165) #13
  %.not155 = icmp eq i32 %169, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #13
  br i1 %.not155, label %149, label %.thread198, !llvm.loop !35

170:                                              ; preds = %149
  %.not154 = icmp eq ptr %148, null
  br i1 %.not154, label %.thread198, label %171

171:                                              ; preds = %170
  call void @list_iterator_destroy(ptr noundef nonnull %148) #13
  br label %.thread198

.thread198:                                       ; preds = %139, %168, %.thread174, %.thread177, %171, %170, %.thread180, %144, %108
  %.8203 = phi i32 [ 0, %144 ], [ %100, %108 ], [ 0, %.thread174 ], [ -12, %.thread177 ], [ -12, %.thread180 ], [ 0, %170 ], [ 0, %171 ], [ %169, %168 ], [ %140, %139 ]
  call void @clib_package_free(ptr noundef nonnull %.0100233) #13
  %.not157 = icmp eq ptr %.0101165232, null
  br i1 %.not157, label %173, label %172

.thread219:                                       ; preds = %19
  tail call void @free(ptr noundef nonnull %18) #13
  br label %.thread210

172:                                              ; preds = %.thread198
  call void @free(ptr noundef nonnull %.0101165232) #13
  br label %173

.thread210:                                       ; preds = %.thread228, %.thread219, %11
  %.8194209212 = phi i32 [ 0, %11 ], [ -12, %.thread219 ], [ -12, %.thread228 ]
  tail call void @free(ptr noundef nonnull %9) #13
  br label %173

173:                                              ; preds = %.thread198, %172, %.thread210, %2
  %.0 = phi i32 [ -12, %2 ], [ %.8194209212, %.thread210 ], [ %.8203, %172 ], [ %.8203, %.thread198 ]
  ret i32 %.0
}

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

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

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

declare i32 @fs_exists(ptr noundef) local_unnamed_addr #2

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

declare ptr @fs_read(ptr noundef) local_unnamed_addr #2

declare ptr @clib_package_new(ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @clib_package_new_from_slug(ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @str_flatten(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

declare void @clib_package_set_opts(ptr noundef byval(%struct.clib_package_opts_t) align 8) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @setenv(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: nofree nounwind
declare noundef ptr @realpath(ptr nocapture noundef readonly, ptr noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #8

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #10

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

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

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

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

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

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

declare ptr @list_iterator_next(ptr noundef) local_unnamed_addr #2

declare void @clib_package_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @build_package(ptr noundef) local_unnamed_addr #0

declare void @list_iterator_destroy(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #12

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 #8 = { mustprogress nofree nounwind willreturn memory(argmem: 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 #9 = { 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 #10 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #11 = { 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 #12 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #13 = { nounwind }
attributes #14 = { nounwind willreturn memory(read) }

!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 88}
!10 = !{!"", !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}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"options", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !6, i64 40, !6, i64 48}
!15 = !{!10, !6, i64 112}
!16 = !{!17, !6, i64 16}
!17 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !6, i64 16, !11, i64 24, !6, i64 32}
!18 = !{!14, !6, i64 8}
!19 = !{!14, !6, i64 40}
!20 = !{!14, !6, i64 48}
!21 = !{!14, !11, i64 16}
!22 = !{!14, !11, i64 20}
!23 = !{!10, !6, i64 48}
!24 = !{!10, !6, i64 120}
!25 = !{!26, !6, i64 16}
!26 = !{!"list_node", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!28, !6, i64 8}
!28 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!28, !6, i64 0}
!30 = !{!28, !6, i64 16}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!14, !11, i64 24}
!34 = !{!10, !6, i64 128}
!35 = distinct !{!35, !32}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass