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

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

@RijEncSbox = external constant [256 x i8], align 64

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

28:                                               ; preds = %6
  store i32 -8, ptr %7, align 4
  br label %195

29:                                               ; preds = %6
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._cpAES_XTS, ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !11
  %33 = load ptr, ptr %11, align 8, !tbaa !5
  %34 = call i64 @IPP_UINT_PTR(ptr noundef %33)
  %35 = trunc i64 %34 to i32
  %36 = xor i32 %32, %35
  %37 = icmp eq i32 %36, 1129136467
  br i1 %37, label %39, label %38

38:                                               ; preds = %29
  store i32 -13, ptr %7, align 4
  br label %195

39:                                               ; preds = %29
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = icmp eq ptr null, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %39
  store i32 -8, ptr %7, align 4
  br label %195

43:                                               ; preds = %39
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = icmp eq ptr null, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %43
  store i32 -8, ptr %7, align 4
  br label %195

47:                                               ; preds = %43
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = icmp eq ptr null, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %47
  store i32 -8, ptr %7, align 4
  br label %195

51:                                               ; preds = %47
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = icmp slt i32 %52, 128
  br i1 %53, label %54, label %55

54:                                               ; preds = %51
  store i32 -15, ptr %7, align 4
  br label %195

55:                                               ; preds = %51
  %56 = load i32, ptr %13, align 4, !tbaa !9
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._cpAES_XTS, ptr %58, i32 0, i32 1
  %60 = load i32, ptr %59, align 4, !tbaa !14
  %61 = call i32 @IsLegalGeometry(i32 noundef %56, i32 noundef %57, i32 noundef %60)
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %64, label %63

63:                                               ; preds = %55
  store i32 -5, ptr %7, align 4
  br label %195

64:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct._cpAES_XTS, ptr %65, i32 0, i32 3
  store ptr %66, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %67 = load ptr, ptr %15, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._cpRijndael128, ptr %67, i32 0, i32 4
  %69 = load ptr, ptr %68, align 8, !tbaa !15
  store ptr %69, ptr %16, align 8, !tbaa !5
  %70 = load ptr, ptr %16, align 8, !tbaa !5
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %73 = load ptr, ptr %15, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._cpRijndael128, ptr %73, i32 0, i32 3
  %75 = load i32, ptr %74, align 4, !tbaa !16
  %76 = load ptr, ptr %15, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct._cpRijndael128, ptr %76, i32 0, i32 8
  %78 = load ptr, ptr %77, align 8, !tbaa !17
  call void %70(ptr noundef %71, ptr noundef %72, i32 noundef %75, ptr noundef %78, ptr noundef @RijEncSbox)
  br label %79

79:                                               ; preds = %84, %64
  %80 = load i32, ptr %13, align 4, !tbaa !9
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %82, label %87

82:                                               ; preds = %79
  %83 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  call void @gf_mul_by_primitive(ptr noundef %83)
  br label %84

84:                                               ; preds = %82
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = add nsw i32 %85, -1
  store i32 %86, ptr %13, align 4, !tbaa !9
  br label %79, !llvm.loop !18

87:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct._cpAES_XTS, ptr %88, i32 0, i32 2
  store ptr %89, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = sdiv i32 %90, 128
  store i32 %91, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = srem i32 %92, 128
  store i32 %93, ptr %19, align 4, !tbaa !9
  %94 = load i32, ptr %19, align 4, !tbaa !9
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %99

96:                                               ; preds = %87
  %97 = load i32, ptr %18, align 4, !tbaa !9
  %98 = add nsw i32 %97, -1
  store i32 %98, ptr %18, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %96, %87
  %100 = load i32, ptr %18, align 4, !tbaa !9
  %101 = icmp sgt i32 %100, 0
  br i1 %101, label %102, label %120

102:                                              ; preds = %99
  br label %103

103:                                              ; preds = %116, %102
  %104 = load i32, ptr %18, align 4, !tbaa !9
  %105 = icmp sgt i32 %104, 0
  br i1 %105, label %106, label %119

106:                                              ; preds = %103
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %110 = load ptr, ptr %17, align 8, !tbaa !5
  call void @cpAES_XTS_EncBlock(ptr noundef %107, ptr noundef %108, ptr noundef %109, ptr noundef %110)
  %111 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  call void @gf_mul_by_primitive(ptr noundef %111)
  %112 = load ptr, ptr %8, align 8, !tbaa !5
  %113 = getelementptr inbounds i8, ptr %112, i64 16
  store ptr %113, ptr %8, align 8, !tbaa !5
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds i8, ptr %114, i64 16
  store ptr %115, ptr %9, align 8, !tbaa !5
  br label %116

116:                                              ; preds = %106
  %117 = load i32, ptr %18, align 4, !tbaa !9
  %118 = add nsw i32 %117, -1
  store i32 %118, ptr %18, align 4, !tbaa !9
  br label %103, !llvm.loop !20

119:                                              ; preds = %103
  br label %120

120:                                              ; preds = %119, %99
  %121 = load i32, ptr %19, align 4, !tbaa !9
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %194

123:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %124 = load i32, ptr %19, align 4, !tbaa !9
  %125 = sdiv i32 %124, 8
  store i32 %125, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #3
  %126 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %129 = load ptr, ptr %17, align 8, !tbaa !5
  call void @cpAES_XTS_EncBlock(ptr noundef %126, ptr noundef %127, ptr noundef %128, ptr noundef %129)
  %130 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  call void @gf_mul_by_primitive(ptr noundef %130)
  %131 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %132 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  call void @CopyBlock16(ptr noundef %131, ptr noundef %132)
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = getelementptr inbounds i8, ptr %133, i64 16
  %135 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %136 = load i32, ptr %20, align 4, !tbaa !9
  call void @CopyBlock(ptr noundef %134, ptr noundef %135, i32 noundef %136)
  %137 = load i32, ptr %19, align 4, !tbaa !9
  %138 = srem i32 %137, 8
  store i32 %138, ptr %19, align 4, !tbaa !9
  %139 = load i32, ptr %19, align 4, !tbaa !9
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %185

141:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #3
  %142 = load i32, ptr %19, align 4, !tbaa !9
  %143 = sub nsw i32 8, %142
  %144 = srem i32 %143, 8
  %145 = shl i32 255, %144
  %146 = trunc i32 %145 to i8
  store i8 %146, ptr %23, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #3
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = load i32, ptr %20, align 4, !tbaa !9
  %149 = add nsw i32 16, %148
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds i8, ptr %147, i64 %150
  %152 = load i8, ptr %151, align 1, !tbaa !21
  store i8 %152, ptr %24, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #3
  %153 = load i32, ptr %20, align 4, !tbaa !9
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 %154
  %156 = load i8, ptr %155, align 1, !tbaa !21
  store i8 %156, ptr %25, align 1, !tbaa !21
  %157 = load i8, ptr %24, align 1, !tbaa !21
  %158 = zext i8 %157 to i32
  %159 = load i8, ptr %23, align 1, !tbaa !21
  %160 = zext i8 %159 to i32
  %161 = and i32 %158, %160
  %162 = load i8, ptr %25, align 1, !tbaa !21
  %163 = zext i8 %162 to i32
  %164 = load i8, ptr %23, align 1, !tbaa !21
  %165 = zext i8 %164 to i32
  %166 = xor i32 %165, -1
  %167 = and i32 %163, %166
  %168 = or i32 %161, %167
  %169 = trunc i32 %168 to i8
  store i8 %169, ptr %24, align 1, !tbaa !21
  %170 = load i8, ptr %24, align 1, !tbaa !21
  %171 = load i32, ptr %20, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 %172
  store i8 %170, ptr %173, align 1, !tbaa !21
  %174 = load i8, ptr %23, align 1, !tbaa !21
  %175 = zext i8 %174 to i32
  %176 = load i32, ptr %20, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 %177
  %179 = load i8, ptr %178, align 1, !tbaa !21
  %180 = zext i8 %179 to i32
  %181 = and i32 %180, %175
  %182 = trunc i32 %181 to i8
  store i8 %182, ptr %178, align 1, !tbaa !21
  %183 = load i32, ptr %20, align 4, !tbaa !9
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #3
  br label %185

185:                                              ; preds = %141, %123
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  %187 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %188 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 0
  %189 = load ptr, ptr %17, align 8, !tbaa !5
  call void @cpAES_XTS_EncBlock(ptr noundef %186, ptr noundef %187, ptr noundef %188, ptr noundef %189)
  %190 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = getelementptr inbounds i8, ptr %191, i64 16
  %193 = load i32, ptr %20, align 4, !tbaa !9
  call void @CopyBlock(ptr noundef %190, ptr noundef %192, i32 noundef %193)
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  br label %194

194:                                              ; preds = %185, %120
  store i32 0, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #3
  br label %195

195:                                              ; preds = %194, %63, %54, %50, %46, %42, %38, %28
  %196 = load i32, ptr %7, align 4
  ret i32 %196
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @IsLegalGeometry(i32 noundef, i32 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: inlinehint nounwind uwtable
declare hidden void @gf_mul_by_primitive(ptr noundef) #1

; 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 hidden void @cpAES_XTS_EncBlock(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @CopyBlock16(ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @CopyBlock(ptr noundef, ptr noundef, i32 noundef) #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = !{!"_cpAES_XTS", !10, i64 0, !10, i64 4, !13, i64 8, !13, i64 576}
!13 = !{!"_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}
!14 = !{!12, !10, i64 4}
!15 = !{!13, !6, i64 16}
!16 = !{!13, !10, i64 12}
!17 = !{!13, !6, i64 48}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!7, !7, i64 0}


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

@RijEncSbox = external constant [256 x i8], align 64

; Function Attrs: nounwind uwtable
define dso_local range(i32 -15, 1) i32 @ippsAES_XTSEncrypt(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %7 = alloca [16 x i8], align 16
  %8 = alloca [16 x i8], align 16
  %9 = alloca [16 x i8], align 16
  %10 = icmp eq ptr %3, null
  br i1 %10, label %74, label %11

11:                                               ; preds = %6
  %12 = load i32, ptr %3, align 8, !tbaa !5
  %13 = tail call i64 @IPP_UINT_PTR(ptr noundef nonnull %3)
  %14 = trunc i64 %13 to i32
  %15 = xor i32 %12, %14
  %16 = icmp eq i32 %15, 1129136467
  br i1 %16, label %17, label %74

17:                                               ; preds = %11
  %18 = icmp eq ptr %0, null
  %19 = icmp eq ptr %1, null
  %or.cond = or i1 %18, %19
  %20 = icmp eq ptr %4, null
  %or.cond74 = or i1 %or.cond, %20
  br i1 %or.cond74, label %74, label %21

21:                                               ; preds = %17
  %22 = icmp slt i32 %2, 128
  br i1 %22, label %74, label %23

23:                                               ; preds = %21
  %24 = getelementptr inbounds i8, ptr %3, i64 4
  %25 = load i32, ptr %24, align 4, !tbaa !12
  %26 = tail call i32 @IsLegalGeometry(i32 noundef %5, i32 noundef %2, i32 noundef %25)
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %74, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %28 = getelementptr inbounds i8, ptr %3, i64 592
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %3, i64 588
  %31 = load i32, ptr %30, align 4, !tbaa !14
  %32 = getelementptr inbounds i8, ptr %3, i64 624
  %33 = load ptr, ptr %32, align 8, !tbaa !15
  call void %29(ptr noundef nonnull %4, ptr noundef nonnull %7, i32 noundef %31, ptr noundef %33, ptr noundef nonnull @RijEncSbox) #3
  %34 = icmp sgt i32 %5, 0
  br i1 %34, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %27, %.lr.ph
  %.06476 = phi i32 [ %35, %.lr.ph ], [ %5, %27 ]
  call void @gf_mul_by_primitive(ptr noundef nonnull %7)
  %35 = add nsw i32 %.06476, -1
  %36 = icmp ugt i32 %.06476, 1
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %27
  %37 = getelementptr inbounds i8, ptr %3, i64 8
  %38 = lshr i32 %2, 7
  %39 = and i32 %2, 127
  %.not72 = icmp ne i32 %39, 0
  %40 = sext i1 %.not72 to i32
  %spec.select = add nsw i32 %38, %40
  %41 = icmp sgt i32 %spec.select, 0
  br i1 %41, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %._crit_edge, %.preheader
  %.163 = phi i32 [ %44, %.preheader ], [ %spec.select, %._crit_edge ]
  %.059 = phi ptr [ %43, %.preheader ], [ %1, %._crit_edge ]
  %.058 = phi ptr [ %42, %.preheader ], [ %0, %._crit_edge ]
  call void @cpAES_XTS_EncBlock(ptr noundef nonnull %.059, ptr noundef nonnull %.058, ptr noundef nonnull %7, ptr noundef nonnull %37)
  call void @gf_mul_by_primitive(ptr noundef nonnull %7)
  %42 = getelementptr inbounds i8, ptr %.058, i64 16
  %43 = getelementptr inbounds i8, ptr %.059, i64 16
  %44 = add nsw i32 %.163, -1
  %.old1 = icmp ugt i32 %.163, 1
  br i1 %.old1, label %.preheader, label %.loopexit

.loopexit:                                        ; preds = %.preheader, %._crit_edge
  %.160 = phi ptr [ %1, %._crit_edge ], [ %43, %.preheader ]
  %.1 = phi ptr [ %0, %._crit_edge ], [ %42, %.preheader ]
  br i1 %.not72, label %45, label %73

45:                                               ; preds = %.loopexit
  %46 = lshr i32 %39, 3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #3
  call void @cpAES_XTS_EncBlock(ptr noundef nonnull %8, ptr noundef nonnull %.1, ptr noundef nonnull %7, ptr noundef nonnull %37)
  call void @gf_mul_by_primitive(ptr noundef nonnull %7)
  call void @CopyBlock16(ptr noundef nonnull %8, ptr noundef nonnull %9)
  %47 = getelementptr inbounds i8, ptr %.1, i64 16
  call void @CopyBlock(ptr noundef nonnull %47, ptr noundef nonnull %9, i32 noundef %46)
  %48 = and i32 %2, 7
  %.not73 = icmp eq i32 %48, 0
  br i1 %.not73, label %71, label %49

49:                                               ; preds = %45
  %50 = sub nsw i32 0, %2
  %51 = and i32 %50, 7
  %52 = shl nuw nsw i32 255, %51
  %53 = or disjoint i32 %46, 16
  %54 = zext nneg i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %.1, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !18
  %57 = zext nneg i32 %46 to i64
  %58 = getelementptr inbounds [16 x i8], ptr %8, i64 0, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !18
  %60 = zext i8 %56 to i32
  %61 = and i32 %52, %60
  %62 = zext i8 %59 to i32
  %63 = xor i32 %52, -1
  %64 = and i32 %62, %63
  %65 = or disjoint i32 %64, %61
  %66 = trunc nuw i32 %65 to i8
  %67 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 %57
  store i8 %66, ptr %67, align 1, !tbaa !18
  %68 = trunc i32 %52 to i8
  %69 = and i8 %59, %68
  store i8 %69, ptr %58, align 1, !tbaa !18
  %70 = add nuw nsw i32 %46, 1
  br label %71

71:                                               ; preds = %49, %45
  %.061 = phi i32 [ %70, %49 ], [ %46, %45 ]
  call void @cpAES_XTS_EncBlock(ptr noundef nonnull %.160, ptr noundef nonnull %9, ptr noundef nonnull %7, ptr noundef nonnull %37)
  %72 = getelementptr inbounds i8, ptr %.160, i64 16
  call void @CopyBlock(ptr noundef nonnull %8, ptr noundef nonnull %72, i32 noundef %.061)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #3
  br label %73

73:                                               ; preds = %71, %.loopexit
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  br label %74

74:                                               ; preds = %23, %21, %17, %11, %6, %73
  %.0 = phi i32 [ 0, %73 ], [ -8, %6 ], [ -13, %11 ], [ -8, %17 ], [ -15, %21 ], [ -5, %23 ]
  ret i32 %.0
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @IsLegalGeometry(i32 noundef, i32 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: inlinehint nounwind uwtable
declare hidden void @gf_mul_by_primitive(ptr noundef) local_unnamed_addr #1

; 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 hidden void @cpAES_XTS_EncBlock(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @CopyBlock16(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @CopyBlock(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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, !7, i64 0}
!6 = !{!"_cpAES_XTS", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 576}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_cpRijndael128", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !7, i64 64, !7, i64 68, !8, i64 72}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!10, !11, i64 16}
!14 = !{!10, !7, i64 12}
!15 = !{!10, !11, i64 48}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!8, !8, i64 0}


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