; LLVM IR from intel/cryptography-primitives :: sources/ippcp (pcpaesminitca)

; 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._cpRijndael128 = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, [124 x i32] }

@rij128nKeys = external hidden global [3 x i32], align 4
@rij128nRounds = external hidden global [3 x i32], align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @ippsAESInit(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca [32 x i8], align 16
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = icmp eq ptr null, %17
  br i1 %18, label %19, label %20

19:                                               ; preds = %4
  store i32 -8, ptr %5, align 4
  br label %284

20:                                               ; preds = %4
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = icmp ne i32 %21, 16
  br i1 %22, label %23, label %30

23:                                               ; preds = %20
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = icmp ne i32 %24, 24
  br i1 %25, label %26, label %30

26:                                               ; preds = %23
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = icmp ne i32 %27, 32
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  store i32 -15, ptr %5, align 4
  br label %284

30:                                               ; preds = %26, %23, %20
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 568
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = load i32, ptr %9, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i8, ptr %33, i64 %35
  %37 = icmp ugt ptr %32, %36
  br i1 %37, label %38, label %39

38:                                               ; preds = %30
  store i32 -9, ptr %5, align 4
  br label %284

39:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = mul nsw i32 %40, 8
  %42 = sdiv i32 %41, 32
  store i32 %42, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %43 = load i32, ptr %10, align 4, !tbaa !9
  %44 = call i32 @rij_index(i32 noundef %43)
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [3 x i32], ptr @rij128nKeys, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !9
  store i32 %47, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = call i32 @rij_index(i32 noundef %48)
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [3 x i32], ptr @rij128nRounds, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !9
  store i32 %52, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #5
  call void @llvm.memset.p0.i64(ptr align 16 %13, i8 0, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %57

55:                                               ; preds = %39
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  br label %59

57:                                               ; preds = %39
  %58 = getelementptr inbounds [32 x i8], ptr %13, i64 0, i64 0
  br label %59

59:                                               ; preds = %57, %55
  %60 = phi ptr [ %56, %55 ], [ %58, %57 ]
  store ptr %60, ptr %14, align 8, !tbaa !5
  %61 = load ptr, ptr %8, align 8, !tbaa !5
  call void @PadBlock(i8 noundef zeroext 0, ptr noundef %61, i32 noundef 568)
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = call i64 @IPP_UINT_PTR(ptr noundef %62)
  %64 = trunc i64 %63 to i32
  %65 = xor i32 542263626, %64
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._cpRijndael128, ptr %66, i32 0, i32 0
  store i32 %65, ptr %67, align 8, !tbaa !11
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._cpRijndael128, ptr %68, i32 0, i32 2
  store i32 4, ptr %69, align 8, !tbaa !13
  %70 = load i32, ptr %10, align 4, !tbaa !9
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._cpRijndael128, ptr %71, i32 0, i32 1
  store i32 %70, ptr %72, align 4, !tbaa !14
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._cpRijndael128, ptr %74, i32 0, i32 3
  store i32 %73, ptr %75, align 4, !tbaa !15
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._cpRijndael128, ptr %76, i32 0, i32 11
  store i32 1, ptr %77, align 4, !tbaa !16
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  call void @cpAes_setup_ptrs_and_methods(ptr noundef %78)
  %79 = load ptr, ptr %14, align 8, !tbaa !5
  %80 = load i32, ptr %10, align 4, !tbaa !9
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct._cpRijndael128, ptr %83, i32 0, i32 8
  %85 = load ptr, ptr %84, align 8, !tbaa !17
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._cpRijndael128, ptr %86, i32 0, i32 9
  %88 = load ptr, ptr %87, align 8, !tbaa !18
  call void @ExpandRijndaelKey(ptr noundef %79, i32 noundef %80, i32 noundef 4, i32 noundef %81, i32 noundef %82, ptr noundef %85, ptr noundef %88)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct._cpRijndael128, ptr %89, i32 0, i32 8
  %91 = load ptr, ptr %90, align 8, !tbaa !17
  store ptr %91, ptr %16, align 8, !tbaa !5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %278, %59
  %93 = load i32, ptr %15, align 4, !tbaa !9
  %94 = load i32, ptr %12, align 4, !tbaa !9
  %95 = add nsw i32 1, %94
  %96 = icmp slt i32 %93, %95
  br i1 %96, label %97, label %283

97:                                               ; preds = %92
  %98 = load ptr, ptr %16, align 8, !tbaa !5
  %99 = getelementptr inbounds i8, ptr %98, i64 4
  %100 = load i8, ptr %99, align 1, !tbaa !19
  %101 = zext i8 %100 to i32
  %102 = load ptr, ptr %16, align 8, !tbaa !5
  %103 = getelementptr inbounds i8, ptr %102, i64 1
  %104 = load i8, ptr %103, align 1, !tbaa !19
  %105 = zext i8 %104 to i32
  %106 = xor i32 %105, %101
  %107 = trunc i32 %106 to i8
  store i8 %107, ptr %103, align 1, !tbaa !19
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  %109 = getelementptr inbounds i8, ptr %108, i64 1
  %110 = load i8, ptr %109, align 1, !tbaa !19
  %111 = zext i8 %110 to i32
  %112 = load ptr, ptr %16, align 8, !tbaa !5
  %113 = getelementptr inbounds i8, ptr %112, i64 4
  %114 = load i8, ptr %113, align 1, !tbaa !19
  %115 = zext i8 %114 to i32
  %116 = xor i32 %115, %111
  %117 = trunc i32 %116 to i8
  store i8 %117, ptr %113, align 1, !tbaa !19
  %118 = load ptr, ptr %16, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i64 4
  %120 = load i8, ptr %119, align 1, !tbaa !19
  %121 = zext i8 %120 to i32
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = getelementptr inbounds i8, ptr %122, i64 1
  %124 = load i8, ptr %123, align 1, !tbaa !19
  %125 = zext i8 %124 to i32
  %126 = xor i32 %125, %121
  %127 = trunc i32 %126 to i8
  store i8 %127, ptr %123, align 1, !tbaa !19
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = getelementptr inbounds i8, ptr %128, i64 8
  %130 = load i8, ptr %129, align 1, !tbaa !19
  %131 = zext i8 %130 to i32
  %132 = load ptr, ptr %16, align 8, !tbaa !5
  %133 = getelementptr inbounds i8, ptr %132, i64 2
  %134 = load i8, ptr %133, align 1, !tbaa !19
  %135 = zext i8 %134 to i32
  %136 = xor i32 %135, %131
  %137 = trunc i32 %136 to i8
  store i8 %137, ptr %133, align 1, !tbaa !19
  %138 = load ptr, ptr %16, align 8, !tbaa !5
  %139 = getelementptr inbounds i8, ptr %138, i64 2
  %140 = load i8, ptr %139, align 1, !tbaa !19
  %141 = zext i8 %140 to i32
  %142 = load ptr, ptr %16, align 8, !tbaa !5
  %143 = getelementptr inbounds i8, ptr %142, i64 8
  %144 = load i8, ptr %143, align 1, !tbaa !19
  %145 = zext i8 %144 to i32
  %146 = xor i32 %145, %141
  %147 = trunc i32 %146 to i8
  store i8 %147, ptr %143, align 1, !tbaa !19
  %148 = load ptr, ptr %16, align 8, !tbaa !5
  %149 = getelementptr inbounds i8, ptr %148, i64 8
  %150 = load i8, ptr %149, align 1, !tbaa !19
  %151 = zext i8 %150 to i32
  %152 = load ptr, ptr %16, align 8, !tbaa !5
  %153 = getelementptr inbounds i8, ptr %152, i64 2
  %154 = load i8, ptr %153, align 1, !tbaa !19
  %155 = zext i8 %154 to i32
  %156 = xor i32 %155, %151
  %157 = trunc i32 %156 to i8
  store i8 %157, ptr %153, align 1, !tbaa !19
  %158 = load ptr, ptr %16, align 8, !tbaa !5
  %159 = getelementptr inbounds i8, ptr %158, i64 12
  %160 = load i8, ptr %159, align 1, !tbaa !19
  %161 = zext i8 %160 to i32
  %162 = load ptr, ptr %16, align 8, !tbaa !5
  %163 = getelementptr inbounds i8, ptr %162, i64 3
  %164 = load i8, ptr %163, align 1, !tbaa !19
  %165 = zext i8 %164 to i32
  %166 = xor i32 %165, %161
  %167 = trunc i32 %166 to i8
  store i8 %167, ptr %163, align 1, !tbaa !19
  %168 = load ptr, ptr %16, align 8, !tbaa !5
  %169 = getelementptr inbounds i8, ptr %168, i64 3
  %170 = load i8, ptr %169, align 1, !tbaa !19
  %171 = zext i8 %170 to i32
  %172 = load ptr, ptr %16, align 8, !tbaa !5
  %173 = getelementptr inbounds i8, ptr %172, i64 12
  %174 = load i8, ptr %173, align 1, !tbaa !19
  %175 = zext i8 %174 to i32
  %176 = xor i32 %175, %171
  %177 = trunc i32 %176 to i8
  store i8 %177, ptr %173, align 1, !tbaa !19
  %178 = load ptr, ptr %16, align 8, !tbaa !5
  %179 = getelementptr inbounds i8, ptr %178, i64 12
  %180 = load i8, ptr %179, align 1, !tbaa !19
  %181 = zext i8 %180 to i32
  %182 = load ptr, ptr %16, align 8, !tbaa !5
  %183 = getelementptr inbounds i8, ptr %182, i64 3
  %184 = load i8, ptr %183, align 1, !tbaa !19
  %185 = zext i8 %184 to i32
  %186 = xor i32 %185, %181
  %187 = trunc i32 %186 to i8
  store i8 %187, ptr %183, align 1, !tbaa !19
  %188 = load ptr, ptr %16, align 8, !tbaa !5
  %189 = getelementptr inbounds i8, ptr %188, i64 9
  %190 = load i8, ptr %189, align 1, !tbaa !19
  %191 = zext i8 %190 to i32
  %192 = load ptr, ptr %16, align 8, !tbaa !5
  %193 = getelementptr inbounds i8, ptr %192, i64 6
  %194 = load i8, ptr %193, align 1, !tbaa !19
  %195 = zext i8 %194 to i32
  %196 = xor i32 %195, %191
  %197 = trunc i32 %196 to i8
  store i8 %197, ptr %193, align 1, !tbaa !19
  %198 = load ptr, ptr %16, align 8, !tbaa !5
  %199 = getelementptr inbounds i8, ptr %198, i64 6
  %200 = load i8, ptr %199, align 1, !tbaa !19
  %201 = zext i8 %200 to i32
  %202 = load ptr, ptr %16, align 8, !tbaa !5
  %203 = getelementptr inbounds i8, ptr %202, i64 9
  %204 = load i8, ptr %203, align 1, !tbaa !19
  %205 = zext i8 %204 to i32
  %206 = xor i32 %205, %201
  %207 = trunc i32 %206 to i8
  store i8 %207, ptr %203, align 1, !tbaa !19
  %208 = load ptr, ptr %16, align 8, !tbaa !5
  %209 = getelementptr inbounds i8, ptr %208, i64 9
  %210 = load i8, ptr %209, align 1, !tbaa !19
  %211 = zext i8 %210 to i32
  %212 = load ptr, ptr %16, align 8, !tbaa !5
  %213 = getelementptr inbounds i8, ptr %212, i64 6
  %214 = load i8, ptr %213, align 1, !tbaa !19
  %215 = zext i8 %214 to i32
  %216 = xor i32 %215, %211
  %217 = trunc i32 %216 to i8
  store i8 %217, ptr %213, align 1, !tbaa !19
  %218 = load ptr, ptr %16, align 8, !tbaa !5
  %219 = getelementptr inbounds i8, ptr %218, i64 13
  %220 = load i8, ptr %219, align 1, !tbaa !19
  %221 = zext i8 %220 to i32
  %222 = load ptr, ptr %16, align 8, !tbaa !5
  %223 = getelementptr inbounds i8, ptr %222, i64 7
  %224 = load i8, ptr %223, align 1, !tbaa !19
  %225 = zext i8 %224 to i32
  %226 = xor i32 %225, %221
  %227 = trunc i32 %226 to i8
  store i8 %227, ptr %223, align 1, !tbaa !19
  %228 = load ptr, ptr %16, align 8, !tbaa !5
  %229 = getelementptr inbounds i8, ptr %228, i64 7
  %230 = load i8, ptr %229, align 1, !tbaa !19
  %231 = zext i8 %230 to i32
  %232 = load ptr, ptr %16, align 8, !tbaa !5
  %233 = getelementptr inbounds i8, ptr %232, i64 13
  %234 = load i8, ptr %233, align 1, !tbaa !19
  %235 = zext i8 %234 to i32
  %236 = xor i32 %235, %231
  %237 = trunc i32 %236 to i8
  store i8 %237, ptr %233, align 1, !tbaa !19
  %238 = load ptr, ptr %16, align 8, !tbaa !5
  %239 = getelementptr inbounds i8, ptr %238, i64 13
  %240 = load i8, ptr %239, align 1, !tbaa !19
  %241 = zext i8 %240 to i32
  %242 = load ptr, ptr %16, align 8, !tbaa !5
  %243 = getelementptr inbounds i8, ptr %242, i64 7
  %244 = load i8, ptr %243, align 1, !tbaa !19
  %245 = zext i8 %244 to i32
  %246 = xor i32 %245, %241
  %247 = trunc i32 %246 to i8
  store i8 %247, ptr %243, align 1, !tbaa !19
  %248 = load ptr, ptr %16, align 8, !tbaa !5
  %249 = getelementptr inbounds i8, ptr %248, i64 14
  %250 = load i8, ptr %249, align 1, !tbaa !19
  %251 = zext i8 %250 to i32
  %252 = load ptr, ptr %16, align 8, !tbaa !5
  %253 = getelementptr inbounds i8, ptr %252, i64 11
  %254 = load i8, ptr %253, align 1, !tbaa !19
  %255 = zext i8 %254 to i32
  %256 = xor i32 %255, %251
  %257 = trunc i32 %256 to i8
  store i8 %257, ptr %253, align 1, !tbaa !19
  %258 = load ptr, ptr %16, align 8, !tbaa !5
  %259 = getelementptr inbounds i8, ptr %258, i64 11
  %260 = load i8, ptr %259, align 1, !tbaa !19
  %261 = zext i8 %260 to i32
  %262 = load ptr, ptr %16, align 8, !tbaa !5
  %263 = getelementptr inbounds i8, ptr %262, i64 14
  %264 = load i8, ptr %263, align 1, !tbaa !19
  %265 = zext i8 %264 to i32
  %266 = xor i32 %265, %261
  %267 = trunc i32 %266 to i8
  store i8 %267, ptr %263, align 1, !tbaa !19
  %268 = load ptr, ptr %16, align 8, !tbaa !5
  %269 = getelementptr inbounds i8, ptr %268, i64 14
  %270 = load i8, ptr %269, align 1, !tbaa !19
  %271 = zext i8 %270 to i32
  %272 = load ptr, ptr %16, align 8, !tbaa !5
  %273 = getelementptr inbounds i8, ptr %272, i64 11
  %274 = load i8, ptr %273, align 1, !tbaa !19
  %275 = zext i8 %274 to i32
  %276 = xor i32 %275, %271
  %277 = trunc i32 %276 to i8
  store i8 %277, ptr %273, align 1, !tbaa !19
  br label %278

278:                                              ; preds = %97
  %279 = load i32, ptr %15, align 4, !tbaa !9
  %280 = add nsw i32 %279, 1
  store i32 %280, ptr %15, align 4, !tbaa !9
  %281 = load ptr, ptr %16, align 8, !tbaa !5
  %282 = getelementptr inbounds i8, ptr %281, i64 16
  store ptr %282, ptr %16, align 8, !tbaa !5
  br label %92, !llvm.loop !20

283:                                              ; preds = %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  store i32 0, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %284

284:                                              ; preds = %283, %38, %29, %19
  %285 = load i32, ptr %5, align 4
  ret i32 %285
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @rij_index(i32 noundef) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @PadBlock(i8 noundef zeroext, ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @IPP_UINT_PTR(ptr noundef) #2

declare void @cpAes_setup_ptrs_and_methods(ptr noundef) #4

declare void @ExpandRijndaelKey(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #4

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

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

!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 = !{!12, !10, i64 0}
!12 = !{!"_cpRijndael128", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !7, i64 72}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 4}
!15 = !{!12, !10, i64 12}
!16 = !{!12, !10, i64 68}
!17 = !{!12, !6, i64 48}
!18 = !{!12, !6, i64 56}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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

@rij128nKeys = external hidden local_unnamed_addr global [3 x i32], align 4
@rij128nRounds = external hidden local_unnamed_addr global [3 x i32], align 4

; Function Attrs: nounwind uwtable
define dso_local range(i32 -15, 1) i32 @ippsAESInit(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = alloca [32 x i8], align 16
  %6 = icmp eq ptr %2, null
  br i1 %6, label %59, label %7

7:                                                ; preds = %4
  switch i32 %1, label %59 [
    i32 32, label %8
    i32 24, label %8
    i32 16, label %8
  ]

8:                                                ; preds = %7, %7, %7
  %9 = icmp slt i32 %3, 568
  br i1 %9, label %59, label %10

10:                                               ; preds = %8
  %11 = lshr exact i32 %1, 2
  %12 = tail call i32 @rij_index(i32 noundef %11)
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [3 x i32], ptr @rij128nKeys, i64 0, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = tail call i32 @rij_index(i32 noundef %11)
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [3 x i32], ptr @rij128nRounds, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %5, i8 0, i64 32, i1 false)
  %.not = icmp eq ptr %0, null
  %20 = select i1 %.not, ptr %5, ptr %0
  tail call void @PadBlock(i8 noundef zeroext 0, ptr noundef nonnull %2, i32 noundef 568)
  %21 = tail call i64 @IPP_UINT_PTR(ptr noundef nonnull %2)
  %22 = trunc i64 %21 to i32
  %23 = xor i32 %22, 542263626
  store i32 %23, ptr %2, align 8, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 4, ptr %24, align 8, !tbaa !12
  %25 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %11, ptr %25, align 4, !tbaa !13
  %26 = getelementptr inbounds i8, ptr %2, i64 12
  store i32 %19, ptr %26, align 4, !tbaa !14
  %27 = getelementptr inbounds i8, ptr %2, i64 68
  store i32 1, ptr %27, align 4, !tbaa !15
  tail call void @cpAes_setup_ptrs_and_methods(ptr noundef nonnull %2) #5
  %28 = getelementptr inbounds i8, ptr %2, i64 48
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = getelementptr inbounds i8, ptr %2, i64 56
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  call void @ExpandRijndaelKey(ptr noundef nonnull %20, i32 noundef %11, i32 noundef 4, i32 noundef %19, i32 noundef %15, ptr noundef %29, ptr noundef %31) #5
  %.not7576 = icmp slt i32 %19, 0
  br i1 %.not7576, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %10
  %32 = load ptr, ptr %28, align 8, !tbaa !16
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.078 = phi ptr [ %58, %.lr.ph ], [ %32, %.lr.ph.preheader ]
  %.07277 = phi i32 [ %57, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %33 = getelementptr inbounds i8, ptr %.078, i64 4
  %34 = load i8, ptr %33, align 1, !tbaa !18
  %35 = getelementptr inbounds i8, ptr %.078, i64 1
  %36 = load i8, ptr %35, align 1, !tbaa !18
  store i8 %36, ptr %33, align 1, !tbaa !18
  store i8 %34, ptr %35, align 1, !tbaa !18
  %37 = getelementptr inbounds i8, ptr %.078, i64 8
  %38 = load i8, ptr %37, align 1, !tbaa !18
  %39 = getelementptr inbounds i8, ptr %.078, i64 2
  %40 = load i8, ptr %39, align 1, !tbaa !18
  store i8 %40, ptr %37, align 1, !tbaa !18
  store i8 %38, ptr %39, align 1, !tbaa !18
  %41 = getelementptr inbounds i8, ptr %.078, i64 12
  %42 = load i8, ptr %41, align 1, !tbaa !18
  %43 = getelementptr inbounds i8, ptr %.078, i64 3
  %44 = load i8, ptr %43, align 1, !tbaa !18
  store i8 %44, ptr %41, align 1, !tbaa !18
  store i8 %42, ptr %43, align 1, !tbaa !18
  %45 = getelementptr inbounds i8, ptr %.078, i64 9
  %46 = load i8, ptr %45, align 1, !tbaa !18
  %47 = getelementptr inbounds i8, ptr %.078, i64 6
  %48 = load i8, ptr %47, align 1, !tbaa !18
  store i8 %48, ptr %45, align 1, !tbaa !18
  store i8 %46, ptr %47, align 1, !tbaa !18
  %49 = getelementptr inbounds i8, ptr %.078, i64 13
  %50 = load i8, ptr %49, align 1, !tbaa !18
  %51 = getelementptr inbounds i8, ptr %.078, i64 7
  %52 = load i8, ptr %51, align 1, !tbaa !18
  store i8 %52, ptr %49, align 1, !tbaa !18
  store i8 %50, ptr %51, align 1, !tbaa !18
  %53 = getelementptr inbounds i8, ptr %.078, i64 14
  %54 = load i8, ptr %53, align 1, !tbaa !18
  %55 = getelementptr inbounds i8, ptr %.078, i64 11
  %56 = load i8, ptr %55, align 1, !tbaa !18
  store i8 %56, ptr %53, align 1, !tbaa !18
  store i8 %54, ptr %55, align 1, !tbaa !18
  %57 = add nuw i32 %.07277, 1
  %58 = getelementptr inbounds i8, ptr %.078, i64 16
  %exitcond.not = icmp eq i32 %.07277, %19
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph, %10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  br label %59

59:                                               ; preds = %8, %7, %4, %._crit_edge
  %.073 = phi i32 [ 0, %._crit_edge ], [ -8, %4 ], [ -15, %7 ], [ -9, %8 ]
  ret i32 %.073
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @rij_index(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @PadBlock(i8 noundef zeroext, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @IPP_UINT_PTR(ptr noundef) local_unnamed_addr #2

declare void @cpAes_setup_ptrs_and_methods(ptr noundef) local_unnamed_addr #4

declare void @ExpandRijndaelKey(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

!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, !6, i64 0}
!10 = !{!"_cpRijndael128", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !6, i64 64, !6, i64 68, !7, i64 72}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!10, !6, i64 4}
!14 = !{!10, !6, i64 12}
!15 = !{!10, !6, i64 68}
!16 = !{!10, !11, i64 48}
!17 = !{!10, !11, i64 56}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass