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

; 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.SM2_KEY = type { %struct.SM2_Z256_POINT, [4 x i64] }
%struct.SM2_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM2_VERIFY_CTX = type { %struct.SM3_CTX, %struct.SM3_CTX, %struct.SM2_KEY, [16 x %struct.SM2_Z256_POINT] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@stdin = external global ptr, align 8
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@usage = external hidden global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@options = external hidden global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [23 x i8], align 1
@stdout = external global ptr, align 8
@.str.20 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @sm2verify_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 ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %struct.SM2_KEY, align 8
  %18 = alloca %struct.SM2_VERIFY_CTX, align 8
  %19 = alloca [1024 x i8], align 16
  %20 = alloca i64, align 8
  %21 = alloca [4096 x i8], align 16
  %22 = alloca i64, align 8
  %23 = alloca [72 x i8], align 16
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  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) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = getelementptr inbounds ptr, ptr %27, i64 0
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  store ptr %29, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store ptr @.str, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store ptr null, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr null, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store ptr null, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr null, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %30 = load ptr, ptr @stdin, align 8, !tbaa !9
  store ptr %30, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store ptr null, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 128, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 1888, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 1024, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4096, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr %4, align 4, !tbaa !5
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = getelementptr inbounds ptr, ptr %33, i32 1
  store ptr %34, ptr %5, align 8, !tbaa !9
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = icmp slt i32 %35, 1
  br i1 %36, label %37, label %42

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

42:                                               ; preds = %2
  br label %43

43:                                               ; preds = %206, %42
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %46, label %211

46:                                               ; preds = %43
  %47 = load ptr, ptr %5, align 8, !tbaa !9
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = call i32 @strcmp(ptr noundef %48, ptr noundef @.str.2) #7
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %57, label %51

51:                                               ; preds = %46
  %52 = load ptr, ptr %7, align 8, !tbaa !9
  %53 = load ptr, ptr @usage, align 8, !tbaa !9
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %52, ptr noundef %53)
  %55 = load ptr, ptr @options, align 8, !tbaa !9
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %55)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %311

57:                                               ; preds = %46
  %58 = load ptr, ptr %5, align 8, !tbaa !9
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = call i32 @strcmp(ptr noundef %59, ptr noundef @.str.4) #7
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %90, label %62

62:                                               ; preds = %57
  %63 = load ptr, ptr %10, align 8, !tbaa !9
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %69

65:                                               ; preds = %62
  %66 = load ptr, ptr @stderr, align 8, !tbaa !9
  %67 = load ptr, ptr %7, align 8, !tbaa !9
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef @.str.5, ptr noundef %67) #6
  br label %311

69:                                               ; preds = %62
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = add nsw i32 %70, -1
  store i32 %71, ptr %4, align 4, !tbaa !5
  %72 = icmp slt i32 %71, 1
  br i1 %72, label %73, label %74

73:                                               ; preds = %69
  br label %195

74:                                               ; preds = %69
  %75 = load ptr, ptr %5, align 8, !tbaa !9
  %76 = getelementptr inbounds ptr, ptr %75, i32 1
  store ptr %76, ptr %5, align 8, !tbaa !9
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  store ptr %77, ptr %9, align 8, !tbaa !9
  %78 = load ptr, ptr %9, align 8, !tbaa !9
  %79 = call noalias ptr @fopen(ptr noundef %78, ptr noundef @.str.6)
  store ptr %79, ptr %13, align 8, !tbaa !9
  %80 = icmp ne ptr %79, null
  br i1 %80, label %89, label %81

81:                                               ; preds = %74
  %82 = load ptr, ptr @stderr, align 8, !tbaa !9
  %83 = load ptr, ptr %7, align 8, !tbaa !9
  %84 = load ptr, ptr %9, align 8, !tbaa !9
  %85 = call ptr @__errno_location() #8
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = call ptr @strerror(i32 noundef %86) #6
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.7, ptr noundef %83, ptr noundef %84, ptr noundef %87) #6
  br label %311

89:                                               ; preds = %74
  br label %205

90:                                               ; preds = %57
  %91 = load ptr, ptr %5, align 8, !tbaa !9
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = call i32 @strcmp(ptr noundef %92, ptr noundef @.str.8) #7
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %123, label %95

95:                                               ; preds = %90
  %96 = load ptr, ptr %9, align 8, !tbaa !9
  %97 = icmp ne ptr %96, null
  br i1 %97, label %98, label %102

98:                                               ; preds = %95
  %99 = load ptr, ptr @stderr, align 8, !tbaa !9
  %100 = load ptr, ptr %7, align 8, !tbaa !9
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef @.str.5, ptr noundef %100) #6
  br label %311

102:                                              ; preds = %95
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = add nsw i32 %103, -1
  store i32 %104, ptr %4, align 4, !tbaa !5
  %105 = icmp slt i32 %104, 1
  br i1 %105, label %106, label %107

106:                                              ; preds = %102
  br label %195

107:                                              ; preds = %102
  %108 = load ptr, ptr %5, align 8, !tbaa !9
  %109 = getelementptr inbounds ptr, ptr %108, i32 1
  store ptr %109, ptr %5, align 8, !tbaa !9
  %110 = load ptr, ptr %109, align 8, !tbaa !9
  store ptr %110, ptr %10, align 8, !tbaa !9
  %111 = load ptr, ptr %10, align 8, !tbaa !9
  %112 = call noalias ptr @fopen(ptr noundef %111, ptr noundef @.str.6)
  store ptr %112, ptr %14, align 8, !tbaa !9
  %113 = icmp ne ptr %112, null
  br i1 %113, label %122, label %114

114:                                              ; preds = %107
  %115 = load ptr, ptr @stderr, align 8, !tbaa !9
  %116 = load ptr, ptr %7, align 8, !tbaa !9
  %117 = load ptr, ptr %10, align 8, !tbaa !9
  %118 = call ptr @__errno_location() #8
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = call ptr @strerror(i32 noundef %119) #6
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.7, ptr noundef %116, ptr noundef %117, ptr noundef %120) #6
  br label %311

122:                                              ; preds = %107
  br label %204

123:                                              ; preds = %90
  %124 = load ptr, ptr %5, align 8, !tbaa !9
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = call i32 @strcmp(ptr noundef %125, ptr noundef @.str.9) #7
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %137, label %128

128:                                              ; preds = %123
  %129 = load i32, ptr %4, align 4, !tbaa !5
  %130 = add nsw i32 %129, -1
  store i32 %130, ptr %4, align 4, !tbaa !5
  %131 = icmp slt i32 %130, 1
  br i1 %131, label %132, label %133

132:                                              ; preds = %128
  br label %195

133:                                              ; preds = %128
  %134 = load ptr, ptr %5, align 8, !tbaa !9
  %135 = getelementptr inbounds ptr, ptr %134, i32 1
  store ptr %135, ptr %5, align 8, !tbaa !9
  %136 = load ptr, ptr %135, align 8, !tbaa !9
  store ptr %136, ptr %8, align 8, !tbaa !9
  br label %203

137:                                              ; preds = %123
  %138 = load ptr, ptr %5, align 8, !tbaa !9
  %139 = load ptr, ptr %138, align 8, !tbaa !9
  %140 = call i32 @strcmp(ptr noundef %139, ptr noundef @.str.10) #7
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %163, label %142

142:                                              ; preds = %137
  %143 = load i32, ptr %4, align 4, !tbaa !5
  %144 = add nsw i32 %143, -1
  store i32 %144, ptr %4, align 4, !tbaa !5
  %145 = icmp slt i32 %144, 1
  br i1 %145, label %146, label %147

146:                                              ; preds = %142
  br label %195

147:                                              ; preds = %142
  %148 = load ptr, ptr %5, align 8, !tbaa !9
  %149 = getelementptr inbounds ptr, ptr %148, i32 1
  store ptr %149, ptr %5, align 8, !tbaa !9
  %150 = load ptr, ptr %149, align 8, !tbaa !9
  store ptr %150, ptr %11, align 8, !tbaa !9
  %151 = load ptr, ptr %11, align 8, !tbaa !9
  %152 = call noalias ptr @fopen(ptr noundef %151, ptr noundef @.str.6)
  store ptr %152, ptr %15, align 8, !tbaa !9
  %153 = icmp ne ptr %152, null
  br i1 %153, label %162, label %154

154:                                              ; preds = %147
  %155 = load ptr, ptr @stderr, align 8, !tbaa !9
  %156 = load ptr, ptr %7, align 8, !tbaa !9
  %157 = load ptr, ptr %11, align 8, !tbaa !9
  %158 = call ptr @__errno_location() #8
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = call ptr @strerror(i32 noundef %159) #6
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %155, ptr noundef @.str.7, ptr noundef %156, ptr noundef %157, ptr noundef %160) #6
  br label %311

162:                                              ; preds = %147
  br label %202

163:                                              ; preds = %137
  %164 = load ptr, ptr %5, align 8, !tbaa !9
  %165 = load ptr, ptr %164, align 8, !tbaa !9
  %166 = call i32 @strcmp(ptr noundef %165, ptr noundef @.str.11) #7
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %189, label %168

168:                                              ; preds = %163
  %169 = load i32, ptr %4, align 4, !tbaa !5
  %170 = add nsw i32 %169, -1
  store i32 %170, ptr %4, align 4, !tbaa !5
  %171 = icmp slt i32 %170, 1
  br i1 %171, label %172, label %173

172:                                              ; preds = %168
  br label %195

173:                                              ; preds = %168
  %174 = load ptr, ptr %5, align 8, !tbaa !9
  %175 = getelementptr inbounds ptr, ptr %174, i32 1
  store ptr %175, ptr %5, align 8, !tbaa !9
  %176 = load ptr, ptr %175, align 8, !tbaa !9
  store ptr %176, ptr %12, align 8, !tbaa !9
  %177 = load ptr, ptr %12, align 8, !tbaa !9
  %178 = call noalias ptr @fopen(ptr noundef %177, ptr noundef @.str.6)
  store ptr %178, ptr %16, align 8, !tbaa !9
  %179 = icmp ne ptr %178, null
  br i1 %179, label %188, label %180

180:                                              ; preds = %173
  %181 = load ptr, ptr @stderr, align 8, !tbaa !9
  %182 = load ptr, ptr %7, align 8, !tbaa !9
  %183 = load ptr, ptr %12, align 8, !tbaa !9
  %184 = call ptr @__errno_location() #8
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = call ptr @strerror(i32 noundef %185) #6
  %187 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef @.str.7, ptr noundef %182, ptr noundef %183, ptr noundef %186) #6
  br label %311

188:                                              ; preds = %173
  br label %201

189:                                              ; preds = %163
  %190 = load ptr, ptr @stderr, align 8, !tbaa !9
  %191 = load ptr, ptr %7, align 8, !tbaa !9
  %192 = load ptr, ptr %5, align 8, !tbaa !9
  %193 = load ptr, ptr %192, align 8, !tbaa !9
  %194 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %190, ptr noundef @.str.12, ptr noundef %191, ptr noundef %193) #6
  br label %311

195:                                              ; preds = %172, %146, %132, %106, %73
  %196 = load ptr, ptr @stderr, align 8, !tbaa !9
  %197 = load ptr, ptr %7, align 8, !tbaa !9
  %198 = load ptr, ptr %5, align 8, !tbaa !9
  %199 = load ptr, ptr %198, align 8, !tbaa !9
  %200 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %196, ptr noundef @.str.13, ptr noundef %197, ptr noundef %199) #6
  br label %311

201:                                              ; preds = %188
  br label %202

202:                                              ; preds = %201, %162
  br label %203

203:                                              ; preds = %202, %133
  br label %204

204:                                              ; preds = %203, %122
  br label %205

205:                                              ; preds = %204, %89
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %4, align 4, !tbaa !5
  %208 = add nsw i32 %207, -1
  store i32 %208, ptr %4, align 4, !tbaa !5
  %209 = load ptr, ptr %5, align 8, !tbaa !9
  %210 = getelementptr inbounds ptr, ptr %209, i32 1
  store ptr %210, ptr %5, align 8, !tbaa !9
  br label %43, !llvm.loop !11

211:                                              ; preds = %43
  %212 = load ptr, ptr %12, align 8, !tbaa !9
  %213 = icmp ne ptr %212, null
  br i1 %213, label %218, label %214

214:                                              ; preds = %211
  %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.14, ptr noundef %216) #6
  br label %311

218:                                              ; preds = %211
  %219 = getelementptr inbounds [72 x i8], ptr %23, i64 0, i64 0
  %220 = load ptr, ptr %16, align 8, !tbaa !9
  %221 = call i64 @fread(ptr noundef %219, i64 noundef 1, i64 noundef 72, ptr noundef %220)
  store i64 %221, ptr %24, align 8, !tbaa !13
  %222 = icmp ule i64 %221, 0
  br i1 %222, label %223, label %230

223:                                              ; preds = %218
  %224 = load ptr, ptr @stderr, align 8, !tbaa !9
  %225 = load ptr, ptr %7, align 8, !tbaa !9
  %226 = call ptr @__errno_location() #8
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = call ptr @strerror(i32 noundef %227) #6
  %229 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %224, ptr noundef @.str.15, ptr noundef %225, ptr noundef %228) #6
  br label %311

230:                                              ; preds = %218
  %231 = load ptr, ptr %9, align 8, !tbaa !9
  %232 = icmp ne ptr %231, null
  br i1 %232, label %233, label %242

233:                                              ; preds = %230
  %234 = load ptr, ptr %13, align 8, !tbaa !9
  %235 = call i32 @sm2_public_key_info_from_pem(ptr noundef %17, ptr noundef %234)
  %236 = icmp ne i32 %235, 1
  br i1 %236, label %237, label %241

237:                                              ; preds = %233
  %238 = load ptr, ptr @stderr, align 8, !tbaa !9
  %239 = load ptr, ptr %7, align 8, !tbaa !9
  %240 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %238, ptr noundef @.str.16, ptr noundef %239) #6
  br label %311

241:                                              ; preds = %233
  br label %265

242:                                              ; preds = %230
  %243 = load ptr, ptr %10, align 8, !tbaa !9
  %244 = icmp ne ptr %243, null
  br i1 %244, label %245, label %260

245:                                              ; preds = %242
  %246 = getelementptr inbounds [1024 x i8], ptr %19, i64 0, i64 0
  %247 = load ptr, ptr %14, align 8, !tbaa !9
  %248 = call i32 @x509_cert_from_pem(ptr noundef %246, ptr noundef %20, i64 noundef 1024, ptr noundef %247)
  %249 = icmp ne i32 %248, 1
  br i1 %249, label %255, label %250

250:                                              ; preds = %245
  %251 = getelementptr inbounds [1024 x i8], ptr %19, i64 0, i64 0
  %252 = load i64, ptr %20, align 8, !tbaa !13
  %253 = call i32 @x509_cert_get_subject_public_key(ptr noundef %251, i64 noundef %252, ptr noundef %17)
  %254 = icmp ne i32 %253, 1
  br i1 %254, label %255, label %259

255:                                              ; preds = %250, %245
  %256 = load ptr, ptr @stderr, align 8, !tbaa !9
  %257 = load ptr, ptr %7, align 8, !tbaa !9
  %258 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %256, ptr noundef @.str.17, ptr noundef %257) #6
  br label %311

259:                                              ; preds = %250
  br label %264

260:                                              ; preds = %242
  %261 = load ptr, ptr @stderr, align 8, !tbaa !9
  %262 = load ptr, ptr %7, align 8, !tbaa !9
  %263 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %261, ptr noundef @.str.18, ptr noundef %262) #6
  br label %311

264:                                              ; preds = %259
  br label %265

265:                                              ; preds = %264, %241
  %266 = load ptr, ptr %8, align 8, !tbaa !9
  %267 = load ptr, ptr %8, align 8, !tbaa !9
  %268 = call i64 @strlen(ptr noundef %267) #7
  %269 = call i32 @sm2_verify_init(ptr noundef %18, ptr noundef %17, ptr noundef %266, i64 noundef %268)
  %270 = icmp ne i32 %269, 1
  br i1 %270, label %271, label %275

271:                                              ; preds = %265
  %272 = load ptr, ptr @stderr, align 8, !tbaa !9
  %273 = load ptr, ptr %7, align 8, !tbaa !9
  %274 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %272, ptr noundef @.str.19, ptr noundef %273) #6
  br label %311

275:                                              ; preds = %265
  br label %276

276:                                              ; preds = %290, %275
  %277 = getelementptr inbounds [4096 x i8], ptr %21, i64 0, i64 0
  %278 = load ptr, ptr %15, align 8, !tbaa !9
  %279 = call i64 @fread(ptr noundef %277, i64 noundef 1, i64 noundef 4096, ptr noundef %278)
  store i64 %279, ptr %22, align 8, !tbaa !13
  %280 = icmp ugt i64 %279, 0
  br i1 %280, label %281, label %291

281:                                              ; preds = %276
  %282 = getelementptr inbounds [4096 x i8], ptr %21, i64 0, i64 0
  %283 = load i64, ptr %22, align 8, !tbaa !13
  %284 = call i32 @sm2_verify_update(ptr noundef %18, ptr noundef %282, i64 noundef %283)
  %285 = icmp ne i32 %284, 1
  br i1 %285, label %286, label %290

286:                                              ; preds = %281
  %287 = load ptr, ptr @stderr, align 8, !tbaa !9
  %288 = load ptr, ptr %7, align 8, !tbaa !9
  %289 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %287, ptr noundef @.str.19, ptr noundef %288) #6
  br label %311

290:                                              ; preds = %281
  br label %276, !llvm.loop !15

291:                                              ; preds = %276
  %292 = getelementptr inbounds [72 x i8], ptr %23, i64 0, i64 0
  %293 = load i64, ptr %24, align 8, !tbaa !13
  %294 = call i32 @sm2_verify_finish(ptr noundef %18, ptr noundef %292, i64 noundef %293)
  store i32 %294, ptr %25, align 4, !tbaa !5
  %295 = icmp slt i32 %294, 0
  br i1 %295, label %296, label %300

296:                                              ; preds = %291
  %297 = load ptr, ptr @stderr, align 8, !tbaa !9
  %298 = load ptr, ptr %7, align 8, !tbaa !9
  %299 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %297, ptr noundef @.str.19, ptr noundef %298) #6
  br label %311

300:                                              ; preds = %291
  %301 = load ptr, ptr @stdout, align 8, !tbaa !9
  %302 = load i32, ptr %25, align 4, !tbaa !5
  %303 = icmp eq i32 %302, 1
  %304 = zext i1 %303 to i64
  %305 = select i1 %303, ptr @.str.21, ptr @.str.22
  %306 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %301, ptr noundef @.str.20, ptr noundef %305) #6
  %307 = load i32, ptr %25, align 4, !tbaa !5
  %308 = icmp eq i32 %307, 1
  br i1 %308, label %309, label %310

309:                                              ; preds = %300
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %310

310:                                              ; preds = %309, %300
  br label %311

311:                                              ; preds = %310, %296, %286, %271, %260, %255, %237, %223, %214, %195, %189, %180, %154, %114, %98, %81, %65, %51
  %312 = load ptr, ptr %11, align 8, !tbaa !9
  %313 = icmp ne ptr %312, null
  br i1 %313, label %314, label %320

314:                                              ; preds = %311
  %315 = load ptr, ptr %15, align 8, !tbaa !9
  %316 = icmp ne ptr %315, null
  br i1 %316, label %317, label %320

317:                                              ; preds = %314
  %318 = load ptr, ptr %15, align 8, !tbaa !9
  %319 = call i32 @fclose(ptr noundef %318)
  br label %320

320:                                              ; preds = %317, %314, %311
  %321 = load ptr, ptr %13, align 8, !tbaa !9
  %322 = icmp ne ptr %321, null
  br i1 %322, label %323, label %326

323:                                              ; preds = %320
  %324 = load ptr, ptr %13, align 8, !tbaa !9
  %325 = call i32 @fclose(ptr noundef %324)
  br label %326

326:                                              ; preds = %323, %320
  %327 = load ptr, ptr %14, align 8, !tbaa !9
  %328 = icmp ne ptr %327, null
  br i1 %328, label %329, label %332

329:                                              ; preds = %326
  %330 = load ptr, ptr %14, align 8, !tbaa !9
  %331 = call i32 @fclose(ptr noundef %330)
  br label %332

332:                                              ; preds = %329, %326
  %333 = load ptr, ptr %16, align 8, !tbaa !9
  %334 = icmp ne ptr %333, null
  br i1 %334, label %335, label %338

335:                                              ; preds = %332
  %336 = load ptr, ptr %16, align 8, !tbaa !9
  %337 = call i32 @fclose(ptr noundef %336)
  br label %338

338:                                              ; preds = %335, %332
  %339 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %339, ptr %3, align 4
  store i32 1, ptr %26, align 4
  br label %340

340:                                              ; preds = %338, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 1888, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %341 = load i32, ptr %3, align 4
  ret i32 %341
}

; 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 i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

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

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

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

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

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

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

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

declare i32 @fclose(ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind willreturn memory(none) }

!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}
!15 = distinct !{!15, !12}


; 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.SM2_KEY = type { %struct.SM2_Z256_POINT, [4 x i64] }
%struct.SM2_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM2_VERIFY_CTX = type { %struct.SM3_CTX, %struct.SM3_CTX, %struct.SM2_KEY, [16 x %struct.SM2_Z256_POINT] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@usage = external hidden local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@options = external hidden local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [23 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.20 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @sm2verify_main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.SM2_KEY, align 8
  %4 = alloca %struct.SM2_VERIFY_CTX, align 8
  %5 = alloca [1024 x i8], align 16
  %6 = alloca i64, align 8
  %7 = alloca [4096 x i8], align 16
  %8 = alloca [72 x i8], align 16
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  %10 = load ptr, ptr @stdin, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 1888, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %8) #7
  %11 = icmp slt i32 %0, 2
  br i1 %11, label %13, label %.preheader154.preheader

.preheader154.preheader:                          ; preds = %2
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  br label %.preheader154

13:                                               ; preds = %2
  %14 = load ptr, ptr @stderr, align 8, !tbaa !5
  %15 = load ptr, ptr @usage, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.1, ptr noundef %9, ptr noundef %15) #8
  br label %171

.preheader154:                                    ; preds = %.preheader154.preheader, %100
  %.077.in260 = phi i32 [ %.1, %100 ], [ %0, %.preheader154.preheader ]
  %.078259 = phi ptr [ %101, %100 ], [ %12, %.preheader154.preheader ]
  %.080258 = phi ptr [ %.181, %100 ], [ null, %.preheader154.preheader ]
  %.082257 = phi ptr [ %.183, %100 ], [ %10, %.preheader154.preheader ]
  %.085256 = phi ptr [ %.186, %100 ], [ null, %.preheader154.preheader ]
  %.088255 = phi ptr [ %.189, %100 ], [ null, %.preheader154.preheader ]
  %.091254 = phi ptr [ %.192, %100 ], [ null, %.preheader154.preheader ]
  %.093253 = phi ptr [ %.194, %100 ], [ null, %.preheader154.preheader ]
  %.096252 = phi ptr [ %.197, %100 ], [ null, %.preheader154.preheader ]
  %.098251 = phi ptr [ %.199, %100 ], [ null, %.preheader154.preheader ]
  %.0100250 = phi ptr [ %.1101, %100 ], [ @.str, %.preheader154.preheader ]
  %17 = load ptr, ptr %.078259, align 8, !tbaa !5
  %18 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.2) #9
  %.not128 = icmp eq i32 %18, 0
  br i1 %.not128, label %19, label %24

19:                                               ; preds = %.preheader154
  %20 = load ptr, ptr @usage, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %9, ptr noundef %20)
  %22 = load ptr, ptr @options, align 8, !tbaa !5
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %22)
  br label %157

24:                                               ; preds = %.preheader154
  %25 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.4) #9
  %.not129 = icmp eq i32 %25, 0
  br i1 %.not129, label %26, label %42

26:                                               ; preds = %24
  %.not130 = icmp eq ptr %.096252, null
  br i1 %.not130, label %30, label %27

27:                                               ; preds = %26
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str.5, ptr noundef %9) #8
  br label %157

30:                                               ; preds = %26
  %31 = icmp eq i32 %.077.in260, 2
  br i1 %31, label %97, label %32

32:                                               ; preds = %30
  %33 = getelementptr inbounds i8, ptr %.078259, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = tail call noalias ptr @fopen(ptr noundef %34, ptr noundef nonnull @.str.6)
  %.not131 = icmp eq ptr %35, null
  br i1 %.not131, label %36, label %100

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

42:                                               ; preds = %24
  %43 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.8) #9
  %.not132 = icmp eq i32 %43, 0
  br i1 %.not132, label %44, label %60

44:                                               ; preds = %42
  %.not133 = icmp eq ptr %.098251, null
  br i1 %.not133, label %48, label %45

45:                                               ; preds = %44
  %46 = load ptr, ptr @stderr, align 8, !tbaa !5
  %47 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.5, ptr noundef %9) #8
  br label %157

48:                                               ; preds = %44
  %49 = icmp eq i32 %.077.in260, 2
  br i1 %49, label %97, label %50

50:                                               ; preds = %48
  %51 = getelementptr inbounds i8, ptr %.078259, i64 8
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = tail call noalias ptr @fopen(ptr noundef %52, ptr noundef nonnull @.str.6)
  %.not134 = icmp eq ptr %53, null
  br i1 %.not134, label %54, label %100

54:                                               ; preds = %50
  %55 = load ptr, ptr @stderr, align 8, !tbaa !5
  %56 = tail call ptr @__errno_location() #10
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = tail call ptr @strerror(i32 noundef %57) #7
  %59 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.7, ptr noundef %9, ptr noundef %52, ptr noundef %58) #8
  br label %157

60:                                               ; preds = %42
  %61 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.9) #9
  %.not135 = icmp eq i32 %61, 0
  br i1 %.not135, label %62, label %67

62:                                               ; preds = %60
  %63 = icmp eq i32 %.077.in260, 2
  br i1 %63, label %97, label %64

64:                                               ; preds = %62
  %65 = getelementptr inbounds i8, ptr %.078259, i64 8
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  br label %100

67:                                               ; preds = %60
  %68 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.10) #9
  %.not136 = icmp eq i32 %68, 0
  br i1 %.not136, label %69, label %80

69:                                               ; preds = %67
  %70 = icmp eq i32 %.077.in260, 2
  br i1 %70, label %97, label %71

71:                                               ; preds = %69
  %72 = getelementptr inbounds i8, ptr %.078259, i64 8
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = tail call noalias ptr @fopen(ptr noundef %73, ptr noundef nonnull @.str.6)
  %.not137 = icmp eq ptr %74, null
  br i1 %.not137, label %.thread, label %100

.thread:                                          ; preds = %71
  %75 = load ptr, ptr @stderr, align 8, !tbaa !5
  %76 = tail call ptr @__errno_location() #10
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = tail call ptr @strerror(i32 noundef %77) #7
  %79 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull @.str.7, ptr noundef %9, ptr noundef %73, ptr noundef %78) #8
  br label %162

80:                                               ; preds = %67
  %81 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.11) #9
  %.not138 = icmp eq i32 %81, 0
  br i1 %.not138, label %82, label %94

82:                                               ; preds = %80
  %83 = icmp eq i32 %.077.in260, 2
  br i1 %83, label %97, label %84

84:                                               ; preds = %82
  %85 = getelementptr inbounds i8, ptr %.078259, i64 8
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = tail call noalias ptr @fopen(ptr noundef %86, ptr noundef nonnull @.str.6)
  %.not139 = icmp eq ptr %87, null
  br i1 %.not139, label %88, label %100

88:                                               ; preds = %84
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  %90 = tail call ptr @__errno_location() #10
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = tail call ptr @strerror(i32 noundef %91) #7
  %93 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.7, ptr noundef %9, ptr noundef %86, ptr noundef %92) #8
  br label %157

94:                                               ; preds = %80
  %95 = load ptr, ptr @stderr, align 8, !tbaa !5
  %96 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef nonnull @.str.12, ptr noundef %9, ptr noundef %17) #8
  br label %157

97:                                               ; preds = %82, %69, %62, %48, %30
  %98 = load ptr, ptr @stderr, align 8, !tbaa !5
  %99 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.13, ptr noundef %9, ptr noundef %17) #8
  br label %157

100:                                              ; preds = %32, %64, %84, %71, %50
  %.1101 = phi ptr [ %.0100250, %84 ], [ %.0100250, %71 ], [ %66, %64 ], [ %.0100250, %50 ], [ %.0100250, %32 ]
  %.199 = phi ptr [ %.098251, %84 ], [ %.098251, %71 ], [ %.098251, %64 ], [ null, %50 ], [ %34, %32 ]
  %.197 = phi ptr [ %.096252, %84 ], [ %.096252, %71 ], [ %.096252, %64 ], [ %52, %50 ], [ null, %32 ]
  %.194 = phi ptr [ %.093253, %84 ], [ %73, %71 ], [ %.093253, %64 ], [ %.093253, %50 ], [ %.093253, %32 ]
  %.192 = phi ptr [ %86, %84 ], [ %.091254, %71 ], [ %.091254, %64 ], [ %.091254, %50 ], [ %.091254, %32 ]
  %.189 = phi ptr [ %.088255, %84 ], [ %.088255, %71 ], [ %.088255, %64 ], [ %.088255, %50 ], [ %35, %32 ]
  %.186 = phi ptr [ %.085256, %84 ], [ %.085256, %71 ], [ %.085256, %64 ], [ %53, %50 ], [ %.085256, %32 ]
  %.183 = phi ptr [ %.082257, %84 ], [ %74, %71 ], [ %.082257, %64 ], [ %.082257, %50 ], [ %.082257, %32 ]
  %.181 = phi ptr [ %87, %84 ], [ %.080258, %71 ], [ %.080258, %64 ], [ %.080258, %50 ], [ %.080258, %32 ]
  %.1 = add nsw i32 %.077.in260, -2
  %101 = getelementptr inbounds i8, ptr %.078259, i64 16
  %102 = icmp sgt i32 %.077.in260, 3
  br i1 %102, label %.preheader154, label %103, !llvm.loop !11

103:                                              ; preds = %100
  %.not = icmp eq ptr %.192, null
  br i1 %.not, label %104, label %107

104:                                              ; preds = %103
  %105 = load ptr, ptr @stderr, align 8, !tbaa !5
  %106 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef nonnull @.str.14, ptr noundef %9) #8
  br label %157

107:                                              ; preds = %103
  %108 = call i64 @fread(ptr noundef nonnull %8, i64 noundef 1, i64 noundef 72, ptr noundef %.181)
  %109 = icmp eq i64 %108, 0
  br i1 %109, label %110, label %116

110:                                              ; preds = %107
  %111 = load ptr, ptr @stderr, align 8, !tbaa !5
  %112 = tail call ptr @__errno_location() #10
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = tail call ptr @strerror(i32 noundef %113) #7
  %115 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef nonnull @.str.15, ptr noundef %9, ptr noundef %114) #8
  br label %157

116:                                              ; preds = %107
  %.not120 = icmp eq ptr %.199, null
  br i1 %.not120, label %122, label %117

117:                                              ; preds = %116
  %118 = call i32 @sm2_public_key_info_from_pem(ptr noundef nonnull %3, ptr noundef %.189) #7
  %.not124 = icmp eq i32 %118, 1
  br i1 %.not124, label %134, label %119

119:                                              ; preds = %117
  %120 = load ptr, ptr @stderr, align 8, !tbaa !5
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef nonnull @.str.16, ptr noundef %9) #8
  br label %157

122:                                              ; preds = %116
  %.not121 = icmp eq ptr %.197, null
  br i1 %.not121, label %131, label %123

123:                                              ; preds = %122
  %124 = call i32 @x509_cert_from_pem(ptr noundef nonnull %5, ptr noundef nonnull %6, i64 noundef 1024, ptr noundef %.186) #7
  %.not122 = icmp eq i32 %124, 1
  br i1 %.not122, label %125, label %128

125:                                              ; preds = %123
  %126 = load i64, ptr %6, align 8, !tbaa !13
  %127 = call i32 @x509_cert_get_subject_public_key(ptr noundef nonnull %5, i64 noundef %126, ptr noundef nonnull %3) #7
  %.not123 = icmp eq i32 %127, 1
  br i1 %.not123, label %134, label %128

128:                                              ; preds = %125, %123
  %129 = load ptr, ptr @stderr, align 8, !tbaa !5
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef nonnull @.str.17, ptr noundef %9) #8
  br label %157

131:                                              ; preds = %122
  %132 = load ptr, ptr @stderr, align 8, !tbaa !5
  %133 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %132, ptr noundef nonnull @.str.18, ptr noundef %9) #8
  br label %157

134:                                              ; preds = %125, %117
  %135 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.1101) #9
  %136 = call i32 @sm2_verify_init(ptr noundef nonnull %4, ptr noundef nonnull %3, ptr noundef %.1101, i64 noundef %135) #7
  %.not125 = icmp eq i32 %136, 1
  br i1 %.not125, label %.preheader, label %137

137:                                              ; preds = %134
  %138 = load ptr, ptr @stderr, align 8, !tbaa !5
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef nonnull @.str.19, ptr noundef %9) #8
  br label %157

.preheader:                                       ; preds = %134, %141
  %140 = call i64 @fread(ptr noundef nonnull %7, i64 noundef 1, i64 noundef 4096, ptr noundef %.183)
  %.not126 = icmp eq i64 %140, 0
  br i1 %.not126, label %146, label %141

141:                                              ; preds = %.preheader
  %142 = call i32 @sm2_verify_update(ptr noundef nonnull %4, ptr noundef nonnull %7, i64 noundef %140) #7
  %.not127 = icmp eq i32 %142, 1
  br i1 %.not127, label %.preheader, label %143, !llvm.loop !15

143:                                              ; preds = %141
  %144 = load ptr, ptr @stderr, align 8, !tbaa !5
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef nonnull @.str.19, ptr noundef %9) #8
  br label %157

146:                                              ; preds = %.preheader
  %147 = call i32 @sm2_verify_finish(ptr noundef nonnull %4, ptr noundef nonnull %8, i64 noundef %108) #7
  %148 = icmp slt i32 %147, 0
  br i1 %148, label %149, label %152

149:                                              ; preds = %146
  %150 = load ptr, ptr @stderr, align 8, !tbaa !5
  %151 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %150, ptr noundef nonnull @.str.19, ptr noundef %9) #8
  br label %157

152:                                              ; preds = %146
  %153 = load ptr, ptr @stdout, align 8, !tbaa !5
  %154 = icmp ne i32 %147, 1
  %155 = select i1 %154, ptr @.str.22, ptr @.str.21
  %156 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef nonnull @.str.20, ptr noundef nonnull %155) #7
  %spec.select = zext i1 %154 to i32
  br label %157

157:                                              ; preds = %152, %149, %143, %137, %131, %128, %119, %110, %104, %97, %94, %88, %54, %45, %36, %27, %19
  %.093212 = phi ptr [ %.093253, %94 ], [ %.093253, %97 ], [ %.093253, %88 ], [ %.093253, %45 ], [ %.093253, %54 ], [ %.093253, %27 ], [ %.093253, %36 ], [ %.093253, %19 ], [ %.194, %110 ], [ %.194, %119 ], [ %.194, %137 ], [ %.194, %143 ], [ %.194, %149 ], [ %.194, %128 ], [ %.194, %131 ], [ %.194, %104 ], [ %.194, %152 ]
  %.082175 = phi ptr [ %.082257, %94 ], [ %.082257, %97 ], [ %.082257, %88 ], [ %.082257, %45 ], [ %.082257, %54 ], [ %.082257, %27 ], [ %.082257, %36 ], [ %.082257, %19 ], [ %.183, %110 ], [ %.183, %119 ], [ %.183, %137 ], [ %.183, %143 ], [ %.183, %149 ], [ %.183, %128 ], [ %.183, %131 ], [ %.183, %104 ], [ %.183, %152 ]
  %.0102 = phi i32 [ 1, %94 ], [ 1, %97 ], [ 1, %88 ], [ 1, %45 ], [ 1, %54 ], [ 1, %27 ], [ 1, %36 ], [ 0, %19 ], [ 1, %110 ], [ 1, %119 ], [ 1, %137 ], [ 1, %143 ], [ 1, %149 ], [ 1, %128 ], [ 1, %131 ], [ 1, %104 ], [ %spec.select, %152 ]
  %.290 = phi ptr [ %.088255, %94 ], [ %.088255, %97 ], [ %.088255, %88 ], [ %.088255, %45 ], [ %.088255, %54 ], [ %.088255, %27 ], [ null, %36 ], [ %.088255, %19 ], [ %.189, %110 ], [ %.189, %119 ], [ %.189, %137 ], [ %.189, %143 ], [ %.189, %149 ], [ %.189, %128 ], [ %.189, %131 ], [ %.189, %104 ], [ %.189, %152 ]
  %.287 = phi ptr [ %.085256, %94 ], [ %.085256, %97 ], [ %.085256, %88 ], [ %.085256, %45 ], [ null, %54 ], [ %.085256, %27 ], [ %.085256, %36 ], [ %.085256, %19 ], [ %.186, %110 ], [ %.186, %119 ], [ %.186, %137 ], [ %.186, %143 ], [ %.186, %149 ], [ %.186, %128 ], [ %.186, %131 ], [ %.186, %104 ], [ %.186, %152 ]
  %.2 = phi ptr [ %.080258, %94 ], [ %.080258, %97 ], [ null, %88 ], [ %.080258, %45 ], [ %.080258, %54 ], [ %.080258, %27 ], [ %.080258, %36 ], [ %.080258, %19 ], [ %.181, %110 ], [ %.181, %119 ], [ %.181, %137 ], [ %.181, %143 ], [ %.181, %149 ], [ %.181, %128 ], [ %.181, %131 ], [ %.181, %104 ], [ %.181, %152 ]
  %158 = icmp ne ptr %.093212, null
  %159 = icmp ne ptr %.082175, null
  %or.cond = select i1 %158, i1 %159, i1 false
  br i1 %or.cond, label %160, label %162

160:                                              ; preds = %157
  %161 = call i32 @fclose(ptr noundef nonnull %.082175)
  br label %162

162:                                              ; preds = %.thread, %160, %157
  %.2153 = phi ptr [ %.080258, %.thread ], [ %.2, %160 ], [ %.2, %157 ]
  %.287152 = phi ptr [ %.085256, %.thread ], [ %.287, %160 ], [ %.287, %157 ]
  %.290151 = phi ptr [ %.088255, %.thread ], [ %.290, %160 ], [ %.290, %157 ]
  %.0102150 = phi i32 [ 1, %.thread ], [ %.0102, %160 ], [ %.0102, %157 ]
  %.not140 = icmp eq ptr %.290151, null
  br i1 %.not140, label %165, label %163

163:                                              ; preds = %162
  %164 = call i32 @fclose(ptr noundef nonnull %.290151)
  br label %165

165:                                              ; preds = %163, %162
  %.not141 = icmp eq ptr %.287152, null
  br i1 %.not141, label %168, label %166

166:                                              ; preds = %165
  %167 = call i32 @fclose(ptr noundef nonnull %.287152)
  br label %168

168:                                              ; preds = %166, %165
  %.not142 = icmp eq ptr %.2153, null
  br i1 %.not142, label %171, label %169

169:                                              ; preds = %168
  %170 = call i32 @fclose(ptr noundef nonnull %.2153)
  br label %171

171:                                              ; preds = %168, %169, %13
  %.0 = phi i32 [ 1, %13 ], [ %.0102150, %169 ], [ %.0102150, %168 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 1888, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #7
  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

; 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

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

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

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

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(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

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 = { nounwind }
attributes #8 = { cold nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind willreturn memory(none) }

!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}
!15 = distinct !{!15, !12}


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