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

; 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.ZUC_CTX = type { %struct.ZUC_STATE, [4 x i8], i64 }
%struct.ZUC_STATE = type { [16 x i32], i32, i32 }

@stdin = external global ptr, align 8
@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 [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [28 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 [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1

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

35:                                               ; preds = %2
  %36 = load ptr, ptr @stderr, align 8, !tbaa !9
  %37 = load ptr, ptr %7, align 8, !tbaa !9
  %38 = load ptr, ptr @options, align 8, !tbaa !9
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef @.str, ptr noundef %37, ptr noundef %38) #6
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %293

40:                                               ; preds = %2
  br label %41

41:                                               ; preds = %187, %40
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %192

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

49:                                               ; preds = %44
  %50 = load ptr, ptr %7, align 8, !tbaa !9
  %51 = load ptr, ptr @options, align 8, !tbaa !9
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %50, ptr noundef %51)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %269

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

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

62:                                               ; preds = %58
  br label %177

63:                                               ; preds = %58
  %64 = load ptr, ptr %5, align 8, !tbaa !9
  %65 = getelementptr inbounds ptr, ptr %64, i32 1
  store ptr %65, ptr %5, align 8, !tbaa !9
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  store ptr %66, ptr %8, align 8, !tbaa !9
  %67 = load ptr, ptr %8, align 8, !tbaa !9
  %68 = call i64 @strlen(ptr noundef %67) #7
  %69 = icmp ne i64 %68, 32
  br i1 %69, label %70, label %74

70:                                               ; preds = %63
  %71 = load ptr, ptr @stderr, align 8, !tbaa !9
  %72 = load ptr, ptr %7, align 8, !tbaa !9
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef @.str.3, ptr noundef %72) #6
  br label %269

74:                                               ; preds = %63
  %75 = load ptr, ptr %8, align 8, !tbaa !9
  %76 = load ptr, ptr %8, align 8, !tbaa !9
  %77 = call i64 @strlen(ptr noundef %76) #7
  %78 = getelementptr inbounds [16 x i8], ptr %12, i64 0, i64 0
  %79 = call i32 @hex_to_bytes(ptr noundef %75, i64 noundef %77, ptr noundef %78, ptr noundef %14)
  %80 = icmp ne i32 %79, 1
  br i1 %80, label %81, label %85

81:                                               ; preds = %74
  %82 = load ptr, ptr @stderr, align 8, !tbaa !9
  %83 = load ptr, ptr %7, align 8, !tbaa !9
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.4, ptr noundef %83) #6
  br label %269

85:                                               ; preds = %74
  br label %186

86:                                               ; preds = %53
  %87 = load ptr, ptr %5, align 8, !tbaa !9
  %88 = load ptr, ptr %87, align 8, !tbaa !9
  %89 = call i32 @strcmp(ptr noundef %88, ptr noundef @.str.5) #7
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %119, label %91

91:                                               ; preds = %86
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = add nsw i32 %92, -1
  store i32 %93, ptr %4, align 4, !tbaa !5
  %94 = icmp slt i32 %93, 1
  br i1 %94, label %95, label %96

95:                                               ; preds = %91
  br label %177

96:                                               ; preds = %91
  %97 = load ptr, ptr %5, align 8, !tbaa !9
  %98 = getelementptr inbounds ptr, ptr %97, i32 1
  store ptr %98, ptr %5, align 8, !tbaa !9
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  store ptr %99, ptr %9, align 8, !tbaa !9
  %100 = load ptr, ptr %9, align 8, !tbaa !9
  %101 = call i64 @strlen(ptr noundef %100) #7
  %102 = icmp ne i64 %101, 32
  br i1 %102, label %103, label %107

103:                                              ; preds = %96
  %104 = load ptr, ptr @stderr, align 8, !tbaa !9
  %105 = load ptr, ptr %7, align 8, !tbaa !9
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str.6, ptr noundef %105) #6
  br label %269

107:                                              ; preds = %96
  %108 = load ptr, ptr %9, align 8, !tbaa !9
  %109 = load ptr, ptr %9, align 8, !tbaa !9
  %110 = call i64 @strlen(ptr noundef %109) #7
  %111 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  %112 = call i32 @hex_to_bytes(ptr noundef %108, i64 noundef %110, ptr noundef %111, ptr noundef %15)
  %113 = icmp ne i32 %112, 1
  br i1 %113, label %114, label %118

114:                                              ; preds = %107
  %115 = load ptr, ptr @stderr, align 8, !tbaa !9
  %116 = load ptr, ptr %7, align 8, !tbaa !9
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.4, ptr noundef %116) #6
  br label %269

118:                                              ; preds = %107
  br label %185

119:                                              ; preds = %86
  %120 = load ptr, ptr %5, align 8, !tbaa !9
  %121 = load ptr, ptr %120, align 8, !tbaa !9
  %122 = call i32 @strcmp(ptr noundef %121, ptr noundef @.str.7) #7
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %145, label %124

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

128:                                              ; preds = %124
  br label %177

129:                                              ; preds = %124
  %130 = load ptr, ptr %5, align 8, !tbaa !9
  %131 = getelementptr inbounds ptr, ptr %130, i32 1
  store ptr %131, ptr %5, align 8, !tbaa !9
  %132 = load ptr, ptr %131, align 8, !tbaa !9
  store ptr %132, ptr %10, align 8, !tbaa !9
  %133 = load ptr, ptr %10, align 8, !tbaa !9
  %134 = call noalias ptr @fopen(ptr noundef %133, ptr noundef @.str.8)
  store ptr %134, ptr %16, align 8, !tbaa !9
  %135 = icmp ne ptr %134, null
  br i1 %135, label %144, label %136

136:                                              ; preds = %129
  %137 = load ptr, ptr @stderr, align 8, !tbaa !9
  %138 = load ptr, ptr %7, align 8, !tbaa !9
  %139 = load ptr, ptr %10, align 8, !tbaa !9
  %140 = call ptr @__errno_location() #8
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = call ptr @strerror(i32 noundef %141) #6
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %137, ptr noundef @.str.9, ptr noundef %138, ptr noundef %139, ptr noundef %142) #6
  br label %269

144:                                              ; preds = %129
  br label %184

145:                                              ; preds = %119
  %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) #7
  %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 %177

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 %11, align 8, !tbaa !9
  %159 = load ptr, ptr %11, align 8, !tbaa !9
  %160 = call noalias ptr @fopen(ptr noundef %159, ptr noundef @.str.11)
  store ptr %160, ptr %17, 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 %11, align 8, !tbaa !9
  %166 = call ptr @__errno_location() #8
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = call ptr @strerror(i32 noundef %167) #6
  %169 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %163, ptr noundef @.str.9, ptr noundef %164, ptr noundef %165, ptr noundef %168) #6
  br label %269

170:                                              ; preds = %155
  br label %183

171:                                              ; preds = %145
  %172 = load ptr, ptr @stderr, align 8, !tbaa !9
  %173 = load ptr, ptr %7, align 8, !tbaa !9
  %174 = load ptr, ptr %5, align 8, !tbaa !9
  %175 = load ptr, ptr %174, align 8, !tbaa !9
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %172, ptr noundef @.str.12, ptr noundef %173, ptr noundef %175) #6
  br label %269

177:                                              ; preds = %154, %128, %95, %62
  %178 = load ptr, ptr @stderr, align 8, !tbaa !9
  %179 = load ptr, ptr %7, align 8, !tbaa !9
  %180 = load ptr, ptr %5, align 8, !tbaa !9
  %181 = load ptr, ptr %180, align 8, !tbaa !9
  %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %178, ptr noundef @.str.13, ptr noundef %179, ptr noundef %181) #6
  br label %269

183:                                              ; preds = %170
  br label %184

184:                                              ; preds = %183, %144
  br label %185

185:                                              ; preds = %184, %118
  br label %186

186:                                              ; preds = %185, %85
  br label %187

187:                                              ; preds = %186
  %188 = load i32, ptr %4, align 4, !tbaa !5
  %189 = add nsw i32 %188, -1
  store i32 %189, ptr %4, align 4, !tbaa !5
  %190 = load ptr, ptr %5, align 8, !tbaa !9
  %191 = getelementptr inbounds ptr, ptr %190, i32 1
  store ptr %191, ptr %5, align 8, !tbaa !9
  br label %41, !llvm.loop !13

192:                                              ; preds = %41
  %193 = load ptr, ptr %8, align 8, !tbaa !9
  %194 = icmp ne ptr %193, null
  br i1 %194, label %199, label %195

195:                                              ; preds = %192
  %196 = load ptr, ptr @stderr, align 8, !tbaa !9
  %197 = load ptr, ptr %7, align 8, !tbaa !9
  %198 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %196, ptr noundef @.str.14, ptr noundef %197) #6
  br label %269

199:                                              ; preds = %192
  %200 = load ptr, ptr %9, align 8, !tbaa !9
  %201 = icmp ne ptr %200, null
  br i1 %201, label %206, label %202

202:                                              ; preds = %199
  %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) #6
  br label %269

206:                                              ; preds = %199
  %207 = getelementptr inbounds [16 x i8], ptr %12, i64 0, i64 0
  %208 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  %209 = call i32 @zuc_encrypt_init(ptr noundef %18, ptr noundef %207, ptr noundef %208)
  %210 = icmp ne i32 %209, 1
  br i1 %210, label %211, label %215

211:                                              ; preds = %206
  %212 = load ptr, ptr @stderr, align 8, !tbaa !9
  %213 = load ptr, ptr %7, align 8, !tbaa !9
  %214 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %212, ptr noundef @.str.16, ptr noundef %213) #6
  br label %269

215:                                              ; preds = %206
  br label %216

216:                                              ; preds = %245, %215
  %217 = getelementptr inbounds [4096 x i8], ptr %19, i64 0, i64 0
  %218 = load ptr, ptr %16, align 8, !tbaa !9
  %219 = call i64 @fread(ptr noundef %217, i64 noundef 1, i64 noundef 4096, ptr noundef %218)
  store i64 %219, ptr %20, align 8, !tbaa !11
  %220 = icmp ugt i64 %219, 0
  br i1 %220, label %221, label %246

221:                                              ; preds = %216
  %222 = getelementptr inbounds [4096 x i8], ptr %19, i64 0, i64 0
  %223 = load i64, ptr %20, align 8, !tbaa !11
  %224 = getelementptr inbounds [4196 x i8], ptr %21, i64 0, i64 0
  %225 = call i32 @zuc_encrypt_update(ptr noundef %18, ptr noundef %222, i64 noundef %223, ptr noundef %224, ptr noundef %22)
  %226 = icmp ne i32 %225, 1
  br i1 %226, label %227, label %231

227:                                              ; preds = %221
  %228 = load ptr, ptr @stderr, align 8, !tbaa !9
  %229 = load ptr, ptr %7, align 8, !tbaa !9
  %230 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %228, ptr noundef @.str.16, ptr noundef %229) #6
  br label %269

231:                                              ; preds = %221
  %232 = getelementptr inbounds [4196 x i8], ptr %21, i64 0, i64 0
  %233 = load i64, ptr %22, align 8, !tbaa !11
  %234 = load ptr, ptr %17, align 8, !tbaa !9
  %235 = call i64 @fwrite(ptr noundef %232, i64 noundef 1, i64 noundef %233, ptr noundef %234)
  %236 = load i64, ptr %22, align 8, !tbaa !11
  %237 = icmp ne i64 %235, %236
  br i1 %237, label %238, label %245

238:                                              ; preds = %231
  %239 = load ptr, ptr @stderr, align 8, !tbaa !9
  %240 = load ptr, ptr %7, align 8, !tbaa !9
  %241 = call ptr @__errno_location() #8
  %242 = load i32, ptr %241, align 4, !tbaa !5
  %243 = call ptr @strerror(i32 noundef %242) #6
  %244 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %239, ptr noundef @.str.17, ptr noundef %240, ptr noundef %243) #6
  br label %269

245:                                              ; preds = %231
  br label %216, !llvm.loop !15

246:                                              ; preds = %216
  %247 = getelementptr inbounds [4196 x i8], ptr %21, i64 0, i64 0
  %248 = call i32 @zuc_encrypt_finish(ptr noundef %18, ptr noundef %247, ptr noundef %22)
  %249 = icmp ne i32 %248, 1
  br i1 %249, label %250, label %254

250:                                              ; preds = %246
  %251 = load ptr, ptr @stderr, align 8, !tbaa !9
  %252 = load ptr, ptr %7, align 8, !tbaa !9
  %253 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %251, ptr noundef @.str.16, ptr noundef %252) #6
  br label %269

254:                                              ; preds = %246
  %255 = getelementptr inbounds [4196 x i8], ptr %21, i64 0, i64 0
  %256 = load i64, ptr %22, align 8, !tbaa !11
  %257 = load ptr, ptr %17, align 8, !tbaa !9
  %258 = call i64 @fwrite(ptr noundef %255, i64 noundef 1, i64 noundef %256, ptr noundef %257)
  %259 = load i64, ptr %22, align 8, !tbaa !11
  %260 = icmp ne i64 %258, %259
  br i1 %260, label %261, label %268

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

268:                                              ; preds = %254
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %269

269:                                              ; preds = %268, %261, %250, %238, %227, %211, %202, %195, %177, %171, %162, %136, %114, %103, %81, %70, %49
  call void @gmssl_secure_clear(ptr noundef %18, i64 noundef 88)
  %270 = getelementptr inbounds [16 x i8], ptr %12, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %270, i64 noundef 16)
  %271 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %271, i64 noundef 16)
  %272 = getelementptr inbounds [4096 x i8], ptr %19, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %272, i64 noundef 4096)
  %273 = getelementptr inbounds [4196 x i8], ptr %21, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %273, i64 noundef 4196)
  %274 = load ptr, ptr %10, align 8, !tbaa !9
  %275 = icmp ne ptr %274, null
  br i1 %275, label %276, label %282

276:                                              ; preds = %269
  %277 = load ptr, ptr %16, align 8, !tbaa !9
  %278 = icmp ne ptr %277, null
  br i1 %278, label %279, label %282

279:                                              ; preds = %276
  %280 = load ptr, ptr %16, align 8, !tbaa !9
  %281 = call i32 @fclose(ptr noundef %280)
  br label %282

282:                                              ; preds = %279, %276, %269
  %283 = load ptr, ptr %11, align 8, !tbaa !9
  %284 = icmp ne ptr %283, null
  br i1 %284, label %285, label %291

285:                                              ; preds = %282
  %286 = load ptr, ptr %17, align 8, !tbaa !9
  %287 = icmp ne ptr %286, null
  br i1 %287, label %288, label %291

288:                                              ; preds = %285
  %289 = load ptr, ptr %17, align 8, !tbaa !9
  %290 = call i32 @fclose(ptr noundef %289)
  br label %291

291:                                              ; preds = %288, %285, %282
  %292 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %292, ptr %3, align 4
  store i32 1, ptr %23, align 4
  br label %293

293:                                              ; preds = %291, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4196, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 88, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %294 = load i32, ptr %3, align 4
  ret i32 %294
}

; 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

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

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

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

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

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

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

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

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

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

declare i32 @fclose(ptr noundef) #4

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind willreturn memory(none) }

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

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

%struct.ZUC_CTX = type { %struct.ZUC_STATE, [4 x i8], i64 }
%struct.ZUC_STATE = type { [16 x i32], i32, i32 }

@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [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 [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [28 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 [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1

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

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

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

.preheader114:                                    ; preds = %.preheader114.preheader, %91
  %.065186 = phi ptr [ %.1, %91 ], [ %13, %.preheader114.preheader ]
  %.066185 = phi ptr [ %.167, %91 ], [ %12, %.preheader114.preheader ]
  %.069184 = phi ptr [ %.170, %91 ], [ null, %.preheader114.preheader ]
  %.072183 = phi ptr [ %.173, %91 ], [ null, %.preheader114.preheader ]
  %.075182 = phi ptr [ %.176, %91 ], [ null, %.preheader114.preheader ]
  %.077181 = phi ptr [ %.178, %91 ], [ null, %.preheader114.preheader ]
  %.079.in180 = phi i32 [ %.180, %91 ], [ %0, %.preheader114.preheader ]
  %.082179 = phi ptr [ %92, %91 ], [ %15, %.preheader114.preheader ]
  %20 = load ptr, ptr %.082179, align 8, !tbaa !5
  %21 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.1) #9
  %.not103 = icmp eq i32 %21, 0
  br i1 %.not103, label %22, label %25

22:                                               ; preds = %.preheader114
  %23 = load ptr, ptr @options, align 8, !tbaa !5
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %11, ptr noundef %23)
  br label %138

25:                                               ; preds = %.preheader114
  %26 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.2) #9
  %.not104 = icmp eq i32 %26, 0
  br i1 %.not104, label %27, label %41

27:                                               ; preds = %25
  %28 = icmp eq i32 %.079.in180, 2
  br i1 %28, label %88, label %29

29:                                               ; preds = %27
  %30 = getelementptr inbounds i8, ptr %.082179, i64 8
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %31) #9
  %.not105 = icmp eq i64 %32, 32
  br i1 %.not105, label %36, label %33

33:                                               ; preds = %29
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.3, ptr noundef %11) #8
  br label %138

36:                                               ; preds = %29
  %37 = call i32 @hex_to_bytes(ptr noundef %31, i64 noundef 32, ptr noundef nonnull %3, ptr noundef nonnull %5) #7
  %.not106 = icmp eq i32 %37, 1
  br i1 %.not106, label %91, label %38

38:                                               ; preds = %36
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.4, ptr noundef %11) #8
  br label %138

41:                                               ; preds = %25
  %42 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.5) #9
  %.not107 = icmp eq i32 %42, 0
  br i1 %.not107, label %43, label %57

43:                                               ; preds = %41
  %44 = icmp eq i32 %.079.in180, 2
  br i1 %44, label %88, label %45

45:                                               ; preds = %43
  %46 = getelementptr inbounds i8, ptr %.082179, i64 8
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %47) #9
  %.not108 = icmp eq i64 %48, 32
  br i1 %.not108, label %52, label %49

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

52:                                               ; preds = %45
  %53 = call i32 @hex_to_bytes(ptr noundef %47, i64 noundef 32, ptr noundef nonnull %4, ptr noundef nonnull %6) #7
  %.not109 = icmp eq i32 %53, 1
  br i1 %.not109, label %91, label %54

54:                                               ; preds = %52
  %55 = load ptr, ptr @stderr, align 8, !tbaa !5
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.4, ptr noundef %11) #8
  br label %138

57:                                               ; preds = %41
  %58 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.7) #9
  %.not110 = icmp eq i32 %58, 0
  br i1 %.not110, label %59, label %71

59:                                               ; preds = %57
  %60 = icmp eq i32 %.079.in180, 2
  br i1 %60, label %88, label %61

61:                                               ; preds = %59
  %62 = getelementptr inbounds i8, ptr %.082179, i64 8
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  %64 = call noalias ptr @fopen(ptr noundef %63, ptr noundef nonnull @.str.8)
  %.not111 = icmp eq ptr %64, null
  br i1 %.not111, label %65, label %91

65:                                               ; preds = %61
  %66 = load ptr, ptr @stderr, align 8, !tbaa !5
  %67 = tail call ptr @__errno_location() #10
  %68 = load i32, ptr %67, align 4, !tbaa !11
  %69 = call ptr @strerror(i32 noundef %68) #7
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.9, ptr noundef %11, ptr noundef %63, ptr noundef %69) #8
  br label %138

71:                                               ; preds = %57
  %72 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %20, ptr noundef nonnull dereferenceable(1) @.str.10) #9
  %.not112 = icmp eq i32 %72, 0
  br i1 %.not112, label %73, label %85

73:                                               ; preds = %71
  %74 = icmp eq i32 %.079.in180, 2
  br i1 %74, label %88, label %75

75:                                               ; preds = %73
  %76 = getelementptr inbounds i8, ptr %.082179, i64 8
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = call noalias ptr @fopen(ptr noundef %77, ptr noundef nonnull @.str.11)
  %.not113 = icmp eq ptr %78, null
  br i1 %.not113, label %79, label %91

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

85:                                               ; preds = %71
  %86 = load ptr, ptr @stderr, align 8, !tbaa !5
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef nonnull @.str.12, ptr noundef %11, ptr noundef %20) #8
  br label %138

88:                                               ; preds = %73, %59, %43, %27
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.13, ptr noundef %11, ptr noundef %20) #8
  br label %138

91:                                               ; preds = %36, %61, %75, %52
  %.178 = phi ptr [ %.077181, %75 ], [ %.077181, %61 ], [ %.077181, %52 ], [ %31, %36 ]
  %.176 = phi ptr [ %.075182, %75 ], [ %.075182, %61 ], [ %47, %52 ], [ %.075182, %36 ]
  %.173 = phi ptr [ %.072183, %75 ], [ %63, %61 ], [ %.072183, %52 ], [ %.072183, %36 ]
  %.170 = phi ptr [ %77, %75 ], [ %.069184, %61 ], [ %.069184, %52 ], [ %.069184, %36 ]
  %.167 = phi ptr [ %.066185, %75 ], [ %64, %61 ], [ %.066185, %52 ], [ %.066185, %36 ]
  %.1 = phi ptr [ %78, %75 ], [ %.065186, %61 ], [ %.065186, %52 ], [ %.065186, %36 ]
  %.180 = add nsw i32 %.079.in180, -2
  %92 = getelementptr inbounds i8, ptr %.082179, i64 16
  %93 = icmp sgt i32 %.079.in180, 3
  br i1 %93, label %.preheader114, label %94, !llvm.loop !13

94:                                               ; preds = %91
  %.not = icmp eq ptr %.178, null
  br i1 %.not, label %95, label %98

95:                                               ; preds = %94
  %96 = load ptr, ptr @stderr, align 8, !tbaa !5
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef nonnull @.str.14, ptr noundef %11) #8
  br label %138

98:                                               ; preds = %94
  %.not96 = icmp eq ptr %.176, null
  br i1 %.not96, label %99, label %102

99:                                               ; preds = %98
  %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 %11) #8
  br label %138

102:                                              ; preds = %98
  %103 = call i32 @zuc_encrypt_init(ptr noundef nonnull %7, ptr noundef nonnull %3, ptr noundef nonnull %4) #7
  %.not97 = icmp eq i32 %103, 1
  br i1 %.not97, label %.preheader, label %104

104:                                              ; preds = %102
  %105 = load ptr, ptr @stderr, align 8, !tbaa !5
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %105, ptr noundef nonnull @.str.16, ptr noundef %11) #8
  br label %138

.preheader:                                       ; preds = %102, %113
  %107 = call i64 @fread(ptr noundef nonnull %8, i64 noundef 1, i64 noundef 4096, ptr noundef %.167)
  %.not98 = icmp eq i64 %107, 0
  br i1 %.not98, label %123, label %108

108:                                              ; preds = %.preheader
  %109 = call i32 @zuc_encrypt_update(ptr noundef nonnull %7, ptr noundef nonnull %8, i64 noundef %107, ptr noundef nonnull %9, ptr noundef nonnull %10) #7
  %.not101 = icmp eq i32 %109, 1
  br i1 %.not101, label %113, label %110

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

113:                                              ; preds = %108
  %114 = load i64, ptr %10, align 8, !tbaa !9
  %115 = call i64 @fwrite(ptr noundef nonnull %9, i64 noundef 1, i64 noundef %114, ptr noundef %.1)
  %116 = load i64, ptr %10, align 8, !tbaa !9
  %.not102 = icmp eq i64 %115, %116
  br i1 %.not102, label %.preheader, label %117, !llvm.loop !15

117:                                              ; preds = %113
  %118 = load ptr, ptr @stderr, align 8, !tbaa !5
  %119 = tail call ptr @__errno_location() #10
  %120 = load i32, ptr %119, align 4, !tbaa !11
  %121 = call ptr @strerror(i32 noundef %120) #7
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef nonnull @.str.17, ptr noundef %11, ptr noundef %121) #8
  br label %138

123:                                              ; preds = %.preheader
  %124 = call i32 @zuc_encrypt_finish(ptr noundef nonnull %7, ptr noundef nonnull %9, ptr noundef nonnull %10) #7
  %.not99 = icmp eq i32 %124, 1
  br i1 %.not99, label %128, label %125

125:                                              ; preds = %123
  %126 = load ptr, ptr @stderr, align 8, !tbaa !5
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef nonnull @.str.16, ptr noundef %11) #8
  br label %138

128:                                              ; preds = %123
  %129 = load i64, ptr %10, align 8, !tbaa !9
  %130 = call i64 @fwrite(ptr noundef nonnull %9, i64 noundef 1, i64 noundef %129, ptr noundef %.1)
  %131 = load i64, ptr %10, align 8, !tbaa !9
  %.not100 = icmp eq i64 %130, %131
  br i1 %.not100, label %138, label %132

132:                                              ; preds = %128
  %133 = load ptr, ptr @stderr, align 8, !tbaa !5
  %134 = tail call ptr @__errno_location() #10
  %135 = load i32, ptr %134, align 4, !tbaa !11
  %136 = call ptr @strerror(i32 noundef %135) #7
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef nonnull @.str.17, ptr noundef %11, ptr noundef %136) #8
  br label %138

138:                                              ; preds = %128, %132, %125, %117, %110, %104, %99, %95, %88, %85, %79, %65, %54, %49, %38, %33, %22
  %.081 = phi i32 [ 1, %85 ], [ 1, %88 ], [ 1, %79 ], [ 1, %65 ], [ 1, %49 ], [ 1, %54 ], [ 1, %33 ], [ 1, %38 ], [ 0, %22 ], [ 1, %104 ], [ 1, %110 ], [ 1, %117 ], [ 1, %125 ], [ 1, %132 ], [ 1, %99 ], [ 1, %95 ], [ 0, %128 ]
  %.274 = phi ptr [ %.072183, %85 ], [ %.072183, %88 ], [ %.072183, %79 ], [ %63, %65 ], [ %.072183, %49 ], [ %.072183, %54 ], [ %.072183, %33 ], [ %.072183, %38 ], [ %.072183, %22 ], [ %.173, %104 ], [ %.173, %110 ], [ %.173, %117 ], [ %.173, %125 ], [ %.173, %132 ], [ %.173, %99 ], [ %.173, %95 ], [ %.173, %128 ]
  %.271 = phi ptr [ %.069184, %85 ], [ %.069184, %88 ], [ %77, %79 ], [ %.069184, %65 ], [ %.069184, %49 ], [ %.069184, %54 ], [ %.069184, %33 ], [ %.069184, %38 ], [ %.069184, %22 ], [ %.170, %104 ], [ %.170, %110 ], [ %.170, %117 ], [ %.170, %125 ], [ %.170, %132 ], [ %.170, %99 ], [ %.170, %95 ], [ %.170, %128 ]
  %.268 = phi ptr [ %.066185, %85 ], [ %.066185, %88 ], [ %.066185, %79 ], [ null, %65 ], [ %.066185, %49 ], [ %.066185, %54 ], [ %.066185, %33 ], [ %.066185, %38 ], [ %.066185, %22 ], [ %.167, %104 ], [ %.167, %110 ], [ %.167, %117 ], [ %.167, %125 ], [ %.167, %132 ], [ %.167, %99 ], [ %.167, %95 ], [ %.167, %128 ]
  %.2 = phi ptr [ %.065186, %85 ], [ %.065186, %88 ], [ null, %79 ], [ %.065186, %65 ], [ %.065186, %49 ], [ %.065186, %54 ], [ %.065186, %33 ], [ %.065186, %38 ], [ %.065186, %22 ], [ %.1, %104 ], [ %.1, %110 ], [ %.1, %117 ], [ %.1, %125 ], [ %.1, %132 ], [ %.1, %99 ], [ %.1, %95 ], [ %.1, %128 ]
  call void @gmssl_secure_clear(ptr noundef nonnull %7, i64 noundef 88) #7
  call void @gmssl_secure_clear(ptr noundef nonnull %3, i64 noundef 16) #7
  call void @gmssl_secure_clear(ptr noundef nonnull %4, i64 noundef 16) #7
  call void @gmssl_secure_clear(ptr noundef nonnull %8, i64 noundef 4096) #7
  call void @gmssl_secure_clear(ptr noundef nonnull %9, i64 noundef 4196) #7
  %139 = icmp ne ptr %.274, null
  %140 = icmp ne ptr %.268, null
  %or.cond = select i1 %139, i1 %140, i1 false
  br i1 %or.cond, label %141, label %143

141:                                              ; preds = %138
  %142 = call i32 @fclose(ptr noundef nonnull %.268)
  br label %143

143:                                              ; preds = %141, %138
  %144 = icmp ne ptr %.271, null
  %145 = icmp ne ptr %.2, null
  %or.cond3 = select i1 %144, i1 %145, i1 false
  br i1 %or.cond3, label %146, label %148

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

148:                                              ; preds = %143, %146, %16
  %.0 = phi i32 [ 1, %16 ], [ %.081, %146 ], [ %.081, %143 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4196, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  ret i32 %.0
}

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

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

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

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

; Function Attrs: 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: 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 #5

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

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

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

declare i32 @zuc_encrypt_update(ptr noundef, ptr noundef, i64 noundef, ptr 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 i32 @zuc_encrypt_finish(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

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

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

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

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


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