; LLVM IR from guanzhi/GmSSL :: tools (cmsverify)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@options = external hidden global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [11 x i8], align 1

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

38:                                               ; preds = %2
  %39 = load ptr, ptr @stderr, align 8, !tbaa !9
  %40 = load ptr, ptr %7, align 8, !tbaa !9
  %41 = load ptr, ptr @options, align 8, !tbaa !9
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str, ptr noundef %40, ptr noundef %41) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %26, align 4
  br label %248

43:                                               ; preds = %2
  br label %44

44:                                               ; preds = %122, %43
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = icmp sgt i32 %45, 1
  br i1 %46, label %47, label %127

47:                                               ; preds = %44
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  %50 = call i32 @strcmp(ptr noundef %49, ptr noundef @.str.1) #8
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %56, label %52

52:                                               ; preds = %47
  %53 = load ptr, ptr %7, align 8, !tbaa !9
  %54 = load ptr, ptr @options, align 8, !tbaa !9
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %53, ptr noundef %54)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %223

56:                                               ; preds = %47
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = call i32 @strcmp(ptr noundef %58, ptr noundef @.str.2) #8
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %82, label %61

61:                                               ; preds = %56
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %4, align 4, !tbaa !5
  %64 = icmp slt i32 %63, 1
  br i1 %64, label %65, label %66

65:                                               ; preds = %61
  br label %114

66:                                               ; preds = %61
  %67 = load ptr, ptr %5, align 8, !tbaa !9
  %68 = getelementptr inbounds ptr, ptr %67, i32 1
  store ptr %68, ptr %5, align 8, !tbaa !9
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  store ptr %69, ptr %8, align 8, !tbaa !9
  %70 = load ptr, ptr %8, align 8, !tbaa !9
  %71 = call noalias ptr @fopen(ptr noundef %70, ptr noundef @.str.3)
  store ptr %71, ptr %10, align 8, !tbaa !9
  %72 = icmp ne ptr %71, null
  br i1 %72, label %81, label %73

73:                                               ; preds = %66
  %74 = load ptr, ptr @stderr, align 8, !tbaa !9
  %75 = load ptr, ptr %7, align 8, !tbaa !9
  %76 = load ptr, ptr %8, align 8, !tbaa !9
  %77 = call ptr @__errno_location() #9
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = call ptr @strerror(i32 noundef %78) #7
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef @.str.4, ptr noundef %75, ptr noundef %76, ptr noundef %79) #7
  br label %223

81:                                               ; preds = %66
  br label %121

82:                                               ; preds = %56
  %83 = load ptr, ptr %5, align 8, !tbaa !9
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  %85 = call i32 @strcmp(ptr noundef %84, ptr noundef @.str.5) #8
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %108, label %87

87:                                               ; preds = %82
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = add nsw i32 %88, -1
  store i32 %89, ptr %4, align 4, !tbaa !5
  %90 = icmp slt i32 %89, 1
  br i1 %90, label %91, label %92

91:                                               ; preds = %87
  br label %114

92:                                               ; preds = %87
  %93 = load ptr, ptr %5, align 8, !tbaa !9
  %94 = getelementptr inbounds ptr, ptr %93, i32 1
  store ptr %94, ptr %5, align 8, !tbaa !9
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  store ptr %95, ptr %9, align 8, !tbaa !9
  %96 = load ptr, ptr %9, align 8, !tbaa !9
  %97 = call noalias ptr @fopen(ptr noundef %96, ptr noundef @.str.6)
  store ptr %97, ptr %11, align 8, !tbaa !9
  %98 = icmp ne ptr %97, null
  br i1 %98, label %107, label %99

99:                                               ; preds = %92
  %100 = load ptr, ptr @stderr, align 8, !tbaa !9
  %101 = load ptr, ptr %7, align 8, !tbaa !9
  %102 = load ptr, ptr %9, align 8, !tbaa !9
  %103 = call ptr @__errno_location() #9
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = call ptr @strerror(i32 noundef %104) #7
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.4, ptr noundef %101, ptr noundef %102, ptr noundef %105) #7
  br label %223

107:                                              ; preds = %92
  br label %120

108:                                              ; preds = %82
  %109 = load ptr, ptr @stderr, align 8, !tbaa !9
  %110 = load ptr, ptr %7, align 8, !tbaa !9
  %111 = load ptr, ptr %5, align 8, !tbaa !9
  %112 = load ptr, ptr %111, align 8, !tbaa !9
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef @.str.7, ptr noundef %110, ptr noundef %112) #7
  br label %223

114:                                              ; preds = %91, %65
  %115 = load ptr, ptr @stderr, align 8, !tbaa !9
  %116 = load ptr, ptr %7, align 8, !tbaa !9
  %117 = load ptr, ptr %5, align 8, !tbaa !9
  %118 = load ptr, ptr %117, align 8, !tbaa !9
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.8, ptr noundef %116, ptr noundef %118) #7
  br label %223

120:                                              ; preds = %107
  br label %121

121:                                              ; preds = %120, %81
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = add nsw i32 %123, -1
  store i32 %124, ptr %4, align 4, !tbaa !5
  %125 = load ptr, ptr %5, align 8, !tbaa !9
  %126 = getelementptr inbounds ptr, ptr %125, i32 1
  store ptr %126, ptr %5, align 8, !tbaa !9
  br label %44, !llvm.loop !11

127:                                              ; preds = %44
  %128 = load ptr, ptr %8, align 8, !tbaa !9
  %129 = icmp ne ptr %128, null
  br i1 %129, label %134, label %130

130:                                              ; preds = %127
  %131 = load ptr, ptr @stderr, align 8, !tbaa !9
  %132 = load ptr, ptr %7, align 8, !tbaa !9
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef @.str.9, ptr noundef %132) #7
  br label %223

134:                                              ; preds = %127
  %135 = load ptr, ptr %10, align 8, !tbaa !9
  %136 = call i32 @file_size(ptr noundef %135, ptr noundef %12)
  %137 = icmp ne i32 %136, 1
  br i1 %137, label %138, label %142

138:                                              ; preds = %134
  %139 = load ptr, ptr @stderr, align 8, !tbaa !9
  %140 = load ptr, ptr %7, align 8, !tbaa !9
  %141 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.10, ptr noundef %140) #7
  br label %223

142:                                              ; preds = %134
  %143 = load i64, ptr %12, align 8, !tbaa !13
  %144 = mul i64 %143, 3
  %145 = udiv i64 %144, 4
  %146 = add i64 %145, 1
  store i64 %146, ptr %15, align 8, !tbaa !13
  %147 = load i64, ptr %15, align 8, !tbaa !13
  %148 = call noalias ptr @malloc(i64 noundef %147) #10
  store ptr %148, ptr %13, align 8, !tbaa !9
  %149 = icmp ne ptr %148, null
  br i1 %149, label %154, label %150

150:                                              ; preds = %142
  %151 = load ptr, ptr @stderr, align 8, !tbaa !9
  %152 = load ptr, ptr %7, align 8, !tbaa !9
  %153 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %151, ptr noundef @.str.11, ptr noundef %152) #7
  br label %223

154:                                              ; preds = %142
  %155 = load ptr, ptr %13, align 8, !tbaa !9
  %156 = load i64, ptr %15, align 8, !tbaa !13
  %157 = load ptr, ptr %10, align 8, !tbaa !9
  %158 = call i32 @cms_from_pem(ptr noundef %155, ptr noundef %14, i64 noundef %156, ptr noundef %157)
  %159 = icmp ne i32 %158, 1
  br i1 %159, label %160, label %164

160:                                              ; preds = %154
  %161 = load ptr, ptr @stderr, align 8, !tbaa !9
  %162 = load ptr, ptr %7, align 8, !tbaa !9
  %163 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %161, ptr noundef @.str.12, ptr noundef %162) #7
  br label %223

164:                                              ; preds = %154
  %165 = load ptr, ptr %13, align 8, !tbaa !9
  %166 = load i64, ptr %14, align 8, !tbaa !13
  %167 = call i32 @cms_verify(ptr noundef %165, i64 noundef %166, ptr noundef null, i64 noundef 0, ptr noundef null, i64 noundef 0, ptr noundef %16, ptr noundef %17, ptr noundef %18, ptr noundef %19, ptr noundef %20, ptr noundef %21, ptr noundef %22, ptr noundef %23, ptr noundef %24)
  store i32 %167, ptr %25, align 4, !tbaa !5
  %168 = icmp slt i32 %167, 0
  br i1 %168, label %169, label %173

169:                                              ; preds = %164
  %170 = load ptr, ptr @stderr, align 8, !tbaa !9
  %171 = load ptr, ptr %7, align 8, !tbaa !9
  %172 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %170, ptr noundef @.str.13, ptr noundef %171) #7
  br label %223

173:                                              ; preds = %164
  %174 = load i32, ptr %25, align 4, !tbaa !5
  %175 = icmp ne i32 %174, 0
  %176 = zext i1 %175 to i64
  %177 = select i1 %175, ptr @.str.15, ptr @.str.16
  %178 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, ptr noundef %177)
  %179 = load i32, ptr %25, align 4, !tbaa !5
  %180 = icmp ne i32 %179, 0
  %181 = zext i1 %180 to i64
  %182 = select i1 %180, i32 0, i32 1
  store i32 %182, ptr %6, align 4, !tbaa !5
  %183 = load ptr, ptr %9, align 8, !tbaa !9
  %184 = icmp ne ptr %183, null
  br i1 %184, label %185, label %222

185:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %186 = load i32, ptr %16, align 4, !tbaa !5
  %187 = icmp eq i32 %186, 118
  br i1 %187, label %188, label %214

188:                                              ; preds = %185
  %189 = call i32 @asn1_type_from_der(i32 noundef 4, ptr noundef %27, ptr noundef %28, ptr noundef %17, ptr noundef %18)
  %190 = icmp ne i32 %189, 1
  br i1 %190, label %195, label %191

191:                                              ; preds = %188
  %192 = load i64, ptr %18, align 8, !tbaa !13
  %193 = call i32 @asn1_length_is_zero(i64 noundef %192)
  %194 = icmp ne i32 %193, 1
  br i1 %194, label %195, label %199

195:                                              ; preds = %191, %188
  %196 = load ptr, ptr @stderr, align 8, !tbaa !9
  %197 = load ptr, ptr %7, align 8, !tbaa !9
  %198 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %196, ptr noundef @.str.17, ptr noundef %197) #7
  store i32 4, ptr %26, align 4
  br label %219

199:                                              ; preds = %191
  %200 = load i64, ptr %28, align 8, !tbaa !13
  %201 = load ptr, ptr %27, align 8, !tbaa !9
  %202 = load i64, ptr %28, align 8, !tbaa !13
  %203 = load ptr, ptr %11, align 8, !tbaa !9
  %204 = call i64 @fwrite(ptr noundef %201, i64 noundef 1, i64 noundef %202, ptr noundef %203)
  %205 = icmp ne i64 %200, %204
  br i1 %205, label %206, label %213

206:                                              ; preds = %199
  %207 = load ptr, ptr @stderr, align 8, !tbaa !9
  %208 = load ptr, ptr %7, align 8, !tbaa !9
  %209 = call ptr @__errno_location() #9
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = call ptr @strerror(i32 noundef %210) #7
  %212 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %207, ptr noundef @.str.18, ptr noundef %208, ptr noundef %211) #7
  store i32 4, ptr %26, align 4
  br label %219

213:                                              ; preds = %199
  br label %218

214:                                              ; preds = %185
  %215 = load ptr, ptr @stderr, align 8, !tbaa !9
  %216 = load ptr, ptr %7, align 8, !tbaa !9
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %215, ptr noundef @.str.19, ptr noundef %216) #7
  store i32 4, ptr %26, align 4
  br label %219

218:                                              ; preds = %213
  store i32 0, ptr %26, align 4
  br label %219

219:                                              ; preds = %218, %214, %206, %195
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  %220 = load i32, ptr %26, align 4
  switch i32 %220, label %248 [
    i32 0, label %221
    i32 4, label %223
  ]

221:                                              ; preds = %219
  br label %222

222:                                              ; preds = %221, %173
  br label %223

223:                                              ; preds = %222, %219, %169, %160, %150, %138, %130, %114, %108, %99, %73, %52
  %224 = load ptr, ptr %8, align 8, !tbaa !9
  %225 = icmp ne ptr %224, null
  br i1 %225, label %226, label %232

226:                                              ; preds = %223
  %227 = load ptr, ptr %10, align 8, !tbaa !9
  %228 = icmp ne ptr %227, null
  br i1 %228, label %229, label %232

229:                                              ; preds = %226
  %230 = load ptr, ptr %10, align 8, !tbaa !9
  %231 = call i32 @fclose(ptr noundef %230)
  br label %232

232:                                              ; preds = %229, %226, %223
  %233 = load ptr, ptr %9, align 8, !tbaa !9
  %234 = icmp ne ptr %233, null
  br i1 %234, label %235, label %241

235:                                              ; preds = %232
  %236 = load ptr, ptr %11, align 8, !tbaa !9
  %237 = icmp ne ptr %236, null
  br i1 %237, label %238, label %241

238:                                              ; preds = %235
  %239 = load ptr, ptr %11, align 8, !tbaa !9
  %240 = call i32 @fclose(ptr noundef %239)
  br label %241

241:                                              ; preds = %238, %235, %232
  %242 = load ptr, ptr %13, align 8, !tbaa !9
  %243 = icmp ne ptr %242, null
  br i1 %243, label %244, label %246

244:                                              ; preds = %241
  %245 = load ptr, ptr %13, align 8, !tbaa !9
  call void @free(ptr noundef %245) #7
  br label %246

246:                                              ; preds = %244, %241
  %247 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %247, ptr %3, align 4
  store i32 1, ptr %26, align 4
  br label %248

248:                                              ; preds = %246, %219, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %249 = load i32, ptr %3, align 4
  ret i32 %249
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #5

declare i32 @file_size(ptr noundef, ptr noundef) #4

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

declare i32 @cms_from_pem(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #4

declare i32 @cms_verify(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @asn1_type_from_der(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @asn1_length_is_zero(i64 noundef) #4

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

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

declare i32 @fclose(ptr noundef) #4

; Function Attrs: nounwind
declare void @free(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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind 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 #4 = { "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 willreturn memory(none) "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 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@options = external hidden local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @cmsverify_main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #9
  %17 = icmp slt i32 %0, 2
  br i1 %17, label %19, label %.preheader

.preheader:                                       ; preds = %2
  %.not143 = icmp eq i32 %0, 2
  br i1 %.not143, label %._crit_edge.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %18 = getelementptr inbounds i8, ptr %1, i64 8
  br label %.lr.ph

19:                                               ; preds = %2
  %20 = load ptr, ptr @stderr, align 8, !tbaa !5
  %21 = load ptr, ptr @options, align 8, !tbaa !5
  %22 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str, ptr noundef %16, ptr noundef %21) #10
  br label %125

.lr.ph:                                           ; preds = %.lr.ph.preheader, %55
  %.059.in139 = phi i32 [ %.1, %55 ], [ %0, %.lr.ph.preheader ]
  %.061138 = phi ptr [ %.162, %55 ], [ null, %.lr.ph.preheader ]
  %.063137 = phi ptr [ %.164, %55 ], [ null, %.lr.ph.preheader ]
  %.066136 = phi ptr [ %.167, %55 ], [ null, %.lr.ph.preheader ]
  %.069135 = phi ptr [ %.170, %55 ], [ null, %.lr.ph.preheader ]
  %.072134 = phi ptr [ %56, %55 ], [ %18, %.lr.ph.preheader ]
  %23 = load ptr, ptr %.072134, align 8, !tbaa !5
  %24 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %23, ptr noundef nonnull dereferenceable(1) @.str.1) #11
  %.not93 = icmp eq i32 %24, 0
  br i1 %.not93, label %25, label %28

25:                                               ; preds = %.lr.ph
  %26 = load ptr, ptr @options, align 8, !tbaa !5
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %16, ptr noundef %26)
  br label %114

28:                                               ; preds = %.lr.ph
  %29 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %23, ptr noundef nonnull dereferenceable(1) @.str.2) #11
  %.not94 = icmp eq i32 %29, 0
  br i1 %.not94, label %30, label %40

30:                                               ; preds = %28
  %31 = getelementptr inbounds i8, ptr %.072134, i64 8
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = tail call noalias ptr @fopen(ptr noundef %32, ptr noundef nonnull @.str.3)
  %.not95 = icmp eq ptr %33, null
  br i1 %.not95, label %34, label %55

34:                                               ; preds = %30
  %35 = load ptr, ptr @stderr, align 8, !tbaa !5
  %36 = tail call ptr @__errno_location() #12
  %37 = load i32, ptr %36, align 4, !tbaa !9
  %38 = tail call ptr @strerror(i32 noundef %37) #9
  %39 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.4, ptr noundef %16, ptr noundef %32, ptr noundef %38) #10
  br label %.thread

40:                                               ; preds = %28
  %41 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %23, ptr noundef nonnull dereferenceable(1) @.str.5) #11
  %.not96 = icmp eq i32 %41, 0
  br i1 %.not96, label %42, label %52

42:                                               ; preds = %40
  %43 = getelementptr inbounds i8, ptr %.072134, i64 8
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = tail call noalias ptr @fopen(ptr noundef %44, ptr noundef nonnull @.str.6)
  %.not97 = icmp eq ptr %45, null
  br i1 %.not97, label %46, label %55

46:                                               ; preds = %42
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = tail call ptr @__errno_location() #12
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = tail call ptr @strerror(i32 noundef %49) #9
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.4, ptr noundef %16, ptr noundef %44, ptr noundef %50) #10
  br label %114

52:                                               ; preds = %40
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.7, ptr noundef %16, ptr noundef %23) #10
  br label %114

55:                                               ; preds = %30, %42
  %.170 = phi ptr [ %.069135, %42 ], [ %32, %30 ]
  %.167 = phi ptr [ %44, %42 ], [ %.066136, %30 ]
  %.164 = phi ptr [ %.063137, %42 ], [ %33, %30 ]
  %.162 = phi ptr [ %45, %42 ], [ %.061138, %30 ]
  %.1 = add nsw i32 %.059.in139, -2
  %56 = getelementptr inbounds i8, ptr %.072134, i64 16
  %57 = icmp sgt i32 %.059.in139, 4
  br i1 %57, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %55
  %.not = icmp eq ptr %.170, null
  br i1 %.not, label %._crit_edge.thread, label %60

._crit_edge.thread:                               ; preds = %.preheader, %._crit_edge
  %.061.lcssa172 = phi ptr [ %.162, %._crit_edge ], [ null, %.preheader ]
  %.066.lcssa171 = phi ptr [ %.167, %._crit_edge ], [ null, %.preheader ]
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.9, ptr noundef %16) #10
  br label %.thread

60:                                               ; preds = %._crit_edge
  %61 = call i32 @file_size(ptr noundef %.164, ptr noundef nonnull %3) #9
  %.not85 = icmp eq i32 %61, 1
  br i1 %.not85, label %65, label %62

62:                                               ; preds = %60
  %63 = load ptr, ptr @stderr, align 8, !tbaa !5
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef nonnull @.str.10, ptr noundef %16) #10
  br label %114

65:                                               ; preds = %60
  %66 = load i64, ptr %3, align 8, !tbaa !13
  %67 = mul i64 %66, 3
  %68 = lshr i64 %67, 2
  %69 = add nuw nsw i64 %68, 1
  %70 = call noalias ptr @malloc(i64 noundef %69) #13
  %.not86 = icmp eq ptr %70, null
  br i1 %.not86, label %71, label %74

71:                                               ; preds = %65
  %72 = load ptr, ptr @stderr, align 8, !tbaa !5
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.11, ptr noundef %16) #10
  br label %114

74:                                               ; preds = %65
  %75 = call i32 @cms_from_pem(ptr noundef nonnull %70, ptr noundef nonnull %4, i64 noundef %69, ptr noundef %.164) #9
  %.not87 = icmp eq i32 %75, 1
  br i1 %.not87, label %79, label %76

76:                                               ; preds = %74
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.12, ptr noundef %16) #10
  br label %114

79:                                               ; preds = %74
  %80 = load i64, ptr %4, align 8, !tbaa !13
  %81 = call i32 @cms_verify(ptr noundef nonnull %70, i64 noundef %80, ptr noundef null, i64 noundef 0, ptr noundef null, i64 noundef 0, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %13) #9
  %82 = icmp slt i32 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %79
  %84 = load ptr, ptr @stderr, align 8, !tbaa !5
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.13, ptr noundef %16) #10
  br label %114

86:                                               ; preds = %79
  %.not88 = icmp eq i32 %81, 0
  %87 = select i1 %.not88, ptr @.str.16, ptr @.str.15
  %88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, ptr noundef nonnull %87)
  %.not89 = icmp eq ptr %.167, null
  br i1 %.not89, label %114, label %89

89:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #9
  %90 = load i32, ptr %5, align 4, !tbaa !9
  %91 = icmp eq i32 %90, 118
  br i1 %91, label %92, label %110

92:                                               ; preds = %89
  %93 = call i32 @asn1_type_from_der(i32 noundef 4, ptr noundef nonnull %14, ptr noundef nonnull %15, ptr noundef nonnull %6, ptr noundef nonnull %7) #9
  %.not90 = icmp eq i32 %93, 1
  br i1 %.not90, label %94, label %97

94:                                               ; preds = %92
  %95 = load i64, ptr %7, align 8, !tbaa !13
  %96 = call i32 @asn1_length_is_zero(i64 noundef %95) #9
  %.not91 = icmp eq i32 %96, 1
  br i1 %.not91, label %100, label %97

97:                                               ; preds = %94, %92
  %98 = load ptr, ptr @stderr, align 8, !tbaa !5
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.17, ptr noundef %16) #10
  br label %113

100:                                              ; preds = %94
  %101 = load i64, ptr %15, align 8, !tbaa !13
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  %103 = call i64 @fwrite(ptr noundef %102, i64 noundef 1, i64 noundef %101, ptr noundef %.162)
  %.not92 = icmp eq i64 %101, %103
  br i1 %.not92, label %113, label %104

104:                                              ; preds = %100
  %105 = load ptr, ptr @stderr, align 8, !tbaa !5
  %106 = tail call ptr @__errno_location() #12
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = call ptr @strerror(i32 noundef %107) #9
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef nonnull @.str.18, ptr noundef %16, ptr noundef %108) #10
  br label %113

110:                                              ; preds = %89
  %111 = load ptr, ptr @stderr, align 8, !tbaa !5
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef nonnull @.str.19, ptr noundef %16) #10
  br label %113

113:                                              ; preds = %100, %110, %104, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #9
  br label %114

114:                                              ; preds = %113, %86, %83, %76, %71, %62, %52, %46, %25
  %.069128 = phi ptr [ %.069135, %52 ], [ %.069135, %46 ], [ %.069135, %25 ], [ %.170, %62 ], [ %.170, %76 ], [ %.170, %83 ], [ %.170, %113 ], [ %.170, %86 ], [ %.170, %71 ]
  %.063119 = phi ptr [ %.063137, %52 ], [ %.063137, %46 ], [ %.063137, %25 ], [ %.164, %62 ], [ %.164, %76 ], [ %.164, %83 ], [ %.164, %113 ], [ %.164, %86 ], [ %.164, %71 ]
  %.074.shrunk = phi i1 [ true, %52 ], [ true, %46 ], [ false, %25 ], [ true, %62 ], [ true, %76 ], [ true, %83 ], [ %.not88, %113 ], [ %.not88, %86 ], [ true, %71 ]
  %.268 = phi ptr [ %.066136, %52 ], [ %44, %46 ], [ %.066136, %25 ], [ %.167, %62 ], [ %.167, %76 ], [ %.167, %83 ], [ %.167, %113 ], [ null, %86 ], [ %.167, %71 ]
  %.2 = phi ptr [ %.061138, %52 ], [ null, %46 ], [ %.061138, %25 ], [ %.162, %62 ], [ %.162, %76 ], [ %.162, %83 ], [ %.162, %113 ], [ %.162, %86 ], [ %.162, %71 ]
  %.060 = phi ptr [ null, %52 ], [ null, %46 ], [ null, %25 ], [ null, %62 ], [ %70, %76 ], [ %70, %83 ], [ %70, %113 ], [ %70, %86 ], [ null, %71 ]
  %115 = icmp ne ptr %.069128, null
  %116 = icmp ne ptr %.063119, null
  %or.cond = select i1 %115, i1 %116, i1 false
  br i1 %or.cond, label %117, label %.thread

117:                                              ; preds = %114
  %118 = call i32 @fclose(ptr noundef nonnull %.063119)
  br label %.thread

.thread:                                          ; preds = %34, %._crit_edge.thread, %117, %114
  %.074110.shrunk = phi i1 [ %.074.shrunk, %117 ], [ %.074.shrunk, %114 ], [ true, %._crit_edge.thread ], [ true, %34 ]
  %.060109 = phi ptr [ %.060, %117 ], [ %.060, %114 ], [ null, %._crit_edge.thread ], [ null, %34 ]
  %.2108 = phi ptr [ %.2, %117 ], [ %.2, %114 ], [ %.061.lcssa172, %._crit_edge.thread ], [ %.061138, %34 ]
  %.268107 = phi ptr [ %.268, %117 ], [ %.268, %114 ], [ %.066.lcssa171, %._crit_edge.thread ], [ %.066136, %34 ]
  %119 = icmp ne ptr %.268107, null
  %120 = icmp ne ptr %.2108, null
  %or.cond3 = select i1 %119, i1 %120, i1 false
  br i1 %or.cond3, label %121, label %123

121:                                              ; preds = %.thread
  %122 = call i32 @fclose(ptr noundef nonnull %.2108)
  br label %123

123:                                              ; preds = %121, %.thread
  %.not98 = icmp eq ptr %.060109, null
  br i1 %.not98, label %125, label %124

124:                                              ; preds = %123
  call void @free(ptr noundef nonnull %.060109) #9
  br label %125

125:                                              ; preds = %123, %124, %19
  %.058.shrunk = phi i1 [ true, %19 ], [ %.074110.shrunk, %124 ], [ %.074110.shrunk, %123 ]
  %.058 = zext i1 %.058.shrunk to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  ret i32 %.058
}

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #5

declare i32 @file_size(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #7

declare i32 @cms_from_pem(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #6

declare i32 @cms_verify(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @asn1_type_from_der(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @asn1_length_is_zero(i64 noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

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

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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #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 nofree nosync nounwind willreturn memory(none) "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 = { "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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #8 = { 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 #9 = { nounwind }
attributes #10 = { cold nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind willreturn memory(none) }
attributes #13 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}


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