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

; 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.SM4_CBC_SM3_HMAC_CTX = type { %struct.SM4_CBC_CTX, %struct.SM3_HMAC_CTX, [32 x i8], i64 }
%struct.SM4_CBC_CTX = type { %struct.SM4_KEY, [16 x i8], [16 x i8], i64 }
%struct.SM4_KEY = type { [32 x i32] }
%struct.SM3_HMAC_CTX = type { %struct.SM3_CTX, [64 x i8] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }

@stdin = external global ptr, align 8
@stdout = external global ptr, align 8
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@usage = external hidden global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@options = external hidden global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [72 x i8], align 1
@__FUNCTION__.sm4_cbc_sm3_hmac_main = external hidden unnamed_addr constant [22 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [31 x i8], align 1

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

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

43:                                               ; preds = %2
  br label %44

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

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

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

58:                                               ; preds = %47
  %59 = load ptr, ptr %5, align 8, !tbaa !9
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  %61 = call i32 @strcmp(ptr noundef %60, ptr noundef @.str.3) #8
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %71, label %63

63:                                               ; preds = %58
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %70

66:                                               ; preds = %63
  %67 = load ptr, ptr @stderr, align 8, !tbaa !9
  %68 = load ptr, ptr %7, align 8, !tbaa !9
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef @.str.4, ptr noundef %68) #7
  br label %436

70:                                               ; preds = %63
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %288

71:                                               ; preds = %58
  %72 = load ptr, ptr %5, align 8, !tbaa !9
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %74 = call i32 @strcmp(ptr noundef %73, ptr noundef @.str.5) #8
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %84, label %76

76:                                               ; preds = %71
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = icmp eq i32 %77, 1
  br i1 %78, label %79, label %83

79:                                               ; preds = %76
  %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 %436

83:                                               ; preds = %76
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %287

84:                                               ; preds = %71
  %85 = load ptr, ptr %5, align 8, !tbaa !9
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  %87 = call i32 @strcmp(ptr noundef %86, ptr noundef @.str.6) #8
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %117, label %89

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

93:                                               ; preds = %89
  br label %275

94:                                               ; preds = %89
  %95 = load ptr, ptr %5, align 8, !tbaa !9
  %96 = getelementptr inbounds ptr, ptr %95, i32 1
  store ptr %96, ptr %5, align 8, !tbaa !9
  %97 = load ptr, ptr %96, align 8, !tbaa !9
  store ptr %97, ptr %9, align 8, !tbaa !9
  %98 = load ptr, ptr %9, align 8, !tbaa !9
  %99 = call i64 @strlen(ptr noundef %98) #8
  %100 = icmp ne i64 %99, 96
  br i1 %100, label %101, label %105

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

105:                                              ; preds = %94
  %106 = load ptr, ptr %9, align 8, !tbaa !9
  %107 = load ptr, ptr %9, align 8, !tbaa !9
  %108 = call i64 @strlen(ptr noundef %107) #8
  %109 = getelementptr inbounds [48 x i8], ptr %16, i64 0, i64 0
  %110 = call i32 @hex_to_bytes(ptr noundef %106, i64 noundef %108, ptr noundef %109, ptr noundef %17)
  %111 = icmp ne i32 %110, 1
  br i1 %111, label %112, label %116

112:                                              ; preds = %105
  %113 = load ptr, ptr @stderr, align 8, !tbaa !9
  %114 = load ptr, ptr %7, align 8, !tbaa !9
  %115 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef @.str.8, ptr noundef %114, i32 noundef 16) #7
  br label %436

116:                                              ; preds = %105
  br label %286

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

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

126:                                              ; preds = %122
  br label %275

127:                                              ; preds = %122
  %128 = load ptr, ptr %5, align 8, !tbaa !9
  %129 = getelementptr inbounds ptr, ptr %128, i32 1
  store ptr %129, ptr %5, align 8, !tbaa !9
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  store ptr %130, ptr %10, align 8, !tbaa !9
  %131 = load ptr, ptr %10, align 8, !tbaa !9
  %132 = call i64 @strlen(ptr noundef %131) #8
  %133 = icmp ne i64 %132, 32
  br i1 %133, label %134, label %138

134:                                              ; preds = %127
  %135 = load ptr, ptr @stderr, align 8, !tbaa !9
  %136 = load ptr, ptr %7, align 8, !tbaa !9
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %135, ptr noundef @.str.10, ptr noundef %136) #7
  br label %436

138:                                              ; preds = %127
  %139 = load ptr, ptr %10, align 8, !tbaa !9
  %140 = load ptr, ptr %10, align 8, !tbaa !9
  %141 = call i64 @strlen(ptr noundef %140) #8
  %142 = getelementptr inbounds [16 x i8], ptr %18, i64 0, i64 0
  %143 = call i32 @hex_to_bytes(ptr noundef %139, i64 noundef %141, ptr noundef %142, ptr noundef %19)
  %144 = icmp ne i32 %143, 1
  br i1 %144, label %145, label %149

145:                                              ; preds = %138
  %146 = load ptr, ptr @stderr, align 8, !tbaa !9
  %147 = load ptr, ptr %7, align 8, !tbaa !9
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef @.str.11, ptr noundef %147) #7
  br label %436

149:                                              ; preds = %138
  br label %285

150:                                              ; preds = %117
  %151 = load ptr, ptr %5, align 8, !tbaa !9
  %152 = load ptr, ptr %151, align 8, !tbaa !9
  %153 = call i32 @strcmp(ptr noundef %152, ptr noundef @.str.12) #8
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %173, label %155

155:                                              ; preds = %150
  %156 = load i32, ptr %4, align 4, !tbaa !5
  %157 = add nsw i32 %156, -1
  store i32 %157, ptr %4, align 4, !tbaa !5
  %158 = icmp slt i32 %157, 1
  br i1 %158, label %159, label %160

159:                                              ; preds = %155
  br label %275

160:                                              ; preds = %155
  %161 = load ptr, ptr %11, align 8, !tbaa !9
  %162 = icmp ne ptr %161, null
  br i1 %162, label %163, label %167

163:                                              ; preds = %160
  %164 = load ptr, ptr @stderr, align 8, !tbaa !9
  %165 = load ptr, ptr %7, align 8, !tbaa !9
  %166 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %164, ptr noundef @.str.13, ptr noundef %165) #7
  br label %275

167:                                              ; preds = %160
  %168 = load ptr, ptr %5, align 8, !tbaa !9
  %169 = getelementptr inbounds ptr, ptr %168, i32 1
  store ptr %169, ptr %5, align 8, !tbaa !9
  %170 = load ptr, ptr %169, align 8, !tbaa !9
  store ptr %170, ptr %11, align 8, !tbaa !9
  %171 = load ptr, ptr %11, align 8, !tbaa !9
  %172 = call i64 @strlen(ptr noundef %171) #8
  store i64 %172, ptr %13, align 8, !tbaa !11
  br label %284

173:                                              ; preds = %150
  %174 = load ptr, ptr %5, align 8, !tbaa !9
  %175 = load ptr, ptr %174, align 8, !tbaa !9
  %176 = call i32 @strcmp(ptr noundef %175, ptr noundef @.str.14) #8
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %217, label %178

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

182:                                              ; preds = %178
  br label %275

183:                                              ; preds = %178
  %184 = load ptr, ptr %11, align 8, !tbaa !9
  %185 = icmp ne ptr %184, null
  br i1 %185, label %186, label %190

186:                                              ; preds = %183
  %187 = load ptr, ptr @stderr, align 8, !tbaa !9
  %188 = load ptr, ptr %7, align 8, !tbaa !9
  %189 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %187, ptr noundef @.str.13, ptr noundef %188) #7
  br label %275

190:                                              ; preds = %183
  %191 = load ptr, ptr %5, align 8, !tbaa !9
  %192 = getelementptr inbounds ptr, ptr %191, i32 1
  store ptr %192, ptr %5, align 8, !tbaa !9
  %193 = load ptr, ptr %192, align 8, !tbaa !9
  store ptr %193, ptr %11, align 8, !tbaa !9
  %194 = load ptr, ptr %11, align 8, !tbaa !9
  %195 = call i64 @strlen(ptr noundef %194) #8
  %196 = udiv i64 %195, 2
  %197 = add i64 %196, 1
  %198 = call noalias ptr @malloc(i64 noundef %197) #9
  store ptr %198, ptr %12, align 8, !tbaa !9
  %199 = icmp ne ptr %198, null
  br i1 %199, label %204, label %200

200:                                              ; preds = %190
  %201 = load ptr, ptr @stderr, align 8, !tbaa !9
  %202 = load ptr, ptr %7, align 8, !tbaa !9
  %203 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %201, ptr noundef @.str.15, ptr noundef %202) #7
  br label %436

204:                                              ; preds = %190
  %205 = load ptr, ptr %11, align 8, !tbaa !9
  %206 = load ptr, ptr %11, align 8, !tbaa !9
  %207 = call i64 @strlen(ptr noundef %206) #8
  %208 = load ptr, ptr %12, align 8, !tbaa !9
  %209 = call i32 @hex_to_bytes(ptr noundef %205, i64 noundef %207, ptr noundef %208, ptr noundef %13)
  %210 = icmp ne i32 %209, 1
  br i1 %210, label %211, label %215

211:                                              ; preds = %204
  %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) #7
  br label %436

215:                                              ; preds = %204
  %216 = load ptr, ptr %12, align 8, !tbaa !9
  store ptr %216, ptr %11, align 8, !tbaa !9
  br label %283

217:                                              ; preds = %173
  %218 = load ptr, ptr %5, align 8, !tbaa !9
  %219 = load ptr, ptr %218, align 8, !tbaa !9
  %220 = call i32 @strcmp(ptr noundef %219, ptr noundef @.str.17) #8
  %221 = icmp ne i32 %220, 0
  br i1 %221, label %243, label %222

222:                                              ; preds = %217
  %223 = load i32, ptr %4, align 4, !tbaa !5
  %224 = add nsw i32 %223, -1
  store i32 %224, ptr %4, align 4, !tbaa !5
  %225 = icmp slt i32 %224, 1
  br i1 %225, label %226, label %227

226:                                              ; preds = %222
  br label %275

227:                                              ; preds = %222
  %228 = load ptr, ptr %5, align 8, !tbaa !9
  %229 = getelementptr inbounds ptr, ptr %228, i32 1
  store ptr %229, ptr %5, align 8, !tbaa !9
  %230 = load ptr, ptr %229, align 8, !tbaa !9
  store ptr %230, ptr %14, align 8, !tbaa !9
  %231 = load ptr, ptr %14, align 8, !tbaa !9
  %232 = call noalias ptr @fopen(ptr noundef %231, ptr noundef @.str.18)
  store ptr %232, ptr %20, align 8, !tbaa !9
  %233 = icmp ne ptr %232, null
  br i1 %233, label %242, label %234

234:                                              ; preds = %227
  %235 = load ptr, ptr @stderr, align 8, !tbaa !9
  %236 = load ptr, ptr %7, align 8, !tbaa !9
  %237 = load ptr, ptr %14, align 8, !tbaa !9
  %238 = call ptr @__errno_location() #10
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = call ptr @strerror(i32 noundef %239) #7
  %241 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %235, ptr noundef @.str.19, ptr noundef %236, ptr noundef %237, ptr noundef %240) #7
  br label %436

242:                                              ; preds = %227
  br label %282

243:                                              ; preds = %217
  %244 = load ptr, ptr %5, align 8, !tbaa !9
  %245 = load ptr, ptr %244, align 8, !tbaa !9
  %246 = call i32 @strcmp(ptr noundef %245, ptr noundef @.str.20) #8
  %247 = icmp ne i32 %246, 0
  br i1 %247, label %269, label %248

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

252:                                              ; preds = %248
  br label %275

253:                                              ; preds = %248
  %254 = load ptr, ptr %5, align 8, !tbaa !9
  %255 = getelementptr inbounds ptr, ptr %254, i32 1
  store ptr %255, ptr %5, align 8, !tbaa !9
  %256 = load ptr, ptr %255, align 8, !tbaa !9
  store ptr %256, ptr %15, align 8, !tbaa !9
  %257 = load ptr, ptr %15, align 8, !tbaa !9
  %258 = call noalias ptr @fopen(ptr noundef %257, ptr noundef @.str.21)
  store ptr %258, ptr %21, align 8, !tbaa !9
  %259 = icmp ne ptr %258, null
  br i1 %259, label %268, label %260

260:                                              ; preds = %253
  %261 = load ptr, ptr @stderr, align 8, !tbaa !9
  %262 = load ptr, ptr %7, align 8, !tbaa !9
  %263 = load ptr, ptr %15, align 8, !tbaa !9
  %264 = call ptr @__errno_location() #10
  %265 = load i32, ptr %264, align 4, !tbaa !5
  %266 = call ptr @strerror(i32 noundef %265) #7
  %267 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %261, ptr noundef @.str.19, ptr noundef %262, ptr noundef %263, ptr noundef %266) #7
  br label %436

268:                                              ; preds = %253
  br label %281

269:                                              ; preds = %243
  %270 = load ptr, ptr @stderr, align 8, !tbaa !9
  %271 = load ptr, ptr %7, align 8, !tbaa !9
  %272 = load ptr, ptr %5, align 8, !tbaa !9
  %273 = load ptr, ptr %272, align 8, !tbaa !9
  %274 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %270, ptr noundef @.str.22, ptr noundef %271, ptr noundef %273) #7
  br label %436

275:                                              ; preds = %252, %226, %186, %182, %163, %159, %126, %93
  %276 = load ptr, ptr @stderr, align 8, !tbaa !9
  %277 = load ptr, ptr %7, align 8, !tbaa !9
  %278 = load ptr, ptr %5, align 8, !tbaa !9
  %279 = load ptr, ptr %278, align 8, !tbaa !9
  %280 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %276, ptr noundef @.str.23, ptr noundef %277, ptr noundef %279) #7
  br label %436

281:                                              ; preds = %268
  br label %282

282:                                              ; preds = %281, %242
  br label %283

283:                                              ; preds = %282, %215
  br label %284

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

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

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

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

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

289:                                              ; preds = %288
  %290 = load i32, ptr %4, align 4, !tbaa !5
  %291 = add nsw i32 %290, -1
  store i32 %291, ptr %4, align 4, !tbaa !5
  %292 = load ptr, ptr %5, align 8, !tbaa !9
  %293 = getelementptr inbounds ptr, ptr %292, i32 1
  store ptr %293, ptr %5, align 8, !tbaa !9
  br label %44, !llvm.loop !13

294:                                              ; preds = %44
  %295 = load i32, ptr %8, align 4, !tbaa !5
  %296 = icmp slt i32 %295, 0
  br i1 %296, label %297, label %301

297:                                              ; preds = %294
  %298 = load ptr, ptr @stderr, align 8, !tbaa !9
  %299 = load ptr, ptr %7, align 8, !tbaa !9
  %300 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %298, ptr noundef @.str.24, ptr noundef %299) #7
  br label %436

301:                                              ; preds = %294
  %302 = load ptr, ptr %9, align 8, !tbaa !9
  %303 = icmp ne ptr %302, null
  br i1 %303, label %308, label %304

304:                                              ; preds = %301
  %305 = load ptr, ptr @stderr, align 8, !tbaa !9
  %306 = load ptr, ptr %7, align 8, !tbaa !9
  %307 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %305, ptr noundef @.str.25, ptr noundef %306) #7
  br label %436

308:                                              ; preds = %301
  %309 = load ptr, ptr %10, align 8, !tbaa !9
  %310 = icmp ne ptr %309, null
  br i1 %310, label %315, label %311

311:                                              ; preds = %308
  %312 = load ptr, ptr @stderr, align 8, !tbaa !9
  %313 = load ptr, ptr %7, align 8, !tbaa !9
  %314 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %312, ptr noundef @.str.26, ptr noundef %313) #7
  br label %436

315:                                              ; preds = %308
  %316 = load i32, ptr %8, align 4, !tbaa !5
  %317 = icmp ne i32 %316, 0
  br i1 %317, label %318, label %332

318:                                              ; preds = %315
  %319 = getelementptr inbounds [48 x i8], ptr %16, i64 0, i64 0
  %320 = getelementptr inbounds [16 x i8], ptr %18, i64 0, i64 0
  %321 = load ptr, ptr %11, align 8, !tbaa !9
  %322 = load i64, ptr %13, align 8, !tbaa !11
  %323 = call i32 @sm4_cbc_sm3_hmac_encrypt_init(ptr noundef %22, ptr noundef %319, ptr noundef %320, ptr noundef %321, i64 noundef %322)
  %324 = icmp ne i32 %323, 1
  br i1 %324, label %325, label %331

325:                                              ; preds = %318
  br label %326

326:                                              ; preds = %325
  %327 = load ptr, ptr @stderr, align 8, !tbaa !9
  %328 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %327, ptr noundef @.str.27, ptr noundef @.str.28, i32 noundef 181, ptr noundef @__FUNCTION__.sm4_cbc_sm3_hmac_main) #7
  br label %329

329:                                              ; preds = %326
  br label %330

330:                                              ; preds = %329
  br label %436

331:                                              ; preds = %318
  br label %346

332:                                              ; preds = %315
  %333 = getelementptr inbounds [48 x i8], ptr %16, i64 0, i64 0
  %334 = getelementptr inbounds [16 x i8], ptr %18, i64 0, i64 0
  %335 = load ptr, ptr %11, align 8, !tbaa !9
  %336 = load i64, ptr %13, align 8, !tbaa !11
  %337 = call i32 @sm4_cbc_sm3_hmac_decrypt_init(ptr noundef %22, ptr noundef %333, ptr noundef %334, ptr noundef %335, i64 noundef %336)
  %338 = icmp ne i32 %337, 1
  br i1 %338, label %339, label %345

339:                                              ; preds = %332
  br label %340

340:                                              ; preds = %339
  %341 = load ptr, ptr @stderr, align 8, !tbaa !9
  %342 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %341, ptr noundef @.str.27, ptr noundef @.str.28, i32 noundef 186, ptr noundef @__FUNCTION__.sm4_cbc_sm3_hmac_main) #7
  br label %343

343:                                              ; preds = %340
  br label %344

344:                                              ; preds = %343
  br label %436

345:                                              ; preds = %332
  br label %346

346:                                              ; preds = %345, %331
  br label %347

347:                                              ; preds = %395, %346
  %348 = getelementptr inbounds [4096 x i8], ptr %23, i64 0, i64 0
  %349 = load ptr, ptr %20, align 8, !tbaa !9
  %350 = call i64 @fread(ptr noundef %348, i64 noundef 1, i64 noundef 4096, ptr noundef %349)
  store i64 %350, ptr %24, align 8, !tbaa !11
  %351 = icmp ugt i64 %350, 0
  br i1 %351, label %352, label %396

352:                                              ; preds = %347
  %353 = load i32, ptr %8, align 4, !tbaa !5
  %354 = icmp ne i32 %353, 0
  br i1 %354, label %355, label %368

355:                                              ; preds = %352
  %356 = getelementptr inbounds [4096 x i8], ptr %23, i64 0, i64 0
  %357 = load i64, ptr %24, align 8, !tbaa !11
  %358 = getelementptr inbounds [4096 x i8], ptr %23, i64 0, i64 0
  %359 = call i32 @sm4_cbc_sm3_hmac_encrypt_update(ptr noundef %22, ptr noundef %356, i64 noundef %357, ptr noundef %358, ptr noundef %25)
  %360 = icmp ne i32 %359, 1
  br i1 %360, label %361, label %367

361:                                              ; preds = %355
  br label %362

362:                                              ; preds = %361
  %363 = load ptr, ptr @stderr, align 8, !tbaa !9
  %364 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %363, ptr noundef @.str.27, ptr noundef @.str.28, i32 noundef 194, ptr noundef @__FUNCTION__.sm4_cbc_sm3_hmac_main) #7
  br label %365

365:                                              ; preds = %362
  br label %366

366:                                              ; preds = %365
  br label %436

367:                                              ; preds = %355
  br label %381

368:                                              ; preds = %352
  %369 = getelementptr inbounds [4096 x i8], ptr %23, i64 0, i64 0
  %370 = load i64, ptr %24, align 8, !tbaa !11
  %371 = getelementptr inbounds [4096 x i8], ptr %23, i64 0, i64 0
  %372 = call i32 @sm4_cbc_sm3_hmac_decrypt_update(ptr noundef %22, ptr noundef %369, i64 noundef %370, ptr noundef %371, ptr noundef %25)
  %373 = icmp ne i32 %372, 1
  br i1 %373, label %374, label %380

374:                                              ; preds = %368
  br label %375

375:                                              ; preds = %374
  %376 = load ptr, ptr @stderr, align 8, !tbaa !9
  %377 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %376, ptr noundef @.str.27, ptr noundef @.str.28, i32 noundef 199, ptr noundef @__FUNCTION__.sm4_cbc_sm3_hmac_main) #7
  br label %378

378:                                              ; preds = %375
  br label %379

379:                                              ; preds = %378
  br label %436

380:                                              ; preds = %368
  br label %381

381:                                              ; preds = %380, %367
  %382 = getelementptr inbounds [4096 x i8], ptr %23, i64 0, i64 0
  %383 = load i64, ptr %25, align 8, !tbaa !11
  %384 = load ptr, ptr %21, align 8, !tbaa !9
  %385 = call i64 @fwrite(ptr noundef %382, i64 noundef 1, i64 noundef %383, ptr noundef %384)
  %386 = load i64, ptr %25, align 8, !tbaa !11
  %387 = icmp ne i64 %385, %386
  br i1 %387, label %388, label %395

388:                                              ; preds = %381
  %389 = load ptr, ptr @stderr, align 8, !tbaa !9
  %390 = load ptr, ptr %7, align 8, !tbaa !9
  %391 = call ptr @__errno_location() #10
  %392 = load i32, ptr %391, align 4, !tbaa !5
  %393 = call ptr @strerror(i32 noundef %392) #7
  %394 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %389, ptr noundef @.str.29, ptr noundef %390, ptr noundef %393) #7
  br label %436

395:                                              ; preds = %381
  br label %347, !llvm.loop !15

396:                                              ; preds = %347
  %397 = load i32, ptr %8, align 4, !tbaa !5
  %398 = icmp ne i32 %397, 0
  br i1 %398, label %399, label %410

399:                                              ; preds = %396
  %400 = getelementptr inbounds [4096 x i8], ptr %23, i64 0, i64 0
  %401 = call i32 @sm4_cbc_sm3_hmac_encrypt_finish(ptr noundef %22, ptr noundef %400, ptr noundef %25)
  %402 = icmp ne i32 %401, 1
  br i1 %402, label %403, label %409

403:                                              ; preds = %399
  br label %404

404:                                              ; preds = %403
  %405 = load ptr, ptr @stderr, align 8, !tbaa !9
  %406 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %405, ptr noundef @.str.27, ptr noundef @.str.28, i32 noundef 211, ptr noundef @__FUNCTION__.sm4_cbc_sm3_hmac_main) #7
  br label %407

407:                                              ; preds = %404
  br label %408

408:                                              ; preds = %407
  br label %436

409:                                              ; preds = %399
  br label %421

410:                                              ; preds = %396
  %411 = getelementptr inbounds [4096 x i8], ptr %23, i64 0, i64 0
  %412 = call i32 @sm4_cbc_sm3_hmac_decrypt_finish(ptr noundef %22, ptr noundef %411, ptr noundef %25)
  %413 = icmp ne i32 %412, 1
  br i1 %413, label %414, label %420

414:                                              ; preds = %410
  br label %415

415:                                              ; preds = %414
  %416 = load ptr, ptr @stderr, align 8, !tbaa !9
  %417 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %416, ptr noundef @.str.27, ptr noundef @.str.28, i32 noundef 216, ptr noundef @__FUNCTION__.sm4_cbc_sm3_hmac_main) #7
  br label %418

418:                                              ; preds = %415
  br label %419

419:                                              ; preds = %418
  br label %436

420:                                              ; preds = %410
  br label %421

421:                                              ; preds = %420, %409
  %422 = getelementptr inbounds [4096 x i8], ptr %23, i64 0, i64 0
  %423 = load i64, ptr %25, align 8, !tbaa !11
  %424 = load ptr, ptr %21, align 8, !tbaa !9
  %425 = call i64 @fwrite(ptr noundef %422, i64 noundef 1, i64 noundef %423, ptr noundef %424)
  %426 = load i64, ptr %25, align 8, !tbaa !11
  %427 = icmp ne i64 %425, %426
  br i1 %427, label %428, label %435

428:                                              ; preds = %421
  %429 = load ptr, ptr @stderr, align 8, !tbaa !9
  %430 = load ptr, ptr %7, align 8, !tbaa !9
  %431 = call ptr @__errno_location() #10
  %432 = load i32, ptr %431, align 4, !tbaa !5
  %433 = call ptr @strerror(i32 noundef %432) #7
  %434 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %429, ptr noundef @.str.29, ptr noundef %430, ptr noundef %433) #7
  br label %436

435:                                              ; preds = %421
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %436

436:                                              ; preds = %435, %428, %419, %408, %388, %379, %366, %344, %330, %311, %304, %297, %275, %269, %260, %234, %211, %200, %145, %134, %112, %101, %79, %66, %52
  %437 = getelementptr inbounds [48 x i8], ptr %16, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %437, i64 noundef 48)
  %438 = getelementptr inbounds [16 x i8], ptr %18, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %438, i64 noundef 16)
  call void @gmssl_secure_clear(ptr noundef %22, i64 noundef 384)
  %439 = getelementptr inbounds [4096 x i8], ptr %23, i64 0, i64 0
  call void @gmssl_secure_clear(ptr noundef %439, i64 noundef 4096)
  %440 = load ptr, ptr %14, align 8, !tbaa !9
  %441 = icmp ne ptr %440, null
  br i1 %441, label %442, label %448

442:                                              ; preds = %436
  %443 = load ptr, ptr %20, align 8, !tbaa !9
  %444 = icmp ne ptr %443, null
  br i1 %444, label %445, label %448

445:                                              ; preds = %442
  %446 = load ptr, ptr %20, align 8, !tbaa !9
  %447 = call i32 @fclose(ptr noundef %446)
  br label %448

448:                                              ; preds = %445, %442, %436
  %449 = load ptr, ptr %15, align 8, !tbaa !9
  %450 = icmp ne ptr %449, null
  br i1 %450, label %451, label %457

451:                                              ; preds = %448
  %452 = load ptr, ptr %21, align 8, !tbaa !9
  %453 = icmp ne ptr %452, null
  br i1 %453, label %454, label %457

454:                                              ; preds = %451
  %455 = load ptr, ptr %21, align 8, !tbaa !9
  %456 = call i32 @fclose(ptr noundef %455)
  br label %457

457:                                              ; preds = %454, %451, %448
  %458 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %458, ptr %3, align 4
  store i32 1, ptr %26, align 4
  br label %459

459:                                              ; preds = %457, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4096, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 384, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, 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
  %460 = load i32, ptr %3, align 4
  ret i32 %460
}

; 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: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #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 @sm4_cbc_sm3_hmac_encrypt_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) #4

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

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

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

declare i32 @sm4_cbc_sm3_hmac_decrypt_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 @sm4_cbc_sm3_hmac_encrypt_finish(ptr noundef, ptr noundef, ptr noundef) #4

declare i32 @sm4_cbc_sm3_hmac_decrypt_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 allocsize(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 allocsize(0) }
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 = !{!"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.SM4_CBC_SM3_HMAC_CTX = type { %struct.SM4_CBC_CTX, %struct.SM3_HMAC_CTX, [32 x i8], i64 }
%struct.SM4_CBC_CTX = type { %struct.SM4_KEY, [16 x i8], [16 x i8], i64 }
%struct.SM4_KEY = type { [32 x i32] }
%struct.SM3_HMAC_CTX = type { %struct.SM3_CTX, [64 x i8] }
%struct.SM3_CTX = type { [8 x i32], i64, [64 x i8], i64 }

@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [20 x i8], align 1
@usage = external hidden local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@options = external hidden local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [72 x i8], align 1
@__FUNCTION__.sm4_cbc_sm3_hmac_main = external hidden unnamed_addr constant [22 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @sm4_cbc_sm3_hmac_main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  %4 = alloca [48 x i8], align 16
  %5 = alloca i64, align 8
  %6 = alloca [16 x i8], align 16
  %7 = alloca i64, align 8
  %8 = alloca %struct.SM4_CBC_SM3_HMAC_CTX, align 8
  %9 = alloca [4096 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 8, ptr nonnull %3) #8
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %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 384, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  %14 = icmp slt i32 %0, 2
  br i1 %14, label %15, label %.preheader

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

.preheader:                                       ; preds = %2, %143
  %.094329 = phi ptr [ %.1, %143 ], [ %13, %2 ]
  %.095328 = phi ptr [ %.196, %143 ], [ %12, %2 ]
  %.098327 = phi ptr [ %.199, %143 ], [ null, %2 ]
  %.0101326 = phi ptr [ %.1102, %143 ], [ null, %2 ]
  %.0104325 = phi ptr [ %.1105, %143 ], [ null, %2 ]
  %.0106324 = phi ptr [ %.1107, %143 ], [ null, %2 ]
  %.0108323 = phi ptr [ %.1109, %143 ], [ null, %2 ]
  %.0110322 = phi i32 [ %.1111, %143 ], [ -1, %2 ]
  %.0112.in321 = phi i32 [ %.1113, %143 ], [ %0, %2 ]
  %.pn320 = phi ptr [ %.1116, %143 ], [ %1, %2 ]
  %.0115330 = getelementptr inbounds i8, ptr %.pn320, i64 8
  %.0112331 = add nsw i32 %.0112.in321, -1
  %19 = load ptr, ptr %.0115330, align 8, !tbaa !5
  %20 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.1) #10
  %.not143 = icmp eq i32 %20, 0
  br i1 %.not143, label %21, label %26

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

26:                                               ; preds = %.preheader
  %27 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.3) #10
  %.not144 = icmp eq i32 %27, 0
  br i1 %.not144, label %28, label %33

28:                                               ; preds = %26
  %29 = icmp eq i32 %.0110322, 0
  br i1 %29, label %30, label %143

30:                                               ; preds = %28
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.4, ptr noundef %11) #9
  br label %214

33:                                               ; preds = %26
  %34 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.5) #10
  %.not145 = icmp eq i32 %34, 0
  br i1 %.not145, label %35, label %40

35:                                               ; preds = %33
  %36 = icmp eq i32 %.0110322, 1
  br i1 %36, label %37, label %143

37:                                               ; preds = %35
  %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 %11) #9
  br label %214

40:                                               ; preds = %33
  %41 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.6) #10
  %.not146 = icmp eq i32 %41, 0
  br i1 %.not146, label %42, label %57

42:                                               ; preds = %40
  %43 = add nsw i32 %.0112.in321, -2
  %44 = icmp eq i32 %.0112.in321, 2
  br i1 %44, label %.loopexit, label %45

45:                                               ; preds = %42
  %46 = getelementptr inbounds i8, ptr %.pn320, i64 16
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %47) #10
  %.not147 = icmp eq i64 %48, 96
  br i1 %.not147, 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.7, ptr noundef %11, i32 noundef 48) #9
  br label %214

52:                                               ; preds = %45
  %53 = call i32 @hex_to_bytes(ptr noundef %47, i64 noundef 96, ptr noundef nonnull %4, ptr noundef nonnull %5) #8
  %.not148 = icmp eq i32 %53, 1
  br i1 %.not148, label %143, 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.8, ptr noundef %11, i32 noundef 16) #9
  br label %214

57:                                               ; preds = %40
  %58 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.9) #10
  %.not149 = icmp eq i32 %58, 0
  br i1 %.not149, label %59, label %74

59:                                               ; preds = %57
  %60 = add nsw i32 %.0112.in321, -2
  %61 = icmp eq i32 %.0112.in321, 2
  br i1 %61, label %.loopexit, label %62

62:                                               ; preds = %59
  %63 = getelementptr inbounds i8, ptr %.pn320, i64 16
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %65 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %64) #10
  %.not150 = icmp eq i64 %65, 32
  br i1 %.not150, label %69, label %66

66:                                               ; preds = %62
  %67 = load ptr, ptr @stderr, align 8, !tbaa !5
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.10, ptr noundef %11) #9
  br label %214

69:                                               ; preds = %62
  %70 = call i32 @hex_to_bytes(ptr noundef %64, i64 noundef 32, ptr noundef nonnull %6, ptr noundef nonnull %7) #8
  %.not151 = icmp eq i32 %70, 1
  br i1 %.not151, label %143, label %71

71:                                               ; preds = %69
  %72 = load ptr, ptr @stderr, align 8, !tbaa !5
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.11, ptr noundef %11) #9
  br label %214

74:                                               ; preds = %57
  %75 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.12) #10
  %.not152 = icmp eq i32 %75, 0
  br i1 %.not152, label %76, label %84

76:                                               ; preds = %74
  %77 = add nsw i32 %.0112.in321, -2
  %78 = icmp eq i32 %.0112.in321, 2
  br i1 %78, label %.loopexit, label %79

79:                                               ; preds = %76
  %.not153 = icmp eq ptr %.0104325, null
  br i1 %.not153, label %80, label %.loopexit.sink.split

80:                                               ; preds = %79
  %81 = getelementptr inbounds i8, ptr %.pn320, i64 16
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %82) #10
  store i64 %83, ptr %3, align 8, !tbaa !9
  br label %143

84:                                               ; preds = %74
  %85 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.14) #10
  %.not154 = icmp eq i32 %85, 0
  br i1 %.not154, label %86, label %105

86:                                               ; preds = %84
  %87 = add nsw i32 %.0112.in321, -2
  %88 = icmp eq i32 %.0112.in321, 2
  br i1 %88, label %.loopexit, label %89

89:                                               ; preds = %86
  %.not155 = icmp eq ptr %.0104325, null
  br i1 %.not155, label %90, label %.loopexit.sink.split

90:                                               ; preds = %89
  %91 = getelementptr inbounds i8, ptr %.pn320, i64 16
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %92) #10
  %94 = lshr i64 %93, 1
  %95 = add nuw i64 %94, 1
  %96 = call noalias ptr @malloc(i64 noundef %95) #11
  %.not156 = icmp eq ptr %96, null
  br i1 %.not156, label %97, label %100

97:                                               ; preds = %90
  %98 = load ptr, ptr @stderr, align 8, !tbaa !5
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.15, ptr noundef %11) #9
  br label %214

100:                                              ; preds = %90
  %101 = call i32 @hex_to_bytes(ptr noundef %92, i64 noundef %93, ptr noundef nonnull %96, ptr noundef nonnull %3) #8
  %.not157 = icmp eq i32 %101, 1
  br i1 %.not157, label %143, label %102

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

105:                                              ; preds = %84
  %106 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.17) #10
  %.not158 = icmp eq i32 %106, 0
  br i1 %.not158, label %107, label %120

107:                                              ; preds = %105
  %108 = icmp eq i32 %.0112.in321, 2
  br i1 %108, label %.loopexit, label %109

109:                                              ; preds = %107
  %110 = add nsw i32 %.0112.in321, -2
  %111 = getelementptr inbounds i8, ptr %.pn320, i64 16
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = call noalias ptr @fopen(ptr noundef %112, ptr noundef nonnull @.str.18)
  %.not159 = icmp eq ptr %113, null
  br i1 %.not159, label %114, label %143

114:                                              ; preds = %109
  %115 = load ptr, ptr @stderr, align 8, !tbaa !5
  %116 = tail call ptr @__errno_location() #12
  %117 = load i32, ptr %116, align 4, !tbaa !11
  %118 = call ptr @strerror(i32 noundef %117) #8
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef nonnull @.str.19, ptr noundef %11, ptr noundef %112, ptr noundef %118) #9
  br label %214

120:                                              ; preds = %105
  %121 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.20) #10
  %.not160 = icmp eq i32 %121, 0
  br i1 %.not160, label %122, label %135

122:                                              ; preds = %120
  %123 = icmp eq i32 %.0112.in321, 2
  br i1 %123, label %.loopexit, label %124

124:                                              ; preds = %122
  %125 = add nsw i32 %.0112.in321, -2
  %126 = getelementptr inbounds i8, ptr %.pn320, i64 16
  %127 = load ptr, ptr %126, align 8, !tbaa !5
  %128 = call noalias ptr @fopen(ptr noundef %127, ptr noundef nonnull @.str.21)
  %.not161 = icmp eq ptr %128, null
  br i1 %.not161, label %129, label %143

129:                                              ; preds = %124
  %130 = load ptr, ptr @stderr, align 8, !tbaa !5
  %131 = tail call ptr @__errno_location() #12
  %132 = load i32, ptr %131, align 4, !tbaa !11
  %133 = call ptr @strerror(i32 noundef %132) #8
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef nonnull @.str.19, ptr noundef %11, ptr noundef %127, ptr noundef %133) #9
  br label %214

135:                                              ; preds = %120
  %136 = load ptr, ptr @stderr, align 8, !tbaa !5
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef nonnull @.str.22, ptr noundef %11, ptr noundef %19) #9
  br label %214

.loopexit.sink.split:                             ; preds = %89, %79
  %138 = load ptr, ptr @stderr, align 8, !tbaa !5
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef nonnull @.str.13, ptr noundef %11) #9
  br label %.loopexit

.loopexit:                                        ; preds = %122, %107, %86, %76, %59, %42, %.loopexit.sink.split
  %140 = load ptr, ptr @stderr, align 8, !tbaa !5
  %141 = load ptr, ptr %.0115330, align 8, !tbaa !5
  %142 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %140, ptr noundef nonnull @.str.23, ptr noundef %11, ptr noundef %141) #9
  br label %214

143:                                              ; preds = %100, %35, %28, %52, %80, %109, %124, %69
  %.1116 = phi ptr [ %126, %124 ], [ %111, %109 ], [ %81, %80 ], [ %63, %69 ], [ %46, %52 ], [ %.0115330, %28 ], [ %.0115330, %35 ], [ %91, %100 ]
  %.1113 = phi i32 [ %125, %124 ], [ %110, %109 ], [ %77, %80 ], [ %60, %69 ], [ %43, %52 ], [ %.0112331, %28 ], [ %.0112331, %35 ], [ %87, %100 ]
  %.1111 = phi i32 [ %.0110322, %124 ], [ %.0110322, %109 ], [ %.0110322, %80 ], [ %.0110322, %69 ], [ %.0110322, %52 ], [ 1, %28 ], [ 0, %35 ], [ %.0110322, %100 ]
  %.1109 = phi ptr [ %.0108323, %124 ], [ %.0108323, %109 ], [ %.0108323, %80 ], [ %.0108323, %69 ], [ %47, %52 ], [ %.0108323, %28 ], [ %.0108323, %35 ], [ %.0108323, %100 ]
  %.1107 = phi ptr [ %.0106324, %124 ], [ %.0106324, %109 ], [ %.0106324, %80 ], [ %64, %69 ], [ %.0106324, %52 ], [ %.0106324, %28 ], [ %.0106324, %35 ], [ %.0106324, %100 ]
  %.1105 = phi ptr [ %.0104325, %124 ], [ %.0104325, %109 ], [ %82, %80 ], [ %.0104325, %69 ], [ %.0104325, %52 ], [ %.0104325, %28 ], [ %.0104325, %35 ], [ %96, %100 ]
  %.1102 = phi ptr [ %.0101326, %124 ], [ %112, %109 ], [ %.0101326, %80 ], [ %.0101326, %69 ], [ %.0101326, %52 ], [ %.0101326, %28 ], [ %.0101326, %35 ], [ %.0101326, %100 ]
  %.199 = phi ptr [ %127, %124 ], [ %.098327, %109 ], [ %.098327, %80 ], [ %.098327, %69 ], [ %.098327, %52 ], [ %.098327, %28 ], [ %.098327, %35 ], [ %.098327, %100 ]
  %.196 = phi ptr [ %.095328, %124 ], [ %113, %109 ], [ %.095328, %80 ], [ %.095328, %69 ], [ %.095328, %52 ], [ %.095328, %28 ], [ %.095328, %35 ], [ %.095328, %100 ]
  %.1 = phi ptr [ %128, %124 ], [ %.094329, %109 ], [ %.094329, %80 ], [ %.094329, %69 ], [ %.094329, %52 ], [ %.094329, %28 ], [ %.094329, %35 ], [ %.094329, %100 ]
  %144 = icmp sgt i32 %.1113, 1
  br i1 %144, label %.preheader, label %145, !llvm.loop !13

145:                                              ; preds = %143
  %146 = icmp slt i32 %.1111, 0
  br i1 %146, label %147, label %150

147:                                              ; preds = %145
  %148 = load ptr, ptr @stderr, align 8, !tbaa !5
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef nonnull @.str.24, ptr noundef %11) #9
  br label %214

150:                                              ; preds = %145
  %.not = icmp eq ptr %.1109, null
  br i1 %.not, label %151, label %154

151:                                              ; preds = %150
  %152 = load ptr, ptr @stderr, align 8, !tbaa !5
  %153 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %152, ptr noundef nonnull @.str.25, ptr noundef %11) #9
  br label %214

154:                                              ; preds = %150
  %.not132 = icmp eq ptr %.1107, null
  br i1 %.not132, label %155, label %158

155:                                              ; preds = %154
  %156 = load ptr, ptr @stderr, align 8, !tbaa !5
  %157 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef nonnull @.str.26, ptr noundef %11) #9
  br label %214

158:                                              ; preds = %154
  %.not133 = icmp eq i32 %.1111, 0
  %159 = load i64, ptr %3, align 8, !tbaa !9
  br i1 %.not133, label %165, label %160

160:                                              ; preds = %158
  %161 = call i32 @sm4_cbc_sm3_hmac_encrypt_init(ptr noundef nonnull %8, ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef %.1105, i64 noundef %159) #8
  %.not135 = icmp eq i32 %161, 1
  br i1 %.not135, label %.split, label %162

162:                                              ; preds = %160
  %163 = load ptr, ptr @stderr, align 8, !tbaa !5
  %164 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %163, ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.28, i32 noundef 181, ptr noundef nonnull @__FUNCTION__.sm4_cbc_sm3_hmac_main) #9
  br label %214

165:                                              ; preds = %158
  %166 = call i32 @sm4_cbc_sm3_hmac_decrypt_init(ptr noundef nonnull %8, ptr noundef nonnull %4, ptr noundef nonnull %6, ptr noundef %.1105, i64 noundef %159) #8
  %.not134 = icmp eq i32 %166, 1
  br i1 %.not134, label %.split.us, label %167

167:                                              ; preds = %165
  %168 = load ptr, ptr @stderr, align 8, !tbaa !5
  %169 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %168, ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.28, i32 noundef 186, ptr noundef nonnull @__FUNCTION__.sm4_cbc_sm3_hmac_main) #9
  br label %214

.split.us:                                        ; preds = %165, %173
  %170 = call i64 @fread(ptr noundef nonnull %9, i64 noundef 1, i64 noundef 4096, ptr noundef %.196)
  %.not136.us = icmp eq i64 %170, 0
  br i1 %.not136.us, label %.split333.us, label %171

171:                                              ; preds = %.split.us
  %172 = call i32 @sm4_cbc_sm3_hmac_decrypt_update(ptr noundef nonnull %8, ptr noundef nonnull %9, i64 noundef %170, ptr noundef nonnull %9, ptr noundef nonnull %10) #8
  %.not140.us = icmp eq i32 %172, 1
  br i1 %.not140.us, label %173, label %.split335.us

173:                                              ; preds = %171
  %174 = load i64, ptr %10, align 8, !tbaa !9
  %175 = call i64 @fwrite(ptr noundef nonnull %9, i64 noundef 1, i64 noundef %174, ptr noundef %.1)
  %176 = load i64, ptr %10, align 8, !tbaa !9
  %.not142.us = icmp eq i64 %175, %176
  br i1 %.not142.us, label %.split.us, label %.split337.us, !llvm.loop !15

.split:                                           ; preds = %160, %185
  %177 = call i64 @fread(ptr noundef nonnull %9, i64 noundef 1, i64 noundef 4096, ptr noundef %.196)
  %.not136 = icmp eq i64 %177, 0
  br i1 %.not136, label %.split333.us, label %178

178:                                              ; preds = %.split
  %179 = call i32 @sm4_cbc_sm3_hmac_encrypt_update(ptr noundef nonnull %8, ptr noundef nonnull %9, i64 noundef %177, ptr noundef nonnull %9, ptr noundef nonnull %10) #8
  %.not141 = icmp eq i32 %179, 1
  br i1 %.not141, label %185, label %180

180:                                              ; preds = %178
  %181 = load ptr, ptr @stderr, align 8, !tbaa !5
  %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.28, i32 noundef 194, ptr noundef nonnull @__FUNCTION__.sm4_cbc_sm3_hmac_main) #9
  br label %214

.split335.us:                                     ; preds = %171
  %183 = load ptr, ptr @stderr, align 8, !tbaa !5
  %184 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %183, ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.28, i32 noundef 199, ptr noundef nonnull @__FUNCTION__.sm4_cbc_sm3_hmac_main) #9
  br label %214

185:                                              ; preds = %178
  %186 = load i64, ptr %10, align 8, !tbaa !9
  %187 = call i64 @fwrite(ptr noundef nonnull %9, i64 noundef 1, i64 noundef %186, ptr noundef %.1)
  %188 = load i64, ptr %10, align 8, !tbaa !9
  %.not142 = icmp eq i64 %187, %188
  br i1 %.not142, label %.split, label %.split337.us, !llvm.loop !15

.split337.us:                                     ; preds = %185, %173
  %189 = load ptr, ptr @stderr, align 8, !tbaa !5
  %190 = tail call ptr @__errno_location() #12
  %191 = load i32, ptr %190, align 4, !tbaa !11
  %192 = call ptr @strerror(i32 noundef %191) #8
  %193 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %189, ptr noundef nonnull @.str.29, ptr noundef %11, ptr noundef %192) #9
  br label %214

.split333.us:                                     ; preds = %.split, %.split.us
  br i1 %.not133, label %199, label %194

194:                                              ; preds = %.split333.us
  %195 = call i32 @sm4_cbc_sm3_hmac_encrypt_finish(ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10) #8
  %.not138 = icmp eq i32 %195, 1
  br i1 %.not138, label %204, label %196

196:                                              ; preds = %194
  %197 = load ptr, ptr @stderr, align 8, !tbaa !5
  %198 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %197, ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.28, i32 noundef 211, ptr noundef nonnull @__FUNCTION__.sm4_cbc_sm3_hmac_main) #9
  br label %214

199:                                              ; preds = %.split333.us
  %200 = call i32 @sm4_cbc_sm3_hmac_decrypt_finish(ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10) #8
  %.not137 = icmp eq i32 %200, 1
  br i1 %.not137, label %204, label %201

201:                                              ; preds = %199
  %202 = load ptr, ptr @stderr, align 8, !tbaa !5
  %203 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %202, ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.28, i32 noundef 216, ptr noundef nonnull @__FUNCTION__.sm4_cbc_sm3_hmac_main) #9
  br label %214

204:                                              ; preds = %199, %194
  %205 = load i64, ptr %10, align 8, !tbaa !9
  %206 = call i64 @fwrite(ptr noundef nonnull %9, i64 noundef 1, i64 noundef %205, ptr noundef %.1)
  %207 = load i64, ptr %10, align 8, !tbaa !9
  %.not139 = icmp eq i64 %206, %207
  br i1 %.not139, label %214, label %208

208:                                              ; preds = %204
  %209 = load ptr, ptr @stderr, align 8, !tbaa !5
  %210 = tail call ptr @__errno_location() #12
  %211 = load i32, ptr %210, align 4, !tbaa !11
  %212 = call ptr @strerror(i32 noundef %211) #8
  %213 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %209, ptr noundef nonnull @.str.29, ptr noundef %11, ptr noundef %212) #9
  br label %214

214:                                              ; preds = %204, %208, %201, %196, %.split337.us, %.split335.us, %180, %167, %162, %155, %151, %147, %.loopexit, %135, %129, %114, %102, %97, %71, %66, %54, %49, %37, %30, %21
  %.0114 = phi i32 [ 1, %135 ], [ 1, %.loopexit ], [ 1, %129 ], [ 1, %114 ], [ 1, %102 ], [ 1, %97 ], [ 1, %66 ], [ 1, %71 ], [ 1, %49 ], [ 1, %54 ], [ 1, %37 ], [ 1, %30 ], [ 0, %21 ], [ 1, %147 ], [ 1, %162 ], [ 1, %180 ], [ 1, %.split337.us ], [ 1, %.split335.us ], [ 1, %196 ], [ 1, %208 ], [ 1, %201 ], [ 1, %167 ], [ 1, %155 ], [ 1, %151 ], [ 0, %204 ]
  %.2103 = phi ptr [ %.0101326, %135 ], [ %.0101326, %.loopexit ], [ %.0101326, %129 ], [ %112, %114 ], [ %.0101326, %102 ], [ %.0101326, %97 ], [ %.0101326, %66 ], [ %.0101326, %71 ], [ %.0101326, %49 ], [ %.0101326, %54 ], [ %.0101326, %37 ], [ %.0101326, %30 ], [ %.0101326, %21 ], [ %.1102, %147 ], [ %.1102, %162 ], [ %.1102, %180 ], [ %.1102, %.split337.us ], [ %.1102, %.split335.us ], [ %.1102, %196 ], [ %.1102, %208 ], [ %.1102, %201 ], [ %.1102, %167 ], [ %.1102, %155 ], [ %.1102, %151 ], [ %.1102, %204 ]
  %.2100 = phi ptr [ %.098327, %135 ], [ %.098327, %.loopexit ], [ %127, %129 ], [ %.098327, %114 ], [ %.098327, %102 ], [ %.098327, %97 ], [ %.098327, %66 ], [ %.098327, %71 ], [ %.098327, %49 ], [ %.098327, %54 ], [ %.098327, %37 ], [ %.098327, %30 ], [ %.098327, %21 ], [ %.199, %147 ], [ %.199, %162 ], [ %.199, %180 ], [ %.199, %.split337.us ], [ %.199, %.split335.us ], [ %.199, %196 ], [ %.199, %208 ], [ %.199, %201 ], [ %.199, %167 ], [ %.199, %155 ], [ %.199, %151 ], [ %.199, %204 ]
  %.297 = phi ptr [ %.095328, %135 ], [ %.095328, %.loopexit ], [ %.095328, %129 ], [ null, %114 ], [ %.095328, %102 ], [ %.095328, %97 ], [ %.095328, %66 ], [ %.095328, %71 ], [ %.095328, %49 ], [ %.095328, %54 ], [ %.095328, %37 ], [ %.095328, %30 ], [ %.095328, %21 ], [ %.196, %147 ], [ %.196, %162 ], [ %.196, %180 ], [ %.196, %.split337.us ], [ %.196, %.split335.us ], [ %.196, %196 ], [ %.196, %208 ], [ %.196, %201 ], [ %.196, %167 ], [ %.196, %155 ], [ %.196, %151 ], [ %.196, %204 ]
  %.2 = phi ptr [ %.094329, %135 ], [ %.094329, %.loopexit ], [ null, %129 ], [ %.094329, %114 ], [ %.094329, %102 ], [ %.094329, %97 ], [ %.094329, %66 ], [ %.094329, %71 ], [ %.094329, %49 ], [ %.094329, %54 ], [ %.094329, %37 ], [ %.094329, %30 ], [ %.094329, %21 ], [ %.1, %147 ], [ %.1, %162 ], [ %.1, %180 ], [ %.1, %.split337.us ], [ %.1, %.split335.us ], [ %.1, %196 ], [ %.1, %208 ], [ %.1, %201 ], [ %.1, %167 ], [ %.1, %155 ], [ %.1, %151 ], [ %.1, %204 ]
  call void @gmssl_secure_clear(ptr noundef nonnull %4, i64 noundef 48) #8
  call void @gmssl_secure_clear(ptr noundef nonnull %6, i64 noundef 16) #8
  call void @gmssl_secure_clear(ptr noundef nonnull %8, i64 noundef 384) #8
  call void @gmssl_secure_clear(ptr noundef nonnull %9, i64 noundef 4096) #8
  %215 = icmp ne ptr %.2103, null
  %216 = icmp ne ptr %.297, null
  %or.cond = select i1 %215, i1 %216, i1 false
  br i1 %or.cond, label %217, label %219

217:                                              ; preds = %214
  %218 = call i32 @fclose(ptr noundef nonnull %.297)
  br label %219

219:                                              ; preds = %217, %214
  %220 = icmp ne ptr %.2100, null
  %221 = icmp ne ptr %.2, null
  %or.cond3 = select i1 %220, i1 %221, i1 false
  br i1 %or.cond3, label %222, label %224

222:                                              ; preds = %219
  %223 = call i32 @fclose(ptr noundef nonnull %.2)
  br label %224

224:                                              ; preds = %219, %222, %15
  %.0 = phi i32 [ 1, %15 ], [ %.0114, %222 ], [ %.0114, %219 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 384, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  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: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) 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 @sm4_cbc_sm3_hmac_encrypt_init(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

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

declare i32 @sm4_cbc_sm3_hmac_decrypt_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 @sm4_cbc_sm3_hmac_encrypt_finish(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @sm4_cbc_sm3_hmac_decrypt_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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0) }
attributes #12 = { nounwind willreturn memory(none) }

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

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


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