; LLVM IR from clibs/clib :: test/package (package-install-dev-dependencies)

; 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 }

@__assert_failures = external hidden global i32, align 4
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@stderr = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [92 x i8], align 1
@__assert_bail = external hidden global i32, align 4
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.clib_package_opts_t, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  %13 = call i32 @curl_global_init(i64 noundef 3)
  call void @llvm.memset.p0.i64(ptr align 8 %2, i8 0, i64 40, i1 false)
  %14 = getelementptr inbounds %struct.clib_package_opts_t, ptr %2, i32 0, i32 0
  store i32 1, ptr %14, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.clib_package_opts_t, ptr %2, i32 0, i32 1
  store i32 1, ptr %15, align 4, !tbaa !11
  %16 = getelementptr inbounds %struct.clib_package_opts_t, ptr %2, i32 0, i32 2
  %17 = getelementptr inbounds %struct.clib_package_opts_t, ptr %2, i32 0, i32 3
  %18 = getelementptr inbounds %struct.clib_package_opts_t, ptr %2, i32 0, i32 4
  %19 = getelementptr inbounds %struct.clib_package_opts_t, ptr %2, i32 0, i32 5
  call void @clib_package_set_opts(ptr noundef byval(%struct.clib_package_opts_t) align 8 %2)
  %20 = call i32 @clib_cache_init(i64 noundef 100)
  %21 = call ptr @clib_cache_dir()
  %22 = call i32 @rimraf(ptr noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !12
  br label %23

23:                                               ; preds = %221, %0
  %24 = load i32, ptr %3, align 4, !tbaa !12
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %3, align 4, !tbaa !12
  %26 = icmp eq i32 %24, 0
  br i1 %26, label %27, label %30

27:                                               ; preds = %23
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef @.str.5)
  %29 = icmp ne i32 %28, 0
  br label %30

30:                                               ; preds = %27, %23
  %31 = phi i1 [ false, %23 ], [ %29, %27 ]
  br i1 %31, label %33, label %32

32:                                               ; preds = %30
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %223

33:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %34 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  store i32 %34, ptr %5, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !12
  br label %35

35:                                               ; preds = %56, %33
  %36 = load i32, ptr %6, align 4, !tbaa !12
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %6, align 4, !tbaa !12
  %38 = icmp eq i32 %36, 0
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %58

40:                                               ; preds = %35
  br label %41

41:                                               ; preds = %40
  %42 = call i32 @clib_package_install_development(ptr noundef null, ptr noundef @.str.6, i32 noundef 0)
  %43 = icmp eq i32 -1, %42
  br i1 %43, label %53, label %44

44:                                               ; preds = %41
  %45 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr @__assert_failures, align 4, !tbaa !12
  %47 = load ptr, ptr @stderr, align 8, !tbaa !13
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.7, ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 20) #6
  %49 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %44
  call void @abort() #7
  unreachable

52:                                               ; preds = %44
  br label %53

53:                                               ; preds = %52, %41
  br label %54

54:                                               ; preds = %53
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %5, align 4, !tbaa !12
  call void @__describe_after_spec(ptr noundef @.str.10, i32 noundef %57)
  br label %35, !llvm.loop !14

58:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %59 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  store i32 %59, ptr %7, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !12
  br label %60

60:                                               ; preds = %99, %58
  %61 = load i32, ptr %8, align 4, !tbaa !12
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %8, align 4, !tbaa !12
  %63 = icmp eq i32 %61, 0
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %101

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %66 = call ptr @clib_package_new_from_slug(ptr noundef @.str.11, i32 noundef 0)
  store ptr %66, ptr %9, align 8, !tbaa !13
  br label %67

67:                                               ; preds = %65
  %68 = load ptr, ptr %9, align 8, !tbaa !13
  %69 = icmp ne ptr %68, null
  br i1 %69, label %79, label %70

70:                                               ; preds = %67
  %71 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr @__assert_failures, align 4, !tbaa !12
  %73 = load ptr, ptr @stderr, align 8, !tbaa !13
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef @.str.7, ptr noundef @.str.12, ptr noundef @.str.9, i32 noundef 26) #6
  %75 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %70
  call void @abort() #7
  unreachable

78:                                               ; preds = %70
  br label %79

79:                                               ; preds = %78, %67
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %9, align 8, !tbaa !13
  %84 = call i32 @clib_package_install_development(ptr noundef %83, ptr noundef null, i32 noundef 0)
  %85 = icmp eq i32 -1, %84
  br i1 %85, label %95, label %86

86:                                               ; preds = %82
  %87 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr @__assert_failures, align 4, !tbaa !12
  %89 = load ptr, ptr @stderr, align 8, !tbaa !13
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef @.str.7, ptr noundef @.str.13, ptr noundef @.str.9, i32 noundef 27) #6
  %91 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %86
  call void @abort() #7
  unreachable

94:                                               ; preds = %86
  br label %95

95:                                               ; preds = %94, %82
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr %9, align 8, !tbaa !13
  call void @clib_package_free(ptr noundef %98)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %99

99:                                               ; preds = %97
  %100 = load i32, ptr %7, align 4, !tbaa !12
  call void @__describe_after_spec(ptr noundef @.str.14, i32 noundef %100)
  br label %60, !llvm.loop !16

101:                                              ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %102 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  store i32 %102, ptr %10, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !12
  br label %103

103:                                              ; preds = %218, %101
  %104 = load i32, ptr %11, align 4, !tbaa !12
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %11, align 4, !tbaa !12
  %106 = icmp eq i32 %104, 0
  br i1 %106, label %108, label %107

107:                                              ; preds = %103
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %220

108:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %109 = call ptr @clib_package_new_from_slug(ptr noundef @.str.15, i32 noundef 0)
  store ptr %109, ptr %12, align 8, !tbaa !13
  br label %110

110:                                              ; preds = %108
  %111 = load ptr, ptr %12, align 8, !tbaa !13
  %112 = icmp ne ptr %111, null
  br i1 %112, label %122, label %113

113:                                              ; preds = %110
  %114 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr @__assert_failures, align 4, !tbaa !12
  %116 = load ptr, ptr @stderr, align 8, !tbaa !13
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.7, ptr noundef @.str.12, ptr noundef @.str.9, i32 noundef 34) #6
  %118 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %113
  call void @abort() #7
  unreachable

121:                                              ; preds = %113
  br label %122

122:                                              ; preds = %121, %110
  br label %123

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %12, align 8, !tbaa !13
  %127 = call i32 @clib_package_install_development(ptr noundef %126, ptr noundef @.str.16, i32 noundef 0)
  %128 = icmp eq i32 0, %127
  br i1 %128, label %138, label %129

129:                                              ; preds = %125
  %130 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr @__assert_failures, align 4, !tbaa !12
  %132 = load ptr, ptr @stderr, align 8, !tbaa !13
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %132, ptr noundef @.str.7, ptr noundef @.str.17, ptr noundef @.str.9, i32 noundef 35) #6
  %134 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %137

136:                                              ; preds = %129
  call void @abort() #7
  unreachable

137:                                              ; preds = %129
  br label %138

138:                                              ; preds = %137, %125
  br label %139

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140
  %142 = call i32 @fs_exists(ptr noundef @.str.18)
  %143 = icmp eq i32 0, %142
  br i1 %143, label %153, label %144

144:                                              ; preds = %141
  %145 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr @__assert_failures, align 4, !tbaa !12
  %147 = load ptr, ptr @stderr, align 8, !tbaa !13
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %147, ptr noundef @.str.7, ptr noundef @.str.19, ptr noundef @.str.9, i32 noundef 36) #6
  %149 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %144
  call void @abort() #7
  unreachable

152:                                              ; preds = %144
  br label %153

153:                                              ; preds = %152, %141
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  br label %156

156:                                              ; preds = %155
  %157 = call i32 @fs_exists(ptr noundef @.str.20)
  %158 = icmp eq i32 0, %157
  br i1 %158, label %168, label %159

159:                                              ; preds = %156
  %160 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr @__assert_failures, align 4, !tbaa !12
  %162 = load ptr, ptr @stderr, align 8, !tbaa !13
  %163 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %162, ptr noundef @.str.7, ptr noundef @.str.21, ptr noundef @.str.9, i32 noundef 37) #6
  %164 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %167

166:                                              ; preds = %159
  call void @abort() #7
  unreachable

167:                                              ; preds = %159
  br label %168

168:                                              ; preds = %167, %156
  br label %169

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169
  br label %171

171:                                              ; preds = %170
  %172 = call i32 @fs_exists(ptr noundef @.str.22)
  %173 = icmp eq i32 0, %172
  br i1 %173, label %183, label %174

174:                                              ; preds = %171
  %175 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr @__assert_failures, align 4, !tbaa !12
  %177 = load ptr, ptr @stderr, align 8, !tbaa !13
  %178 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %177, ptr noundef @.str.7, ptr noundef @.str.23, ptr noundef @.str.9, i32 noundef 38) #6
  %179 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %181, label %182

181:                                              ; preds = %174
  call void @abort() #7
  unreachable

182:                                              ; preds = %174
  br label %183

183:                                              ; preds = %182, %171
  br label %184

184:                                              ; preds = %183
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185
  %187 = call i32 @fs_exists(ptr noundef @.str.24)
  %188 = icmp eq i32 0, %187
  br i1 %188, label %198, label %189

189:                                              ; preds = %186
  %190 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr @__assert_failures, align 4, !tbaa !12
  %192 = load ptr, ptr @stderr, align 8, !tbaa !13
  %193 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %192, ptr noundef @.str.7, ptr noundef @.str.25, ptr noundef @.str.9, i32 noundef 40) #6
  %194 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %195 = icmp ne i32 %194, 0
  br i1 %195, label %196, label %197

196:                                              ; preds = %189
  call void @abort() #7
  unreachable

197:                                              ; preds = %189
  br label %198

198:                                              ; preds = %197, %186
  br label %199

199:                                              ; preds = %198
  br label %200

200:                                              ; preds = %199
  br label %201

201:                                              ; preds = %200
  %202 = call i32 @fs_exists(ptr noundef @.str.26)
  %203 = icmp eq i32 0, %202
  br i1 %203, label %213, label %204

204:                                              ; preds = %201
  %205 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr @__assert_failures, align 4, !tbaa !12
  %207 = load ptr, ptr @stderr, align 8, !tbaa !13
  %208 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %207, ptr noundef @.str.7, ptr noundef @.str.27, ptr noundef @.str.9, i32 noundef 41) #6
  %209 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %210 = icmp ne i32 %209, 0
  br i1 %210, label %211, label %212

211:                                              ; preds = %204
  call void @abort() #7
  unreachable

212:                                              ; preds = %204
  br label %213

213:                                              ; preds = %212, %201
  br label %214

214:                                              ; preds = %213
  br label %215

215:                                              ; preds = %214
  %216 = call i32 @rimraf(ptr noundef @.str.16)
  %217 = load ptr, ptr %12, align 8, !tbaa !13
  call void @clib_package_free(ptr noundef %217)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %218

218:                                              ; preds = %215
  %219 = load i32, ptr %10, align 4, !tbaa !12
  call void @__describe_after_spec(ptr noundef @.str.28, i32 noundef %219)
  br label %103, !llvm.loop !17

220:                                              ; preds = %107
  br label %221

221:                                              ; preds = %220
  %222 = call i32 (ptr, ...) @printf(ptr noundef @.str.29)
  br label %23, !llvm.loop !18

223:                                              ; preds = %32
  call void @curl_global_cleanup()
  call void (...) @clib_package_cleanup()
  %224 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  ret i32 %224
}

declare i32 @curl_global_init(i64 noundef) #1

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

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

declare i32 @clib_cache_init(i64 noundef) #1

declare i32 @rimraf(ptr noundef) #1

declare ptr @clib_cache_dir() #1

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @abort() #5

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

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

declare void @clib_package_free(ptr noundef) #1

declare i32 @fs_exists(ptr noundef) #1

declare void @curl_global_cleanup() #1

declare void @clib_package_cleanup(...) #1

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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { noreturn 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 #6 = { nounwind }
attributes #7 = { noreturn 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !7, i64 24, !10, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!7, !7, i64 0}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


; 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 }

@__assert_failures = external hidden local_unnamed_addr global i32, align 4
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [92 x i8], align 1
@__assert_bail = external hidden local_unnamed_addr global i32, align 4
@.str.10 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.clib_package_opts_t, align 8
  %2 = tail call i32 @curl_global_init(i64 noundef 3) #5
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %3, i8 0, i64 32, i1 false)
  store i32 1, ptr %1, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 1, ptr %4, align 4, !tbaa !11
  tail call void @clib_package_set_opts(ptr noundef nonnull byval(%struct.clib_package_opts_t) align 8 %1) #5
  %5 = tail call i32 @clib_cache_init(i64 noundef 100) #5
  %6 = tail call ptr @clib_cache_dir() #5
  %7 = tail call i32 @rimraf(ptr noundef %6) #5
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.5)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %.critedge, label %.critedge28

.critedge:                                        ; preds = %108, %0
  tail call void @curl_global_cleanup() #5
  tail call void (...) @clib_package_cleanup() #5
  %9 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  ret i32 %9

.critedge28:                                      ; preds = %0
  %10 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %11 = tail call i32 @clib_package_install_development(ptr noundef null, ptr noundef nonnull @.str.6, i32 noundef 0) #5
  %12 = icmp eq i32 %11, -1
  br i1 %12, label %.critedge30, label %13

13:                                               ; preds = %.critedge28
  %14 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr @__assert_failures, align 4, !tbaa !12
  %16 = load ptr, ptr @stderr, align 8, !tbaa !13
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 20) #6
  %18 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %.not26 = icmp eq i32 %18, 0
  br i1 %.not26, label %.critedge30, label %19

19:                                               ; preds = %13
  tail call void @abort() #7
  unreachable

.critedge30:                                      ; preds = %.critedge28, %13
  tail call void @__describe_after_spec(ptr noundef nonnull @.str.10, i32 noundef %10)
  %20 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %21 = tail call ptr @clib_package_new_from_slug(ptr noundef nonnull @.str.11, i32 noundef 0) #5
  %.not23 = icmp eq ptr %21, null
  br i1 %.not23, label %22, label %29

22:                                               ; preds = %.critedge30
  %23 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr @__assert_failures, align 4, !tbaa !12
  %25 = load ptr, ptr @stderr, align 8, !tbaa !13
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.9, i32 noundef 26) #6
  %27 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %.not24 = icmp eq i32 %27, 0
  br i1 %.not24, label %29, label %28

28:                                               ; preds = %22
  tail call void @abort() #7
  unreachable

29:                                               ; preds = %.critedge30, %22
  %30 = tail call i32 @clib_package_install_development(ptr noundef %21, ptr noundef null, i32 noundef 0) #5
  %31 = icmp eq i32 %30, -1
  br i1 %31, label %.critedge32, label %32

32:                                               ; preds = %29
  %33 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr @__assert_failures, align 4, !tbaa !12
  %35 = load ptr, ptr @stderr, align 8, !tbaa !13
  %36 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.9, i32 noundef 27) #6
  %37 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %.not25 = icmp eq i32 %37, 0
  br i1 %.not25, label %.critedge32, label %38

38:                                               ; preds = %32
  tail call void @abort() #7
  unreachable

.critedge32:                                      ; preds = %32, %29
  tail call void @clib_package_free(ptr noundef %21) #5
  tail call void @__describe_after_spec(ptr noundef nonnull @.str.14, i32 noundef %20)
  %39 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %40 = tail call ptr @clib_package_new_from_slug(ptr noundef nonnull @.str.15, i32 noundef 0) #5
  %.not15 = icmp eq ptr %40, null
  br i1 %.not15, label %41, label %48

41:                                               ; preds = %.critedge32
  %42 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr @__assert_failures, align 4, !tbaa !12
  %44 = load ptr, ptr @stderr, align 8, !tbaa !13
  %45 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.9, i32 noundef 34) #6
  %46 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %.not16 = icmp eq i32 %46, 0
  br i1 %.not16, label %48, label %47

47:                                               ; preds = %41
  tail call void @abort() #7
  unreachable

48:                                               ; preds = %.critedge32, %41
  %49 = tail call i32 @clib_package_install_development(ptr noundef %40, ptr noundef nonnull @.str.16, i32 noundef 0) #5
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %58, label %51

51:                                               ; preds = %48
  %52 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr @__assert_failures, align 4, !tbaa !12
  %54 = load ptr, ptr @stderr, align 8, !tbaa !13
  %55 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.9, i32 noundef 35) #6
  %56 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %.not17 = icmp eq i32 %56, 0
  br i1 %.not17, label %58, label %57

57:                                               ; preds = %51
  tail call void @abort() #7
  unreachable

58:                                               ; preds = %48, %51
  %59 = tail call i32 @fs_exists(ptr noundef nonnull @.str.18) #5
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %68, label %61

61:                                               ; preds = %58
  %62 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr @__assert_failures, align 4, !tbaa !12
  %64 = load ptr, ptr @stderr, align 8, !tbaa !13
  %65 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.9, i32 noundef 36) #6
  %66 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %.not18 = icmp eq i32 %66, 0
  br i1 %.not18, label %68, label %67

67:                                               ; preds = %61
  tail call void @abort() #7
  unreachable

68:                                               ; preds = %58, %61
  %69 = tail call i32 @fs_exists(ptr noundef nonnull @.str.20) #5
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %78, label %71

71:                                               ; preds = %68
  %72 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr @__assert_failures, align 4, !tbaa !12
  %74 = load ptr, ptr @stderr, align 8, !tbaa !13
  %75 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.9, i32 noundef 37) #6
  %76 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %.not19 = icmp eq i32 %76, 0
  br i1 %.not19, label %78, label %77

77:                                               ; preds = %71
  tail call void @abort() #7
  unreachable

78:                                               ; preds = %68, %71
  %79 = tail call i32 @fs_exists(ptr noundef nonnull @.str.22) #5
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %88, label %81

81:                                               ; preds = %78
  %82 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr @__assert_failures, align 4, !tbaa !12
  %84 = load ptr, ptr @stderr, align 8, !tbaa !13
  %85 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.9, i32 noundef 38) #6
  %86 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %.not20 = icmp eq i32 %86, 0
  br i1 %.not20, label %88, label %87

87:                                               ; preds = %81
  tail call void @abort() #7
  unreachable

88:                                               ; preds = %78, %81
  %89 = tail call i32 @fs_exists(ptr noundef nonnull @.str.24) #5
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %98, label %91

91:                                               ; preds = %88
  %92 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr @__assert_failures, align 4, !tbaa !12
  %94 = load ptr, ptr @stderr, align 8, !tbaa !13
  %95 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.9, i32 noundef 40) #6
  %96 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %.not21 = icmp eq i32 %96, 0
  br i1 %.not21, label %98, label %97

97:                                               ; preds = %91
  tail call void @abort() #7
  unreachable

98:                                               ; preds = %88, %91
  %99 = tail call i32 @fs_exists(ptr noundef nonnull @.str.26) #5
  %100 = icmp eq i32 %99, 0
  br i1 %100, label %108, label %101

101:                                              ; preds = %98
  %102 = load i32, ptr @__assert_failures, align 4, !tbaa !12
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr @__assert_failures, align 4, !tbaa !12
  %104 = load ptr, ptr @stderr, align 8, !tbaa !13
  %105 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.9, i32 noundef 41) #6
  %106 = load i32, ptr @__assert_bail, align 4, !tbaa !12
  %.not22 = icmp eq i32 %106, 0
  br i1 %.not22, label %108, label %107

107:                                              ; preds = %101
  tail call void @abort() #7
  unreachable

108:                                              ; preds = %101, %98
  %109 = tail call i32 @rimraf(ptr noundef nonnull @.str.16) #5
  tail call void @clib_package_free(ptr noundef %40) #5
  tail call void @__describe_after_spec(ptr noundef nonnull @.str.28, i32 noundef %39)
  %110 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29)
  br label %.critedge
}

declare i32 @curl_global_init(i64 noundef) local_unnamed_addr #1

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

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

declare i32 @clib_cache_init(i64 noundef) local_unnamed_addr #1

declare i32 @rimraf(ptr noundef) local_unnamed_addr #1

declare ptr @clib_cache_dir() local_unnamed_addr #1

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

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

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

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

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

declare void @clib_package_free(ptr noundef) local_unnamed_addr #1

declare i32 @fs_exists(ptr noundef) local_unnamed_addr #1

declare void @curl_global_cleanup() local_unnamed_addr #1

declare void @clib_package_cleanup(...) local_unnamed_addr #1

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 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { noreturn 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 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { noreturn 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !7, i64 24, !10, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!7, !7, i64 0}
!13 = !{!10, !10, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass