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

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

@stdout = external global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@options = external hidden global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@usage = external hidden global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 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 [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [23 x i8], align 1

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

41:                                               ; preds = %2
  %42 = load ptr, ptr @stderr, align 8, !tbaa !9
  %43 = load ptr, ptr %7, align 8, !tbaa !9
  %44 = load ptr, ptr @options, align 8, !tbaa !9
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str, ptr noundef %43, ptr noundef %44) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %29, align 4
  br label %399

46:                                               ; preds = %2
  br label %47

47:                                               ; preds = %294, %46
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %50, label %299

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

55:                                               ; preds = %50
  %56 = load ptr, ptr %7, align 8, !tbaa !9
  %57 = load ptr, ptr @options, align 8, !tbaa !9
  %58 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %56, ptr noundef %57)
  %59 = load ptr, ptr @usage, align 8, !tbaa !9
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %59)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %382

61:                                               ; preds = %50
  %62 = load ptr, ptr %5, align 8, !tbaa !9
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = call i32 @strcmp(ptr noundef %63, ptr noundef @.str.4) #8
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %75, label %66

66:                                               ; preds = %61
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = add nsw i32 %67, -1
  store i32 %68, ptr %4, align 4, !tbaa !5
  %69 = icmp slt i32 %68, 1
  br i1 %69, label %70, label %71

70:                                               ; preds = %66
  br label %277

71:                                               ; preds = %66
  %72 = load ptr, ptr %5, align 8, !tbaa !9
  %73 = getelementptr inbounds ptr, ptr %72, i32 1
  store ptr %73, ptr %5, align 8, !tbaa !9
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  store ptr %74, ptr %11, align 8, !tbaa !9
  br label %293

75:                                               ; preds = %61
  %76 = load ptr, ptr %5, align 8, !tbaa !9
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = call i32 @strcmp(ptr noundef %77, ptr noundef @.str.5) #8
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %89, label %80

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

84:                                               ; preds = %80
  br label %277

85:                                               ; preds = %80
  %86 = load ptr, ptr %5, align 8, !tbaa !9
  %87 = getelementptr inbounds ptr, ptr %86, i32 1
  store ptr %87, ptr %5, align 8, !tbaa !9
  %88 = load ptr, ptr %87, align 8, !tbaa !9
  store ptr %88, ptr %12, align 8, !tbaa !9
  br label %292

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

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

98:                                               ; preds = %94
  br label %277

99:                                               ; preds = %94
  %100 = load ptr, ptr %5, align 8, !tbaa !9
  %101 = getelementptr inbounds ptr, ptr %100, i32 1
  store ptr %101, ptr %5, align 8, !tbaa !9
  %102 = load ptr, ptr %101, align 8, !tbaa !9
  store ptr %102, ptr %13, align 8, !tbaa !9
  br label %291

103:                                              ; preds = %89
  %104 = load ptr, ptr %5, align 8, !tbaa !9
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = call i32 @strcmp(ptr noundef %105, ptr noundef @.str.7) #8
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %117, label %108

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

112:                                              ; preds = %108
  br label %277

113:                                              ; preds = %108
  %114 = load ptr, ptr %5, align 8, !tbaa !9
  %115 = getelementptr inbounds ptr, ptr %114, i32 1
  store ptr %115, ptr %5, align 8, !tbaa !9
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  store ptr %116, ptr %14, align 8, !tbaa !9
  br label %290

117:                                              ; preds = %103
  %118 = load ptr, ptr %5, align 8, !tbaa !9
  %119 = load ptr, ptr %118, align 8, !tbaa !9
  %120 = call i32 @strcmp(ptr noundef %119, ptr noundef @.str.8) #8
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %131, label %122

122:                                              ; preds = %117
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = add nsw i32 %123, -1
  store i32 %124, ptr %4, align 4, !tbaa !5
  %125 = icmp slt i32 %124, 1
  br i1 %125, label %126, label %127

126:                                              ; preds = %122
  br label %277

127:                                              ; preds = %122
  %128 = load ptr, ptr %5, align 8, !tbaa !9
  %129 = getelementptr inbounds ptr, ptr %128, i32 1
  store ptr %129, ptr %5, align 8, !tbaa !9
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  store ptr %130, ptr %15, align 8, !tbaa !9
  br label %289

131:                                              ; preds = %117
  %132 = load ptr, ptr %5, align 8, !tbaa !9
  %133 = load ptr, ptr %132, align 8, !tbaa !9
  %134 = call i32 @strcmp(ptr noundef %133, ptr noundef @.str.9) #8
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %145, label %136

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

140:                                              ; preds = %136
  br label %277

141:                                              ; preds = %136
  %142 = load ptr, ptr %5, align 8, !tbaa !9
  %143 = getelementptr inbounds ptr, ptr %142, i32 1
  store ptr %143, ptr %5, align 8, !tbaa !9
  %144 = load ptr, ptr %143, align 8, !tbaa !9
  store ptr %144, ptr %16, align 8, !tbaa !9
  br label %288

145:                                              ; preds = %131
  %146 = load ptr, ptr %5, align 8, !tbaa !9
  %147 = load ptr, ptr %146, align 8, !tbaa !9
  %148 = call i32 @strcmp(ptr noundef %147, ptr noundef @.str.10) #8
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %171, label %150

150:                                              ; preds = %145
  %151 = load i32, ptr %4, align 4, !tbaa !5
  %152 = add nsw i32 %151, -1
  store i32 %152, ptr %4, align 4, !tbaa !5
  %153 = icmp slt i32 %152, 1
  br i1 %153, label %154, label %155

154:                                              ; preds = %150
  br label %277

155:                                              ; preds = %150
  %156 = load ptr, ptr %5, align 8, !tbaa !9
  %157 = getelementptr inbounds ptr, ptr %156, i32 1
  store ptr %157, ptr %5, align 8, !tbaa !9
  %158 = load ptr, ptr %157, align 8, !tbaa !9
  store ptr %158, ptr %8, align 8, !tbaa !9
  %159 = load ptr, ptr %8, align 8, !tbaa !9
  %160 = call noalias ptr @fopen(ptr noundef %159, ptr noundef @.str.11)
  store ptr %160, ptr %19, align 8, !tbaa !9
  %161 = icmp ne ptr %160, null
  br i1 %161, label %170, label %162

162:                                              ; preds = %155
  %163 = load ptr, ptr @stderr, align 8, !tbaa !9
  %164 = load ptr, ptr %7, align 8, !tbaa !9
  %165 = load ptr, ptr %8, align 8, !tbaa !9
  %166 = call ptr @__errno_location() #9
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = call ptr @strerror(i32 noundef %167) #7
  %169 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %163, ptr noundef @.str.12, ptr noundef %164, ptr noundef %165, ptr noundef %168) #7
  br label %382

170:                                              ; preds = %155
  br label %287

171:                                              ; preds = %145
  %172 = load ptr, ptr %5, align 8, !tbaa !9
  %173 = load ptr, ptr %172, align 8, !tbaa !9
  %174 = call i32 @strcmp(ptr noundef %173, ptr noundef @.str.13) #8
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %185, label %176

176:                                              ; preds = %171
  %177 = load i32, ptr %4, align 4, !tbaa !5
  %178 = add nsw i32 %177, -1
  store i32 %178, ptr %4, align 4, !tbaa !5
  %179 = icmp slt i32 %178, 1
  br i1 %179, label %180, label %181

180:                                              ; preds = %176
  br label %277

181:                                              ; preds = %176
  %182 = load ptr, ptr %5, align 8, !tbaa !9
  %183 = getelementptr inbounds ptr, ptr %182, i32 1
  store ptr %183, ptr %5, align 8, !tbaa !9
  %184 = load ptr, ptr %183, align 8, !tbaa !9
  store ptr %184, ptr %20, align 8, !tbaa !9
  br label %286

185:                                              ; preds = %171
  %186 = load ptr, ptr %5, align 8, !tbaa !9
  %187 = load ptr, ptr %186, align 8, !tbaa !9
  %188 = call i32 @strcmp(ptr noundef %187, ptr noundef @.str.14) #8
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %212, label %190

190:                                              ; preds = %185
  %191 = load i32, ptr %4, align 4, !tbaa !5
  %192 = add nsw i32 %191, -1
  store i32 %192, ptr %4, align 4, !tbaa !5
  %193 = icmp slt i32 %192, 1
  br i1 %193, label %194, label %195

194:                                              ; preds = %190
  br label %277

195:                                              ; preds = %190
  %196 = load ptr, ptr %5, align 8, !tbaa !9
  %197 = getelementptr inbounds ptr, ptr %196, i32 1
  store ptr %197, ptr %5, align 8, !tbaa !9
  %198 = load ptr, ptr %197, align 8, !tbaa !9
  store ptr %198, ptr %8, align 8, !tbaa !9
  %199 = load ptr, ptr %8, align 8, !tbaa !9
  %200 = call i64 @strlen(ptr noundef %199) #8
  %201 = icmp ugt i64 %200, 8191
  br i1 %201, label %202, label %206

202:                                              ; preds = %195
  %203 = load ptr, ptr @stderr, align 8, !tbaa !9
  %204 = load ptr, ptr %7, align 8, !tbaa !9
  %205 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %203, ptr noundef @.str.15, ptr noundef %204) #7
  br label %382

206:                                              ; preds = %195
  %207 = getelementptr inbounds [8192 x i8], ptr %22, i64 0, i64 0
  %208 = load ptr, ptr %8, align 8, !tbaa !9
  %209 = call ptr @strncpy(ptr noundef %207, ptr noundef %208, i64 noundef 8192) #7
  %210 = load ptr, ptr %8, align 8, !tbaa !9
  %211 = call i64 @strlen(ptr noundef %210) #8
  store i64 %211, ptr %23, align 8, !tbaa !11
  br label %285

212:                                              ; preds = %185
  %213 = load ptr, ptr %5, align 8, !tbaa !9
  %214 = load ptr, ptr %213, align 8, !tbaa !9
  %215 = call i32 @strcmp(ptr noundef %214, ptr noundef @.str.16) #8
  %216 = icmp ne i32 %215, 0
  br i1 %216, label %245, label %217

217:                                              ; preds = %212
  %218 = load i32, ptr %4, align 4, !tbaa !5
  %219 = add nsw i32 %218, -1
  store i32 %219, ptr %4, align 4, !tbaa !5
  %220 = icmp slt i32 %219, 1
  br i1 %220, label %221, label %222

221:                                              ; preds = %217
  br label %277

222:                                              ; preds = %217
  %223 = load ptr, ptr %5, align 8, !tbaa !9
  %224 = getelementptr inbounds ptr, ptr %223, i32 1
  store ptr %224, ptr %5, align 8, !tbaa !9
  %225 = load ptr, ptr %224, align 8, !tbaa !9
  store ptr %225, ptr %8, align 8, !tbaa !9
  %226 = load ptr, ptr %8, align 8, !tbaa !9
  %227 = call i64 @strlen(ptr noundef %226) #8
  %228 = icmp ugt i64 %227, 16382
  br i1 %228, label %229, label %233

229:                                              ; preds = %222
  %230 = load ptr, ptr @stderr, align 8, !tbaa !9
  %231 = load ptr, ptr %7, align 8, !tbaa !9
  %232 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %230, ptr noundef @.str.17, ptr noundef %231) #7
  br label %382

233:                                              ; preds = %222
  %234 = load ptr, ptr %8, align 8, !tbaa !9
  %235 = load ptr, ptr %8, align 8, !tbaa !9
  %236 = call i64 @strlen(ptr noundef %235) #8
  %237 = getelementptr inbounds [8192 x i8], ptr %22, i64 0, i64 0
  %238 = call i32 @hex_to_bytes(ptr noundef %234, i64 noundef %236, ptr noundef %237, ptr noundef %23)
  %239 = icmp ne i32 %238, 1
  br i1 %239, label %240, label %244

240:                                              ; preds = %233
  %241 = load ptr, ptr @stderr, align 8, !tbaa !9
  %242 = load ptr, ptr %7, align 8, !tbaa !9
  %243 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %241, ptr noundef @.str.18, ptr noundef %242) #7
  br label %382

244:                                              ; preds = %233
  br label %284

245:                                              ; preds = %212
  %246 = load ptr, ptr %5, align 8, !tbaa !9
  %247 = load ptr, ptr %246, align 8, !tbaa !9
  %248 = call i32 @strcmp(ptr noundef %247, ptr noundef @.str.19) #8
  %249 = icmp ne i32 %248, 0
  br i1 %249, label %271, label %250

250:                                              ; preds = %245
  %251 = load i32, ptr %4, align 4, !tbaa !5
  %252 = add nsw i32 %251, -1
  store i32 %252, ptr %4, align 4, !tbaa !5
  %253 = icmp slt i32 %252, 1
  br i1 %253, label %254, label %255

254:                                              ; preds = %250
  br label %277

255:                                              ; preds = %250
  %256 = load ptr, ptr %5, align 8, !tbaa !9
  %257 = getelementptr inbounds ptr, ptr %256, i32 1
  store ptr %257, ptr %5, align 8, !tbaa !9
  %258 = load ptr, ptr %257, align 8, !tbaa !9
  store ptr %258, ptr %24, align 8, !tbaa !9
  %259 = load ptr, ptr %24, align 8, !tbaa !9
  %260 = call noalias ptr @fopen(ptr noundef %259, ptr noundef @.str.20)
  store ptr %260, ptr %25, align 8, !tbaa !9
  %261 = icmp ne ptr %260, null
  br i1 %261, label %270, label %262

262:                                              ; preds = %255
  %263 = load ptr, ptr @stderr, align 8, !tbaa !9
  %264 = load ptr, ptr %7, align 8, !tbaa !9
  %265 = load ptr, ptr %24, align 8, !tbaa !9
  %266 = call ptr @__errno_location() #9
  %267 = load i32, ptr %266, align 4, !tbaa !5
  %268 = call ptr @strerror(i32 noundef %267) #7
  %269 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %263, ptr noundef @.str.12, ptr noundef %264, ptr noundef %265, ptr noundef %268) #7
  br label %382

270:                                              ; preds = %255
  br label %283

271:                                              ; preds = %245
  %272 = load ptr, ptr @stderr, align 8, !tbaa !9
  %273 = load ptr, ptr %7, align 8, !tbaa !9
  %274 = load ptr, ptr %5, align 8, !tbaa !9
  %275 = load ptr, ptr %274, align 8, !tbaa !9
  %276 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %272, ptr noundef @.str.21, ptr noundef %273, ptr noundef %275) #7
  br label %382

277:                                              ; preds = %254, %221, %194, %180, %154, %140, %126, %112, %98, %84, %70
  %278 = load ptr, ptr @stderr, align 8, !tbaa !9
  %279 = load ptr, ptr %7, align 8, !tbaa !9
  %280 = load ptr, ptr %5, align 8, !tbaa !9
  %281 = load ptr, ptr %280, align 8, !tbaa !9
  %282 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %278, ptr noundef @.str.22, ptr noundef %279, ptr noundef %281) #7
  br label %382

283:                                              ; preds = %270
  br label %284

284:                                              ; preds = %283, %244
  br label %285

285:                                              ; preds = %284, %206
  br label %286

286:                                              ; preds = %285, %181
  br label %287

287:                                              ; preds = %286, %170
  br label %288

288:                                              ; preds = %287, %141
  br label %289

289:                                              ; preds = %288, %127
  br label %290

290:                                              ; preds = %289, %113
  br label %291

291:                                              ; preds = %290, %99
  br label %292

292:                                              ; preds = %291, %85
  br label %293

293:                                              ; preds = %292, %71
  br label %294

294:                                              ; preds = %293
  %295 = load i32, ptr %4, align 4, !tbaa !5
  %296 = add nsw i32 %295, -1
  store i32 %296, ptr %4, align 4, !tbaa !5
  %297 = load ptr, ptr %5, align 8, !tbaa !9
  %298 = getelementptr inbounds ptr, ptr %297, i32 1
  store ptr %298, ptr %5, align 8, !tbaa !9
  br label %47, !llvm.loop !13

299:                                              ; preds = %47
  %300 = load ptr, ptr %16, align 8, !tbaa !9
  %301 = icmp ne ptr %300, null
  br i1 %301, label %309, label %302

302:                                              ; preds = %299
  %303 = load ptr, ptr @stderr, align 8, !tbaa !9
  %304 = load ptr, ptr %7, align 8, !tbaa !9
  %305 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %303, ptr noundef @.str.23, ptr noundef %304) #7
  %306 = load ptr, ptr %7, align 8, !tbaa !9
  %307 = load ptr, ptr @options, align 8, !tbaa !9
  %308 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %306, ptr noundef %307)
  br label %382

309:                                              ; preds = %299
  %310 = load ptr, ptr %19, align 8, !tbaa !9
  %311 = icmp ne ptr %310, null
  br i1 %311, label %319, label %312

312:                                              ; preds = %309
  %313 = load ptr, ptr @stderr, align 8, !tbaa !9
  %314 = load ptr, ptr %7, align 8, !tbaa !9
  %315 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %313, ptr noundef @.str.24, ptr noundef %314) #7
  %316 = load ptr, ptr %7, align 8, !tbaa !9
  %317 = load ptr, ptr @options, align 8, !tbaa !9
  %318 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %316, ptr noundef %317)
  br label %382

319:                                              ; preds = %309
  %320 = load ptr, ptr %20, align 8, !tbaa !9
  %321 = icmp ne ptr %320, null
  br i1 %321, label %329, label %322

322:                                              ; preds = %319
  %323 = load ptr, ptr @stderr, align 8, !tbaa !9
  %324 = load ptr, ptr %7, align 8, !tbaa !9
  %325 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %323, ptr noundef @.str.25, ptr noundef %324) #7
  %326 = load ptr, ptr %7, align 8, !tbaa !9
  %327 = load ptr, ptr @options, align 8, !tbaa !9
  %328 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %326, ptr noundef %327)
  br label %382

329:                                              ; preds = %319
  %330 = load ptr, ptr %20, align 8, !tbaa !9
  %331 = load ptr, ptr %19, align 8, !tbaa !9
  %332 = call i32 @sm2_private_key_info_decrypt_from_pem(ptr noundef %21, ptr noundef %330, ptr noundef %331)
  %333 = icmp ne i32 %332, 1
  br i1 %333, label %334, label %338

334:                                              ; preds = %329
  %335 = load ptr, ptr @stderr, align 8, !tbaa !9
  %336 = load ptr, ptr %7, align 8, !tbaa !9
  %337 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %335, ptr noundef @.str.26, ptr noundef %336) #7
  br label %382

338:                                              ; preds = %329
  %339 = load i64, ptr %23, align 8, !tbaa !11
  %340 = icmp ne i64 %339, 0
  br i1 %340, label %344, label %341

341:                                              ; preds = %338
  %342 = getelementptr inbounds [8192 x i8], ptr %22, i64 0, i64 0
  %343 = call ptr @strcpy(ptr noundef %342, ptr noundef @.str.27) #7
  store i64 16, ptr %23, align 8, !tbaa !11
  br label %344

344:                                              ; preds = %341, %338
  %345 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 0
  %346 = load ptr, ptr %11, align 8, !tbaa !9
  %347 = load ptr, ptr %12, align 8, !tbaa !9
  %348 = load ptr, ptr %13, align 8, !tbaa !9
  %349 = load ptr, ptr %14, align 8, !tbaa !9
  %350 = load ptr, ptr %15, align 8, !tbaa !9
  %351 = load ptr, ptr %16, align 8, !tbaa !9
  %352 = call i32 @x509_name_set(ptr noundef %345, ptr noundef %10, i64 noundef 256, ptr noundef %346, ptr noundef %347, ptr noundef %348, ptr noundef %349, ptr noundef %350, ptr noundef %351)
  %353 = icmp ne i32 %352, 1
  br i1 %353, label %354, label %358

354:                                              ; preds = %344
  %355 = load ptr, ptr @stderr, align 8, !tbaa !9
  %356 = load ptr, ptr %7, align 8, !tbaa !9
  %357 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %355, ptr noundef @.str.28, ptr noundef %356) #7
  br label %382

358:                                              ; preds = %344
  %359 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 0
  %360 = load i64, ptr %10, align 8, !tbaa !11
  %361 = getelementptr inbounds [512 x i8], ptr %17, i64 0, i64 0
  %362 = load i64, ptr %18, align 8, !tbaa !11
  %363 = getelementptr inbounds [8192 x i8], ptr %22, i64 0, i64 0
  %364 = load i64, ptr %23, align 8, !tbaa !11
  %365 = call i32 @x509_req_sign_to_der(i32 noundef 0, ptr noundef %359, i64 noundef %360, ptr noundef %21, ptr noundef %361, i64 noundef %362, i32 noundef 16, ptr noundef %21, ptr noundef %363, i64 noundef %364, ptr noundef %27, ptr noundef %28)
  %366 = icmp ne i32 %365, 1
  br i1 %366, label %367, label %371

367:                                              ; preds = %358
  %368 = load ptr, ptr @stderr, align 8, !tbaa !9
  %369 = load ptr, ptr %7, align 8, !tbaa !9
  %370 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %368, ptr noundef @.str.29, ptr noundef %369) #7
  br label %382

371:                                              ; preds = %358
  %372 = getelementptr inbounds [1024 x i8], ptr %26, i64 0, i64 0
  %373 = load i64, ptr %28, align 8, !tbaa !11
  %374 = load ptr, ptr %25, align 8, !tbaa !9
  %375 = call i32 @x509_req_to_pem(ptr noundef %372, i64 noundef %373, ptr noundef %374)
  %376 = icmp ne i32 %375, 1
  br i1 %376, label %377, label %381

377:                                              ; preds = %371
  %378 = load ptr, ptr @stderr, align 8, !tbaa !9
  %379 = load ptr, ptr %7, align 8, !tbaa !9
  %380 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %378, ptr noundef @.str.30, ptr noundef %379) #7
  br label %382

381:                                              ; preds = %371
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %382

382:                                              ; preds = %381, %377, %367, %354, %334, %322, %312, %302, %277, %271, %262, %240, %229, %202, %162, %55
  call void @gmssl_secure_clear(ptr noundef %21, i64 noundef 128)
  %383 = load ptr, ptr %19, align 8, !tbaa !9
  %384 = icmp ne ptr %383, null
  br i1 %384, label %385, label %388

385:                                              ; preds = %382
  %386 = load ptr, ptr %19, align 8, !tbaa !9
  %387 = call i32 @fclose(ptr noundef %386)
  br label %388

388:                                              ; preds = %385, %382
  %389 = load ptr, ptr %24, align 8, !tbaa !9
  %390 = icmp ne ptr %389, null
  br i1 %390, label %391, label %397

391:                                              ; preds = %388
  %392 = load ptr, ptr %25, align 8, !tbaa !9
  %393 = icmp ne ptr %392, null
  br i1 %393, label %394, label %397

394:                                              ; preds = %391
  %395 = load ptr, ptr %25, align 8, !tbaa !9
  %396 = call i32 @fclose(ptr noundef %395)
  br label %397

397:                                              ; preds = %394, %391, %388
  %398 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %398, ptr %3, align 4
  store i32 1, ptr %29, align 4
  br label %399

399:                                              ; preds = %397, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8192, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %400 = load i32, ptr %3, align 4
  ret i32 %400
}

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

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

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

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

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

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

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

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

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

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

declare i32 @hex_to_bytes(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #5

declare i32 @sm2_private_key_info_decrypt_from_pem(ptr noundef, ptr noundef, ptr noundef) #5

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

declare i32 @x509_name_set(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #5

declare i32 @x509_req_sign_to_der(i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #5

declare i32 @x509_req_to_pem(ptr noundef, i64 noundef, ptr noundef) #5

declare void @gmssl_secure_clear(ptr noundef, i64 noundef) #5

declare i32 @fclose(ptr noundef) #5

; 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { "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 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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

@stdout = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@options = external hidden local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@usage = external hidden local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 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 [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @reqgen_main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [256 x i8], align 16
  %4 = alloca i64, align 8
  %5 = alloca [512 x i8], align 16
  %6 = alloca %struct.SM2_KEY, align 8
  %7 = alloca [8192 x i8], align 16
  %8 = alloca i64, align 8
  %9 = alloca [1024 x i8], align 16
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  store i64 0, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %7) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8192) %7, i8 0, i64 8192, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  store i64 0, ptr %8, align 8, !tbaa !9
  %13 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  store ptr %9, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #9
  store i64 0, ptr %11, align 8, !tbaa !9
  %14 = icmp slt i32 %0, 2
  br i1 %14, label %16, label %.preheader.preheader

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

16:                                               ; preds = %2
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = load ptr, ptr @options, align 8, !tbaa !5
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str, ptr noundef %12, ptr noundef %18) #10
  br label %198

.preheader:                                       ; preds = %.preheader.preheader, %142
  %.0281 = phi ptr [ %.1, %142 ], [ %13, %.preheader.preheader ]
  %.092280 = phi ptr [ %.193, %142 ], [ null, %.preheader.preheader ]
  %.095279 = phi ptr [ %.196, %142 ], [ null, %.preheader.preheader ]
  %.097278 = phi ptr [ %.198, %142 ], [ null, %.preheader.preheader ]
  %.0101277 = phi ptr [ %.1102, %142 ], [ null, %.preheader.preheader ]
  %.0103276 = phi ptr [ %.1104, %142 ], [ null, %.preheader.preheader ]
  %.0105275 = phi ptr [ %.1106, %142 ], [ null, %.preheader.preheader ]
  %.0107274 = phi ptr [ %.1108, %142 ], [ null, %.preheader.preheader ]
  %.0109273 = phi ptr [ %.1110, %142 ], [ null, %.preheader.preheader ]
  %.0111272 = phi ptr [ %.1112, %142 ], [ null, %.preheader.preheader ]
  %.0113.in271 = phi i32 [ %.1114, %142 ], [ %0, %.preheader.preheader ]
  %.0116270 = phi ptr [ %143, %142 ], [ %15, %.preheader.preheader ]
  %20 = load ptr, ptr %.0116270, align 8, !tbaa !5
  %21 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.1) #11
  %.not142 = icmp eq i32 %21, 0
  br i1 %.not142, label %22, label %27

22:                                               ; preds = %.preheader
  %23 = load ptr, ptr @options, align 8, !tbaa !5
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %12, ptr noundef %23)
  %25 = load ptr, ptr @usage, align 8, !tbaa !5
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %25)
  br label %190

27:                                               ; preds = %.preheader
  %28 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.4) #11
  %.not143 = icmp eq i32 %28, 0
  br i1 %.not143, label %29, label %34

29:                                               ; preds = %27
  %30 = icmp eq i32 %.0113.in271, 2
  br i1 %30, label %139, label %31

31:                                               ; preds = %29
  %32 = getelementptr inbounds i8, ptr %.0116270, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  br label %142

34:                                               ; preds = %27
  %35 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.5) #11
  %.not144 = icmp eq i32 %35, 0
  br i1 %.not144, label %36, label %41

36:                                               ; preds = %34
  %37 = icmp eq i32 %.0113.in271, 2
  br i1 %37, label %139, label %38

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

41:                                               ; preds = %34
  %42 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.6) #11
  %.not145 = icmp eq i32 %42, 0
  br i1 %.not145, label %43, label %48

43:                                               ; preds = %41
  %44 = icmp eq i32 %.0113.in271, 2
  br i1 %44, label %139, label %45

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

48:                                               ; preds = %41
  %49 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.7) #11
  %.not146 = icmp eq i32 %49, 0
  br i1 %.not146, label %50, label %55

50:                                               ; preds = %48
  %51 = icmp eq i32 %.0113.in271, 2
  br i1 %51, label %139, label %52

52:                                               ; preds = %50
  %53 = getelementptr inbounds i8, ptr %.0116270, i64 8
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  br label %142

55:                                               ; preds = %48
  %56 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.8) #11
  %.not147 = icmp eq i32 %56, 0
  br i1 %.not147, label %57, label %62

57:                                               ; preds = %55
  %58 = icmp eq i32 %.0113.in271, 2
  br i1 %58, label %139, label %59

59:                                               ; preds = %57
  %60 = getelementptr inbounds i8, ptr %.0116270, i64 8
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  br label %142

62:                                               ; preds = %55
  %63 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.9) #11
  %.not148 = icmp eq i32 %63, 0
  br i1 %.not148, label %64, label %69

64:                                               ; preds = %62
  %65 = icmp eq i32 %.0113.in271, 2
  br i1 %65, label %139, label %66

66:                                               ; preds = %64
  %67 = getelementptr inbounds i8, ptr %.0116270, i64 8
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  br label %142

69:                                               ; preds = %62
  %70 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.10) #11
  %.not149 = icmp eq i32 %70, 0
  br i1 %.not149, label %71, label %83

71:                                               ; preds = %69
  %72 = icmp eq i32 %.0113.in271, 2
  br i1 %72, label %139, label %73

73:                                               ; preds = %71
  %74 = getelementptr inbounds i8, ptr %.0116270, i64 8
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %76 = call noalias ptr @fopen(ptr noundef %75, ptr noundef nonnull @.str.11)
  %.not150 = icmp eq ptr %76, null
  br i1 %.not150, label %77, label %142

77:                                               ; preds = %73
  %78 = load ptr, ptr @stderr, align 8, !tbaa !5
  %79 = tail call ptr @__errno_location() #12
  %80 = load i32, ptr %79, align 4, !tbaa !11
  %81 = call ptr @strerror(i32 noundef %80) #9
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str.12, ptr noundef %12, ptr noundef %75, ptr noundef %81) #10
  br label %.thread171

83:                                               ; preds = %69
  %84 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.13) #11
  %.not151 = icmp eq i32 %84, 0
  br i1 %.not151, label %85, label %90

85:                                               ; preds = %83
  %86 = icmp eq i32 %.0113.in271, 2
  br i1 %86, label %139, label %87

87:                                               ; preds = %85
  %88 = getelementptr inbounds i8, ptr %.0116270, i64 8
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  br label %142

90:                                               ; preds = %83
  %91 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.14) #11
  %.not152 = icmp eq i32 %91, 0
  br i1 %.not152, label %92, label %105

92:                                               ; preds = %90
  %93 = icmp eq i32 %.0113.in271, 2
  br i1 %93, label %139, label %94

94:                                               ; preds = %92
  %95 = getelementptr inbounds i8, ptr %.0116270, i64 8
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %96) #11
  %98 = icmp ugt i64 %97, 8191
  br i1 %98, label %99, label %102

99:                                               ; preds = %94
  %100 = load ptr, ptr @stderr, align 8, !tbaa !5
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef nonnull @.str.15, ptr noundef %12) #10
  br label %190

102:                                              ; preds = %94
  %103 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) %96, i64 noundef 8192) #9
  %104 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %96) #11
  store i64 %104, ptr %8, align 8, !tbaa !9
  br label %142

105:                                              ; preds = %90
  %106 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.16) #11
  %.not153 = icmp eq i32 %106, 0
  br i1 %.not153, label %107, label %122

107:                                              ; preds = %105
  %108 = icmp eq i32 %.0113.in271, 2
  br i1 %108, label %139, label %109

109:                                              ; preds = %107
  %110 = getelementptr inbounds i8, ptr %.0116270, i64 8
  %111 = load ptr, ptr %110, align 8, !tbaa !5
  %112 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %111) #11
  %113 = icmp ugt i64 %112, 16382
  br i1 %113, label %114, label %117

114:                                              ; preds = %109
  %115 = load ptr, ptr @stderr, align 8, !tbaa !5
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef nonnull @.str.17, ptr noundef %12) #10
  br label %190

117:                                              ; preds = %109
  %118 = call i32 @hex_to_bytes(ptr noundef %111, i64 noundef %112, ptr noundef nonnull %7, ptr noundef nonnull %8) #9
  %.not154 = icmp eq i32 %118, 1
  br i1 %.not154, label %142, 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.18, ptr noundef %12) #10
  br label %190

122:                                              ; preds = %105
  %123 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.19) #11
  %.not155 = icmp eq i32 %123, 0
  br i1 %.not155, label %124, label %136

124:                                              ; preds = %122
  %125 = icmp eq i32 %.0113.in271, 2
  br i1 %125, label %139, label %126

126:                                              ; preds = %124
  %127 = getelementptr inbounds i8, ptr %.0116270, i64 8
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  %129 = call noalias ptr @fopen(ptr noundef %128, ptr noundef nonnull @.str.20)
  %.not156 = icmp eq ptr %129, null
  br i1 %.not156, label %130, label %142

130:                                              ; preds = %126
  %131 = load ptr, ptr @stderr, align 8, !tbaa !5
  %132 = tail call ptr @__errno_location() #12
  %133 = load i32, ptr %132, align 4, !tbaa !11
  %134 = call ptr @strerror(i32 noundef %133) #9
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef nonnull @.str.12, ptr noundef %12, ptr noundef %128, ptr noundef %134) #10
  br label %190

136:                                              ; preds = %122
  %137 = load ptr, ptr @stderr, align 8, !tbaa !5
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %137, ptr noundef nonnull @.str.21, ptr noundef %12, ptr noundef %20) #10
  br label %190

139:                                              ; preds = %124, %107, %92, %85, %71, %64, %57, %50, %43, %36, %29
  %140 = load ptr, ptr @stderr, align 8, !tbaa !5
  %141 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %140, ptr noundef nonnull @.str.22, ptr noundef %12, ptr noundef %20) #10
  br label %190

142:                                              ; preds = %31, %45, %59, %73, %102, %126, %117, %87, %66, %52, %38
  %.1112 = phi ptr [ %.0111272, %126 ], [ %.0111272, %117 ], [ %.0111272, %102 ], [ %.0111272, %87 ], [ %.0111272, %73 ], [ %.0111272, %66 ], [ %.0111272, %59 ], [ %.0111272, %52 ], [ %.0111272, %45 ], [ %.0111272, %38 ], [ %33, %31 ]
  %.1110 = phi ptr [ %.0109273, %126 ], [ %.0109273, %117 ], [ %.0109273, %102 ], [ %.0109273, %87 ], [ %.0109273, %73 ], [ %.0109273, %66 ], [ %.0109273, %59 ], [ %.0109273, %52 ], [ %.0109273, %45 ], [ %40, %38 ], [ %.0109273, %31 ]
  %.1108 = phi ptr [ %.0107274, %126 ], [ %.0107274, %117 ], [ %.0107274, %102 ], [ %.0107274, %87 ], [ %.0107274, %73 ], [ %.0107274, %66 ], [ %.0107274, %59 ], [ %.0107274, %52 ], [ %47, %45 ], [ %.0107274, %38 ], [ %.0107274, %31 ]
  %.1106 = phi ptr [ %.0105275, %126 ], [ %.0105275, %117 ], [ %.0105275, %102 ], [ %.0105275, %87 ], [ %.0105275, %73 ], [ %.0105275, %66 ], [ %.0105275, %59 ], [ %54, %52 ], [ %.0105275, %45 ], [ %.0105275, %38 ], [ %.0105275, %31 ]
  %.1104 = phi ptr [ %.0103276, %126 ], [ %.0103276, %117 ], [ %.0103276, %102 ], [ %.0103276, %87 ], [ %.0103276, %73 ], [ %.0103276, %66 ], [ %61, %59 ], [ %.0103276, %52 ], [ %.0103276, %45 ], [ %.0103276, %38 ], [ %.0103276, %31 ]
  %.1102 = phi ptr [ %.0101277, %126 ], [ %.0101277, %117 ], [ %.0101277, %102 ], [ %.0101277, %87 ], [ %.0101277, %73 ], [ %68, %66 ], [ %.0101277, %59 ], [ %.0101277, %52 ], [ %.0101277, %45 ], [ %.0101277, %38 ], [ %.0101277, %31 ]
  %.198 = phi ptr [ %.097278, %126 ], [ %.097278, %117 ], [ %.097278, %102 ], [ %.097278, %87 ], [ %76, %73 ], [ %.097278, %66 ], [ %.097278, %59 ], [ %.097278, %52 ], [ %.097278, %45 ], [ %.097278, %38 ], [ %.097278, %31 ]
  %.196 = phi ptr [ %.095279, %126 ], [ %.095279, %117 ], [ %.095279, %102 ], [ %89, %87 ], [ %.095279, %73 ], [ %.095279, %66 ], [ %.095279, %59 ], [ %.095279, %52 ], [ %.095279, %45 ], [ %.095279, %38 ], [ %.095279, %31 ]
  %.193 = phi ptr [ %128, %126 ], [ %.092280, %117 ], [ %.092280, %102 ], [ %.092280, %87 ], [ %.092280, %73 ], [ %.092280, %66 ], [ %.092280, %59 ], [ %.092280, %52 ], [ %.092280, %45 ], [ %.092280, %38 ], [ %.092280, %31 ]
  %.1 = phi ptr [ %129, %126 ], [ %.0281, %117 ], [ %.0281, %102 ], [ %.0281, %87 ], [ %.0281, %73 ], [ %.0281, %66 ], [ %.0281, %59 ], [ %.0281, %52 ], [ %.0281, %45 ], [ %.0281, %38 ], [ %.0281, %31 ]
  %.1114 = add nsw i32 %.0113.in271, -2
  %143 = getelementptr inbounds i8, ptr %.0116270, i64 16
  %144 = icmp sgt i32 %.0113.in271, 3
  br i1 %144, label %.preheader, label %145, !llvm.loop !13

145:                                              ; preds = %142
  %.not = icmp eq ptr %.1102, null
  br i1 %.not, label %146, label %151

146:                                              ; preds = %145
  %147 = load ptr, ptr @stderr, align 8, !tbaa !5
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %147, ptr noundef nonnull @.str.23, ptr noundef %12) #10
  %149 = load ptr, ptr @options, align 8, !tbaa !5
  %150 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %12, ptr noundef %149)
  br label %190

151:                                              ; preds = %145
  %.not135 = icmp eq ptr %.198, null
  br i1 %.not135, label %152, label %157

152:                                              ; preds = %151
  %153 = load ptr, ptr @stderr, align 8, !tbaa !5
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef nonnull @.str.24, ptr noundef %12) #10
  %155 = load ptr, ptr @options, align 8, !tbaa !5
  %156 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %12, ptr noundef %155)
  br label %.thread171

157:                                              ; preds = %151
  %.not136 = icmp eq ptr %.196, null
  br i1 %.not136, label %158, label %163

158:                                              ; preds = %157
  %159 = load ptr, ptr @stderr, align 8, !tbaa !5
  %160 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %159, ptr noundef nonnull @.str.25, ptr noundef %12) #10
  %161 = load ptr, ptr @options, align 8, !tbaa !5
  %162 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %12, ptr noundef %161)
  br label %.thread

163:                                              ; preds = %157
  %164 = call i32 @sm2_private_key_info_decrypt_from_pem(ptr noundef nonnull %6, ptr noundef nonnull %.196, ptr noundef nonnull %.198) #9
  %.not137 = icmp eq i32 %164, 1
  br i1 %.not137, label %168, label %165

165:                                              ; preds = %163
  %166 = load ptr, ptr @stderr, align 8, !tbaa !5
  %167 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %166, ptr noundef nonnull @.str.26, ptr noundef %12) #10
  br label %.thread

168:                                              ; preds = %163
  %169 = load i64, ptr %8, align 8, !tbaa !9
  %.not138 = icmp eq i64 %169, 0
  br i1 %.not138, label %170, label %172

170:                                              ; preds = %168
  %171 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str.27) #9
  store i64 16, ptr %8, align 8, !tbaa !9
  br label %172

172:                                              ; preds = %170, %168
  %173 = call i32 @x509_name_set(ptr noundef nonnull %3, ptr noundef nonnull %4, i64 noundef 256, ptr noundef %.1112, ptr noundef %.1110, ptr noundef %.1108, ptr noundef %.1106, ptr noundef %.1104, ptr noundef nonnull %.1102) #9
  %.not139 = icmp eq i32 %173, 1
  br i1 %.not139, label %177, label %174

174:                                              ; preds = %172
  %175 = load ptr, ptr @stderr, align 8, !tbaa !5
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %175, ptr noundef nonnull @.str.28, ptr noundef %12) #10
  br label %.thread

177:                                              ; preds = %172
  %178 = load i64, ptr %4, align 8, !tbaa !9
  %179 = load i64, ptr %8, align 8, !tbaa !9
  %180 = call i32 @x509_req_sign_to_der(i32 noundef 0, ptr noundef nonnull %3, i64 noundef %178, ptr noundef nonnull %6, ptr noundef nonnull %5, i64 noundef 0, i32 noundef 16, ptr noundef nonnull %6, ptr noundef nonnull %7, i64 noundef %179, ptr noundef nonnull %10, ptr noundef nonnull %11) #9
  %.not140 = icmp eq i32 %180, 1
  br i1 %.not140, label %184, label %181

181:                                              ; preds = %177
  %182 = load ptr, ptr @stderr, align 8, !tbaa !5
  %183 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %182, ptr noundef nonnull @.str.29, ptr noundef %12) #10
  br label %.thread

184:                                              ; preds = %177
  %185 = load i64, ptr %11, align 8, !tbaa !9
  %186 = call i32 @x509_req_to_pem(ptr noundef nonnull %9, i64 noundef %185, ptr noundef %.1) #9
  %.not141 = icmp eq i32 %186, 1
  br i1 %.not141, label %.thread, label %187

187:                                              ; preds = %184
  %188 = load ptr, ptr @stderr, align 8, !tbaa !5
  %189 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %188, ptr noundef nonnull @.str.30, ptr noundef %12) #10
  br label %.thread

.thread:                                          ; preds = %165, %174, %181, %187, %158, %184
  %.0115.ph = phi i32 [ 0, %184 ], [ 1, %158 ], [ 1, %187 ], [ 1, %181 ], [ 1, %174 ], [ 1, %165 ]
  call void @gmssl_secure_clear(ptr noundef nonnull %6, i64 noundef 128) #9
  br label %191

.thread171:                                       ; preds = %77, %152
  %.092195 = phi ptr [ %.092280, %77 ], [ %.193, %152 ]
  %.0186 = phi ptr [ %.0281, %77 ], [ %.1, %152 ]
  call void @gmssl_secure_clear(ptr noundef nonnull %6, i64 noundef 128) #9
  br label %193

190:                                              ; preds = %146, %139, %136, %130, %119, %114, %99, %22
  %.097213 = phi ptr [ %.097278, %136 ], [ %.097278, %139 ], [ %.097278, %130 ], [ %.097278, %114 ], [ %.097278, %119 ], [ %.097278, %99 ], [ %.097278, %22 ], [ %.198, %146 ]
  %.0115 = phi i32 [ 1, %136 ], [ 1, %139 ], [ 1, %130 ], [ 1, %114 ], [ 1, %119 ], [ 1, %99 ], [ 0, %22 ], [ 1, %146 ]
  %.294 = phi ptr [ %.092280, %136 ], [ %.092280, %139 ], [ %128, %130 ], [ %.092280, %114 ], [ %.092280, %119 ], [ %.092280, %99 ], [ %.092280, %22 ], [ %.193, %146 ]
  %.2 = phi ptr [ %.0281, %136 ], [ %.0281, %139 ], [ null, %130 ], [ %.0281, %114 ], [ %.0281, %119 ], [ %.0281, %99 ], [ %.0281, %22 ], [ %.1, %146 ]
  call void @gmssl_secure_clear(ptr noundef nonnull %6, i64 noundef 128) #9
  %.not157 = icmp eq ptr %.097213, null
  br i1 %.not157, label %193, label %191

191:                                              ; preds = %.thread, %190
  %.097212 = phi ptr [ %.198, %.thread ], [ %.097213, %190 ]
  %.2168 = phi ptr [ %.1, %.thread ], [ %.2, %190 ]
  %.294166 = phi ptr [ %.193, %.thread ], [ %.294, %190 ]
  %.0115163 = phi i32 [ %.0115.ph, %.thread ], [ %.0115, %190 ]
  %192 = call i32 @fclose(ptr noundef nonnull %.097212)
  br label %193

193:                                              ; preds = %.thread171, %191, %190
  %.2169 = phi ptr [ %.2168, %191 ], [ %.2, %190 ], [ %.0186, %.thread171 ]
  %.294167 = phi ptr [ %.294166, %191 ], [ %.294, %190 ], [ %.092195, %.thread171 ]
  %.0115164 = phi i32 [ %.0115163, %191 ], [ %.0115, %190 ], [ 1, %.thread171 ]
  %194 = icmp ne ptr %.294167, null
  %195 = icmp ne ptr %.2169, null
  %or.cond = select i1 %194, i1 %195, i1 false
  br i1 %or.cond, label %196, label %198

196:                                              ; preds = %193
  %197 = call i32 @fclose(ptr noundef nonnull %.2169)
  br label %198

198:                                              ; preds = %193, %196, %16
  %.0100 = phi i32 [ 1, %16 ], [ %.0115164, %196 ], [ %.0115164, %193 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #9
  ret i32 %.0100
}

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #7

declare i32 @hex_to_bytes(ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #8

declare i32 @sm2_private_key_info_decrypt_from_pem(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #8

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #7

declare i32 @x509_name_set(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #8

declare i32 @x509_req_sign_to_der(i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #8

declare i32 @x509_req_to_pem(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #8

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

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

; 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { cold nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind willreturn memory(none) }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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