; LLVM IR from tleonhardt/practical_cryptography_engineering :: mbedtls (aes)

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

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@aes_test_ecb_dec = external hidden constant [3 x [16 x i8]], align 16
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@aes_test_ecb_enc = external hidden constant [3 x [16 x i8]], align 16
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@aes_test_cbc_dec = external hidden constant [3 x [16 x i8]], align 16
@aes_test_cbc_enc = external hidden constant [3 x [16 x i8]], align 16
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@aes_test_cfb128_iv = external hidden constant [16 x i8], align 16
@aes_test_cfb128_ct = external hidden constant [3 x [64 x i8]], align 16
@aes_test_cfb128_pt = external hidden constant [64 x i8], align 16
@.str.8 = external hidden unnamed_addr constant [21 x i8], align 1
@aes_test_ctr_nonce_counter = external hidden constant [3 x [16 x i8]], align 16
@aes_test_ctr_key = external hidden constant [3 x [16 x i8]], align 16
@aes_test_ctr_len = external hidden constant [3 x i32], align 4
@aes_test_cfb128_key = external hidden constant <{ <{ [16 x i8], [16 x i8] }>, <{ [24 x i8], [8 x i8] }>, [32 x i8] }>, align 16
@aes_test_ctr_ct = external hidden constant <{ <{ [16 x i8], [32 x i8] }>, <{ [32 x i8], [16 x i8] }>, <{ [36 x i8], [12 x i8] }> }>, align 16
@aes_test_ctr_pt = external hidden constant <{ <{ [16 x i8], [32 x i8] }>, <{ [32 x i8], [16 x i8] }>, <{ [36 x i8], [12 x i8] }> }>, align 16

; Function Attrs: nounwind uwtable
declare dso_local void @mbedtls_aes_init(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @mbedtls_aes_free(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_setkey_enc(ptr noundef, ptr noundef, i32 noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_setkey_dec(ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_crypt_ecb(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_crypt_cbc(ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #0

; 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) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_crypt_cfb128(ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_crypt_ctr(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @mbedtls_aes_self_test(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [32 x i8], align 16
  %9 = alloca [64 x i8], align 16
  %10 = alloca [16 x i8], align 16
  %11 = alloca [16 x i8], align 16
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca [16 x i8], align 16
  %15 = alloca [16 x i8], align 16
  %16 = alloca %struct.mbedtls_aes_context, align 8
  %17 = alloca [16 x i8], align 16
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 288, ptr %16) #6
  %18 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %18, i8 0, i64 32, i1 false)
  call void @mbedtls_aes_init(ptr noundef %16)
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %112, %1
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = icmp slt i32 %20, 6
  br i1 %21, label %22, label %115

22:                                               ; preds = %19
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = ashr i32 %23, 1
  store i32 %24, ptr %6, align 4, !tbaa !5
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = and i32 %25, 1
  store i32 %26, ptr %7, align 4, !tbaa !5
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %38

29:                                               ; preds = %22
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = mul nsw i32 %30, 64
  %32 = add nsw i32 128, %31
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = icmp eq i32 %33, 0
  %35 = zext i1 %34 to i64
  %36 = select i1 %34, ptr @.str.1, ptr @.str.2
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %32, ptr noundef %36)
  br label %38

38:                                               ; preds = %29, %22
  %39 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %39, i8 0, i64 16, i1 false)
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %74

42:                                               ; preds = %38
  %43 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = mul nsw i32 %44, 64
  %46 = add nsw i32 128, %45
  %47 = call i32 @mbedtls_aes_setkey_dec(ptr noundef %16, ptr noundef %43, i32 noundef %46)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %56, %42
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = icmp slt i32 %49, 10000
  br i1 %50, label %51, label %59

51:                                               ; preds = %48
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %54 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %55 = call i32 @mbedtls_aes_crypt_ecb(ptr noundef %16, i32 noundef %52, ptr noundef %53, ptr noundef %54)
  br label %56

56:                                               ; preds = %51
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %5, align 4, !tbaa !5
  br label %48, !llvm.loop !9

59:                                               ; preds = %48
  %60 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_ecb_dec, i64 0, i64 %62
  %64 = getelementptr inbounds [16 x i8], ptr %63, i64 0, i64 0
  %65 = call i32 @memcmp(ptr noundef %60, ptr noundef %64, i64 noundef 16) #7
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %73

67:                                               ; preds = %59
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %72

70:                                               ; preds = %67
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %72

72:                                               ; preds = %70, %67
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %443

73:                                               ; preds = %59
  br label %106

74:                                               ; preds = %38
  %75 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = mul nsw i32 %76, 64
  %78 = add nsw i32 128, %77
  %79 = call i32 @mbedtls_aes_setkey_enc(ptr noundef %16, ptr noundef %75, i32 noundef %78)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %88, %74
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = icmp slt i32 %81, 10000
  br i1 %82, label %83, label %91

83:                                               ; preds = %80
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %86 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %87 = call i32 @mbedtls_aes_crypt_ecb(ptr noundef %16, i32 noundef %84, ptr noundef %85, ptr noundef %86)
  br label %88

88:                                               ; preds = %83
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %5, align 4, !tbaa !5
  br label %80, !llvm.loop !11

91:                                               ; preds = %80
  %92 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_ecb_enc, i64 0, i64 %94
  %96 = getelementptr inbounds [16 x i8], ptr %95, i64 0, i64 0
  %97 = call i32 @memcmp(ptr noundef %92, ptr noundef %96, i64 noundef 16) #7
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %105

99:                                               ; preds = %91
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %104

102:                                              ; preds = %99
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %104

104:                                              ; preds = %102, %99
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %443

105:                                              ; preds = %91
  br label %106

106:                                              ; preds = %105, %73
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %111

109:                                              ; preds = %106
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %111

111:                                              ; preds = %109, %106
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %4, align 4, !tbaa !5
  br label %19, !llvm.loop !12

115:                                              ; preds = %19
  %116 = load i32, ptr %2, align 4, !tbaa !5
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %120

118:                                              ; preds = %115
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %120

120:                                              ; preds = %118, %115
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %224, %120
  %122 = load i32, ptr %4, align 4, !tbaa !5
  %123 = icmp slt i32 %122, 6
  br i1 %123, label %124, label %227

124:                                              ; preds = %121
  %125 = load i32, ptr %4, align 4, !tbaa !5
  %126 = ashr i32 %125, 1
  store i32 %126, ptr %6, align 4, !tbaa !5
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = and i32 %127, 1
  store i32 %128, ptr %7, align 4, !tbaa !5
  %129 = load i32, ptr %2, align 4, !tbaa !5
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %140

131:                                              ; preds = %124
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = mul nsw i32 %132, 64
  %134 = add nsw i32 128, %133
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = icmp eq i32 %135, 0
  %137 = zext i1 %136 to i64
  %138 = select i1 %136, ptr @.str.1, ptr @.str.2
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %134, ptr noundef %138)
  br label %140

140:                                              ; preds = %131, %124
  %141 = getelementptr inbounds [16 x i8], ptr %10, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %141, i8 0, i64 16, i1 false)
  %142 = getelementptr inbounds [16 x i8], ptr %11, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %142, i8 0, i64 16, i1 false)
  %143 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %143, i8 0, i64 16, i1 false)
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = icmp eq i32 %144, 0
  br i1 %145, label %146, label %179

146:                                              ; preds = %140
  %147 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %148 = load i32, ptr %6, align 4, !tbaa !5
  %149 = mul nsw i32 %148, 64
  %150 = add nsw i32 128, %149
  %151 = call i32 @mbedtls_aes_setkey_dec(ptr noundef %16, ptr noundef %147, i32 noundef %150)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %161, %146
  %153 = load i32, ptr %5, align 4, !tbaa !5
  %154 = icmp slt i32 %153, 10000
  br i1 %154, label %155, label %164

155:                                              ; preds = %152
  %156 = load i32, ptr %7, align 4, !tbaa !5
  %157 = getelementptr inbounds [16 x i8], ptr %10, i64 0, i64 0
  %158 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %159 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %160 = call i32 @mbedtls_aes_crypt_cbc(ptr noundef %16, i32 noundef %156, i64 noundef 16, ptr noundef %157, ptr noundef %158, ptr noundef %159)
  br label %161

161:                                              ; preds = %155
  %162 = load i32, ptr %5, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %5, align 4, !tbaa !5
  br label %152, !llvm.loop !13

164:                                              ; preds = %152
  %165 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %166 = load i32, ptr %6, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_cbc_dec, i64 0, i64 %167
  %169 = getelementptr inbounds [16 x i8], ptr %168, i64 0, i64 0
  %170 = call i32 @memcmp(ptr noundef %165, ptr noundef %169, i64 noundef 16) #7
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %172, label %178

172:                                              ; preds = %164
  %173 = load i32, ptr %2, align 4, !tbaa !5
  %174 = icmp ne i32 %173, 0
  br i1 %174, label %175, label %177

175:                                              ; preds = %172
  %176 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %177

177:                                              ; preds = %175, %172
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %443

178:                                              ; preds = %164
  br label %218

179:                                              ; preds = %140
  %180 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %181 = load i32, ptr %6, align 4, !tbaa !5
  %182 = mul nsw i32 %181, 64
  %183 = add nsw i32 128, %182
  %184 = call i32 @mbedtls_aes_setkey_enc(ptr noundef %16, ptr noundef %180, i32 noundef %183)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %200, %179
  %186 = load i32, ptr %5, align 4, !tbaa !5
  %187 = icmp slt i32 %186, 10000
  br i1 %187, label %188, label %203

188:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %189 = load i32, ptr %7, align 4, !tbaa !5
  %190 = getelementptr inbounds [16 x i8], ptr %10, i64 0, i64 0
  %191 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %192 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %193 = call i32 @mbedtls_aes_crypt_cbc(ptr noundef %16, i32 noundef %189, i64 noundef 16, ptr noundef %190, ptr noundef %191, ptr noundef %192)
  %194 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  %195 = getelementptr inbounds [16 x i8], ptr %11, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %194, ptr align 16 %195, i64 16, i1 false)
  %196 = getelementptr inbounds [16 x i8], ptr %11, i64 0, i64 0
  %197 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %196, ptr align 16 %197, i64 16, i1 false)
  %198 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %199 = getelementptr inbounds [16 x i8], ptr %17, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %198, ptr align 16 %199, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  br label %200

200:                                              ; preds = %188
  %201 = load i32, ptr %5, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %5, align 4, !tbaa !5
  br label %185, !llvm.loop !14

203:                                              ; preds = %185
  %204 = getelementptr inbounds [16 x i8], ptr %11, i64 0, i64 0
  %205 = load i32, ptr %6, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_cbc_enc, i64 0, i64 %206
  %208 = getelementptr inbounds [16 x i8], ptr %207, i64 0, i64 0
  %209 = call i32 @memcmp(ptr noundef %204, ptr noundef %208, i64 noundef 16) #7
  %210 = icmp ne i32 %209, 0
  br i1 %210, label %211, label %217

211:                                              ; preds = %203
  %212 = load i32, ptr %2, align 4, !tbaa !5
  %213 = icmp ne i32 %212, 0
  br i1 %213, label %214, label %216

214:                                              ; preds = %211
  %215 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %216

216:                                              ; preds = %214, %211
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %443

217:                                              ; preds = %203
  br label %218

218:                                              ; preds = %217, %178
  %219 = load i32, ptr %2, align 4, !tbaa !5
  %220 = icmp ne i32 %219, 0
  br i1 %220, label %221, label %223

221:                                              ; preds = %218
  %222 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %223

223:                                              ; preds = %221, %218
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %4, align 4, !tbaa !5
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %4, align 4, !tbaa !5
  br label %121, !llvm.loop !15

227:                                              ; preds = %121
  %228 = load i32, ptr %2, align 4, !tbaa !5
  %229 = icmp ne i32 %228, 0
  br i1 %229, label %230, label %232

230:                                              ; preds = %227
  %231 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %232

232:                                              ; preds = %230, %227
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %233

233:                                              ; preds = %318, %232
  %234 = load i32, ptr %4, align 4, !tbaa !5
  %235 = icmp slt i32 %234, 6
  br i1 %235, label %236, label %321

236:                                              ; preds = %233
  %237 = load i32, ptr %4, align 4, !tbaa !5
  %238 = ashr i32 %237, 1
  store i32 %238, ptr %6, align 4, !tbaa !5
  %239 = load i32, ptr %4, align 4, !tbaa !5
  %240 = and i32 %239, 1
  store i32 %240, ptr %7, align 4, !tbaa !5
  %241 = load i32, ptr %2, align 4, !tbaa !5
  %242 = icmp ne i32 %241, 0
  br i1 %242, label %243, label %252

243:                                              ; preds = %236
  %244 = load i32, ptr %6, align 4, !tbaa !5
  %245 = mul nsw i32 %244, 64
  %246 = add nsw i32 128, %245
  %247 = load i32, ptr %7, align 4, !tbaa !5
  %248 = icmp eq i32 %247, 0
  %249 = zext i1 %248 to i64
  %250 = select i1 %248, ptr @.str.1, ptr @.str.2
  %251 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %246, ptr noundef %250)
  br label %252

252:                                              ; preds = %243, %236
  %253 = getelementptr inbounds [16 x i8], ptr %10, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %253, ptr align 16 @aes_test_cfb128_iv, i64 16, i1 false)
  %254 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %255 = load i32, ptr %6, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [3 x [32 x i8]], ptr @aes_test_cfb128_key, i64 0, i64 %256
  %258 = getelementptr inbounds [32 x i8], ptr %257, i64 0, i64 0
  %259 = load i32, ptr %6, align 4, !tbaa !5
  %260 = mul nsw i32 %259, 8
  %261 = add nsw i32 16, %260
  %262 = sext i32 %261 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %254, ptr align 16 %258, i64 %262, i1 false)
  store i64 0, ptr %12, align 8, !tbaa !16
  %263 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %264 = load i32, ptr %6, align 4, !tbaa !5
  %265 = mul nsw i32 %264, 64
  %266 = add nsw i32 128, %265
  %267 = call i32 @mbedtls_aes_setkey_enc(ptr noundef %16, ptr noundef %263, i32 noundef %266)
  %268 = load i32, ptr %7, align 4, !tbaa !5
  %269 = icmp eq i32 %268, 0
  br i1 %269, label %270, label %291

270:                                              ; preds = %252
  %271 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %272 = load i32, ptr %6, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [3 x [64 x i8]], ptr @aes_test_cfb128_ct, i64 0, i64 %273
  %275 = getelementptr inbounds [64 x i8], ptr %274, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %271, ptr align 16 %275, i64 64, i1 false)
  %276 = load i32, ptr %7, align 4, !tbaa !5
  %277 = getelementptr inbounds [16 x i8], ptr %10, i64 0, i64 0
  %278 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %279 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %280 = call i32 @mbedtls_aes_crypt_cfb128(ptr noundef %16, i32 noundef %276, i64 noundef 64, ptr noundef %12, ptr noundef %277, ptr noundef %278, ptr noundef %279)
  %281 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %282 = call i32 @memcmp(ptr noundef %281, ptr noundef @aes_test_cfb128_pt, i64 noundef 64) #7
  %283 = icmp ne i32 %282, 0
  br i1 %283, label %284, label %290

284:                                              ; preds = %270
  %285 = load i32, ptr %2, align 4, !tbaa !5
  %286 = icmp ne i32 %285, 0
  br i1 %286, label %287, label %289

287:                                              ; preds = %284
  %288 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %289

289:                                              ; preds = %287, %284
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %443

290:                                              ; preds = %270
  br label %312

291:                                              ; preds = %252
  %292 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %292, ptr align 16 @aes_test_cfb128_pt, i64 64, i1 false)
  %293 = load i32, ptr %7, align 4, !tbaa !5
  %294 = getelementptr inbounds [16 x i8], ptr %10, i64 0, i64 0
  %295 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %296 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %297 = call i32 @mbedtls_aes_crypt_cfb128(ptr noundef %16, i32 noundef %293, i64 noundef 64, ptr noundef %12, ptr noundef %294, ptr noundef %295, ptr noundef %296)
  %298 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %299 = load i32, ptr %6, align 4, !tbaa !5
  %300 = sext i32 %299 to i64
  %301 = getelementptr inbounds [3 x [64 x i8]], ptr @aes_test_cfb128_ct, i64 0, i64 %300
  %302 = getelementptr inbounds [64 x i8], ptr %301, i64 0, i64 0
  %303 = call i32 @memcmp(ptr noundef %298, ptr noundef %302, i64 noundef 64) #7
  %304 = icmp ne i32 %303, 0
  br i1 %304, label %305, label %311

305:                                              ; preds = %291
  %306 = load i32, ptr %2, align 4, !tbaa !5
  %307 = icmp ne i32 %306, 0
  br i1 %307, label %308, label %310

308:                                              ; preds = %305
  %309 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %310

310:                                              ; preds = %308, %305
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %443

311:                                              ; preds = %291
  br label %312

312:                                              ; preds = %311, %290
  %313 = load i32, ptr %2, align 4, !tbaa !5
  %314 = icmp ne i32 %313, 0
  br i1 %314, label %315, label %317

315:                                              ; preds = %312
  %316 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %317

317:                                              ; preds = %315, %312
  br label %318

318:                                              ; preds = %317
  %319 = load i32, ptr %4, align 4, !tbaa !5
  %320 = add nsw i32 %319, 1
  store i32 %320, ptr %4, align 4, !tbaa !5
  br label %233, !llvm.loop !18

321:                                              ; preds = %233
  %322 = load i32, ptr %2, align 4, !tbaa !5
  %323 = icmp ne i32 %322, 0
  br i1 %323, label %324, label %326

324:                                              ; preds = %321
  %325 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %326

326:                                              ; preds = %324, %321
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %327

327:                                              ; preds = %434, %326
  %328 = load i32, ptr %4, align 4, !tbaa !5
  %329 = icmp slt i32 %328, 6
  br i1 %329, label %330, label %437

330:                                              ; preds = %327
  %331 = load i32, ptr %4, align 4, !tbaa !5
  %332 = ashr i32 %331, 1
  store i32 %332, ptr %6, align 4, !tbaa !5
  %333 = load i32, ptr %4, align 4, !tbaa !5
  %334 = and i32 %333, 1
  store i32 %334, ptr %7, align 4, !tbaa !5
  %335 = load i32, ptr %2, align 4, !tbaa !5
  %336 = icmp ne i32 %335, 0
  br i1 %336, label %337, label %343

337:                                              ; preds = %330
  %338 = load i32, ptr %7, align 4, !tbaa !5
  %339 = icmp eq i32 %338, 0
  %340 = zext i1 %339 to i64
  %341 = select i1 %339, ptr @.str.1, ptr @.str.2
  %342 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %341)
  br label %343

343:                                              ; preds = %337, %330
  %344 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %345 = load i32, ptr %6, align 4, !tbaa !5
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_ctr_nonce_counter, i64 0, i64 %346
  %348 = getelementptr inbounds [16 x i8], ptr %347, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %344, ptr align 16 %348, i64 16, i1 false)
  %349 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %350 = load i32, ptr %6, align 4, !tbaa !5
  %351 = sext i32 %350 to i64
  %352 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_ctr_key, i64 0, i64 %351
  %353 = getelementptr inbounds [16 x i8], ptr %352, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %349, ptr align 16 %353, i64 16, i1 false)
  store i64 0, ptr %12, align 8, !tbaa !16
  %354 = getelementptr inbounds [32 x i8], ptr %8, i64 0, i64 0
  %355 = call i32 @mbedtls_aes_setkey_enc(ptr noundef %16, ptr noundef %354, i32 noundef 128)
  %356 = load i32, ptr %7, align 4, !tbaa !5
  %357 = icmp eq i32 %356, 0
  br i1 %357, label %358, label %393

358:                                              ; preds = %343
  %359 = load i32, ptr %6, align 4, !tbaa !5
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds [3 x i32], ptr @aes_test_ctr_len, i64 0, i64 %360
  %362 = load i32, ptr %361, align 4, !tbaa !5
  store i32 %362, ptr %13, align 4, !tbaa !5
  %363 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %364 = load i32, ptr %6, align 4, !tbaa !5
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds [3 x [48 x i8]], ptr @aes_test_ctr_ct, i64 0, i64 %365
  %367 = getelementptr inbounds [48 x i8], ptr %366, i64 0, i64 0
  %368 = load i32, ptr %13, align 4, !tbaa !5
  %369 = sext i32 %368 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %363, ptr align 16 %367, i64 %369, i1 false)
  %370 = load i32, ptr %13, align 4, !tbaa !5
  %371 = sext i32 %370 to i64
  %372 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %373 = getelementptr inbounds [16 x i8], ptr %15, i64 0, i64 0
  %374 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %375 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %376 = call i32 @mbedtls_aes_crypt_ctr(ptr noundef %16, i64 noundef %371, ptr noundef %12, ptr noundef %372, ptr noundef %373, ptr noundef %374, ptr noundef %375)
  %377 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %378 = load i32, ptr %6, align 4, !tbaa !5
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds [3 x [48 x i8]], ptr @aes_test_ctr_pt, i64 0, i64 %379
  %381 = getelementptr inbounds [48 x i8], ptr %380, i64 0, i64 0
  %382 = load i32, ptr %13, align 4, !tbaa !5
  %383 = sext i32 %382 to i64
  %384 = call i32 @memcmp(ptr noundef %377, ptr noundef %381, i64 noundef %383) #7
  %385 = icmp ne i32 %384, 0
  br i1 %385, label %386, label %392

386:                                              ; preds = %358
  %387 = load i32, ptr %2, align 4, !tbaa !5
  %388 = icmp ne i32 %387, 0
  br i1 %388, label %389, label %391

389:                                              ; preds = %386
  %390 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %391

391:                                              ; preds = %389, %386
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %443

392:                                              ; preds = %358
  br label %428

393:                                              ; preds = %343
  %394 = load i32, ptr %6, align 4, !tbaa !5
  %395 = sext i32 %394 to i64
  %396 = getelementptr inbounds [3 x i32], ptr @aes_test_ctr_len, i64 0, i64 %395
  %397 = load i32, ptr %396, align 4, !tbaa !5
  store i32 %397, ptr %13, align 4, !tbaa !5
  %398 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %399 = load i32, ptr %6, align 4, !tbaa !5
  %400 = sext i32 %399 to i64
  %401 = getelementptr inbounds [3 x [48 x i8]], ptr @aes_test_ctr_pt, i64 0, i64 %400
  %402 = getelementptr inbounds [48 x i8], ptr %401, i64 0, i64 0
  %403 = load i32, ptr %13, align 4, !tbaa !5
  %404 = sext i32 %403 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %398, ptr align 16 %402, i64 %404, i1 false)
  %405 = load i32, ptr %13, align 4, !tbaa !5
  %406 = sext i32 %405 to i64
  %407 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %408 = getelementptr inbounds [16 x i8], ptr %15, i64 0, i64 0
  %409 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %410 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %411 = call i32 @mbedtls_aes_crypt_ctr(ptr noundef %16, i64 noundef %406, ptr noundef %12, ptr noundef %407, ptr noundef %408, ptr noundef %409, ptr noundef %410)
  %412 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %413 = load i32, ptr %6, align 4, !tbaa !5
  %414 = sext i32 %413 to i64
  %415 = getelementptr inbounds [3 x [48 x i8]], ptr @aes_test_ctr_ct, i64 0, i64 %414
  %416 = getelementptr inbounds [48 x i8], ptr %415, i64 0, i64 0
  %417 = load i32, ptr %13, align 4, !tbaa !5
  %418 = sext i32 %417 to i64
  %419 = call i32 @memcmp(ptr noundef %412, ptr noundef %416, i64 noundef %418) #7
  %420 = icmp ne i32 %419, 0
  br i1 %420, label %421, label %427

421:                                              ; preds = %393
  %422 = load i32, ptr %2, align 4, !tbaa !5
  %423 = icmp ne i32 %422, 0
  br i1 %423, label %424, label %426

424:                                              ; preds = %421
  %425 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %426

426:                                              ; preds = %424, %421
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %443

427:                                              ; preds = %393
  br label %428

428:                                              ; preds = %427, %392
  %429 = load i32, ptr %2, align 4, !tbaa !5
  %430 = icmp ne i32 %429, 0
  br i1 %430, label %431, label %433

431:                                              ; preds = %428
  %432 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %433

433:                                              ; preds = %431, %428
  br label %434

434:                                              ; preds = %433
  %435 = load i32, ptr %4, align 4, !tbaa !5
  %436 = add nsw i32 %435, 1
  store i32 %436, ptr %4, align 4, !tbaa !5
  br label %327, !llvm.loop !19

437:                                              ; preds = %327
  %438 = load i32, ptr %2, align 4, !tbaa !5
  %439 = icmp ne i32 %438, 0
  br i1 %439, label %440, label %442

440:                                              ; preds = %437
  %441 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %442

442:                                              ; preds = %440, %437
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %443

443:                                              ; preds = %442, %426, %391, %310, %289, %216, %177, %104, %72
  call void @mbedtls_aes_free(ptr noundef %16)
  %444 = load i32, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 288, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret i32 %444
}

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

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

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


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

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@aes_test_ecb_dec = external hidden constant [3 x [16 x i8]], align 16
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@aes_test_ecb_enc = external hidden constant [3 x [16 x i8]], align 16
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@aes_test_cbc_dec = external hidden constant [3 x [16 x i8]], align 16
@aes_test_cbc_enc = external hidden constant [3 x [16 x i8]], align 16
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@aes_test_cfb128_iv = external hidden local_unnamed_addr constant [16 x i8], align 16
@aes_test_cfb128_ct = external hidden constant [3 x [64 x i8]], align 16
@aes_test_cfb128_pt = external hidden constant [64 x i8], align 16
@.str.8 = external hidden unnamed_addr constant [21 x i8], align 1
@aes_test_ctr_nonce_counter = external hidden local_unnamed_addr constant [3 x [16 x i8]], align 16
@aes_test_ctr_key = external hidden local_unnamed_addr constant [3 x [16 x i8]], align 16
@aes_test_ctr_len = external hidden local_unnamed_addr constant [3 x i32], align 4
@aes_test_cfb128_key = external hidden local_unnamed_addr constant <{ <{ [16 x i8], [16 x i8] }>, <{ [24 x i8], [8 x i8] }>, [32 x i8] }>, align 16
@aes_test_ctr_ct = external hidden constant <{ <{ [16 x i8], [32 x i8] }>, <{ [32 x i8], [16 x i8] }>, <{ [36 x i8], [12 x i8] }> }>, align 16
@aes_test_ctr_pt = external hidden constant <{ <{ [16 x i8], [32 x i8] }>, <{ [32 x i8], [16 x i8] }>, <{ [36 x i8], [12 x i8] }> }>, align 16

; Function Attrs: nounwind uwtable
declare dso_local void @mbedtls_aes_init(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @mbedtls_aes_free(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_setkey_enc(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_setkey_dec(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_crypt_ecb(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_crypt_cbc(ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; 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) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_crypt_cfb128(ptr noundef, i32 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @mbedtls_aes_crypt_ctr(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @mbedtls_aes_self_test(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca [32 x i8], align 16
  %3 = alloca [64 x i8], align 16
  %4 = alloca [16 x i8], align 16
  %5 = alloca [16 x i8], align 16
  %6 = alloca i64, align 8
  %7 = alloca [16 x i8], align 16
  %8 = alloca [16 x i8], align 16
  %9 = alloca %struct.mbedtls_aes_context, align 8
  %10 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 288, ptr nonnull %9) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %2, i8 0, i64 32, i1 false)
  call void @mbedtls_aes_init(ptr noundef nonnull %9)
  %.not111 = icmp eq i32 %0, 0
  br label %.backedge150

.backedge150:                                     ; preds = %.backedge150.backedge, %1
  %.089119 = phi i32 [ 0, %1 ], [ %.089119.be, %.backedge150.backedge ]
  %11 = lshr i32 %.089119, 1
  %12 = and i32 %.089119, 1
  br i1 %.not111, label %19, label %13

13:                                               ; preds = %.backedge150
  %14 = shl nuw nsw i32 %11, 6
  %15 = add nuw nsw i32 %14, 128
  %16 = icmp eq i32 %12, 0
  %17 = select i1 %16, ptr @.str.1, ptr @.str.2
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15, ptr noundef nonnull %17)
  br label %19

19:                                               ; preds = %13, %.backedge150
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  %20 = icmp eq i32 %12, 0
  %21 = shl nuw nsw i32 %11, 6
  %22 = add nuw nsw i32 %21, 128
  br i1 %20, label %23, label %32

23:                                               ; preds = %19
  %24 = call i32 @mbedtls_aes_setkey_dec(ptr noundef nonnull %9, ptr noundef nonnull %2, i32 noundef %22)
  br label %25

25:                                               ; preds = %23, %25
  %.0118 = phi i32 [ 0, %23 ], [ %27, %25 ]
  %26 = call i32 @mbedtls_aes_crypt_ecb(ptr noundef nonnull %9, i32 noundef 0, ptr noundef nonnull %3, ptr noundef nonnull %3)
  %27 = add nuw nsw i32 %.0118, 1
  %exitcond125.not = icmp eq i32 %27, 10000
  br i1 %exitcond125.not, label %28, label %25, !llvm.loop !5

28:                                               ; preds = %25
  %29 = zext nneg i32 %11 to i64
  %30 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_ecb_dec, i64 0, i64 %29
  %bcmp114 = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %3, ptr noundef nonnull dereferenceable(16) %30, i64 16)
  %.not115 = icmp eq i32 %bcmp114, 0
  br i1 %.not115, label %41, label %31

31:                                               ; preds = %28
  br i1 %.not111, label %.loopexit, label %.loopexit.sink.split

32:                                               ; preds = %19
  %33 = call i32 @mbedtls_aes_setkey_enc(ptr noundef nonnull %9, ptr noundef nonnull %2, i32 noundef %22)
  br label %34

34:                                               ; preds = %32, %34
  %.1117 = phi i32 [ 0, %32 ], [ %36, %34 ]
  %35 = call i32 @mbedtls_aes_crypt_ecb(ptr noundef nonnull %9, i32 noundef 1, ptr noundef nonnull %3, ptr noundef nonnull %3)
  %36 = add nuw nsw i32 %.1117, 1
  %exitcond.not = icmp eq i32 %36, 10000
  br i1 %exitcond.not, label %37, label %34, !llvm.loop !7

37:                                               ; preds = %34
  %38 = zext nneg i32 %11 to i64
  %39 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_ecb_enc, i64 0, i64 %38
  %bcmp112 = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %3, ptr noundef nonnull dereferenceable(16) %39, i64 16)
  %.not113 = icmp eq i32 %bcmp112, 0
  br i1 %.not113, label %41, label %40

40:                                               ; preds = %37
  br i1 %.not111, label %.loopexit, label %.loopexit.sink.split

41:                                               ; preds = %37, %28
  br i1 %.not111, label %42, label %.thread

42:                                               ; preds = %41
  %43 = add nuw nsw i32 %.089119, 1
  %exitcond126.not = icmp eq i32 %43, 6
  br i1 %exitcond126.not, label %.loopexit149.preheader, label %.backedge150.backedge

.backedge150.backedge:                            ; preds = %42, %.thread
  %.089119.be = phi i32 [ %43, %42 ], [ %45, %.thread ]
  br label %.backedge150, !llvm.loop !8

.thread:                                          ; preds = %41
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %45 = add nuw nsw i32 %.089119, 1
  %exitcond126.not134 = icmp eq i32 %45, 6
  br i1 %exitcond126.not134, label %46, label %.backedge150.backedge

46:                                               ; preds = %.thread
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %.loopexit149.preheader

.loopexit149.preheader:                           ; preds = %42, %46
  br label %.loopexit149

.loopexit149:                                     ; preds = %.loopexit149.backedge, %.loopexit149.preheader
  %.190122 = phi i32 [ 0, %.loopexit149.preheader ], [ %.190122.be, %.loopexit149.backedge ]
  %48 = lshr i32 %.190122, 1
  %49 = and i32 %.190122, 1
  br i1 %.not111, label %56, label %50

50:                                               ; preds = %.loopexit149
  %51 = shl nuw nsw i32 %48, 6
  %52 = add nuw nsw i32 %51, 128
  %53 = icmp eq i32 %49, 0
  %54 = select i1 %53, ptr @.str.1, ptr @.str.2
  %55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %52, ptr noundef nonnull %54)
  br label %56

56:                                               ; preds = %50, %.loopexit149
  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(16) %5, i8 0, i64 16, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  %57 = icmp eq i32 %49, 0
  %58 = shl nuw nsw i32 %48, 6
  %59 = add nuw nsw i32 %58, 128
  br i1 %57, label %60, label %69

60:                                               ; preds = %56
  %61 = call i32 @mbedtls_aes_setkey_dec(ptr noundef nonnull %9, ptr noundef nonnull %2, i32 noundef %59)
  br label %62

62:                                               ; preds = %60, %62
  %.2121 = phi i32 [ 0, %60 ], [ %64, %62 ]
  %63 = call i32 @mbedtls_aes_crypt_cbc(ptr noundef nonnull %9, i32 noundef 0, i64 noundef 16, ptr noundef nonnull %4, ptr noundef nonnull %3, ptr noundef nonnull %3)
  %64 = add nuw nsw i32 %.2121, 1
  %exitcond128.not = icmp eq i32 %64, 10000
  br i1 %exitcond128.not, label %65, label %62, !llvm.loop !9

65:                                               ; preds = %62
  %66 = zext nneg i32 %48 to i64
  %67 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_cbc_dec, i64 0, i64 %66
  %bcmp109 = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %3, ptr noundef nonnull dereferenceable(16) %67, i64 16)
  %.not110 = icmp eq i32 %bcmp109, 0
  br i1 %.not110, label %78, label %68

68:                                               ; preds = %65
  br i1 %.not111, label %.loopexit, label %.loopexit.sink.split

69:                                               ; preds = %56
  %70 = call i32 @mbedtls_aes_setkey_enc(ptr noundef nonnull %9, ptr noundef nonnull %2, i32 noundef %59)
  br label %71

71:                                               ; preds = %69, %71
  %.3120 = phi i32 [ 0, %69 ], [ %73, %71 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10)
  %72 = call i32 @mbedtls_aes_crypt_cbc(ptr noundef nonnull %9, i32 noundef 1, i64 noundef 16, ptr noundef nonnull %4, ptr noundef nonnull %3, ptr noundef nonnull %3)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %10, ptr noundef nonnull align 16 dereferenceable(16) %5, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %3, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 16 dereferenceable(16) %10, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10)
  %73 = add nuw nsw i32 %.3120, 1
  %exitcond127.not = icmp eq i32 %73, 10000
  br i1 %exitcond127.not, label %74, label %71, !llvm.loop !10

74:                                               ; preds = %71
  %75 = zext nneg i32 %48 to i64
  %76 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_cbc_enc, i64 0, i64 %75
  %bcmp107 = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %5, ptr noundef nonnull dereferenceable(16) %76, i64 16)
  %.not108 = icmp eq i32 %bcmp107, 0
  br i1 %.not108, label %78, label %77

77:                                               ; preds = %74
  br i1 %.not111, label %.loopexit, label %.loopexit.sink.split

78:                                               ; preds = %74, %65
  br i1 %.not111, label %79, label %.thread136

79:                                               ; preds = %78
  %80 = add nuw nsw i32 %.190122, 1
  %exitcond129.not = icmp eq i32 %80, 6
  br i1 %exitcond129.not, label %.loopexit147.preheader, label %.loopexit149.backedge

.loopexit149.backedge:                            ; preds = %79, %.thread136
  %.190122.be = phi i32 [ %80, %79 ], [ %82, %.thread136 ]
  br label %.loopexit149, !llvm.loop !11

.thread136:                                       ; preds = %78
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %82 = add nuw nsw i32 %.190122, 1
  %exitcond129.not137 = icmp eq i32 %82, 6
  br i1 %exitcond129.not137, label %83, label %.loopexit149.backedge

83:                                               ; preds = %.thread136
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %.loopexit147.preheader

.loopexit147.preheader:                           ; preds = %79, %83
  br label %.loopexit147

.loopexit147:                                     ; preds = %.loopexit147.backedge, %.loopexit147.preheader
  %.291123 = phi i32 [ 0, %.loopexit147.preheader ], [ %.291123.be, %.loopexit147.backedge ]
  %85 = lshr i32 %.291123, 1
  %86 = and i32 %.291123, 1
  %.pre = shl nuw nsw i32 %85, 6
  %.pre132 = add nuw nsw i32 %.pre, 128
  br i1 %.not111, label %._crit_edge, label %87

87:                                               ; preds = %.loopexit147
  %88 = icmp eq i32 %86, 0
  %89 = select i1 %88, ptr @.str.1, ptr @.str.2
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %.pre132, ptr noundef nonnull %89)
  br label %._crit_edge

._crit_edge:                                      ; preds = %.loopexit147, %87
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, ptr noundef nonnull align 16 dereferenceable(16) @aes_test_cfb128_iv, i64 16, i1 false)
  %91 = zext nneg i32 %85 to i64
  %92 = getelementptr inbounds [3 x [32 x i8]], ptr @aes_test_cfb128_key, i64 0, i64 %91
  %93 = shl nuw nsw i32 %85, 3
  %94 = add nuw nsw i32 %93, 16
  %95 = zext nneg i32 %94 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %2, ptr noundef nonnull align 16 dereferenceable(1) %92, i64 %95, i1 false)
  store i64 0, ptr %6, align 8, !tbaa !12
  %96 = call i32 @mbedtls_aes_setkey_enc(ptr noundef nonnull %9, ptr noundef nonnull %2, i32 noundef %.pre132)
  %97 = icmp eq i32 %86, 0
  br i1 %97, label %98, label %102

98:                                               ; preds = %._crit_edge
  %99 = getelementptr inbounds [3 x [64 x i8]], ptr @aes_test_cfb128_ct, i64 0, i64 %91
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %3, ptr noundef nonnull align 16 dereferenceable(64) %99, i64 64, i1 false)
  %100 = call i32 @mbedtls_aes_crypt_cfb128(ptr noundef nonnull %9, i32 noundef 0, i64 noundef 64, ptr noundef nonnull %6, ptr noundef nonnull %4, ptr noundef nonnull %3, ptr noundef nonnull %3)
  %bcmp105 = call i32 @bcmp(ptr noundef nonnull dereferenceable(64) %3, ptr noundef nonnull dereferenceable(64) @aes_test_cfb128_pt, i64 64)
  %.not106 = icmp eq i32 %bcmp105, 0
  br i1 %.not106, label %106, label %101

101:                                              ; preds = %98
  br i1 %.not111, label %.loopexit, label %.loopexit.sink.split

102:                                              ; preds = %._crit_edge
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %3, ptr noundef nonnull align 16 dereferenceable(64) @aes_test_cfb128_pt, i64 64, i1 false)
  %103 = call i32 @mbedtls_aes_crypt_cfb128(ptr noundef nonnull %9, i32 noundef 1, i64 noundef 64, ptr noundef nonnull %6, ptr noundef nonnull %4, ptr noundef nonnull %3, ptr noundef nonnull %3)
  %104 = getelementptr inbounds [3 x [64 x i8]], ptr @aes_test_cfb128_ct, i64 0, i64 %91
  %bcmp103 = call i32 @bcmp(ptr noundef nonnull dereferenceable(64) %3, ptr noundef nonnull dereferenceable(64) %104, i64 64)
  %.not104 = icmp eq i32 %bcmp103, 0
  br i1 %.not104, label %106, label %105

105:                                              ; preds = %102
  br i1 %.not111, label %.loopexit, label %.loopexit.sink.split

106:                                              ; preds = %102, %98
  br i1 %.not111, label %107, label %.thread139

107:                                              ; preds = %106
  %108 = add nuw nsw i32 %.291123, 1
  %exitcond130.not = icmp eq i32 %108, 6
  br i1 %exitcond130.not, label %.loopexit145.preheader, label %.loopexit147.backedge

.loopexit147.backedge:                            ; preds = %107, %.thread139
  %.291123.be = phi i32 [ %108, %107 ], [ %110, %.thread139 ]
  br label %.loopexit147, !llvm.loop !16

.thread139:                                       ; preds = %106
  %109 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %110 = add nuw nsw i32 %.291123, 1
  %exitcond130.not140 = icmp eq i32 %110, 6
  br i1 %exitcond130.not140, label %111, label %.loopexit147.backedge

111:                                              ; preds = %.thread139
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %.loopexit145.preheader

.loopexit145.preheader:                           ; preds = %107, %111
  br label %.loopexit145

.loopexit145:                                     ; preds = %.loopexit145.backedge, %.loopexit145.preheader
  %.392124 = phi i32 [ 0, %.loopexit145.preheader ], [ %.392124.be, %.loopexit145.backedge ]
  %113 = lshr i32 %.392124, 1
  %114 = and i32 %.392124, 1
  br i1 %.not111, label %119, label %115

115:                                              ; preds = %.loopexit145
  %116 = icmp eq i32 %114, 0
  %117 = select i1 %116, ptr @.str.1, ptr @.str.2
  %118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef nonnull %117)
  br label %119

119:                                              ; preds = %115, %.loopexit145
  %120 = zext nneg i32 %113 to i64
  %121 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_ctr_nonce_counter, i64 0, i64 %120
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %7, ptr noundef nonnull align 16 dereferenceable(16) %121, i64 16, i1 false)
  %122 = getelementptr inbounds [3 x [16 x i8]], ptr @aes_test_ctr_key, i64 0, i64 %120
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %2, ptr noundef nonnull align 16 dereferenceable(16) %122, i64 16, i1 false)
  store i64 0, ptr %6, align 8, !tbaa !12
  %123 = call i32 @mbedtls_aes_setkey_enc(ptr noundef nonnull %9, ptr noundef nonnull %2, i32 noundef 128)
  %124 = icmp eq i32 %114, 0
  %125 = getelementptr inbounds [3 x i32], ptr @aes_test_ctr_len, i64 0, i64 %120
  %126 = load i32, ptr %125, align 4, !tbaa !17
  %127 = sext i32 %126 to i64
  br i1 %124, label %128, label %133

128:                                              ; preds = %119
  %129 = getelementptr inbounds [3 x [48 x i8]], ptr @aes_test_ctr_ct, i64 0, i64 %120
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %3, ptr nonnull align 16 %129, i64 %127, i1 false)
  %130 = call i32 @mbedtls_aes_crypt_ctr(ptr noundef nonnull %9, i64 noundef %127, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %3, ptr noundef nonnull %3)
  %131 = getelementptr inbounds [3 x [48 x i8]], ptr @aes_test_ctr_pt, i64 0, i64 %120
  %bcmp101 = call i32 @bcmp(ptr nonnull %3, ptr nonnull %131, i64 %127)
  %.not102 = icmp eq i32 %bcmp101, 0
  br i1 %.not102, label %138, label %132

132:                                              ; preds = %128
  br i1 %.not111, label %.loopexit, label %.loopexit.sink.split

133:                                              ; preds = %119
  %134 = getelementptr inbounds [3 x [48 x i8]], ptr @aes_test_ctr_pt, i64 0, i64 %120
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %3, ptr nonnull align 16 %134, i64 %127, i1 false)
  %135 = call i32 @mbedtls_aes_crypt_ctr(ptr noundef nonnull %9, i64 noundef %127, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %3, ptr noundef nonnull %3)
  %136 = getelementptr inbounds [3 x [48 x i8]], ptr @aes_test_ctr_ct, i64 0, i64 %120
  %bcmp = call i32 @bcmp(ptr nonnull %3, ptr nonnull %136, i64 %127)
  %.not100 = icmp eq i32 %bcmp, 0
  br i1 %.not100, label %138, label %137

137:                                              ; preds = %133
  br i1 %.not111, label %.loopexit, label %.loopexit.sink.split

138:                                              ; preds = %133, %128
  br i1 %.not111, label %139, label %.thread142

139:                                              ; preds = %138
  %140 = add nuw nsw i32 %.392124, 1
  %exitcond131.not = icmp eq i32 %140, 6
  br i1 %exitcond131.not, label %.loopexit, label %.loopexit145.backedge

.loopexit145.backedge:                            ; preds = %139, %.thread142
  %.392124.be = phi i32 [ %140, %139 ], [ %142, %.thread142 ]
  br label %.loopexit145, !llvm.loop !19

.thread142:                                       ; preds = %138
  %141 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %142 = add nuw nsw i32 %.392124, 1
  %exitcond131.not143 = icmp eq i32 %142, 6
  br i1 %exitcond131.not143, label %.loopexit.sink.split, label %.loopexit145.backedge

.loopexit.sink.split:                             ; preds = %.thread142, %137, %132, %105, %101, %77, %68, %40, %31
  %.str.5.sink = phi ptr [ @.str.3, %31 ], [ @.str.3, %40 ], [ @.str.3, %68 ], [ @.str.3, %77 ], [ @.str.3, %101 ], [ @.str.3, %105 ], [ @.str.3, %132 ], [ @.str.3, %137 ], [ @.str.5, %.thread142 ]
  %.093.ph = phi i32 [ 1, %31 ], [ 1, %40 ], [ 1, %68 ], [ 1, %77 ], [ 1, %101 ], [ 1, %105 ], [ 1, %132 ], [ 1, %137 ], [ 0, %.thread142 ]
  %143 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink)
  br label %.loopexit

.loopexit:                                        ; preds = %139, %.loopexit.sink.split, %137, %132, %105, %101, %77, %68, %40, %31
  %.093 = phi i32 [ 1, %31 ], [ 1, %40 ], [ 1, %68 ], [ 1, %77 ], [ 1, %101 ], [ 1, %105 ], [ 1, %132 ], [ 1, %137 ], [ %.093.ph, %.loopexit.sink.split ], [ 0, %139 ]
  call void @mbedtls_aes_free(ptr noundef nonnull %9)
  call void @llvm.lifetime.end.p0(i64 288, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  ret i32 %.093
}

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

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

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 nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}
!9 = distinct !{!9, !6}
!10 = distinct !{!10, !6}
!11 = distinct !{!11, !6}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !14, i64 0}
!14 = !{!"omnipotent char", !15, i64 0}
!15 = !{!"Simple C/C++ TBAA"}
!16 = distinct !{!16, !6}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !14, i64 0}
!19 = distinct !{!19, !6}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass