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

; 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.SM9_ENC_KEY = type { %struct.SM9_Z256_POINT, %struct.SM9_Z256_TWIST_POINT }
%struct.SM9_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM9_Z256_TWIST_POINT = type { [2 x [4 x i64]], [2 x [4 x i64]], [2 x [4 x i64]] }

@stdin = external global ptr, align 8
@stdout = external global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@usage = 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
@options = external hidden global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [66 x i8], align 1
@__FUNCTION__.sm9decrypt_main = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [31 x i8], align 1

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

33:                                               ; preds = %2
  %34 = load ptr, ptr @stderr, align 8, !tbaa !9
  %35 = load ptr, ptr %7, align 8, !tbaa !9
  %36 = load ptr, ptr @usage, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str, ptr noundef %35, ptr noundef %36) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %263

38:                                               ; preds = %2
  br label %39

39:                                               ; preds = %165, %38
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %42, label %170

42:                                               ; preds = %39
  %43 = load ptr, ptr %5, align 8, !tbaa !9
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = call i32 @strcmp(ptr noundef %44, ptr noundef @.str.1) #6
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %53, label %47

47:                                               ; preds = %42
  %48 = load ptr, ptr %7, align 8, !tbaa !9
  %49 = load ptr, ptr @usage, align 8, !tbaa !9
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %48, ptr noundef %49)
  %51 = load ptr, ptr @options, align 8, !tbaa !9
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %51)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %263

53:                                               ; preds = %42
  %54 = load ptr, ptr %5, align 8, !tbaa !9
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = call i32 @strcmp(ptr noundef %55, ptr noundef @.str.3) #6
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %77, label %58

58:                                               ; preds = %53
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = add nsw i32 %59, -1
  store i32 %60, ptr %4, align 4, !tbaa !5
  %61 = icmp slt i32 %60, 1
  br i1 %61, label %62, label %63

62:                                               ; preds = %58
  br label %154

63:                                               ; preds = %58
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = getelementptr inbounds ptr, ptr %64, i32 1
  store ptr %65, ptr %5, align 8, !tbaa !9
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  store ptr %66, ptr %9, align 8, !tbaa !9
  %67 = load ptr, ptr %9, align 8, !tbaa !9
  %68 = call noalias ptr @fopen(ptr noundef %67, ptr noundef @.str.4)
  store ptr %68, ptr %13, align 8, !tbaa !9
  %69 = icmp ne ptr %68, null
  br i1 %69, label %76, label %70

70:                                               ; preds = %63
  br label %71

71:                                               ; preds = %70
  %72 = load ptr, ptr @stderr, align 8, !tbaa !9
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 73, ptr noundef @__FUNCTION__.sm9decrypt_main) #5
  br label %74

74:                                               ; preds = %71
  br label %75

75:                                               ; preds = %74
  br label %236

76:                                               ; preds = %63
  br label %164

77:                                               ; preds = %53
  %78 = load ptr, ptr %5, align 8, !tbaa !9
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = call i32 @strcmp(ptr noundef %79, ptr noundef @.str.7) #6
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %91, label %82

82:                                               ; preds = %77
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = add nsw i32 %83, -1
  store i32 %84, ptr %4, align 4, !tbaa !5
  %85 = icmp slt i32 %84, 1
  br i1 %85, label %86, label %87

86:                                               ; preds = %82
  br label %154

87:                                               ; preds = %82
  %88 = load ptr, ptr %5, align 8, !tbaa !9
  %89 = getelementptr inbounds ptr, ptr %88, i32 1
  store ptr %89, ptr %5, align 8, !tbaa !9
  %90 = load ptr, ptr %89, align 8, !tbaa !9
  store ptr %90, ptr %10, align 8, !tbaa !9
  br label %163

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

96:                                               ; preds = %91
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = add nsw i32 %97, -1
  store i32 %98, ptr %4, align 4, !tbaa !5
  %99 = icmp slt i32 %98, 1
  br i1 %99, label %100, label %101

100:                                              ; preds = %96
  br label %154

101:                                              ; preds = %96
  %102 = load ptr, ptr %5, align 8, !tbaa !9
  %103 = getelementptr inbounds ptr, ptr %102, i32 1
  store ptr %103, ptr %5, align 8, !tbaa !9
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  store ptr %104, ptr %11, align 8, !tbaa !9
  br label %162

105:                                              ; preds = %91
  %106 = load ptr, ptr %5, align 8, !tbaa !9
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  %108 = call i32 @strcmp(ptr noundef %107, ptr noundef @.str.9) #6
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %129, label %110

110:                                              ; preds = %105
  %111 = load i32, ptr %4, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr %4, align 4, !tbaa !5
  %113 = icmp slt i32 %112, 1
  br i1 %113, label %114, label %115

114:                                              ; preds = %110
  br label %154

115:                                              ; preds = %110
  %116 = load ptr, ptr %5, align 8, !tbaa !9
  %117 = getelementptr inbounds ptr, ptr %116, i32 1
  store ptr %117, ptr %5, align 8, !tbaa !9
  %118 = load ptr, ptr %117, align 8, !tbaa !9
  store ptr %118, ptr %8, align 8, !tbaa !9
  %119 = load ptr, ptr %8, align 8, !tbaa !9
  %120 = call noalias ptr @fopen(ptr noundef %119, ptr noundef @.str.4)
  store ptr %120, ptr %14, align 8, !tbaa !9
  %121 = icmp ne ptr %120, null
  br i1 %121, label %128, label %122

122:                                              ; preds = %115
  br label %123

123:                                              ; preds = %122
  %124 = load ptr, ptr @stderr, align 8, !tbaa !9
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 86, ptr noundef @__FUNCTION__.sm9decrypt_main) #5
  br label %126

126:                                              ; preds = %123
  br label %127

127:                                              ; preds = %126
  br label %236

128:                                              ; preds = %115
  br label %161

129:                                              ; preds = %105
  %130 = load ptr, ptr %5, align 8, !tbaa !9
  %131 = load ptr, ptr %130, align 8, !tbaa !9
  %132 = call i32 @strcmp(ptr noundef %131, ptr noundef @.str.10) #6
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %153, label %134

134:                                              ; preds = %129
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = add nsw i32 %135, -1
  store i32 %136, ptr %4, align 4, !tbaa !5
  %137 = icmp slt i32 %136, 1
  br i1 %137, label %138, label %139

138:                                              ; preds = %134
  br label %154

139:                                              ; preds = %134
  %140 = load ptr, ptr %5, align 8, !tbaa !9
  %141 = getelementptr inbounds ptr, ptr %140, i32 1
  store ptr %141, ptr %5, align 8, !tbaa !9
  %142 = load ptr, ptr %141, align 8, !tbaa !9
  store ptr %142, ptr %12, align 8, !tbaa !9
  %143 = load ptr, ptr %12, align 8, !tbaa !9
  %144 = call noalias ptr @fopen(ptr noundef %143, ptr noundef @.str.11)
  store ptr %144, ptr %15, align 8, !tbaa !9
  %145 = icmp ne ptr %144, null
  br i1 %145, label %152, label %146

146:                                              ; preds = %139
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr @stderr, align 8, !tbaa !9
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 93, ptr noundef @__FUNCTION__.sm9decrypt_main) #5
  br label %150

150:                                              ; preds = %147
  br label %151

151:                                              ; preds = %150
  br label %236

152:                                              ; preds = %139
  br label %160

153:                                              ; preds = %129
  br label %154

154:                                              ; preds = %153, %138, %114, %100, %86, %62
  %155 = load ptr, ptr @stderr, align 8, !tbaa !9
  %156 = load ptr, ptr %7, align 8, !tbaa !9
  %157 = load ptr, ptr %5, align 8, !tbaa !9
  %158 = load ptr, ptr %157, align 8, !tbaa !9
  %159 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %155, ptr noundef @.str.12, ptr noundef %156, ptr noundef %158) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %263

160:                                              ; preds = %152
  br label %161

161:                                              ; preds = %160, %128
  br label %162

162:                                              ; preds = %161, %101
  br label %163

163:                                              ; preds = %162, %87
  br label %164

164:                                              ; preds = %163, %76
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %4, align 4, !tbaa !5
  %167 = add nsw i32 %166, -1
  store i32 %167, ptr %4, align 4, !tbaa !5
  %168 = load ptr, ptr %5, align 8, !tbaa !9
  %169 = getelementptr inbounds ptr, ptr %168, i32 1
  store ptr %169, ptr %5, align 8, !tbaa !9
  br label %39, !llvm.loop !11

170:                                              ; preds = %39
  %171 = load ptr, ptr %9, align 8, !tbaa !9
  %172 = icmp ne ptr %171, null
  br i1 %172, label %173, label %179

173:                                              ; preds = %170
  %174 = load ptr, ptr %10, align 8, !tbaa !9
  %175 = icmp ne ptr %174, null
  br i1 %175, label %176, label %179

176:                                              ; preds = %173
  %177 = load ptr, ptr %11, align 8, !tbaa !9
  %178 = icmp ne ptr %177, null
  br i1 %178, label %185, label %179

179:                                              ; preds = %176, %173, %170
  br label %180

180:                                              ; preds = %179
  %181 = load ptr, ptr @stderr, align 8, !tbaa !9
  %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 107, ptr noundef @__FUNCTION__.sm9decrypt_main) #5
  br label %183

183:                                              ; preds = %180
  br label %184

184:                                              ; preds = %183
  br label %236

185:                                              ; preds = %176
  %186 = load ptr, ptr %10, align 8, !tbaa !9
  %187 = load ptr, ptr %13, align 8, !tbaa !9
  %188 = call i32 @sm9_enc_key_info_decrypt_from_pem(ptr noundef %16, ptr noundef %186, ptr noundef %187)
  %189 = icmp ne i32 %188, 1
  br i1 %189, label %190, label %196

190:                                              ; preds = %185
  br label %191

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

194:                                              ; preds = %191
  br label %195

195:                                              ; preds = %194
  br label %236

196:                                              ; preds = %185
  %197 = getelementptr inbounds [367 x i8], ptr %17, i64 0, i64 0
  %198 = load ptr, ptr %14, align 8, !tbaa !9
  %199 = call i64 @fread(ptr noundef %197, i64 noundef 1, i64 noundef 367, ptr noundef %198)
  store i64 %199, ptr %19, align 8, !tbaa !13
  %200 = icmp ule i64 %199, 0
  br i1 %200, label %201, label %207

201:                                              ; preds = %196
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr @stderr, align 8, !tbaa !9
  %204 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %203, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 116, ptr noundef @__FUNCTION__.sm9decrypt_main) #5
  br label %205

205:                                              ; preds = %202
  br label %206

206:                                              ; preds = %205
  br label %236

207:                                              ; preds = %196
  %208 = load ptr, ptr %11, align 8, !tbaa !9
  %209 = load ptr, ptr %11, align 8, !tbaa !9
  %210 = call i64 @strlen(ptr noundef %209) #6
  %211 = getelementptr inbounds [367 x i8], ptr %17, i64 0, i64 0
  %212 = load i64, ptr %19, align 8, !tbaa !13
  %213 = getelementptr inbounds [367 x i8], ptr %18, i64 0, i64 0
  %214 = call i32 @sm9_decrypt(ptr noundef %16, ptr noundef %208, i64 noundef %210, ptr noundef %211, i64 noundef %212, ptr noundef %213, ptr noundef %20)
  %215 = icmp ne i32 %214, 1
  br i1 %215, label %216, label %222

216:                                              ; preds = %207
  br label %217

217:                                              ; preds = %216
  %218 = load ptr, ptr @stderr, align 8, !tbaa !9
  %219 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %218, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 120, ptr noundef @__FUNCTION__.sm9decrypt_main) #5
  br label %220

220:                                              ; preds = %217
  br label %221

221:                                              ; preds = %220
  br label %236

222:                                              ; preds = %207
  %223 = load i64, ptr %20, align 8, !tbaa !13
  %224 = getelementptr inbounds [367 x i8], ptr %18, i64 0, i64 0
  %225 = load i64, ptr %20, align 8, !tbaa !13
  %226 = load ptr, ptr %15, align 8, !tbaa !9
  %227 = call i64 @fwrite(ptr noundef %224, i64 noundef 1, i64 noundef %225, ptr noundef %226)
  %228 = icmp ne i64 %223, %227
  br i1 %228, label %229, label %235

229:                                              ; preds = %222
  br label %230

230:                                              ; preds = %229
  %231 = load ptr, ptr @stderr, align 8, !tbaa !9
  %232 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %231, ptr noundef @.str.5, ptr noundef @.str.6, i32 noundef 124, ptr noundef @__FUNCTION__.sm9decrypt_main) #5
  br label %233

233:                                              ; preds = %230
  br label %234

234:                                              ; preds = %233
  br label %236

235:                                              ; preds = %222
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %236

236:                                              ; preds = %235, %234, %221, %206, %195, %184, %151, %127, %75
  call void @gmssl_secure_clear(ptr noundef %16, i64 noundef 288)
  %237 = getelementptr inbounds [367 x i8], ptr %18, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %237, i64 noundef 367)
  %238 = load ptr, ptr %13, align 8, !tbaa !9
  %239 = icmp ne ptr %238, null
  br i1 %239, label %240, label %243

240:                                              ; preds = %236
  %241 = load ptr, ptr %13, align 8, !tbaa !9
  %242 = call i32 @fclose(ptr noundef %241)
  br label %243

243:                                              ; preds = %240, %236
  %244 = load ptr, ptr %8, align 8, !tbaa !9
  %245 = icmp ne ptr %244, null
  br i1 %245, label %246, label %252

246:                                              ; preds = %243
  %247 = load ptr, ptr %14, align 8, !tbaa !9
  %248 = icmp ne ptr %247, null
  br i1 %248, label %249, label %252

249:                                              ; preds = %246
  %250 = load ptr, ptr %14, align 8, !tbaa !9
  %251 = call i32 @fclose(ptr noundef %250)
  br label %252

252:                                              ; preds = %249, %246, %243
  %253 = load ptr, ptr %12, align 8, !tbaa !9
  %254 = icmp ne ptr %253, null
  br i1 %254, label %255, label %261

255:                                              ; preds = %252
  %256 = load ptr, ptr %15, align 8, !tbaa !9
  %257 = icmp ne ptr %256, null
  br i1 %257, label %258, label %261

258:                                              ; preds = %255
  %259 = load ptr, ptr %15, align 8, !tbaa !9
  %260 = call i32 @fclose(ptr noundef %259)
  br label %261

261:                                              ; preds = %258, %255, %252
  %262 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %262, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %263

263:                                              ; preds = %261, %154, %47, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 367, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 367, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 288, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %264 = load i32, ptr %3, align 4
  ret i32 %264
}

; 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

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

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

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

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

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

declare void @gmssl_secure_clear(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 }
attributes #6 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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"

%struct.SM9_ENC_KEY = type { %struct.SM9_Z256_POINT, %struct.SM9_Z256_TWIST_POINT }
%struct.SM9_Z256_POINT = type { [4 x i64], [4 x i64], [4 x i64] }
%struct.SM9_Z256_TWIST_POINT = type { [2 x [4 x i64]], [2 x [4 x i64]], [2 x [4 x i64]] }

@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@usage = 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
@options = external hidden local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [66 x i8], align 1
@__FUNCTION__.sm9decrypt_main = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @sm9decrypt_main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.SM9_ENC_KEY, align 8
  %4 = alloca [367 x i8], align 16
  %5 = alloca [367 x i8], align 16
  %6 = alloca i64, align 8
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  %8 = load ptr, ptr @stdin, align 8, !tbaa !5
  %9 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 288, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 367, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 367, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %10 = icmp slt i32 %0, 2
  br i1 %10, label %12, label %.preheader.preheader

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

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

.preheader:                                       ; preds = %.preheader.preheader, %72
  %.056161 = phi ptr [ %.1, %72 ], [ %9, %.preheader.preheader ]
  %.057160 = phi ptr [ %.158, %72 ], [ %8, %.preheader.preheader ]
  %.060159 = phi ptr [ %.161, %72 ], [ null, %.preheader.preheader ]
  %.063158 = phi ptr [ %.164, %72 ], [ null, %.preheader.preheader ]
  %.066157 = phi ptr [ %.167, %72 ], [ null, %.preheader.preheader ]
  %.068156 = phi ptr [ %.169, %72 ], [ null, %.preheader.preheader ]
  %.070155 = phi ptr [ %.171, %72 ], [ null, %.preheader.preheader ]
  %.072154 = phi ptr [ %.173, %72 ], [ null, %.preheader.preheader ]
  %.075.in153 = phi i32 [ %.176, %72 ], [ %0, %.preheader.preheader ]
  %.078152 = phi ptr [ %73, %72 ], [ %11, %.preheader.preheader ]
  %16 = load ptr, ptr %.078152, align 8, !tbaa !5
  %17 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) @.str.1) #7
  %.not95 = icmp eq i32 %17, 0
  br i1 %.not95, label %18, label %23

18:                                               ; preds = %.preheader
  %19 = load ptr, ptr @usage, align 8, !tbaa !5
  %20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %7, ptr noundef %19)
  %21 = load ptr, ptr @options, align 8, !tbaa !5
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %21)
  br label %118

23:                                               ; preds = %.preheader
  %24 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) @.str.3) #7
  %.not96 = icmp eq i32 %24, 0
  br i1 %.not96, label %25, label %34

25:                                               ; preds = %23
  %26 = icmp eq i32 %.075.in153, 2
  br i1 %26, label %69, label %27

27:                                               ; preds = %25
  %28 = getelementptr inbounds i8, ptr %.078152, i64 8
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = tail call noalias ptr @fopen(ptr noundef %29, ptr noundef nonnull @.str.4)
  %.not97 = icmp eq ptr %30, null
  br i1 %.not97, label %31, label %72

31:                                               ; preds = %27
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 73, ptr noundef nonnull @__FUNCTION__.sm9decrypt_main) #6
  br label %105

34:                                               ; preds = %23
  %35 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) @.str.7) #7
  %.not98 = icmp eq i32 %35, 0
  br i1 %.not98, label %36, label %41

36:                                               ; preds = %34
  %37 = icmp eq i32 %.075.in153, 2
  br i1 %37, label %69, label %38

38:                                               ; preds = %36
  %39 = getelementptr inbounds i8, ptr %.078152, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  br label %72

41:                                               ; preds = %34
  %42 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) @.str.8) #7
  %.not99 = icmp eq i32 %42, 0
  br i1 %.not99, label %43, label %48

43:                                               ; preds = %41
  %44 = icmp eq i32 %.075.in153, 2
  br i1 %44, label %69, label %45

45:                                               ; preds = %43
  %46 = getelementptr inbounds i8, ptr %.078152, i64 8
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  br label %72

48:                                               ; preds = %41
  %49 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) @.str.9) #7
  %.not100 = icmp eq i32 %49, 0
  br i1 %.not100, label %50, label %59

50:                                               ; preds = %48
  %51 = icmp eq i32 %.075.in153, 2
  br i1 %51, label %69, label %52

52:                                               ; preds = %50
  %53 = getelementptr inbounds i8, ptr %.078152, i64 8
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  %55 = tail call noalias ptr @fopen(ptr noundef %54, ptr noundef nonnull @.str.4)
  %.not101 = icmp eq ptr %55, null
  br i1 %.not101, label %56, label %72

56:                                               ; preds = %52
  %57 = load ptr, ptr @stderr, align 8, !tbaa !5
  %58 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 86, ptr noundef nonnull @__FUNCTION__.sm9decrypt_main) #6
  br label %105

59:                                               ; preds = %48
  %60 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) @.str.10) #7
  %.not102 = icmp ne i32 %60, 0
  %61 = icmp eq i32 %.075.in153, 2
  %or.cond105 = or i1 %61, %.not102
  br i1 %or.cond105, label %69, label %62

62:                                               ; preds = %59
  %63 = getelementptr inbounds i8, ptr %.078152, i64 8
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = tail call noalias ptr @fopen(ptr noundef %64, ptr noundef nonnull @.str.11)
  %.not103 = icmp eq ptr %65, null
  br i1 %.not103, label %66, label %72

66:                                               ; preds = %62
  %67 = load ptr, ptr @stderr, align 8, !tbaa !5
  %68 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 93, ptr noundef nonnull @__FUNCTION__.sm9decrypt_main) #6
  br label %105

69:                                               ; preds = %59, %50, %43, %36, %25
  %70 = load ptr, ptr @stderr, align 8, !tbaa !5
  %71 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str.12, ptr noundef %7, ptr noundef %16) #6
  br label %118

72:                                               ; preds = %27, %45, %62, %52, %38
  %.173 = phi ptr [ %.072154, %62 ], [ %54, %52 ], [ %.072154, %45 ], [ %.072154, %38 ], [ %.072154, %27 ]
  %.171 = phi ptr [ %.070155, %62 ], [ %.070155, %52 ], [ %.070155, %45 ], [ %.070155, %38 ], [ %29, %27 ]
  %.169 = phi ptr [ %.068156, %62 ], [ %.068156, %52 ], [ %.068156, %45 ], [ %40, %38 ], [ %.068156, %27 ]
  %.167 = phi ptr [ %.066157, %62 ], [ %.066157, %52 ], [ %47, %45 ], [ %.066157, %38 ], [ %.066157, %27 ]
  %.164 = phi ptr [ %64, %62 ], [ %.063158, %52 ], [ %.063158, %45 ], [ %.063158, %38 ], [ %.063158, %27 ]
  %.161 = phi ptr [ %.060159, %62 ], [ %.060159, %52 ], [ %.060159, %45 ], [ %.060159, %38 ], [ %30, %27 ]
  %.158 = phi ptr [ %.057160, %62 ], [ %55, %52 ], [ %.057160, %45 ], [ %.057160, %38 ], [ %.057160, %27 ]
  %.1 = phi ptr [ %65, %62 ], [ %.056161, %52 ], [ %.056161, %45 ], [ %.056161, %38 ], [ %.056161, %27 ]
  %.176 = add nsw i32 %.075.in153, -2
  %73 = getelementptr inbounds i8, ptr %.078152, i64 16
  %74 = icmp sgt i32 %.075.in153, 3
  br i1 %74, label %.preheader, label %75, !llvm.loop !9

75:                                               ; preds = %72
  %76 = icmp ne ptr %.171, null
  %77 = icmp ne ptr %.169, null
  %or.cond = select i1 %76, i1 %77, i1 false
  %78 = icmp ne ptr %.167, null
  %or.cond3 = select i1 %or.cond, i1 %78, i1 false
  br i1 %or.cond3, label %82, label %79

79:                                               ; preds = %75
  %80 = load ptr, ptr @stderr, align 8, !tbaa !5
  %81 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 107, ptr noundef nonnull @__FUNCTION__.sm9decrypt_main) #6
  br label %105

82:                                               ; preds = %75
  %83 = call i32 @sm9_enc_key_info_decrypt_from_pem(ptr noundef nonnull %3, ptr noundef nonnull %.169, ptr noundef %.161) #5
  %.not = icmp eq i32 %83, 1
  br i1 %.not, label %87, label %84

84:                                               ; preds = %82
  %85 = load ptr, ptr @stderr, align 8, !tbaa !5
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 112, ptr noundef nonnull @__FUNCTION__.sm9decrypt_main) #6
  br label %105

87:                                               ; preds = %82
  %88 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 1, i64 noundef 367, ptr noundef %.158)
  %89 = icmp eq i64 %88, 0
  br i1 %89, label %90, label %93

90:                                               ; preds = %87
  %91 = load ptr, ptr @stderr, align 8, !tbaa !5
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 116, ptr noundef nonnull @__FUNCTION__.sm9decrypt_main) #6
  br label %105

93:                                               ; preds = %87
  %94 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.167) #7
  %95 = call i32 @sm9_decrypt(ptr noundef nonnull %3, ptr noundef nonnull %.167, i64 noundef %94, ptr noundef nonnull %4, i64 noundef %88, ptr noundef nonnull %5, ptr noundef nonnull %6) #5
  %.not93 = icmp eq i32 %95, 1
  br i1 %.not93, label %99, label %96

96:                                               ; preds = %93
  %97 = load ptr, ptr @stderr, align 8, !tbaa !5
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 120, ptr noundef nonnull @__FUNCTION__.sm9decrypt_main) #6
  br label %105

99:                                               ; preds = %93
  %100 = load i64, ptr %6, align 8, !tbaa !11
  %101 = call i64 @fwrite(ptr noundef nonnull %5, i64 noundef 1, i64 noundef %100, ptr noundef %.1)
  %.not94 = icmp eq i64 %100, %101
  br i1 %.not94, label %105, label %102

102:                                              ; preds = %99
  %103 = load ptr, ptr @stderr, align 8, !tbaa !5
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, i32 noundef 124, ptr noundef nonnull @__FUNCTION__.sm9decrypt_main) #6
  br label %105

105:                                              ; preds = %99, %102, %96, %90, %84, %79, %66, %56, %31
  %.077 = phi i32 [ 1, %66 ], [ 1, %56 ], [ 1, %31 ], [ 1, %84 ], [ 1, %90 ], [ 1, %96 ], [ 1, %102 ], [ 1, %79 ], [ 0, %99 ]
  %.274 = phi ptr [ %.072154, %66 ], [ %54, %56 ], [ %.072154, %31 ], [ %.173, %84 ], [ %.173, %90 ], [ %.173, %96 ], [ %.173, %102 ], [ %.173, %79 ], [ %.173, %99 ]
  %.265 = phi ptr [ %64, %66 ], [ %.063158, %56 ], [ %.063158, %31 ], [ %.164, %84 ], [ %.164, %90 ], [ %.164, %96 ], [ %.164, %102 ], [ %.164, %79 ], [ %.164, %99 ]
  %.262 = phi ptr [ %.060159, %66 ], [ %.060159, %56 ], [ null, %31 ], [ %.161, %84 ], [ %.161, %90 ], [ %.161, %96 ], [ %.161, %102 ], [ %.161, %79 ], [ %.161, %99 ]
  %.259 = phi ptr [ %.057160, %66 ], [ null, %56 ], [ %.057160, %31 ], [ %.158, %84 ], [ %.158, %90 ], [ %.158, %96 ], [ %.158, %102 ], [ %.158, %79 ], [ %.158, %99 ]
  %.2 = phi ptr [ null, %66 ], [ %.056161, %56 ], [ %.056161, %31 ], [ %.1, %84 ], [ %.1, %90 ], [ %.1, %96 ], [ %.1, %102 ], [ %.1, %79 ], [ %.1, %99 ]
  call void @gmssl_secure_clear(ptr noundef nonnull %3, i64 noundef 288) #5
  call void @gmssl_secure_clear(ptr noundef nonnull %5, i64 noundef 367) #5
  %.not104 = icmp eq ptr %.262, null
  br i1 %.not104, label %108, label %106

106:                                              ; preds = %105
  %107 = call i32 @fclose(ptr noundef nonnull %.262)
  br label %108

108:                                              ; preds = %106, %105
  %109 = icmp ne ptr %.274, null
  %110 = icmp ne ptr %.259, null
  %or.cond5 = select i1 %109, i1 %110, i1 false
  br i1 %or.cond5, label %111, label %113

111:                                              ; preds = %108
  %112 = call i32 @fclose(ptr noundef nonnull %.259)
  br label %113

113:                                              ; preds = %111, %108
  %114 = icmp ne ptr %.265, null
  %115 = icmp ne ptr %.2, null
  %or.cond7 = select i1 %114, i1 %115, i1 false
  br i1 %or.cond7, label %116, label %118

116:                                              ; preds = %113
  %117 = call i32 @fclose(ptr noundef nonnull %.2)
  br label %118

118:                                              ; preds = %113, %116, %69, %18, %12
  %.0 = phi i32 [ 1, %12 ], [ 1, %69 ], [ 0, %18 ], [ %.077, %116 ], [ %.077, %113 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 367, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 367, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 288, ptr nonnull %3) #5
  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

declare i32 @sm9_enc_key_info_decrypt_from_pem(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i32 @sm9_decrypt(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

declare void @gmssl_secure_clear(ptr noundef, i64 noundef) local_unnamed_addr #4

; 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { cold nounwind }
attributes #7 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}


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