; LLVM IR from ARMmbed/mbed-crypto :: programs/aes (aescrypt2)

; 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.mbedtls_aes_context = type { i32, ptr, [68 x i32] }
%struct.mbedtls_md_context_t = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [161 x i8], align 1
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @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 i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca [16 x i8], align 16
  %18 = alloca [16 x i8], align 16
  %19 = alloca [512 x i8], align 16
  %20 = alloca [64 x i8], align 16
  %21 = alloca [1024 x i8], align 16
  %22 = alloca i8, align 1
  %23 = alloca %struct.mbedtls_aes_context, align 8
  %24 = alloca %struct.mbedtls_md_context_t, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  store i32 0, ptr %3, 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) #8
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store ptr null, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store ptr null, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 512, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 1024, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 288, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  call void @mbedtls_aes_init(ptr noundef %23)
  call void @mbedtls_md_init(ptr noundef %24)
  %27 = call ptr @mbedtls_md_info_from_type(i32 noundef 6)
  %28 = call i32 @mbedtls_md_setup(ptr noundef %24, ptr noundef %27, i32 noundef 1)
  store i32 %28, ptr %6, align 4, !tbaa !5
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %35

31:                                               ; preds = %2
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sub nsw i32 0, %32
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %33)
  br label %492

35:                                               ; preds = %2
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = icmp ne i32 %36, 5
  br i1 %37, label %38, label %40

38:                                               ; preds = %35
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %492

40:                                               ; preds = %35
  %41 = load ptr, ptr %5, align 8, !tbaa !9
  %42 = getelementptr inbounds ptr, ptr %41, i64 1
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = call i32 @atoi(ptr noundef %43) #9
  store i32 %44, ptr %10, align 4, !tbaa !5
  %45 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %45, i8 0, i64 16, i1 false)
  %46 = getelementptr inbounds [512 x i8], ptr %19, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %46, i8 0, i64 512, i1 false)
  %47 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %47, i8 0, i64 64, i1 false)
  %48 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %48, i8 0, i64 1024, i1 false)
  %49 = load i32, ptr %10, align 4, !tbaa !5
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %57

51:                                               ; preds = %40
  %52 = load i32, ptr %10, align 4, !tbaa !5
  %53 = icmp ne i32 %52, 1
  br i1 %53, label %54, label %57

54:                                               ; preds = %51
  %55 = load ptr, ptr @stderr, align 8, !tbaa !9
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef @.str.2) #8
  br label %492

57:                                               ; preds = %51, %40
  %58 = load ptr, ptr %5, align 8, !tbaa !9
  %59 = getelementptr inbounds ptr, ptr %58, i64 2
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  %61 = load ptr, ptr %5, align 8, !tbaa !9
  %62 = getelementptr inbounds ptr, ptr %61, i64 3
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = call i32 @strcmp(ptr noundef %60, ptr noundef %63) #9
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %69

66:                                               ; preds = %57
  %67 = load ptr, ptr @stderr, align 8, !tbaa !9
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef @.str.3) #8
  br label %492

69:                                               ; preds = %57
  %70 = load ptr, ptr %5, align 8, !tbaa !9
  %71 = getelementptr inbounds ptr, ptr %70, i64 2
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  %73 = call noalias ptr @fopen(ptr noundef %72, ptr noundef @.str.4)
  store ptr %73, ptr %14, align 8, !tbaa !9
  %74 = icmp eq ptr %73, null
  br i1 %74, label %75, label %81

75:                                               ; preds = %69
  %76 = load ptr, ptr @stderr, align 8, !tbaa !9
  %77 = load ptr, ptr %5, align 8, !tbaa !9
  %78 = getelementptr inbounds ptr, ptr %77, i64 2
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef @.str.5, ptr noundef %79) #8
  br label %492

81:                                               ; preds = %69
  %82 = load ptr, ptr %5, align 8, !tbaa !9
  %83 = getelementptr inbounds ptr, ptr %82, i64 3
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  %85 = call noalias ptr @fopen(ptr noundef %84, ptr noundef @.str.6)
  store ptr %85, ptr %15, align 8, !tbaa !9
  %86 = icmp eq ptr %85, null
  br i1 %86, label %87, label %93

87:                                               ; preds = %81
  %88 = load ptr, ptr @stderr, align 8, !tbaa !9
  %89 = load ptr, ptr %5, align 8, !tbaa !9
  %90 = getelementptr inbounds ptr, ptr %89, i64 3
  %91 = load ptr, ptr %90, align 8, !tbaa !9
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef @.str.7, ptr noundef %91) #8
  br label %492

93:                                               ; preds = %81
  %94 = load ptr, ptr %5, align 8, !tbaa !9
  %95 = getelementptr inbounds ptr, ptr %94, i64 4
  %96 = load ptr, ptr %95, align 8, !tbaa !9
  %97 = call noalias ptr @fopen(ptr noundef %96, ptr noundef @.str.4)
  store ptr %97, ptr %13, align 8, !tbaa !9
  %98 = icmp ne ptr %97, null
  br i1 %98, label %99, label %105

99:                                               ; preds = %93
  %100 = getelementptr inbounds [512 x i8], ptr %19, i64 0, i64 0
  %101 = load ptr, ptr %13, align 8, !tbaa !9
  %102 = call i64 @fread(ptr noundef %100, i64 noundef 1, i64 noundef 512, ptr noundef %101)
  store i64 %102, ptr %12, align 8, !tbaa !11
  %103 = load ptr, ptr %13, align 8, !tbaa !9
  %104 = call i32 @fclose(ptr noundef %103)
  br label %149

105:                                              ; preds = %93
  %106 = load ptr, ptr %5, align 8, !tbaa !9
  %107 = getelementptr inbounds ptr, ptr %106, i64 4
  %108 = load ptr, ptr %107, align 8, !tbaa !9
  %109 = call i32 @memcmp(ptr noundef %108, ptr noundef @.str.8, i64 noundef 4) #9
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %111, label %134

111:                                              ; preds = %105
  %112 = load ptr, ptr %5, align 8, !tbaa !9
  %113 = getelementptr inbounds ptr, ptr %112, i64 4
  %114 = load ptr, ptr %113, align 8, !tbaa !9
  %115 = getelementptr inbounds i8, ptr %114, i64 4
  store ptr %115, ptr %16, align 8, !tbaa !9
  store i64 0, ptr %12, align 8, !tbaa !11
  br label %116

116:                                              ; preds = %125, %111
  %117 = load ptr, ptr %16, align 8, !tbaa !9
  %118 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %117, ptr noundef @.str.9, ptr noundef %9) #8
  %119 = icmp sgt i32 %118, 0
  br i1 %119, label %120, label %123

120:                                              ; preds = %116
  %121 = load i64, ptr %12, align 8, !tbaa !11
  %122 = icmp ult i64 %121, 512
  br label %123

123:                                              ; preds = %120, %116
  %124 = phi i1 [ false, %116 ], [ %122, %120 ]
  br i1 %124, label %125, label %133

125:                                              ; preds = %123
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = trunc i32 %126 to i8
  %128 = load i64, ptr %12, align 8, !tbaa !11
  %129 = add i64 %128, 1
  store i64 %129, ptr %12, align 8, !tbaa !11
  %130 = getelementptr inbounds [512 x i8], ptr %19, i64 0, i64 %128
  store i8 %127, ptr %130, align 1, !tbaa !13
  %131 = load ptr, ptr %16, align 8, !tbaa !9
  %132 = getelementptr inbounds i8, ptr %131, i64 2
  store ptr %132, ptr %16, align 8, !tbaa !9
  br label %116, !llvm.loop !14

133:                                              ; preds = %123
  br label %148

134:                                              ; preds = %105
  %135 = load ptr, ptr %5, align 8, !tbaa !9
  %136 = getelementptr inbounds ptr, ptr %135, i64 4
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  %138 = call i64 @strlen(ptr noundef %137) #9
  store i64 %138, ptr %12, align 8, !tbaa !11
  %139 = load i64, ptr %12, align 8, !tbaa !11
  %140 = icmp ugt i64 %139, 512
  br i1 %140, label %141, label %142

141:                                              ; preds = %134
  store i64 512, ptr %12, align 8, !tbaa !11
  br label %142

142:                                              ; preds = %141, %134
  %143 = getelementptr inbounds [512 x i8], ptr %19, i64 0, i64 0
  %144 = load ptr, ptr %5, align 8, !tbaa !9
  %145 = getelementptr inbounds ptr, ptr %144, i64 4
  %146 = load ptr, ptr %145, align 8, !tbaa !9
  %147 = load i64, ptr %12, align 8, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %143, ptr align 1 %146, i64 %147, i1 false)
  br label %148

148:                                              ; preds = %142, %133
  br label %149

149:                                              ; preds = %148, %99
  %150 = load ptr, ptr %14, align 8, !tbaa !9
  %151 = call i32 @fileno(ptr noundef %150) #8
  %152 = call i64 @lseek(i32 noundef %151, i64 noundef 0, i32 noundef 2) #8
  store i64 %152, ptr %25, align 8, !tbaa !11
  %153 = icmp slt i64 %152, 0
  br i1 %153, label %154, label %155

154:                                              ; preds = %149
  call void @perror(ptr noundef @.str.10)
  br label %492

155:                                              ; preds = %149
  %156 = load ptr, ptr %14, align 8, !tbaa !9
  %157 = call i32 @fseek(ptr noundef %156, i64 noundef 0, i32 noundef 0)
  %158 = icmp slt i32 %157, 0
  br i1 %158, label %159, label %162

159:                                              ; preds = %155
  %160 = load ptr, ptr @stderr, align 8, !tbaa !9
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %160, ptr noundef @.str.11) #8
  br label %492

162:                                              ; preds = %155
  %163 = load i32, ptr %10, align 4, !tbaa !5
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %165, label %321

165:                                              ; preds = %162
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %179, %165
  %167 = load i32, ptr %8, align 4, !tbaa !5
  %168 = icmp ult i32 %167, 8
  br i1 %168, label %169, label %182

169:                                              ; preds = %166
  %170 = load i64, ptr %25, align 8, !tbaa !11
  %171 = load i32, ptr %8, align 4, !tbaa !5
  %172 = shl i32 %171, 3
  %173 = zext i32 %172 to i64
  %174 = ashr i64 %170, %173
  %175 = trunc i64 %174 to i8
  %176 = load i32, ptr %8, align 4, !tbaa !5
  %177 = zext i32 %176 to i64
  %178 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 %177
  store i8 %175, ptr %178, align 1, !tbaa !13
  br label %179

179:                                              ; preds = %169
  %180 = load i32, ptr %8, align 4, !tbaa !5
  %181 = add i32 %180, 1
  store i32 %181, ptr %8, align 4, !tbaa !5
  br label %166, !llvm.loop !16

182:                                              ; preds = %166
  %183 = load ptr, ptr %5, align 8, !tbaa !9
  %184 = getelementptr inbounds ptr, ptr %183, i64 2
  %185 = load ptr, ptr %184, align 8, !tbaa !9
  store ptr %185, ptr %16, align 8, !tbaa !9
  %186 = call i32 @mbedtls_md_starts(ptr noundef %24)
  %187 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %188 = call i32 @mbedtls_md_update(ptr noundef %24, ptr noundef %187, i64 noundef 8)
  %189 = load ptr, ptr %16, align 8, !tbaa !9
  %190 = load ptr, ptr %16, align 8, !tbaa !9
  %191 = call i64 @strlen(ptr noundef %190) #9
  %192 = call i32 @mbedtls_md_update(ptr noundef %24, ptr noundef %189, i64 noundef %191)
  %193 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %194 = call i32 @mbedtls_md_finish(ptr noundef %24, ptr noundef %193)
  %195 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  %196 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %195, ptr align 16 %196, i64 16, i1 false)
  %197 = load i64, ptr %25, align 8, !tbaa !11
  %198 = and i64 %197, 15
  %199 = trunc i64 %198 to i32
  store i32 %199, ptr %11, align 4, !tbaa !5
  %200 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 15
  %201 = load i8, ptr %200, align 1, !tbaa !13
  %202 = zext i8 %201 to i32
  %203 = and i32 %202, 240
  %204 = load i32, ptr %11, align 4, !tbaa !5
  %205 = or i32 %203, %204
  %206 = trunc i32 %205 to i8
  %207 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 15
  store i8 %206, ptr %207, align 1, !tbaa !13
  %208 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  %209 = load ptr, ptr %15, align 8, !tbaa !9
  %210 = call i64 @fwrite(ptr noundef %208, i64 noundef 1, i64 noundef 16, ptr noundef %209)
  %211 = icmp ne i64 %210, 16
  br i1 %211, label %212, label %215

212:                                              ; preds = %182
  %213 = load ptr, ptr @stderr, align 8, !tbaa !9
  %214 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %213, ptr noundef @.str.12, i32 noundef 16) #8
  br label %492

215:                                              ; preds = %182
  %216 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %216, i8 0, i64 32, i1 false)
  %217 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %218 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %217, ptr align 16 %218, i64 16, i1 false)
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %219

219:                                              ; preds = %231, %215
  %220 = load i32, ptr %8, align 4, !tbaa !5
  %221 = icmp ult i32 %220, 8192
  br i1 %221, label %222, label %234

222:                                              ; preds = %219
  %223 = call i32 @mbedtls_md_starts(ptr noundef %24)
  %224 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %225 = call i32 @mbedtls_md_update(ptr noundef %24, ptr noundef %224, i64 noundef 32)
  %226 = getelementptr inbounds [512 x i8], ptr %19, i64 0, i64 0
  %227 = load i64, ptr %12, align 8, !tbaa !11
  %228 = call i32 @mbedtls_md_update(ptr noundef %24, ptr noundef %226, i64 noundef %227)
  %229 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %230 = call i32 @mbedtls_md_finish(ptr noundef %24, ptr noundef %229)
  br label %231

231:                                              ; preds = %222
  %232 = load i32, ptr %8, align 4, !tbaa !5
  %233 = add i32 %232, 1
  store i32 %233, ptr %8, align 4, !tbaa !5
  br label %219, !llvm.loop !17

234:                                              ; preds = %219
  %235 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %236 = call i32 @mbedtls_aes_setkey_enc(ptr noundef %23, ptr noundef %235, i32 noundef 256)
  %237 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %238 = call i32 @mbedtls_md_hmac_starts(ptr noundef %24, ptr noundef %237, i64 noundef 32)
  store i64 0, ptr %26, align 8, !tbaa !11
  br label %239

239:                                              ; preds = %307, %234
  %240 = load i64, ptr %26, align 8, !tbaa !11
  %241 = load i64, ptr %25, align 8, !tbaa !11
  %242 = icmp slt i64 %240, %241
  br i1 %242, label %243, label %310

243:                                              ; preds = %239
  %244 = load i64, ptr %25, align 8, !tbaa !11
  %245 = load i64, ptr %26, align 8, !tbaa !11
  %246 = sub nsw i64 %244, %245
  %247 = icmp sgt i64 %246, 16
  br i1 %247, label %248, label %249

248:                                              ; preds = %243
  br label %254

249:                                              ; preds = %243
  %250 = load i64, ptr %25, align 8, !tbaa !11
  %251 = load i64, ptr %26, align 8, !tbaa !11
  %252 = sub nsw i64 %250, %251
  %253 = trunc i64 %252 to i32
  br label %254

254:                                              ; preds = %249, %248
  %255 = phi i32 [ 16, %248 ], [ %253, %249 ]
  store i32 %255, ptr %9, align 4, !tbaa !5
  %256 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %257 = load i32, ptr %9, align 4, !tbaa !5
  %258 = zext i32 %257 to i64
  %259 = load ptr, ptr %14, align 8, !tbaa !9
  %260 = call i64 @fread(ptr noundef %256, i64 noundef 1, i64 noundef %258, ptr noundef %259)
  %261 = load i32, ptr %9, align 4, !tbaa !5
  %262 = zext i32 %261 to i64
  %263 = icmp ne i64 %260, %262
  br i1 %263, label %264, label %268

264:                                              ; preds = %254
  %265 = load ptr, ptr @stderr, align 8, !tbaa !9
  %266 = load i32, ptr %9, align 4, !tbaa !5
  %267 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %265, ptr noundef @.str.13, i32 noundef %266) #8
  br label %492

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

269:                                              ; preds = %288, %268
  %270 = load i32, ptr %8, align 4, !tbaa !5
  %271 = icmp ult i32 %270, 16
  br i1 %271, label %272, label %291

272:                                              ; preds = %269
  %273 = load i32, ptr %8, align 4, !tbaa !5
  %274 = zext i32 %273 to i64
  %275 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 %274
  %276 = load i8, ptr %275, align 1, !tbaa !13
  %277 = zext i8 %276 to i32
  %278 = load i32, ptr %8, align 4, !tbaa !5
  %279 = zext i32 %278 to i64
  %280 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 %279
  %281 = load i8, ptr %280, align 1, !tbaa !13
  %282 = zext i8 %281 to i32
  %283 = xor i32 %277, %282
  %284 = trunc i32 %283 to i8
  %285 = load i32, ptr %8, align 4, !tbaa !5
  %286 = zext i32 %285 to i64
  %287 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 %286
  store i8 %284, ptr %287, align 1, !tbaa !13
  br label %288

288:                                              ; preds = %272
  %289 = load i32, ptr %8, align 4, !tbaa !5
  %290 = add i32 %289, 1
  store i32 %290, ptr %8, align 4, !tbaa !5
  br label %269, !llvm.loop !18

291:                                              ; preds = %269
  %292 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %293 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %294 = call i32 @mbedtls_aes_crypt_ecb(ptr noundef %23, i32 noundef 1, ptr noundef %292, ptr noundef %293)
  %295 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %296 = call i32 @mbedtls_md_hmac_update(ptr noundef %24, ptr noundef %295, i64 noundef 16)
  %297 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %298 = load ptr, ptr %15, align 8, !tbaa !9
  %299 = call i64 @fwrite(ptr noundef %297, i64 noundef 1, i64 noundef 16, ptr noundef %298)
  %300 = icmp ne i64 %299, 16
  br i1 %300, label %301, label %304

301:                                              ; preds = %291
  %302 = load ptr, ptr @stderr, align 8, !tbaa !9
  %303 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %302, ptr noundef @.str.12, i32 noundef 16) #8
  br label %492

304:                                              ; preds = %291
  %305 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  %306 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %305, ptr align 16 %306, i64 16, i1 false)
  br label %307

307:                                              ; preds = %304
  %308 = load i64, ptr %26, align 8, !tbaa !11
  %309 = add nsw i64 %308, 16
  store i64 %309, ptr %26, align 8, !tbaa !11
  br label %239, !llvm.loop !19

310:                                              ; preds = %239
  %311 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %312 = call i32 @mbedtls_md_hmac_finish(ptr noundef %24, ptr noundef %311)
  %313 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %314 = load ptr, ptr %15, align 8, !tbaa !9
  %315 = call i64 @fwrite(ptr noundef %313, i64 noundef 1, i64 noundef 32, ptr noundef %314)
  %316 = icmp ne i64 %315, 32
  br i1 %316, label %317, label %320

317:                                              ; preds = %310
  %318 = load ptr, ptr @stderr, align 8, !tbaa !9
  %319 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %318, ptr noundef @.str.12, i32 noundef 16) #8
  br label %492

320:                                              ; preds = %310
  br label %321

321:                                              ; preds = %320, %162
  %322 = load i32, ptr %10, align 4, !tbaa !5
  %323 = icmp eq i32 %322, 1
  br i1 %323, label %324, label %491

324:                                              ; preds = %321
  %325 = load i64, ptr %25, align 8, !tbaa !11
  %326 = icmp slt i64 %325, 48
  br i1 %326, label %327, label %330

327:                                              ; preds = %324
  %328 = load ptr, ptr @stderr, align 8, !tbaa !9
  %329 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %328, ptr noundef @.str.14) #8
  br label %492

330:                                              ; preds = %324
  %331 = load i64, ptr %25, align 8, !tbaa !11
  %332 = and i64 %331, 15
  %333 = icmp ne i64 %332, 0
  br i1 %333, label %334, label %337

334:                                              ; preds = %330
  %335 = load ptr, ptr @stderr, align 8, !tbaa !9
  %336 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %335, ptr noundef @.str.15) #8
  br label %492

337:                                              ; preds = %330
  %338 = load i64, ptr %25, align 8, !tbaa !11
  %339 = sub nsw i64 %338, 48
  store i64 %339, ptr %25, align 8, !tbaa !11
  %340 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %341 = load ptr, ptr %14, align 8, !tbaa !9
  %342 = call i64 @fread(ptr noundef %340, i64 noundef 1, i64 noundef 16, ptr noundef %341)
  %343 = icmp ne i64 %342, 16
  br i1 %343, label %344, label %347

344:                                              ; preds = %337
  %345 = load ptr, ptr @stderr, align 8, !tbaa !9
  %346 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %345, ptr noundef @.str.13, i32 noundef 16) #8
  br label %492

347:                                              ; preds = %337
  %348 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  %349 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %348, ptr align 16 %349, i64 16, i1 false)
  %350 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 15
  %351 = load i8, ptr %350, align 1, !tbaa !13
  %352 = zext i8 %351 to i32
  %353 = and i32 %352, 15
  store i32 %353, ptr %11, align 4, !tbaa !5
  %354 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %354, i8 0, i64 32, i1 false)
  %355 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %356 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %355, ptr align 16 %356, i64 16, i1 false)
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %357

357:                                              ; preds = %369, %347
  %358 = load i32, ptr %8, align 4, !tbaa !5
  %359 = icmp ult i32 %358, 8192
  br i1 %359, label %360, label %372

360:                                              ; preds = %357
  %361 = call i32 @mbedtls_md_starts(ptr noundef %24)
  %362 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %363 = call i32 @mbedtls_md_update(ptr noundef %24, ptr noundef %362, i64 noundef 32)
  %364 = getelementptr inbounds [512 x i8], ptr %19, i64 0, i64 0
  %365 = load i64, ptr %12, align 8, !tbaa !11
  %366 = call i32 @mbedtls_md_update(ptr noundef %24, ptr noundef %364, i64 noundef %365)
  %367 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %368 = call i32 @mbedtls_md_finish(ptr noundef %24, ptr noundef %367)
  br label %369

369:                                              ; preds = %360
  %370 = load i32, ptr %8, align 4, !tbaa !5
  %371 = add i32 %370, 1
  store i32 %371, ptr %8, align 4, !tbaa !5
  br label %357, !llvm.loop !20

372:                                              ; preds = %357
  %373 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %374 = call i32 @mbedtls_aes_setkey_dec(ptr noundef %23, ptr noundef %373, i32 noundef 256)
  %375 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %376 = call i32 @mbedtls_md_hmac_starts(ptr noundef %24, ptr noundef %375, i64 noundef 32)
  store i64 0, ptr %26, align 8, !tbaa !11
  br label %377

377:                                              ; preds = %447, %372
  %378 = load i64, ptr %26, align 8, !tbaa !11
  %379 = load i64, ptr %25, align 8, !tbaa !11
  %380 = icmp slt i64 %378, %379
  br i1 %380, label %381, label %450

381:                                              ; preds = %377
  %382 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %383 = load ptr, ptr %14, align 8, !tbaa !9
  %384 = call i64 @fread(ptr noundef %382, i64 noundef 1, i64 noundef 16, ptr noundef %383)
  %385 = icmp ne i64 %384, 16
  br i1 %385, label %386, label %389

386:                                              ; preds = %381
  %387 = load ptr, ptr @stderr, align 8, !tbaa !9
  %388 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %387, ptr noundef @.str.13, i32 noundef 16) #8
  br label %492

389:                                              ; preds = %381
  %390 = getelementptr inbounds [16 x i8], ptr %18, i64 0, i64 0
  %391 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %390, ptr align 16 %391, i64 16, i1 false)
  %392 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %393 = call i32 @mbedtls_md_hmac_update(ptr noundef %24, ptr noundef %392, i64 noundef 16)
  %394 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %395 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %396 = call i32 @mbedtls_aes_crypt_ecb(ptr noundef %23, i32 noundef 0, ptr noundef %394, ptr noundef %395)
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %397

397:                                              ; preds = %416, %389
  %398 = load i32, ptr %8, align 4, !tbaa !5
  %399 = icmp ult i32 %398, 16
  br i1 %399, label %400, label %419

400:                                              ; preds = %397
  %401 = load i32, ptr %8, align 4, !tbaa !5
  %402 = zext i32 %401 to i64
  %403 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 %402
  %404 = load i8, ptr %403, align 1, !tbaa !13
  %405 = zext i8 %404 to i32
  %406 = load i32, ptr %8, align 4, !tbaa !5
  %407 = zext i32 %406 to i64
  %408 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 %407
  %409 = load i8, ptr %408, align 1, !tbaa !13
  %410 = zext i8 %409 to i32
  %411 = xor i32 %405, %410
  %412 = trunc i32 %411 to i8
  %413 = load i32, ptr %8, align 4, !tbaa !5
  %414 = zext i32 %413 to i64
  %415 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 %414
  store i8 %412, ptr %415, align 1, !tbaa !13
  br label %416

416:                                              ; preds = %400
  %417 = load i32, ptr %8, align 4, !tbaa !5
  %418 = add i32 %417, 1
  store i32 %418, ptr %8, align 4, !tbaa !5
  br label %397, !llvm.loop !21

419:                                              ; preds = %397
  %420 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  %421 = getelementptr inbounds [16 x i8], ptr %18, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %420, ptr align 16 %421, i64 16, i1 false)
  %422 = load i32, ptr %11, align 4, !tbaa !5
  %423 = icmp sgt i32 %422, 0
  br i1 %423, label %424, label %431

424:                                              ; preds = %419
  %425 = load i64, ptr %26, align 8, !tbaa !11
  %426 = load i64, ptr %25, align 8, !tbaa !11
  %427 = sub nsw i64 %426, 16
  %428 = icmp eq i64 %425, %427
  br i1 %428, label %429, label %431

429:                                              ; preds = %424
  %430 = load i32, ptr %11, align 4, !tbaa !5
  br label %432

431:                                              ; preds = %424, %419
  br label %432

432:                                              ; preds = %431, %429
  %433 = phi i32 [ %430, %429 ], [ 16, %431 ]
  store i32 %433, ptr %9, align 4, !tbaa !5
  %434 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %435 = load i32, ptr %9, align 4, !tbaa !5
  %436 = zext i32 %435 to i64
  %437 = load ptr, ptr %15, align 8, !tbaa !9
  %438 = call i64 @fwrite(ptr noundef %434, i64 noundef 1, i64 noundef %436, ptr noundef %437)
  %439 = load i32, ptr %9, align 4, !tbaa !5
  %440 = zext i32 %439 to i64
  %441 = icmp ne i64 %438, %440
  br i1 %441, label %442, label %446

442:                                              ; preds = %432
  %443 = load ptr, ptr @stderr, align 8, !tbaa !9
  %444 = load i32, ptr %9, align 4, !tbaa !5
  %445 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %443, ptr noundef @.str.12, i32 noundef %444) #8
  br label %492

446:                                              ; preds = %432
  br label %447

447:                                              ; preds = %446
  %448 = load i64, ptr %26, align 8, !tbaa !11
  %449 = add nsw i64 %448, 16
  store i64 %449, ptr %26, align 8, !tbaa !11
  br label %377, !llvm.loop !22

450:                                              ; preds = %377
  %451 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  %452 = call i32 @mbedtls_md_hmac_finish(ptr noundef %24, ptr noundef %451)
  %453 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %454 = load ptr, ptr %14, align 8, !tbaa !9
  %455 = call i64 @fread(ptr noundef %453, i64 noundef 1, i64 noundef 32, ptr noundef %454)
  %456 = icmp ne i64 %455, 32
  br i1 %456, label %457, label %460

457:                                              ; preds = %450
  %458 = load ptr, ptr @stderr, align 8, !tbaa !9
  %459 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %458, ptr noundef @.str.13, i32 noundef 32) #8
  br label %492

460:                                              ; preds = %450
  store i8 0, ptr %22, align 1, !tbaa !13
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %461

461:                                              ; preds = %480, %460
  %462 = load i32, ptr %8, align 4, !tbaa !5
  %463 = icmp ult i32 %462, 32
  br i1 %463, label %464, label %483

464:                                              ; preds = %461
  %465 = load i32, ptr %8, align 4, !tbaa !5
  %466 = zext i32 %465 to i64
  %467 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 %466
  %468 = load i8, ptr %467, align 1, !tbaa !13
  %469 = zext i8 %468 to i32
  %470 = load i32, ptr %8, align 4, !tbaa !5
  %471 = zext i32 %470 to i64
  %472 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 %471
  %473 = load i8, ptr %472, align 1, !tbaa !13
  %474 = zext i8 %473 to i32
  %475 = xor i32 %469, %474
  %476 = load i8, ptr %22, align 1, !tbaa !13
  %477 = zext i8 %476 to i32
  %478 = or i32 %477, %475
  %479 = trunc i32 %478 to i8
  store i8 %479, ptr %22, align 1, !tbaa !13
  br label %480

480:                                              ; preds = %464
  %481 = load i32, ptr %8, align 4, !tbaa !5
  %482 = add i32 %481, 1
  store i32 %482, ptr %8, align 4, !tbaa !5
  br label %461, !llvm.loop !23

483:                                              ; preds = %461
  %484 = load i8, ptr %22, align 1, !tbaa !13
  %485 = zext i8 %484 to i32
  %486 = icmp ne i32 %485, 0
  br i1 %486, label %487, label %490

487:                                              ; preds = %483
  %488 = load ptr, ptr @stderr, align 8, !tbaa !9
  %489 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %488, ptr noundef @.str.16) #8
  br label %492

490:                                              ; preds = %483
  br label %491

491:                                              ; preds = %490, %321
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %492

492:                                              ; preds = %491, %487, %457, %442, %386, %344, %334, %327, %317, %301, %264, %212, %159, %154, %87, %75, %66, %54, %38, %31
  %493 = load ptr, ptr %14, align 8, !tbaa !9
  %494 = icmp ne ptr %493, null
  br i1 %494, label %495, label %498

495:                                              ; preds = %492
  %496 = load ptr, ptr %14, align 8, !tbaa !9
  %497 = call i32 @fclose(ptr noundef %496)
  br label %498

498:                                              ; preds = %495, %492
  %499 = load ptr, ptr %15, align 8, !tbaa !9
  %500 = icmp ne ptr %499, null
  br i1 %500, label %501, label %504

501:                                              ; preds = %498
  %502 = load ptr, ptr %15, align 8, !tbaa !9
  %503 = call i32 @fclose(ptr noundef %502)
  br label %504

504:                                              ; preds = %501, %498
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %505

505:                                              ; preds = %521, %504
  %506 = load i32, ptr %8, align 4, !tbaa !5
  %507 = load i32, ptr %4, align 4, !tbaa !5
  %508 = icmp ult i32 %506, %507
  br i1 %508, label %509, label %524

509:                                              ; preds = %505
  %510 = load ptr, ptr %5, align 8, !tbaa !9
  %511 = load i32, ptr %8, align 4, !tbaa !5
  %512 = zext i32 %511 to i64
  %513 = getelementptr inbounds ptr, ptr %510, i64 %512
  %514 = load ptr, ptr %513, align 8, !tbaa !9
  %515 = load ptr, ptr %5, align 8, !tbaa !9
  %516 = load i32, ptr %8, align 4, !tbaa !5
  %517 = zext i32 %516 to i64
  %518 = getelementptr inbounds ptr, ptr %515, i64 %517
  %519 = load ptr, ptr %518, align 8, !tbaa !9
  %520 = call i64 @strlen(ptr noundef %519) #9
  call void @mbedtls_platform_zeroize(ptr noundef %514, i64 noundef %520)
  br label %521

521:                                              ; preds = %509
  %522 = load i32, ptr %8, align 4, !tbaa !5
  %523 = add i32 %522, 1
  store i32 %523, ptr %8, align 4, !tbaa !5
  br label %505, !llvm.loop !24

524:                                              ; preds = %505
  %525 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  call void @mbedtls_platform_zeroize(ptr noundef %525, i64 noundef 16)
  %526 = getelementptr inbounds [512 x i8], ptr %19, i64 0, i64 0
  call void @mbedtls_platform_zeroize(ptr noundef %526, i64 noundef 512)
  %527 = getelementptr inbounds [16 x i8], ptr %18, i64 0, i64 0
  call void @mbedtls_platform_zeroize(ptr noundef %527, i64 noundef 16)
  %528 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  call void @mbedtls_platform_zeroize(ptr noundef %528, i64 noundef 1024)
  %529 = getelementptr inbounds [64 x i8], ptr %20, i64 0, i64 0
  call void @mbedtls_platform_zeroize(ptr noundef %529, i64 noundef 64)
  call void @mbedtls_aes_free(ptr noundef %23)
  call void @mbedtls_md_free(ptr noundef %24)
  %530 = load i32, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 288, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 512, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  ret i32 %530
}

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

declare void @mbedtls_aes_init(ptr noundef) #2

declare void @mbedtls_md_init(ptr noundef) #2

declare i32 @mbedtls_md_setup(ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @mbedtls_md_info_from_type(i32 noundef) #2

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

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

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

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

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

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

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

declare i32 @fclose(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #6

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #5

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) #5

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

declare void @perror(ptr noundef) #2

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #2

declare i32 @mbedtls_md_starts(ptr noundef) #2

declare i32 @mbedtls_md_update(ptr noundef, ptr noundef, i64 noundef) #2

declare i32 @mbedtls_md_finish(ptr noundef, ptr noundef) #2

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

declare i32 @mbedtls_aes_setkey_enc(ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @mbedtls_md_hmac_starts(ptr noundef, ptr noundef, i64 noundef) #2

declare i32 @mbedtls_aes_crypt_ecb(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare i32 @mbedtls_md_hmac_update(ptr noundef, ptr noundef, i64 noundef) #2

declare i32 @mbedtls_md_hmac_finish(ptr noundef, ptr noundef) #2

declare i32 @mbedtls_aes_setkey_dec(ptr noundef, ptr noundef, i32 noundef) #2

declare void @mbedtls_platform_zeroize(ptr noundef, i64 noundef) #2

declare void @mbedtls_aes_free(ptr noundef) #2

declare void @mbedtls_md_free(ptr noundef) #2

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

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

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


; 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.mbedtls_aes_context = type { i32, ptr, [68 x i32] }
%struct.mbedtls_md_context_t = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [161 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [50 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca [16 x i8], align 16
  %5 = alloca [16 x i8], align 16
  %6 = alloca [512 x i8], align 16
  %7 = alloca [64 x i8], align 16
  %8 = alloca [1024 x i8], align 16
  %9 = alloca %struct.mbedtls_aes_context, align 8
  %10 = alloca %struct.mbedtls_md_context_t, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #11
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #11
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %6) #11
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #11
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %8) #11
  call void @llvm.lifetime.start.p0(i64 288, ptr nonnull %9) #11
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #11
  call void @mbedtls_aes_init(ptr noundef nonnull %9) #11
  call void @mbedtls_md_init(ptr noundef nonnull %10) #11
  %11 = call ptr @mbedtls_md_info_from_type(i32 noundef 6) #11
  %12 = call i32 @mbedtls_md_setup(ptr noundef nonnull %10, ptr noundef %11, i32 noundef 1) #11
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %16, label %13

13:                                               ; preds = %2
  %14 = sub nsw i32 0, %12
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14)
  br label %.thread145

16:                                               ; preds = %2
  %.not116 = icmp eq i32 %0, 5
  br i1 %.not116, label %19, label %17

17:                                               ; preds = %16
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.thread145

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %1, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = call i32 @atoi(ptr nocapture noundef %21) #12
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(512) %6, i8 0, i64 512, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %7, i8 0, i64 64, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %8, i8 0, i64 1024, i1 false)
  %or.cond = icmp ugt i32 %22, 1
  br i1 %or.cond, label %23, label %26

23:                                               ; preds = %19
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.2) #13
  br label %.lr.ph171.preheader

26:                                               ; preds = %19
  %27 = getelementptr inbounds i8, ptr %1, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %1, i64 24
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %28, ptr noundef nonnull dereferenceable(1) %30) #12
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %36

33:                                               ; preds = %26
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.3) #13
  br label %.lr.ph171.preheader

36:                                               ; preds = %26
  %37 = call noalias ptr @fopen(ptr noundef %28, ptr noundef nonnull @.str.4)
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %43

39:                                               ; preds = %36
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = load ptr, ptr %27, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.5, ptr noundef %41) #13
  br label %.lr.ph171.preheader

43:                                               ; preds = %36
  %44 = load ptr, ptr %29, align 8, !tbaa !5
  %45 = call noalias ptr @fopen(ptr noundef %44, ptr noundef nonnull @.str.6)
  %46 = icmp eq ptr %45, null
  br i1 %46, label %.thread, label %51

.thread:                                          ; preds = %43
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = load ptr, ptr %29, align 8, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.7, ptr noundef %48) #13
  %50 = call i32 @fclose(ptr noundef nonnull %37)
  br label %.lr.ph171.preheader

51:                                               ; preds = %43
  %52 = getelementptr inbounds i8, ptr %1, i64 32
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = call noalias ptr @fopen(ptr noundef %53, ptr noundef nonnull @.str.4)
  %.not117 = icmp eq ptr %54, null
  br i1 %.not117, label %58, label %55

55:                                               ; preds = %51
  %56 = call i64 @fread(ptr noundef nonnull %6, i64 noundef 1, i64 noundef 512, ptr noundef nonnull %54)
  %57 = call i32 @fclose(ptr noundef nonnull %54)
  br label %.loopexit

58:                                               ; preds = %51
  %59 = load ptr, ptr %52, align 8, !tbaa !5
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %59, ptr noundef nonnull dereferenceable(4) @.str.8, i64 4)
  %60 = icmp eq i32 %bcmp, 0
  br i1 %60, label %61, label %74

61:                                               ; preds = %58
  %62 = getelementptr inbounds i8, ptr %59, i64 4
  %63 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %62, ptr noundef nonnull @.str.9, ptr noundef nonnull %3) #11
  %64 = icmp sgt i32 %63, 0
  br i1 %64, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %61, %.lr.ph
  %.099156 = phi ptr [ %69, %.lr.ph ], [ %62, %61 ]
  %.0102155 = phi i64 [ %67, %.lr.ph ], [ 0, %61 ]
  %65 = load i32, ptr %3, align 4, !tbaa !9
  %66 = trunc i32 %65 to i8
  %67 = add nuw nsw i64 %.0102155, 1
  %68 = getelementptr inbounds [512 x i8], ptr %6, i64 0, i64 %.0102155
  store i8 %66, ptr %68, align 1, !tbaa !11
  %69 = getelementptr inbounds i8, ptr %.099156, i64 2
  %70 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %69, ptr noundef nonnull @.str.9, ptr noundef nonnull %3) #11
  %71 = icmp sgt i32 %70, 0
  %72 = icmp ult i64 %.0102155, 511
  %73 = and i1 %71, %72
  br i1 %73, label %.lr.ph, label %.loopexit, !llvm.loop !12

74:                                               ; preds = %58
  %75 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %59) #12
  %spec.store.select = call i64 @llvm.umin.i64(i64 %75, i64 512)
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %6, ptr align 1 %59, i64 %spec.store.select, i1 false)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %61, %74, %55
  %.1103 = phi i64 [ %56, %55 ], [ %spec.store.select, %74 ], [ 0, %61 ], [ %67, %.lr.ph ]
  %76 = call i32 @fileno(ptr noundef nonnull %37) #11
  %77 = call i64 @lseek(i32 noundef %76, i64 noundef 0, i32 noundef 2) #11
  %78 = icmp slt i64 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %.loopexit
  call void @perror(ptr noundef nonnull @.str.10) #14
  br label %232

80:                                               ; preds = %.loopexit
  %81 = call i32 @fseek(ptr noundef nonnull %37, i64 noundef 0, i32 noundef 0)
  %82 = icmp slt i32 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %80
  %84 = load ptr, ptr @stderr, align 8, !tbaa !5
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.11) #13
  br label %232

86:                                               ; preds = %80
  %trunc = trunc nuw i32 %22 to i1
  br i1 %trunc, label %164, label %.preheader152.preheader

.preheader152.preheader:                          ; preds = %86
  %87 = trunc i64 %77 to i8
  store i8 %87, ptr %8, align 16, !tbaa !11
  %88 = lshr i64 %77, 8
  %89 = trunc i64 %88 to i8
  %90 = getelementptr inbounds i8, ptr %8, i64 1
  store i8 %89, ptr %90, align 1, !tbaa !11
  %91 = lshr i64 %77, 16
  %92 = trunc i64 %91 to i8
  %93 = getelementptr inbounds i8, ptr %8, i64 2
  store i8 %92, ptr %93, align 2, !tbaa !11
  %94 = lshr i64 %77, 24
  %95 = trunc i64 %94 to i8
  %96 = getelementptr inbounds i8, ptr %8, i64 3
  store i8 %95, ptr %96, align 1, !tbaa !11
  %97 = lshr i64 %77, 32
  %98 = trunc i64 %97 to i8
  %99 = getelementptr inbounds i8, ptr %8, i64 4
  store i8 %98, ptr %99, align 4, !tbaa !11
  %100 = lshr i64 %77, 40
  %101 = trunc i64 %100 to i8
  %102 = getelementptr inbounds i8, ptr %8, i64 5
  store i8 %101, ptr %102, align 1, !tbaa !11
  %103 = lshr i64 %77, 48
  %104 = trunc i64 %103 to i8
  %105 = getelementptr inbounds i8, ptr %8, i64 6
  store i8 %104, ptr %105, align 2, !tbaa !11
  %106 = lshr i64 %77, 56
  %107 = trunc nuw i64 %106 to i8
  %108 = getelementptr inbounds i8, ptr %8, i64 7
  store i8 %107, ptr %108, align 1, !tbaa !11
  %109 = load ptr, ptr %27, align 8, !tbaa !5
  %110 = call i32 @mbedtls_md_starts(ptr noundef nonnull %10) #11
  %111 = call i32 @mbedtls_md_update(ptr noundef nonnull %10, ptr noundef nonnull %8, i64 noundef 8) #11
  %112 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %109) #12
  %113 = call i32 @mbedtls_md_update(ptr noundef nonnull %10, ptr noundef %109, i64 noundef %112) #11
  %114 = call i32 @mbedtls_md_finish(ptr noundef nonnull %10, ptr noundef nonnull %7) #11
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 16 dereferenceable(16) %7, i64 16, i1 false)
  %115 = and i8 %87, 15
  %116 = getelementptr inbounds i8, ptr %4, i64 15
  %117 = load i8, ptr %116, align 1, !tbaa !11
  %118 = and i8 %117, -16
  %119 = or disjoint i8 %118, %115
  store i8 %119, ptr %116, align 1, !tbaa !11
  %120 = call i64 @fwrite(ptr noundef nonnull %4, i64 noundef 1, i64 noundef 16, ptr noundef nonnull %45)
  %.not118 = icmp eq i64 %120, 16
  br i1 %.not118, label %124, label %121

121:                                              ; preds = %.preheader152.preheader
  %122 = load ptr, ptr @stderr, align 8, !tbaa !5
  %123 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef nonnull @.str.12, i32 noundef 16) #13
  br label %232

124:                                              ; preds = %.preheader152.preheader
  %125 = getelementptr inbounds i8, ptr %7, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %125, i8 0, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) %4, i64 16, i1 false)
  br label %126

126:                                              ; preds = %124, %126
  %.1106158 = phi i32 [ 0, %124 ], [ %131, %126 ]
  %127 = call i32 @mbedtls_md_starts(ptr noundef nonnull %10) #11
  %128 = call i32 @mbedtls_md_update(ptr noundef nonnull %10, ptr noundef nonnull %7, i64 noundef 32) #11
  %129 = call i32 @mbedtls_md_update(ptr noundef nonnull %10, ptr noundef nonnull %6, i64 noundef %.1103) #11
  %130 = call i32 @mbedtls_md_finish(ptr noundef nonnull %10, ptr noundef nonnull %7) #11
  %131 = add nuw nsw i32 %.1106158, 1
  %exitcond.not = icmp eq i32 %131, 8192
  br i1 %exitcond.not, label %132, label %126, !llvm.loop !14

132:                                              ; preds = %126
  %133 = call i32 @mbedtls_aes_setkey_enc(ptr noundef nonnull %9, ptr noundef nonnull %7, i32 noundef 256) #11
  %134 = call i32 @mbedtls_md_hmac_starts(ptr noundef nonnull %10, ptr noundef nonnull %7, i64 noundef 32) #11
  %.not173 = icmp eq i64 %77, 0
  br i1 %.not173, label %._crit_edge, label %.lr.ph161

.lr.ph161:                                        ; preds = %132, %154
  %.0160 = phi i64 [ %155, %154 ], [ 0, %132 ]
  %135 = sub nsw i64 %77, %.0160
  %136 = call i64 @llvm.smin.i64(i64 %135, i64 16)
  %137 = trunc i64 %136 to i32
  store i32 %137, ptr %3, align 4, !tbaa !9
  %138 = and i64 %136, 4294967295
  %139 = call i64 @fread(ptr noundef nonnull %8, i64 noundef 1, i64 noundef %138, ptr noundef nonnull %37)
  %140 = load i32, ptr %3, align 4, !tbaa !9
  %141 = zext i32 %140 to i64
  %.not127 = icmp eq i64 %139, %141
  br i1 %.not127, label %.preheader151.preheader, label %148

.preheader151.preheader:                          ; preds = %.lr.ph161
  %142 = load <16 x i8>, ptr %8, align 16, !tbaa !11
  %143 = load <16 x i8>, ptr %4, align 16, !tbaa !11
  %144 = xor <16 x i8> %143, %142
  store <16 x i8> %144, ptr %8, align 16, !tbaa !11
  %145 = call i32 @mbedtls_aes_crypt_ecb(ptr noundef nonnull %9, i32 noundef 1, ptr noundef nonnull %8, ptr noundef nonnull %8) #11
  %146 = call i32 @mbedtls_md_hmac_update(ptr noundef nonnull %10, ptr noundef nonnull %8, i64 noundef 16) #11
  %147 = call i64 @fwrite(ptr noundef nonnull %8, i64 noundef 1, i64 noundef 16, ptr noundef nonnull %45)
  %.not128 = icmp eq i64 %147, 16
  br i1 %.not128, label %154, label %151

148:                                              ; preds = %.lr.ph161
  %149 = load ptr, ptr @stderr, align 8, !tbaa !5
  %150 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %149, ptr noundef nonnull @.str.13, i32 noundef %140) #13
  br label %232

151:                                              ; preds = %.preheader151.preheader
  %152 = load ptr, ptr @stderr, align 8, !tbaa !5
  %153 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %152, ptr noundef nonnull @.str.12, i32 noundef 16) #13
  br label %232

154:                                              ; preds = %.preheader151.preheader
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 16 dereferenceable(16) %8, i64 16, i1 false)
  %155 = add nuw nsw i64 %.0160, 16
  %156 = icmp slt i64 %155, %77
  br i1 %156, label %.lr.ph161, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %154, %132
  %157 = call i32 @mbedtls_md_hmac_finish(ptr noundef nonnull %10, ptr noundef nonnull %7) #11
  %158 = call i64 @fwrite(ptr noundef nonnull %7, i64 noundef 1, i64 noundef 32, ptr noundef nonnull %45)
  %.not119 = icmp eq i64 %158, 32
  br i1 %.not119, label %162, label %159

159:                                              ; preds = %._crit_edge
  %160 = load ptr, ptr @stderr, align 8, !tbaa !5
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %160, ptr noundef nonnull @.str.12, i32 noundef 16) #13
  br label %232

162:                                              ; preds = %._crit_edge
  %163 = icmp eq i32 %22, 1
  br i1 %163, label %164, label %232

164:                                              ; preds = %86, %162
  %165 = icmp slt i64 %77, 48
  br i1 %165, label %166, label %169

166:                                              ; preds = %164
  %167 = load ptr, ptr @stderr, align 8, !tbaa !5
  %168 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %167, ptr noundef nonnull @.str.14) #13
  br label %232

169:                                              ; preds = %164
  %170 = and i64 %77, 15
  %.not120 = icmp eq i64 %170, 0
  br i1 %.not120, label %174, label %171

171:                                              ; preds = %169
  %172 = load ptr, ptr @stderr, align 8, !tbaa !5
  %173 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %172, ptr noundef nonnull @.str.15) #13
  br label %232

174:                                              ; preds = %169
  %175 = add nsw i64 %77, -48
  %176 = call i64 @fread(ptr noundef nonnull %8, i64 noundef 1, i64 noundef 16, ptr noundef nonnull %37)
  %.not121 = icmp eq i64 %176, 16
  br i1 %.not121, label %180, label %177

177:                                              ; preds = %174
  %178 = load ptr, ptr @stderr, align 8, !tbaa !5
  %179 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %178, ptr noundef nonnull @.str.13, i32 noundef 16) #13
  br label %232

180:                                              ; preds = %174
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 16 dereferenceable(16) %8, i64 16, i1 false)
  %181 = getelementptr inbounds i8, ptr %4, i64 15
  %182 = load i8, ptr %181, align 1, !tbaa !11
  %183 = and i8 %182, 15
  %184 = getelementptr inbounds i8, ptr %7, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %184, i8 0, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) %8, i64 16, i1 false)
  br label %185

185:                                              ; preds = %180, %185
  %.3162 = phi i32 [ 0, %180 ], [ %190, %185 ]
  %186 = call i32 @mbedtls_md_starts(ptr noundef nonnull %10) #11
  %187 = call i32 @mbedtls_md_update(ptr noundef nonnull %10, ptr noundef nonnull %7, i64 noundef 32) #11
  %188 = call i32 @mbedtls_md_update(ptr noundef nonnull %10, ptr noundef nonnull %6, i64 noundef %.1103) #11
  %189 = call i32 @mbedtls_md_finish(ptr noundef nonnull %10, ptr noundef nonnull %7) #11
  %190 = add nuw nsw i32 %.3162, 1
  %exitcond185.not = icmp eq i32 %190, 8192
  br i1 %exitcond185.not, label %191, label %185, !llvm.loop !16

191:                                              ; preds = %185
  %192 = zext nneg i8 %183 to i32
  %193 = call i32 @mbedtls_aes_setkey_dec(ptr noundef nonnull %9, ptr noundef nonnull %7, i32 noundef 256) #11
  %194 = call i32 @mbedtls_md_hmac_starts(ptr noundef nonnull %10, ptr noundef nonnull %7, i64 noundef 32) #11
  %.not174 = icmp eq i64 %77, 48
  br i1 %.not174, label %._crit_edge167, label %.lr.ph166

.lr.ph166:                                        ; preds = %191
  %.not125 = icmp eq i8 %183, 0
  %195 = add nsw i64 %77, -64
  br label %199

196:                                              ; preds = %204
  %197 = add nuw nsw i64 %.1164, 16
  %198 = icmp slt i64 %197, %175
  br i1 %198, label %199, label %._crit_edge167, !llvm.loop !17

199:                                              ; preds = %.lr.ph166, %196
  %.1164 = phi i64 [ 0, %.lr.ph166 ], [ %197, %196 ]
  %200 = call i64 @fread(ptr noundef nonnull %8, i64 noundef 1, i64 noundef 16, ptr noundef nonnull %37)
  %.not124 = icmp eq i64 %200, 16
  br i1 %.not124, 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.13, i32 noundef 16) #13
  br label %232

204:                                              ; preds = %199
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %8, i64 16, i1 false)
  %205 = call i32 @mbedtls_md_hmac_update(ptr noundef nonnull %10, ptr noundef nonnull %8, i64 noundef 16) #11
  %206 = call i32 @mbedtls_aes_crypt_ecb(ptr noundef nonnull %9, i32 noundef 0, ptr noundef nonnull %8, ptr noundef nonnull %8) #11
  %207 = load <16 x i8>, ptr %8, align 16, !tbaa !11
  %208 = load <16 x i8>, ptr %4, align 16, !tbaa !11
  %209 = xor <16 x i8> %208, %207
  store <16 x i8> %209, ptr %8, align 16, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 16 dereferenceable(16) %5, i64 16, i1 false)
  %210 = icmp eq i64 %.1164, %195
  %spec.select = select i1 %210, i32 %192, i32 16
  %211 = select i1 %.not125, i32 16, i32 %spec.select
  store i32 %211, ptr %3, align 4, !tbaa !9
  %212 = zext nneg i32 %211 to i64
  %213 = call i64 @fwrite(ptr noundef nonnull %8, i64 noundef 1, i64 noundef %212, ptr noundef nonnull %45)
  %214 = load i32, ptr %3, align 4, !tbaa !9
  %215 = zext i32 %214 to i64
  %.not126 = icmp eq i64 %213, %215
  br i1 %.not126, label %196, label %216

216:                                              ; preds = %204
  %217 = load ptr, ptr @stderr, align 8, !tbaa !5
  %218 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %217, ptr noundef nonnull @.str.12, i32 noundef %214) #13
  br label %232

._crit_edge167:                                   ; preds = %196, %191
  %219 = call i32 @mbedtls_md_hmac_finish(ptr noundef nonnull %10, ptr noundef nonnull %7) #11
  %220 = call i64 @fread(ptr noundef nonnull %8, i64 noundef 1, i64 noundef 32, ptr noundef nonnull %37)
  %.not122 = icmp eq i64 %220, 32
  br i1 %.not122, label %.preheader.preheader, label %226

.preheader.preheader:                             ; preds = %._crit_edge167
  %221 = load <32 x i8>, ptr %7, align 16, !tbaa !11
  %222 = load <32 x i8>, ptr %8, align 16, !tbaa !11
  %223 = icmp ne <32 x i8> %222, %221
  %224 = bitcast <32 x i1> %223 to i32
  %225 = icmp eq i32 %224, 0
  br i1 %225, label %232, label %229

226:                                              ; preds = %._crit_edge167
  %227 = load ptr, ptr @stderr, align 8, !tbaa !5
  %228 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %227, ptr noundef nonnull @.str.13, i32 noundef 32) #13
  br label %232

229:                                              ; preds = %.preheader.preheader
  %230 = load ptr, ptr @stderr, align 8, !tbaa !5
  %231 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %230, ptr noundef nonnull @.str.16) #13
  br label %232

232:                                              ; preds = %79, %83, %121, %148, %151, %159, %166, %171, %177, %201, %216, %226, %229, %.preheader.preheader, %162
  %.0104142 = phi i32 [ 0, %162 ], [ 0, %.preheader.preheader ], [ 1, %229 ], [ 1, %226 ], [ 1, %216 ], [ 1, %201 ], [ 1, %177 ], [ 1, %171 ], [ 1, %166 ], [ 1, %159 ], [ 1, %151 ], [ 1, %148 ], [ 1, %121 ], [ 1, %83 ], [ 1, %79 ]
  %233 = call i32 @fclose(ptr noundef nonnull %37)
  %234 = call i32 @fclose(ptr noundef nonnull %45)
  br label %.thread145

.thread145:                                       ; preds = %13, %17, %232
  %.0104135149 = phi i32 [ %.0104142, %232 ], [ 1, %17 ], [ 1, %13 ]
  %.not175 = icmp eq i32 %0, 0
  br i1 %.not175, label %._crit_edge172, label %.lr.ph171.preheader

.lr.ph171.preheader:                              ; preds = %39, %33, %23, %.thread, %.thread145
  %.0104135149196 = phi i32 [ %.0104135149, %.thread145 ], [ 1, %.thread ], [ 1, %23 ], [ 1, %33 ], [ 1, %39 ]
  %wide.trip.count = zext i32 %0 to i64
  br label %.lr.ph171

.lr.ph171:                                        ; preds = %.lr.ph171.preheader, %.lr.ph171
  %indvars.iv = phi i64 [ 0, %.lr.ph171.preheader ], [ %indvars.iv.next, %.lr.ph171 ]
  %235 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  %236 = load ptr, ptr %235, align 8, !tbaa !5
  %237 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %236) #12
  call void @mbedtls_platform_zeroize(ptr noundef %236, i64 noundef %237) #11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond190.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond190.not, label %._crit_edge172, label %.lr.ph171, !llvm.loop !18

._crit_edge172:                                   ; preds = %.lr.ph171, %.thread145
  %.0104135149197 = phi i32 [ %.0104135149, %.thread145 ], [ %.0104135149196, %.lr.ph171 ]
  call void @mbedtls_platform_zeroize(ptr noundef nonnull %4, i64 noundef 16) #11
  call void @mbedtls_platform_zeroize(ptr noundef nonnull %6, i64 noundef 512) #11
  call void @mbedtls_platform_zeroize(ptr noundef nonnull %5, i64 noundef 16) #11
  call void @mbedtls_platform_zeroize(ptr noundef nonnull %8, i64 noundef 1024) #11
  call void @mbedtls_platform_zeroize(ptr noundef nonnull %7, i64 noundef 64) #11
  call void @mbedtls_aes_free(ptr noundef nonnull %9) #11
  call void @mbedtls_md_free(ptr noundef nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #11
  call void @llvm.lifetime.end.p0(i64 288, ptr nonnull %9) #11
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %8) #11
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #11
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %6) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #11
  ret i32 %.0104135149197
}

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

declare void @mbedtls_aes_init(ptr noundef) local_unnamed_addr #2

declare void @mbedtls_md_init(ptr noundef) local_unnamed_addr #2

declare i32 @mbedtls_md_setup(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @mbedtls_md_info_from_type(i32 noundef) local_unnamed_addr #2

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #8

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

; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #3

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

declare i32 @mbedtls_md_starts(ptr noundef) local_unnamed_addr #2

declare i32 @mbedtls_md_update(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @mbedtls_md_finish(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare i32 @mbedtls_aes_setkey_enc(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @mbedtls_md_hmac_starts(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @mbedtls_aes_crypt_ecb(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @mbedtls_md_hmac_update(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @mbedtls_md_hmac_finish(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @mbedtls_aes_setkey_dec(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @mbedtls_platform_zeroize(ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @mbedtls_aes_free(ptr noundef) local_unnamed_addr #2

declare void @mbedtls_md_free(ptr 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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #9

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #10

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #10

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass