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

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

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

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

30:                                               ; preds = %2
  %31 = load ptr, ptr @stderr, align 8, !tbaa !9
  %32 = load ptr, ptr %7, align 8, !tbaa !9
  %33 = load ptr, ptr @usage, align 8, !tbaa !9
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str, ptr noundef %32, ptr noundef %33) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %316

35:                                               ; preds = %2
  br label %36

36:                                               ; preds = %213, %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %39, label %218

39:                                               ; preds = %36
  %40 = load ptr, ptr %5, align 8, !tbaa !9
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = call i32 @strcmp(ptr noundef %41, ptr noundef @.str.1) #8
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %48, label %44

44:                                               ; preds = %39
  %45 = load ptr, ptr %7, align 8, !tbaa !9
  %46 = load ptr, ptr @options, align 8, !tbaa !9
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %45, ptr noundef %46)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %303

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

53:                                               ; preds = %48
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr %4, align 4, !tbaa !5
  %56 = icmp slt i32 %55, 1
  br i1 %56, label %57, label %58

57:                                               ; preds = %53
  br label %200

58:                                               ; preds = %53
  %59 = load ptr, ptr %5, align 8, !tbaa !9
  %60 = getelementptr inbounds ptr, ptr %59, i32 1
  store ptr %60, ptr %5, align 8, !tbaa !9
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  store ptr %61, ptr %8, align 8, !tbaa !9
  br label %212

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

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

71:                                               ; preds = %67
  br label %200

72:                                               ; preds = %67
  %73 = load ptr, ptr %5, align 8, !tbaa !9
  %74 = getelementptr inbounds ptr, ptr %73, i32 1
  store ptr %74, ptr %5, align 8, !tbaa !9
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  store ptr %75, ptr %9, align 8, !tbaa !9
  %76 = load ptr, ptr %9, align 8, !tbaa !9
  %77 = call i64 @strlen(ptr noundef %76) #8
  %78 = icmp ugt i64 %77, 128
  br i1 %78, label %79, label %83

79:                                               ; preds = %72
  %80 = load ptr, ptr @stderr, align 8, !tbaa !9
  %81 = load ptr, ptr %7, align 8, !tbaa !9
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef @.str.4, ptr noundef %81) #7
  br label %303

83:                                               ; preds = %72
  %84 = load ptr, ptr %9, align 8, !tbaa !9
  %85 = load ptr, ptr %9, align 8, !tbaa !9
  %86 = call i64 @strlen(ptr noundef %85) #8
  %87 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %88 = call i32 @hex_to_bytes(ptr noundef %84, i64 noundef %86, ptr noundef %87, ptr noundef %11)
  %89 = icmp ne i32 %88, 1
  br i1 %89, label %90, label %94

90:                                               ; preds = %83
  %91 = load ptr, ptr @stderr, align 8, !tbaa !9
  %92 = load ptr, ptr %7, align 8, !tbaa !9
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef @.str.5, ptr noundef %92) #7
  br label %303

94:                                               ; preds = %83
  %95 = load i64, ptr %11, align 8, !tbaa !11
  %96 = icmp ult i64 %95, 1
  br i1 %96, label %100, label %97

97:                                               ; preds = %94
  %98 = load i64, ptr %11, align 8, !tbaa !11
  %99 = icmp ugt i64 %98, 64
  br i1 %99, label %100, label %104

100:                                              ; preds = %97, %94
  %101 = load ptr, ptr @stderr, align 8, !tbaa !9
  %102 = load ptr, ptr %7, align 8, !tbaa !9
  %103 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef @.str.4, ptr noundef %102) #7
  br label %303

104:                                              ; preds = %97
  br label %211

105:                                              ; preds = %62
  %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.6) #8
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %130, 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 %200

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
  %119 = call i32 @atoi(ptr noundef %118) #8
  store i32 %119, ptr %12, align 4, !tbaa !5
  %120 = load i32, ptr %12, align 4, !tbaa !5
  %121 = icmp slt i32 %120, 10000
  br i1 %121, label %125, label %122

122:                                              ; preds = %115
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = icmp sgt i32 %123, 16777215
  br i1 %124, label %125, label %129

125:                                              ; preds = %122, %115
  %126 = load ptr, ptr @stderr, align 8, !tbaa !9
  %127 = load ptr, ptr %7, align 8, !tbaa !9
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef @.str.7, ptr noundef %127) #7
  br label %303

129:                                              ; preds = %122
  br label %210

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

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

139:                                              ; preds = %135
  br label %200

140:                                              ; preds = %135
  %141 = load ptr, ptr %5, align 8, !tbaa !9
  %142 = getelementptr inbounds ptr, ptr %141, i32 1
  store ptr %142, ptr %5, align 8, !tbaa !9
  %143 = load ptr, ptr %142, align 8, !tbaa !9
  %144 = call i32 @atoi(ptr noundef %143) #8
  store i32 %144, ptr %13, align 4, !tbaa !5
  %145 = load i32, ptr %13, align 4, !tbaa !5
  %146 = icmp slt i32 %145, 1
  br i1 %146, label %151, label %147

147:                                              ; preds = %140
  %148 = load i32, ptr %13, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = icmp ugt i64 %149, 64
  br i1 %150, label %151, label %155

151:                                              ; preds = %147, %140
  %152 = load ptr, ptr @stderr, align 8, !tbaa !9
  %153 = load ptr, ptr %7, align 8, !tbaa !9
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %152, ptr noundef @.str.9, ptr noundef %153) #7
  br label %303

155:                                              ; preds = %147
  br label %209

156:                                              ; preds = %130
  %157 = load ptr, ptr %5, align 8, !tbaa !9
  %158 = load ptr, ptr %157, align 8, !tbaa !9
  %159 = call i32 @strcmp(ptr noundef %158, ptr noundef @.str.10) #8
  %160 = icmp ne i32 %159, 0
  br i1 %160, label %162, label %161

161:                                              ; preds = %156
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %208

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

167:                                              ; preds = %162
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %207

168:                                              ; preds = %162
  %169 = load ptr, ptr %5, align 8, !tbaa !9
  %170 = load ptr, ptr %169, align 8, !tbaa !9
  %171 = call i32 @strcmp(ptr noundef %170, ptr noundef @.str.12) #8
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %194, label %173

173:                                              ; preds = %168
  %174 = load i32, ptr %4, align 4, !tbaa !5
  %175 = add nsw i32 %174, -1
  store i32 %175, ptr %4, align 4, !tbaa !5
  %176 = icmp slt i32 %175, 1
  br i1 %176, label %177, label %178

177:                                              ; preds = %173
  br label %200

178:                                              ; preds = %173
  %179 = load ptr, ptr %5, align 8, !tbaa !9
  %180 = getelementptr inbounds ptr, ptr %179, i32 1
  store ptr %180, ptr %5, align 8, !tbaa !9
  %181 = load ptr, ptr %180, align 8, !tbaa !9
  store ptr %181, ptr %15, align 8, !tbaa !9
  %182 = load ptr, ptr %15, align 8, !tbaa !9
  %183 = call noalias ptr @fopen(ptr noundef %182, ptr noundef @.str.13)
  store ptr %183, ptr %17, align 8, !tbaa !9
  %184 = icmp ne ptr %183, null
  br i1 %184, label %193, label %185

185:                                              ; preds = %178
  %186 = load ptr, ptr @stderr, align 8, !tbaa !9
  %187 = load ptr, ptr %7, align 8, !tbaa !9
  %188 = load ptr, ptr %15, align 8, !tbaa !9
  %189 = call ptr @__errno_location() #9
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = call ptr @strerror(i32 noundef %190) #7
  %192 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %186, ptr noundef @.str.14, ptr noundef %187, ptr noundef %188, ptr noundef %191) #7
  br label %303

193:                                              ; preds = %178
  br label %206

194:                                              ; preds = %168
  %195 = load ptr, ptr @stderr, align 8, !tbaa !9
  %196 = load ptr, ptr %7, align 8, !tbaa !9
  %197 = load ptr, ptr %5, align 8, !tbaa !9
  %198 = load ptr, ptr %197, align 8, !tbaa !9
  %199 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %195, ptr noundef @.str.15, ptr noundef %196, ptr noundef %198) #7
  br label %303

200:                                              ; preds = %177, %139, %114, %71, %57
  %201 = load ptr, ptr @stderr, align 8, !tbaa !9
  %202 = load ptr, ptr %7, align 8, !tbaa !9
  %203 = load ptr, ptr %5, align 8, !tbaa !9
  %204 = load ptr, ptr %203, align 8, !tbaa !9
  %205 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %201, ptr noundef @.str.16, ptr noundef %202, ptr noundef %204) #7
  br label %303

206:                                              ; preds = %193
  br label %207

207:                                              ; preds = %206, %167
  br label %208

208:                                              ; preds = %207, %161
  br label %209

209:                                              ; preds = %208, %155
  br label %210

210:                                              ; preds = %209, %129
  br label %211

211:                                              ; preds = %210, %104
  br label %212

212:                                              ; preds = %211, %58
  br label %213

213:                                              ; preds = %212
  %214 = load i32, ptr %4, align 4, !tbaa !5
  %215 = add nsw i32 %214, -1
  store i32 %215, ptr %4, align 4, !tbaa !5
  %216 = load ptr, ptr %5, align 8, !tbaa !9
  %217 = getelementptr inbounds ptr, ptr %216, i32 1
  store ptr %217, ptr %5, align 8, !tbaa !9
  br label %36, !llvm.loop !13

218:                                              ; preds = %36
  %219 = load ptr, ptr %8, align 8, !tbaa !9
  %220 = icmp ne ptr %219, null
  br i1 %220, label %225, label %221

221:                                              ; preds = %218
  %222 = load ptr, ptr @stderr, align 8, !tbaa !9
  %223 = load ptr, ptr %7, align 8, !tbaa !9
  %224 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %222, ptr noundef @.str.17, ptr noundef %223) #7
  br label %303

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

228:                                              ; preds = %225
  %229 = load ptr, ptr @stderr, align 8, !tbaa !9
  %230 = load ptr, ptr %7, align 8, !tbaa !9
  %231 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %229, ptr noundef @.str.18, ptr noundef %230) #7
  br label %303

232:                                              ; preds = %225
  %233 = load i32, ptr %12, align 4, !tbaa !5
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %239, label %235

235:                                              ; preds = %232
  %236 = load ptr, ptr @stderr, align 8, !tbaa !9
  %237 = load ptr, ptr %7, align 8, !tbaa !9
  %238 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %236, ptr noundef @.str.19, ptr noundef %237) #7
  br label %303

239:                                              ; preds = %232
  %240 = load i32, ptr %13, align 4, !tbaa !5
  %241 = icmp ne i32 %240, 0
  br i1 %241, label %246, label %242

242:                                              ; preds = %239
  %243 = load ptr, ptr @stderr, align 8, !tbaa !9
  %244 = load ptr, ptr %7, align 8, !tbaa !9
  %245 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %243, ptr noundef @.str.20, ptr noundef %244) #7
  br label %303

246:                                              ; preds = %239
  %247 = load ptr, ptr %8, align 8, !tbaa !9
  %248 = load ptr, ptr %8, align 8, !tbaa !9
  %249 = call i64 @strlen(ptr noundef %248) #8
  %250 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  %251 = load i64, ptr %11, align 8, !tbaa !11
  %252 = load i32, ptr %12, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = load i32, ptr %13, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %257 = call i32 @sm3_pbkdf2(ptr noundef %247, i64 noundef %249, ptr noundef %250, i64 noundef %251, i64 noundef %253, i64 noundef %255, ptr noundef %256)
  %258 = icmp ne i32 %257, 1
  br i1 %258, label %259, label %263

259:                                              ; preds = %246
  %260 = load ptr, ptr @stderr, align 8, !tbaa !9
  %261 = load ptr, ptr %7, align 8, !tbaa !9
  %262 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %260, ptr noundef @.str.21, ptr noundef %261) #7
  br label %303

263:                                              ; preds = %246
  %264 = load i32, ptr %14, align 4, !tbaa !5
  %265 = icmp ne i32 %264, 0
  br i1 %265, label %266, label %283

266:                                              ; preds = %263
  %267 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  %268 = load i32, ptr %13, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = load ptr, ptr %17, align 8, !tbaa !9
  %271 = call i64 @fwrite(ptr noundef %267, i64 noundef 1, i64 noundef %269, ptr noundef %270)
  %272 = load i32, ptr %13, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = icmp ne i64 %271, %273
  br i1 %274, label %275, label %282

275:                                              ; preds = %266
  %276 = load ptr, ptr @stderr, align 8, !tbaa !9
  %277 = load ptr, ptr %7, align 8, !tbaa !9
  %278 = call ptr @__errno_location() #9
  %279 = load i32, ptr %278, align 4, !tbaa !5
  %280 = call ptr @strerror(i32 noundef %279) #7
  %281 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %276, ptr noundef @.str.22, ptr noundef %277, ptr noundef %280) #7
  br label %303

282:                                              ; preds = %266
  br label %302

283:                                              ; preds = %263
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %284

284:                                              ; preds = %296, %283
  %285 = load i32, ptr %18, align 4, !tbaa !5
  %286 = load i32, ptr %13, align 4, !tbaa !5
  %287 = icmp slt i32 %285, %286
  br i1 %287, label %288, label %299

288:                                              ; preds = %284
  %289 = load ptr, ptr %17, align 8, !tbaa !9
  %290 = load i32, ptr %18, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 %291
  %293 = load i8, ptr %292, align 1, !tbaa !15
  %294 = zext i8 %293 to i32
  %295 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %289, ptr noundef @.str.23, i32 noundef %294) #7
  br label %296

296:                                              ; preds = %288
  %297 = load i32, ptr %18, align 4, !tbaa !5
  %298 = add nsw i32 %297, 1
  store i32 %298, ptr %18, align 4, !tbaa !5
  br label %284, !llvm.loop !16

299:                                              ; preds = %284
  %300 = load ptr, ptr %17, align 8, !tbaa !9
  %301 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %300, ptr noundef @.str.24) #7
  br label %302

302:                                              ; preds = %299, %282
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %303

303:                                              ; preds = %302, %275, %259, %242, %235, %228, %221, %200, %194, %185, %151, %125, %100, %90, %79, %44
  %304 = getelementptr inbounds [64 x i8], ptr %16, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %304, i64 noundef 64)
  %305 = getelementptr inbounds [64 x i8], ptr %10, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %305, i64 noundef 64)
  %306 = load ptr, ptr %15, align 8, !tbaa !9
  %307 = icmp ne ptr %306, null
  br i1 %307, label %308, label %314

308:                                              ; preds = %303
  %309 = load ptr, ptr %17, align 8, !tbaa !9
  %310 = icmp ne ptr %309, null
  br i1 %310, label %311, label %314

311:                                              ; preds = %308
  %312 = load ptr, ptr %17, align 8, !tbaa !9
  %313 = call i32 @fclose(ptr noundef %312)
  br label %314

314:                                              ; preds = %311, %308, %303
  %315 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %315, ptr %3, align 4
  store i32 1, ptr %19, align 4
  br label %316

316:                                              ; preds = %314, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %317 = load i32, ptr %3, align 4
  ret i32 %317
}

; 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

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

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #5

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

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

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

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

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 = { inlinehint nounwind willreturn memory(read) 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 #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"}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !14}


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

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

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

.preheader129:                                    ; preds = %2
  %8 = load ptr, ptr @stdout, align 8, !tbaa !5
  br label %13

9:                                                ; preds = %2
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  %11 = load ptr, ptr @usage, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str, ptr noundef %6, ptr noundef %11) #9
  br label %149

13:                                               ; preds = %.preheader129, %102
  %.082212 = phi ptr [ %8, %.preheader129 ], [ %.1, %102 ]
  %.083211 = phi ptr [ null, %.preheader129 ], [ %.184, %102 ]
  %.086210 = phi i32 [ 0, %.preheader129 ], [ %.187, %102 ]
  %.088209 = phi i32 [ 0, %.preheader129 ], [ %.189, %102 ]
  %.090208 = phi i32 [ 0, %.preheader129 ], [ %.191, %102 ]
  %.092207 = phi ptr [ null, %.preheader129 ], [ %.193, %102 ]
  %.094206 = phi ptr [ null, %.preheader129 ], [ %.195, %102 ]
  %.pn205 = phi ptr [ %1, %.preheader129 ], [ %.199, %102 ]
  %.0100.in204 = phi i32 [ %0, %.preheader129 ], [ %.1101, %102 ]
  %.098213 = getelementptr inbounds i8, ptr %.pn205, i64 8
  %.0100214 = add nsw i32 %.0100.in204, -1
  %14 = load ptr, ptr %.098213, align 8, !tbaa !5
  %15 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %14, ptr noundef nonnull dereferenceable(1) @.str.1) #10
  %.not119 = icmp eq i32 %15, 0
  br i1 %.not119, label %16, label %19

16:                                               ; preds = %13
  %17 = load ptr, ptr @options, align 8, !tbaa !5
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %6, ptr noundef %17)
  br label %144

19:                                               ; preds = %13
  %20 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %14, ptr noundef nonnull dereferenceable(1) @.str.2) #10
  %.not120 = icmp eq i32 %20, 0
  br i1 %.not120, label %21, label %27

21:                                               ; preds = %19
  %22 = icmp eq i32 %.0100.in204, 2
  br i1 %22, label %99, label %23

23:                                               ; preds = %21
  %24 = add nsw i32 %.0100.in204, -2
  %25 = getelementptr inbounds i8, ptr %.pn205, i64 16
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  br label %102

27:                                               ; preds = %19
  %28 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %14, ptr noundef nonnull dereferenceable(1) @.str.3) #10
  %.not121 = icmp eq i32 %28, 0
  br i1 %.not121, label %29, label %51

29:                                               ; preds = %27
  %30 = add nsw i32 %.0100.in204, -2
  %31 = icmp eq i32 %.0100.in204, 2
  br i1 %31, label %99, label %32

32:                                               ; preds = %29
  %33 = getelementptr inbounds i8, ptr %.pn205, i64 16
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %34) #10
  %36 = icmp ugt i64 %35, 128
  br i1 %36, label %37, label %40

37:                                               ; preds = %32
  %38 = load ptr, ptr @stderr, align 8, !tbaa !5
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.4, ptr noundef %6) #9
  br label %144

40:                                               ; preds = %32
  %41 = call i32 @hex_to_bytes(ptr noundef %34, i64 noundef %35, ptr noundef nonnull %3, ptr noundef nonnull %4) #8
  %.not122 = icmp eq i32 %41, 1
  br i1 %.not122, label %45, label %42

42:                                               ; preds = %40
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.5, ptr noundef %6) #9
  br label %144

45:                                               ; preds = %40
  %46 = load i64, ptr %4, align 8
  %47 = add i64 %46, -65
  %or.cond = icmp ult i64 %47, -64
  br i1 %or.cond, label %48, label %102

48:                                               ; preds = %45
  %49 = load ptr, ptr @stderr, align 8, !tbaa !5
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.4, ptr noundef %6) #9
  br label %144

51:                                               ; preds = %27
  %52 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %14, ptr noundef nonnull dereferenceable(1) @.str.6) #10
  %.not123 = icmp eq i32 %52, 0
  br i1 %.not123, label %53, label %64

53:                                               ; preds = %51
  %54 = icmp eq i32 %.0100.in204, 2
  br i1 %54, label %99, label %55

55:                                               ; preds = %53
  %56 = add nsw i32 %.0100.in204, -2
  %57 = getelementptr inbounds i8, ptr %.pn205, i64 16
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = call i32 @atoi(ptr nocapture noundef %58) #10
  %60 = add i32 %59, -16777216
  %or.cond3 = icmp ult i32 %60, -16767216
  br i1 %or.cond3, label %61, label %102

61:                                               ; preds = %55
  %62 = load ptr, ptr @stderr, align 8, !tbaa !5
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef nonnull @.str.7, ptr noundef %6) #9
  br label %144

64:                                               ; preds = %51
  %65 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %14, ptr noundef nonnull dereferenceable(1) @.str.8) #10
  %.not124 = icmp eq i32 %65, 0
  br i1 %.not124, label %66, label %77

66:                                               ; preds = %64
  %67 = icmp eq i32 %.0100.in204, 2
  br i1 %67, label %99, label %68

68:                                               ; preds = %66
  %69 = add nsw i32 %.0100.in204, -2
  %70 = getelementptr inbounds i8, ptr %.pn205, i64 16
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  %72 = call i32 @atoi(ptr nocapture noundef %71) #10
  %73 = add i32 %72, -65
  %or.cond6 = icmp ult i32 %73, -64
  br i1 %or.cond6, label %74, label %102

74:                                               ; preds = %68
  %75 = load ptr, ptr @stderr, align 8, !tbaa !5
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull @.str.9, ptr noundef %6) #9
  br label %144

77:                                               ; preds = %64
  %78 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %14, ptr noundef nonnull dereferenceable(1) @.str.10) #10
  %.not125 = icmp eq i32 %78, 0
  br i1 %.not125, label %102, label %79

79:                                               ; preds = %77
  %80 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %14, ptr noundef nonnull dereferenceable(1) @.str.11) #10
  %.not126 = icmp eq i32 %80, 0
  br i1 %.not126, label %102, label %81

81:                                               ; preds = %79
  %82 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %14, ptr noundef nonnull dereferenceable(1) @.str.12) #10
  %.not127 = icmp eq i32 %82, 0
  br i1 %.not127, label %83, label %96

83:                                               ; preds = %81
  %84 = icmp eq i32 %.0100.in204, 2
  br i1 %84, label %99, label %85

85:                                               ; preds = %83
  %86 = add nsw i32 %.0100.in204, -2
  %87 = getelementptr inbounds i8, ptr %.pn205, i64 16
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  %89 = call noalias ptr @fopen(ptr noundef %88, ptr noundef nonnull @.str.13)
  %.not128 = icmp eq ptr %89, null
  br i1 %.not128, label %90, label %102

90:                                               ; preds = %85
  %91 = load ptr, ptr @stderr, align 8, !tbaa !5
  %92 = tail call ptr @__errno_location() #11
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = call ptr @strerror(i32 noundef %93) #8
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef nonnull @.str.14, ptr noundef %6, ptr noundef %88, ptr noundef %94) #9
  br label %144

96:                                               ; preds = %81
  %97 = load ptr, ptr @stderr, align 8, !tbaa !5
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef nonnull @.str.15, ptr noundef %6, ptr noundef %14) #9
  br label %144

99:                                               ; preds = %83, %66, %53, %29, %21
  %100 = load ptr, ptr @stderr, align 8, !tbaa !5
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef nonnull @.str.16, ptr noundef %6, ptr noundef %14) #9
  br label %144

102:                                              ; preds = %79, %77, %23, %55, %85, %68, %45
  %.1101 = phi i32 [ %86, %85 ], [ %69, %68 ], [ %56, %55 ], [ %30, %45 ], [ %24, %23 ], [ %.0100214, %77 ], [ %.0100214, %79 ]
  %.199 = phi ptr [ %87, %85 ], [ %70, %68 ], [ %57, %55 ], [ %33, %45 ], [ %25, %23 ], [ %.098213, %77 ], [ %.098213, %79 ]
  %.195 = phi ptr [ %.094206, %85 ], [ %.094206, %68 ], [ %.094206, %55 ], [ %.094206, %45 ], [ %26, %23 ], [ %.094206, %77 ], [ %.094206, %79 ]
  %.193 = phi ptr [ %.092207, %85 ], [ %.092207, %68 ], [ %.092207, %55 ], [ %34, %45 ], [ %.092207, %23 ], [ %.092207, %77 ], [ %.092207, %79 ]
  %.191 = phi i32 [ %.090208, %85 ], [ %.090208, %68 ], [ %59, %55 ], [ %.090208, %45 ], [ %.090208, %23 ], [ %.090208, %77 ], [ %.090208, %79 ]
  %.189 = phi i32 [ %.088209, %85 ], [ %72, %68 ], [ %.088209, %55 ], [ %.088209, %45 ], [ %.088209, %23 ], [ %.088209, %77 ], [ %.088209, %79 ]
  %.187 = phi i32 [ %.086210, %85 ], [ %.086210, %68 ], [ %.086210, %55 ], [ %.086210, %45 ], [ %.086210, %23 ], [ 0, %77 ], [ 1, %79 ]
  %.184 = phi ptr [ %88, %85 ], [ %.083211, %68 ], [ %.083211, %55 ], [ %.083211, %45 ], [ %.083211, %23 ], [ %.083211, %77 ], [ %.083211, %79 ]
  %.1 = phi ptr [ %89, %85 ], [ %.082212, %68 ], [ %.082212, %55 ], [ %.082212, %45 ], [ %.082212, %23 ], [ %.082212, %77 ], [ %.082212, %79 ]
  %103 = icmp sgt i32 %.1101, 1
  br i1 %103, label %13, label %104, !llvm.loop !11

104:                                              ; preds = %102
  %.not = icmp eq ptr %.195, null
  br i1 %.not, label %105, label %108

105:                                              ; preds = %104
  %106 = load ptr, ptr @stderr, align 8, !tbaa !5
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef nonnull @.str.17, ptr noundef %6) #9
  br label %144

108:                                              ; preds = %104
  %.not113 = icmp eq ptr %.193, null
  br i1 %.not113, label %109, label %112

109:                                              ; preds = %108
  %110 = load ptr, ptr @stderr, align 8, !tbaa !5
  %111 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef nonnull @.str.18, ptr noundef %6) #9
  br label %144

112:                                              ; preds = %108
  %.not114 = icmp eq i32 %.191, 0
  br i1 %.not114, label %113, label %116

113:                                              ; preds = %112
  %114 = load ptr, ptr @stderr, align 8, !tbaa !5
  %115 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef nonnull @.str.19, ptr noundef %6) #9
  br label %144

116:                                              ; preds = %112
  %.not115 = icmp eq i32 %.189, 0
  br i1 %.not115, label %117, label %120

117:                                              ; preds = %116
  %118 = load ptr, ptr @stderr, align 8, !tbaa !5
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef nonnull @.str.20, ptr noundef %6) #9
  br label %144

120:                                              ; preds = %116
  %121 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.195) #10
  %122 = load i64, ptr %4, align 8, !tbaa !13
  %123 = sext i32 %.191 to i64
  %124 = zext i32 %.189 to i64
  %125 = call i32 @sm3_pbkdf2(ptr noundef nonnull %.195, i64 noundef %121, ptr noundef nonnull %3, i64 noundef %122, i64 noundef %123, i64 noundef %124, ptr noundef nonnull %5) #8
  %.not116 = icmp eq i32 %125, 1
  br i1 %.not116, label %129, label %126

126:                                              ; preds = %120
  %127 = load ptr, ptr @stderr, align 8, !tbaa !5
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef nonnull @.str.21, ptr noundef %6) #9
  br label %144

129:                                              ; preds = %120
  %.not117 = icmp eq i32 %.187, 0
  br i1 %.not117, label %.preheader, label %131

.preheader:                                       ; preds = %129
  %130 = icmp sgt i32 %.189, 0
  br i1 %130, label %.lr.ph, label %._crit_edge

131:                                              ; preds = %129
  %132 = call i64 @fwrite(ptr noundef nonnull %5, i64 noundef 1, i64 noundef %124, ptr noundef %.1)
  %.not118 = icmp eq i64 %132, %124
  br i1 %.not118, label %144, label %133

133:                                              ; preds = %131
  %134 = load ptr, ptr @stderr, align 8, !tbaa !5
  %135 = tail call ptr @__errno_location() #11
  %136 = load i32, ptr %135, align 4, !tbaa !9
  %137 = call ptr @strerror(i32 noundef %136) #8
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef nonnull @.str.22, ptr noundef %6, ptr noundef %137) #9
  br label %144

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %139 = getelementptr inbounds [64 x i8], ptr %5, i64 0, i64 %indvars.iv
  %140 = load i8, ptr %139, align 1, !tbaa !15
  %141 = zext i8 %140 to i32
  %142 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.1, ptr noundef nonnull @.str.23, i32 noundef %141) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %124
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.1, ptr noundef nonnull @.str.24) #8
  br label %144

144:                                              ; preds = %._crit_edge, %131, %133, %126, %117, %113, %109, %105, %99, %96, %90, %74, %61, %48, %42, %37, %16
  %.097 = phi i32 [ 1, %96 ], [ 1, %99 ], [ 1, %90 ], [ 1, %74 ], [ 1, %61 ], [ 1, %37 ], [ 1, %42 ], [ 1, %48 ], [ 0, %16 ], [ 1, %126 ], [ 1, %133 ], [ 1, %117 ], [ 1, %113 ], [ 1, %109 ], [ 1, %105 ], [ 0, %131 ], [ 0, %._crit_edge ]
  %.285 = phi ptr [ %.083211, %96 ], [ %.083211, %99 ], [ %88, %90 ], [ %.083211, %74 ], [ %.083211, %61 ], [ %.083211, %37 ], [ %.083211, %42 ], [ %.083211, %48 ], [ %.083211, %16 ], [ %.184, %126 ], [ %.184, %133 ], [ %.184, %117 ], [ %.184, %113 ], [ %.184, %109 ], [ %.184, %105 ], [ %.184, %131 ], [ %.184, %._crit_edge ]
  %.2 = phi ptr [ %.082212, %96 ], [ %.082212, %99 ], [ null, %90 ], [ %.082212, %74 ], [ %.082212, %61 ], [ %.082212, %37 ], [ %.082212, %42 ], [ %.082212, %48 ], [ %.082212, %16 ], [ %.1, %126 ], [ %.1, %133 ], [ %.1, %117 ], [ %.1, %113 ], [ %.1, %109 ], [ %.1, %105 ], [ %.1, %131 ], [ %.1, %._crit_edge ]
  call void @gmssl_secure_clear(ptr noundef nonnull %5, i64 noundef 64) #8
  call void @gmssl_secure_clear(ptr noundef nonnull %3, i64 noundef 64) #8
  %145 = icmp ne ptr %.285, null
  %146 = icmp ne ptr %.2, null
  %or.cond8 = select i1 %145, i1 %146, i1 false
  br i1 %or.cond8, label %147, label %149

147:                                              ; preds = %144
  %148 = call i32 @fclose(ptr noundef nonnull %.2)
  br label %149

149:                                              ; preds = %144, %147, %9
  %.096 = phi i32 [ 1, %9 ], [ %.097, %147 ], [ %.097, %144 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #8
  ret i32 %.096
}

; 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #5

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

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

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

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

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

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

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


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