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

; 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._cpDLP = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct._gsModEngine = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, i64, ptr, ptr, ptr, ptr, i32, i32, ptr }
%struct._cpBigNum = type { i32, i32, i32, i32, ptr, ptr }

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

23:                                               ; preds = %5
  store i32 -8, ptr %6, align 4
  br label %203

24:                                               ; preds = %5
  %25 = load ptr, ptr %9, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct._cpDLP, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 8, !tbaa !11
  %28 = load ptr, ptr %9, align 8, !tbaa !9
  %29 = call i64 @IPP_UINT_PTR(ptr noundef %28)
  %30 = trunc i64 %29 to i32
  %31 = xor i32 %27, %30
  %32 = icmp eq i32 %31, 541346896
  br i1 %32, label %34, label %33

33:                                               ; preds = %24
  store i32 -13, ptr %6, align 4
  br label %203

34:                                               ; preds = %24
  %35 = load ptr, ptr %9, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct._cpDLP, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !13
  %38 = icmp eq i32 %37, 7
  br i1 %38, label %40, label %39

39:                                               ; preds = %34
  store i32 -1013, ptr %6, align 4
  br label %203

40:                                               ; preds = %34
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = icmp sle i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %40
  store i32 -5, ptr %6, align 4
  br label %203

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

47:                                               ; preds = %44
  store i32 -8, ptr %6, align 4
  br label %203

48:                                               ; preds = %44
  %49 = load ptr, ptr %10, align 8, !tbaa !9
  %50 = icmp eq ptr null, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %48
  store i32 -8, ptr %6, align 4
  br label %203

52:                                               ; preds = %48
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = load ptr, ptr %9, align 8, !tbaa !9
  %55 = load ptr, ptr %10, align 8, !tbaa !9
  %56 = load ptr, ptr %11, align 8, !tbaa !9
  %57 = call i32 @DLPValidate(i32 noundef %53, ptr noundef %54, ptr noundef %55, ptr noundef %56)
  %58 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 %57, ptr %58, align 4, !tbaa !5
  %59 = load ptr, ptr %8, align 8, !tbaa !9
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp eq i32 0, %60
  br i1 %61, label %62, label %202

62:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %63 = load ptr, ptr %9, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct._cpDLP, ptr %63, i32 0, i32 13
  %65 = load ptr, ptr %64, align 8, !tbaa !14
  store ptr %65, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %66 = call ptr @cpBigNumListGet(ptr noundef %12)
  store ptr %66, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %67 = load ptr, ptr %9, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct._cpDLP, ptr %67, i32 0, i32 5
  %69 = load ptr, ptr %68, align 8, !tbaa !15
  %70 = getelementptr inbounds %struct._gsModEngine, ptr %69, i32 0, i32 8
  %71 = load ptr, ptr %70, align 8, !tbaa !16
  store ptr %71, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %72 = load ptr, ptr %9, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct._cpDLP, ptr %72, i32 0, i32 7
  %74 = load ptr, ptr %73, align 8, !tbaa !19
  %75 = getelementptr inbounds %struct._gsModEngine, ptr %74, i32 0, i32 8
  %76 = load ptr, ptr %75, align 8, !tbaa !16
  store ptr %76, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %77 = load ptr, ptr %9, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct._cpDLP, ptr %77, i32 0, i32 2
  %79 = load i32, ptr %78, align 8, !tbaa !20
  store i32 %79, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %80 = load ptr, ptr %9, align 8, !tbaa !9
  %81 = getelementptr inbounds %struct._cpDLP, ptr %80, i32 0, i32 3
  %82 = load i32, ptr %81, align 4, !tbaa !21
  store i32 %82, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %83 = load i32, ptr %16, align 4, !tbaa !5
  %84 = add nsw i32 %83, 64
  %85 = sub nsw i32 %84, 1
  %86 = sdiv i32 %85, 64
  store i32 %86, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %87 = load i32, ptr %17, align 4, !tbaa !5
  %88 = add nsw i32 %87, 64
  %89 = sub nsw i32 %88, 1
  %90 = sdiv i32 %89, 64
  store i32 %90, ptr %19, align 4, !tbaa !5
  %91 = load i32, ptr %16, align 4, !tbaa !5
  %92 = icmp sgt i32 512, %91
  br i1 %92, label %100, label %93

93:                                               ; preds = %62
  %94 = load i32, ptr %16, align 4, !tbaa !5
  %95 = icmp slt i32 1024, %94
  br i1 %95, label %100, label %96

96:                                               ; preds = %93
  %97 = load i32, ptr %16, align 4, !tbaa !5
  %98 = srem i32 %97, 64
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %102

100:                                              ; preds = %96, %93, %62
  %101 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 3, ptr %101, align 4, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %199

102:                                              ; preds = %96
  %103 = load ptr, ptr %13, align 8, !tbaa !9
  %104 = load i32, ptr %16, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  %106 = call ptr @cpBN_power2(ptr noundef %103, i32 noundef %105)
  %107 = load ptr, ptr %13, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct._cpBigNum, ptr %107, i32 0, i32 4
  %109 = load ptr, ptr %108, align 8, !tbaa !22
  %110 = load ptr, ptr %13, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct._cpBigNum, ptr %110, i32 0, i32 2
  %112 = load i32, ptr %111, align 8, !tbaa !24
  %113 = load ptr, ptr %14, align 8, !tbaa !9
  %114 = load i32, ptr %18, align 4, !tbaa !5
  %115 = call i32 @cpCmp_BNU(ptr noundef %109, i32 noundef %112, ptr noundef %113, i32 noundef %114)
  %116 = icmp sle i32 0, %115
  br i1 %116, label %117, label %119

117:                                              ; preds = %102
  %118 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 3, ptr %118, align 4, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %199

119:                                              ; preds = %102
  %120 = load ptr, ptr %13, align 8, !tbaa !9
  %121 = load i32, ptr %16, align 4, !tbaa !5
  %122 = call ptr @cpBN_power2(ptr noundef %120, i32 noundef %121)
  %123 = load ptr, ptr %13, align 8, !tbaa !9
  %124 = getelementptr inbounds %struct._cpBigNum, ptr %123, i32 0, i32 4
  %125 = load ptr, ptr %124, align 8, !tbaa !22
  %126 = load ptr, ptr %13, align 8, !tbaa !9
  %127 = getelementptr inbounds %struct._cpBigNum, ptr %126, i32 0, i32 2
  %128 = load i32, ptr %127, align 8, !tbaa !24
  %129 = load ptr, ptr %14, align 8, !tbaa !9
  %130 = load i32, ptr %18, align 4, !tbaa !5
  %131 = call i32 @cpCmp_BNU(ptr noundef %125, i32 noundef %128, ptr noundef %129, i32 noundef %130)
  %132 = icmp sge i32 0, %131
  br i1 %132, label %133, label %135

133:                                              ; preds = %119
  %134 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 3, ptr %134, align 4, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %199

135:                                              ; preds = %119
  %136 = load i32, ptr %17, align 4, !tbaa !5
  %137 = icmp ne i32 160, %136
  br i1 %137, label %138, label %140

138:                                              ; preds = %135
  %139 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 4, ptr %139, align 4, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %199

140:                                              ; preds = %135
  %141 = load ptr, ptr %13, align 8, !tbaa !9
  %142 = load i32, ptr %17, align 4, !tbaa !5
  %143 = sub nsw i32 %142, 1
  %144 = call ptr @cpBN_power2(ptr noundef %141, i32 noundef %143)
  %145 = load ptr, ptr %13, align 8, !tbaa !9
  %146 = getelementptr inbounds %struct._cpBigNum, ptr %145, i32 0, i32 4
  %147 = load ptr, ptr %146, align 8, !tbaa !22
  %148 = load ptr, ptr %13, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct._cpBigNum, ptr %148, i32 0, i32 2
  %150 = load i32, ptr %149, align 8, !tbaa !24
  %151 = load ptr, ptr %15, align 8, !tbaa !9
  %152 = load i32, ptr %19, align 4, !tbaa !5
  %153 = call i32 @cpCmp_BNU(ptr noundef %147, i32 noundef %150, ptr noundef %151, i32 noundef %152)
  %154 = icmp sle i32 0, %153
  br i1 %154, label %155, label %157

155:                                              ; preds = %140
  %156 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 4, ptr %156, align 4, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %199

157:                                              ; preds = %140
  %158 = load ptr, ptr %13, align 8, !tbaa !9
  %159 = load i32, ptr %17, align 4, !tbaa !5
  %160 = call ptr @cpBN_power2(ptr noundef %158, i32 noundef %159)
  %161 = load ptr, ptr %13, align 8, !tbaa !9
  %162 = getelementptr inbounds %struct._cpBigNum, ptr %161, i32 0, i32 4
  %163 = load ptr, ptr %162, align 8, !tbaa !22
  %164 = load ptr, ptr %13, align 8, !tbaa !9
  %165 = getelementptr inbounds %struct._cpBigNum, ptr %164, i32 0, i32 2
  %166 = load i32, ptr %165, align 8, !tbaa !24
  %167 = load ptr, ptr %15, align 8, !tbaa !9
  %168 = load i32, ptr %19, align 4, !tbaa !5
  %169 = call i32 @cpCmp_BNU(ptr noundef %163, i32 noundef %166, ptr noundef %167, i32 noundef %168)
  %170 = icmp sge i32 0, %169
  br i1 %170, label %171, label %173

171:                                              ; preds = %157
  %172 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 4, ptr %172, align 4, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %199

173:                                              ; preds = %157
  %174 = load ptr, ptr %13, align 8, !tbaa !9
  %175 = load ptr, ptr %9, align 8, !tbaa !9
  %176 = getelementptr inbounds %struct._cpDLP, ptr %175, i32 0, i32 8
  %177 = load ptr, ptr %176, align 8, !tbaa !25
  %178 = load ptr, ptr %9, align 8, !tbaa !9
  %179 = getelementptr inbounds %struct._cpDLP, ptr %178, i32 0, i32 5
  %180 = load ptr, ptr %179, align 8, !tbaa !15
  call void @cpMontDec_BN(ptr noundef %174, ptr noundef %177, ptr noundef %180)
  %181 = load ptr, ptr %13, align 8, !tbaa !9
  %182 = call ptr @cpBN_OneRef()
  %183 = call i32 @cpBN_cmp(ptr noundef %181, ptr noundef %182)
  %184 = icmp slt i32 0, %183
  br i1 %184, label %185, label %196

185:                                              ; preds = %173
  %186 = load ptr, ptr %13, align 8, !tbaa !9
  %187 = getelementptr inbounds %struct._cpBigNum, ptr %186, i32 0, i32 4
  %188 = load ptr, ptr %187, align 8, !tbaa !22
  %189 = load ptr, ptr %13, align 8, !tbaa !9
  %190 = getelementptr inbounds %struct._cpBigNum, ptr %189, i32 0, i32 2
  %191 = load i32, ptr %190, align 8, !tbaa !24
  %192 = load ptr, ptr %14, align 8, !tbaa !9
  %193 = load i32, ptr %18, align 4, !tbaa !5
  %194 = call i32 @cpCmp_BNU(ptr noundef %188, i32 noundef %191, ptr noundef %192, i32 noundef %193)
  %195 = icmp sgt i32 0, %194
  br i1 %195, label %198, label %196

196:                                              ; preds = %185, %173
  %197 = load ptr, ptr %8, align 8, !tbaa !9
  store i32 8, ptr %197, align 4, !tbaa !5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %20, align 4
  br label %199

198:                                              ; preds = %185
  store i32 0, ptr %20, align 4
  br label %199

199:                                              ; preds = %198, %196, %171, %155, %138, %133, %117, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %200 = load i32, ptr %20, align 4
  switch i32 %200, label %205 [
    i32 0, label %201
    i32 1, label %203
  ]

201:                                              ; preds = %199
  br label %202

202:                                              ; preds = %201, %52
  store i32 0, ptr %6, align 4
  br label %203

203:                                              ; preds = %202, %199, %51, %47, %43, %39, %33, %23
  %204 = load i32, ptr %6, align 4
  ret i32 %204

205:                                              ; preds = %199
  unreachable
}

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

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

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

declare ptr @cpBigNumListGet(ptr noundef) #3

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

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

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

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

declare ptr @cpBN_OneRef() #3

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_cpDLP", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104}
!13 = !{!12, !6, i64 4}
!14 = !{!12, !10, i64 88}
!15 = !{!12, !10, i64 24}
!16 = !{!17, !10, i64 48}
!17 = !{!"_gsModEngine", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !18, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !6, i64 96, !6, i64 100, !10, i64 104}
!18 = !{!"long long", !7, i64 0}
!19 = !{!12, !10, i64 40}
!20 = !{!12, !6, i64 8}
!21 = !{!12, !6, i64 12}
!22 = !{!23, !10, i64 16}
!23 = !{!"_cpBigNum", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !10, i64 16, !10, i64 24}
!24 = !{!23, !6, i64 8}
!25 = !{!12, !10, i64 48}


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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1013, 1) i32 @ippsDLPValidateDSA(i32 noundef %0, ptr noundef writeonly %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca ptr, align 8
  %7 = icmp eq ptr %2, null
  br i1 %7, label %89, label %8

8:                                                ; preds = %5
  %9 = load i32, ptr %2, align 8, !tbaa !5
  %10 = tail call i64 @IPP_UINT_PTR(ptr noundef nonnull %2)
  %11 = trunc i64 %10 to i32
  %12 = xor i32 %9, %11
  %13 = icmp eq i32 %12, 541346896
  br i1 %13, label %14, label %89

14:                                               ; preds = %8
  %15 = getelementptr inbounds i8, ptr %2, i64 4
  %16 = load i32, ptr %15, align 4, !tbaa !11
  %17 = icmp eq i32 %16, 7
  br i1 %17, label %18, label %89

18:                                               ; preds = %14
  %19 = icmp slt i32 %0, 1
  br i1 %19, label %89, label %20

20:                                               ; preds = %18
  %21 = icmp eq ptr %1, null
  %22 = icmp eq ptr %3, null
  %or.cond74 = or i1 %21, %22
  br i1 %or.cond74, label %89, label %23

23:                                               ; preds = %20
  %24 = tail call i32 @DLPValidate(i32 noundef %0, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef %4)
  store i32 %24, ptr %1, align 4, !tbaa !12
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %89

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %27 = getelementptr inbounds i8, ptr %2, i64 88
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  store ptr %28, ptr %6, align 8, !tbaa !14
  %29 = call ptr @cpBigNumListGet(ptr noundef nonnull %6) #4
  %30 = getelementptr inbounds i8, ptr %2, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = getelementptr inbounds i8, ptr %31, i64 48
  %33 = load ptr, ptr %32, align 8, !tbaa !16
  %34 = getelementptr inbounds i8, ptr %2, i64 40
  %35 = load ptr, ptr %34, align 8, !tbaa !19
  %36 = getelementptr inbounds i8, ptr %35, i64 48
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = getelementptr inbounds i8, ptr %2, i64 8
  %39 = load i32, ptr %38, align 8, !tbaa !20
  %40 = getelementptr inbounds i8, ptr %2, i64 12
  %41 = load i32, ptr %40, align 4, !tbaa !21
  %42 = add nsw i32 %39, 63
  %43 = sdiv i32 %42, 64
  %44 = add nsw i32 %41, 63
  %45 = sdiv i32 %44, 64
  %46 = add i32 %39, -512
  %or.cond = icmp ult i32 %46, 513
  %47 = and i32 %39, 63
  %.not = icmp eq i32 %47, 0
  %or.cond73 = and i1 %or.cond, %.not
  br i1 %or.cond73, label %48, label %.sink.split

48:                                               ; preds = %26
  %49 = add nsw i32 %39, -1
  %50 = call ptr @cpBN_power2(ptr noundef %29, i32 noundef %49)
  %51 = getelementptr inbounds i8, ptr %29, i64 16
  %52 = load ptr, ptr %51, align 8, !tbaa !22
  %53 = getelementptr inbounds i8, ptr %29, i64 8
  %54 = load i32, ptr %53, align 8, !tbaa !24
  %55 = call i32 @cpCmp_BNU(ptr noundef %52, i32 noundef %54, ptr noundef %33, i32 noundef %43)
  %56 = icmp sgt i32 %55, -1
  br i1 %56, label %.sink.split, label %57

57:                                               ; preds = %48
  %58 = call ptr @cpBN_power2(ptr noundef nonnull %29, i32 noundef %39)
  %59 = load ptr, ptr %51, align 8, !tbaa !22
  %60 = load i32, ptr %53, align 8, !tbaa !24
  %61 = call i32 @cpCmp_BNU(ptr noundef %59, i32 noundef %60, ptr noundef %33, i32 noundef %43)
  %62 = icmp slt i32 %61, 1
  br i1 %62, label %.sink.split, label %63

63:                                               ; preds = %57
  %.not72 = icmp eq i32 %41, 160
  br i1 %.not72, label %64, label %.sink.split

64:                                               ; preds = %63
  %65 = call ptr @cpBN_power2(ptr noundef nonnull %29, i32 noundef 159)
  %66 = load ptr, ptr %51, align 8, !tbaa !22
  %67 = load i32, ptr %53, align 8, !tbaa !24
  %68 = call i32 @cpCmp_BNU(ptr noundef %66, i32 noundef %67, ptr noundef %37, i32 noundef %45)
  %69 = icmp sgt i32 %68, -1
  br i1 %69, label %.sink.split, label %70

70:                                               ; preds = %64
  %71 = call ptr @cpBN_power2(ptr noundef nonnull %29, i32 noundef 160)
  %72 = load ptr, ptr %51, align 8, !tbaa !22
  %73 = load i32, ptr %53, align 8, !tbaa !24
  %74 = call i32 @cpCmp_BNU(ptr noundef %72, i32 noundef %73, ptr noundef %37, i32 noundef %45)
  %75 = icmp slt i32 %74, 1
  br i1 %75, label %.sink.split, label %76

76:                                               ; preds = %70
  %77 = getelementptr inbounds i8, ptr %2, i64 48
  %78 = load ptr, ptr %77, align 8, !tbaa !25
  %79 = load ptr, ptr %30, align 8, !tbaa !15
  call void @cpMontDec_BN(ptr noundef nonnull %29, ptr noundef %78, ptr noundef %79)
  %80 = call ptr @cpBN_OneRef() #4
  %81 = call i32 @cpBN_cmp(ptr noundef nonnull %29, ptr noundef %80)
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %83, label %.sink.split

83:                                               ; preds = %76
  %84 = load ptr, ptr %51, align 8, !tbaa !22
  %85 = load i32, ptr %53, align 8, !tbaa !24
  %86 = call i32 @cpCmp_BNU(ptr noundef %84, i32 noundef %85, ptr noundef %33, i32 noundef %43)
  %87 = icmp slt i32 %86, 0
  br i1 %87, label %88, label %.sink.split

.sink.split:                                      ; preds = %76, %83, %70, %64, %63, %57, %48, %26
  %.sink = phi i32 [ 3, %26 ], [ 3, %48 ], [ 3, %57 ], [ 4, %63 ], [ 4, %64 ], [ 4, %70 ], [ 8, %83 ], [ 8, %76 ]
  store i32 %.sink, ptr %1, align 4, !tbaa !12
  br label %88

88:                                               ; preds = %.sink.split, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %89

89:                                               ; preds = %88, %23, %20, %18, %14, %8, %5
  %.1 = phi i32 [ -8, %5 ], [ -13, %8 ], [ -1013, %14 ], [ -5, %18 ], [ -8, %20 ], [ 0, %88 ], [ 0, %23 ]
  ret i32 %.1
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @DLPValidate(i32 noundef, ptr noundef, ptr noundef, ptr 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

declare ptr @cpBigNumListGet(ptr noundef) local_unnamed_addr #3

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

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

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

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

declare ptr @cpBN_OneRef() local_unnamed_addr #3

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"_cpDLP", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!7, !7, i64 0}
!13 = !{!6, !10, i64 88}
!14 = !{!10, !10, i64 0}
!15 = !{!6, !10, i64 24}
!16 = !{!17, !10, i64 48}
!17 = !{!"_gsModEngine", !10, i64 0, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !18, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !7, i64 96, !7, i64 100, !10, i64 104}
!18 = !{!"long long", !8, i64 0}
!19 = !{!6, !10, i64 40}
!20 = !{!6, !7, i64 8}
!21 = !{!6, !7, i64 12}
!22 = !{!23, !10, i64 16}
!23 = !{!"_cpBigNum", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24}
!24 = !{!23, !7, i64 8}
!25 = !{!6, !10, i64 48}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass