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

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

; Function Attrs: nounwind uwtable
define dso_local void @gfec_point_mul(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5) #0 {
  %7 = alloca ptr, align 8
  %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 i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca i8, align 1
  %25 = alloca i8, align 1
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct._cpGFpEC, ptr %28, i32 0, i32 4
  %30 = load i32, ptr %29, align 4, !tbaa !11
  store i32 %30, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 5, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %31 = load ptr, ptr %12, align 8, !tbaa !5
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = call i64 @IPP_INT_PTR(ptr noundef %32)
  %34 = and i64 %33, 63
  %35 = xor i64 %34, -1
  %36 = add nsw i64 %35, 1
  %37 = and i64 %36, 63
  %38 = getelementptr inbounds i8, ptr %31, i64 %37
  store ptr %38, ptr %15, align 8, !tbaa !5
  %39 = load ptr, ptr %15, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  call void @setupTable(ptr noundef %39, ptr noundef %40, ptr noundef %41)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._cpGFpEC, ptr %42, i32 0, i32 2
  %44 = load ptr, ptr %43, align 8, !tbaa !13
  store ptr %44, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %45 = load ptr, ptr %16, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._cpGFp, ptr %45, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !14
  store ptr %47, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %48 = load ptr, ptr %17, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._gsModEngine, ptr %48, i32 0, i32 3
  %50 = load i32, ptr %49, align 8, !tbaa !16
  store i32 %50, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %51 = load ptr, ptr %17, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._gsModEngine, ptr %51, i32 0, i32 6
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = getelementptr inbounds %struct._gsModMethod, ptr %53, i32 0, i32 7
  %55 = load ptr, ptr %54, align 8, !tbaa !20
  store ptr %55, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %56 = load ptr, ptr %17, align 8, !tbaa !5
  %57 = call ptr @gsModPoolAlloc(ptr noundef %56, i32 noundef 1)
  store ptr %57, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = call ptr @cpEcGFpGetPool(i32 noundef 1, ptr noundef %58)
  store ptr %59, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = call ptr @cpEcGFpGetPool(i32 noundef 1, ptr noundef %60)
  store ptr %61, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  store i32 63, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = load i32, ptr %10, align 4, !tbaa !9
  %64 = srem i32 %63, 5
  %65 = sub nsw i32 %62, %64
  store i32 %65, ptr %27, align 4, !tbaa !9
  %66 = load i32, ptr %27, align 4, !tbaa !9
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %84

68:                                               ; preds = %6
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = load i32, ptr %27, align 4, !tbaa !9
  %71 = sub nsw i32 %70, 1
  %72 = sdiv i32 %71, 8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i8, ptr %69, i64 %73
  %75 = load i16, ptr %74, align 2, !tbaa !22
  %76 = zext i16 %75 to i32
  store i32 %76, ptr %23, align 4, !tbaa !9
  %77 = load i32, ptr %23, align 4, !tbaa !9
  %78 = load i32, ptr %27, align 4, !tbaa !9
  %79 = sub nsw i32 %78, 1
  %80 = srem i32 %79, 8
  %81 = ashr i32 %77, %80
  %82 = load i32, ptr %26, align 4, !tbaa !9
  %83 = and i32 %81, %82
  store i32 %83, ptr %23, align 4, !tbaa !9
  br label %85

84:                                               ; preds = %6
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %84, %68
  %86 = load i32, ptr %23, align 4, !tbaa !9
  %87 = trunc i32 %86 to i8
  call void @booth_recode(ptr noundef %25, ptr noundef %24, i8 noundef zeroext %87, i32 noundef 5)
  %88 = load ptr, ptr %21, align 8, !tbaa !5
  %89 = load i32, ptr %13, align 4, !tbaa !9
  %90 = load ptr, ptr %15, align 8, !tbaa !5
  %91 = load i8, ptr %24, align 1, !tbaa !24
  %92 = zext i8 %91 to i32
  %93 = sub nsw i32 %92, 1
  call void @gsScrambleGet_sscm(ptr noundef %88, i32 noundef %89, ptr noundef %90, i32 noundef %93, i32 noundef 4)
  %94 = load i32, ptr %27, align 4, !tbaa !9
  %95 = sub nsw i32 %94, 5
  store i32 %95, ptr %27, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %160, %85
  %97 = load i32, ptr %27, align 4, !tbaa !9
  %98 = icmp sge i32 %97, 5
  br i1 %98, label %99, label %163

99:                                               ; preds = %96
  %100 = load ptr, ptr %21, align 8, !tbaa !5
  %101 = load ptr, ptr %21, align 8, !tbaa !5
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_double(ptr noundef %100, ptr noundef %101, ptr noundef %102)
  %103 = load ptr, ptr %21, align 8, !tbaa !5
  %104 = load ptr, ptr %21, align 8, !tbaa !5
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_double(ptr noundef %103, ptr noundef %104, ptr noundef %105)
  %106 = load ptr, ptr %21, align 8, !tbaa !5
  %107 = load ptr, ptr %21, align 8, !tbaa !5
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_double(ptr noundef %106, ptr noundef %107, ptr noundef %108)
  %109 = load ptr, ptr %21, align 8, !tbaa !5
  %110 = load ptr, ptr %21, align 8, !tbaa !5
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_double(ptr noundef %109, ptr noundef %110, ptr noundef %111)
  %112 = load ptr, ptr %21, align 8, !tbaa !5
  %113 = load ptr, ptr %21, align 8, !tbaa !5
  %114 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_double(ptr noundef %112, ptr noundef %113, ptr noundef %114)
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = load i32, ptr %27, align 4, !tbaa !9
  %117 = sub nsw i32 %116, 1
  %118 = sdiv i32 %117, 8
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i8, ptr %115, i64 %119
  %121 = load i16, ptr %120, align 2, !tbaa !22
  %122 = zext i16 %121 to i32
  store i32 %122, ptr %23, align 4, !tbaa !9
  %123 = load i32, ptr %23, align 4, !tbaa !9
  %124 = load i32, ptr %27, align 4, !tbaa !9
  %125 = sub nsw i32 %124, 1
  %126 = srem i32 %125, 8
  %127 = ashr i32 %123, %126
  %128 = load i32, ptr %26, align 4, !tbaa !9
  %129 = and i32 %127, %128
  store i32 %129, ptr %23, align 4, !tbaa !9
  %130 = load i32, ptr %23, align 4, !tbaa !9
  %131 = trunc i32 %130 to i8
  call void @booth_recode(ptr noundef %25, ptr noundef %24, i8 noundef zeroext %131, i32 noundef 5)
  %132 = load ptr, ptr %22, align 8, !tbaa !5
  %133 = load i32, ptr %13, align 4, !tbaa !9
  %134 = load ptr, ptr %15, align 8, !tbaa !5
  %135 = load i8, ptr %24, align 1, !tbaa !24
  %136 = zext i8 %135 to i32
  %137 = sub nsw i32 %136, 1
  call void @gsScrambleGet_sscm(ptr noundef %132, i32 noundef %133, ptr noundef %134, i32 noundef %137, i32 noundef 4)
  %138 = load ptr, ptr %19, align 8, !tbaa !5
  %139 = load ptr, ptr %20, align 8, !tbaa !5
  %140 = load ptr, ptr %22, align 8, !tbaa !5
  %141 = load i32, ptr %18, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i64, ptr %140, i64 %142
  %144 = load ptr, ptr %17, align 8, !tbaa !5
  %145 = call ptr %138(ptr noundef %139, ptr noundef %143, ptr noundef %144)
  %146 = load ptr, ptr %22, align 8, !tbaa !5
  %147 = load i32, ptr %18, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i64, ptr %146, i64 %148
  %150 = load ptr, ptr %20, align 8, !tbaa !5
  %151 = load i32, ptr %18, align 4, !tbaa !9
  %152 = load i8, ptr %25, align 1, !tbaa !24
  %153 = zext i8 %152 to i64
  %154 = call i64 @cpIsZero_ct(i64 noundef %153)
  %155 = xor i64 %154, -1
  call void @cpMaskedReplace_ct(ptr noundef %149, ptr noundef %150, i32 noundef %151, i64 noundef %155)
  %156 = load ptr, ptr %21, align 8, !tbaa !5
  %157 = load ptr, ptr %21, align 8, !tbaa !5
  %158 = load ptr, ptr %22, align 8, !tbaa !5
  %159 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_add(ptr noundef %156, ptr noundef %157, ptr noundef %158, ptr noundef %159)
  br label %160

160:                                              ; preds = %99
  %161 = load i32, ptr %27, align 4, !tbaa !9
  %162 = sub nsw i32 %161, 5
  store i32 %162, ptr %27, align 4, !tbaa !9
  br label %96, !llvm.loop !25

163:                                              ; preds = %96
  %164 = load ptr, ptr %21, align 8, !tbaa !5
  %165 = load ptr, ptr %21, align 8, !tbaa !5
  %166 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_double(ptr noundef %164, ptr noundef %165, ptr noundef %166)
  %167 = load ptr, ptr %21, align 8, !tbaa !5
  %168 = load ptr, ptr %21, align 8, !tbaa !5
  %169 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_double(ptr noundef %167, ptr noundef %168, ptr noundef %169)
  %170 = load ptr, ptr %21, align 8, !tbaa !5
  %171 = load ptr, ptr %21, align 8, !tbaa !5
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_double(ptr noundef %170, ptr noundef %171, ptr noundef %172)
  %173 = load ptr, ptr %21, align 8, !tbaa !5
  %174 = load ptr, ptr %21, align 8, !tbaa !5
  %175 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_double(ptr noundef %173, ptr noundef %174, ptr noundef %175)
  %176 = load ptr, ptr %21, align 8, !tbaa !5
  %177 = load ptr, ptr %21, align 8, !tbaa !5
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_double(ptr noundef %176, ptr noundef %177, ptr noundef %178)
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  %180 = getelementptr inbounds i8, ptr %179, i64 0
  %181 = load i16, ptr %180, align 2, !tbaa !22
  %182 = zext i16 %181 to i32
  store i32 %182, ptr %23, align 4, !tbaa !9
  %183 = load i32, ptr %23, align 4, !tbaa !9
  %184 = shl i32 %183, 1
  %185 = load i32, ptr %26, align 4, !tbaa !9
  %186 = and i32 %184, %185
  store i32 %186, ptr %23, align 4, !tbaa !9
  %187 = load i32, ptr %23, align 4, !tbaa !9
  %188 = trunc i32 %187 to i8
  call void @booth_recode(ptr noundef %25, ptr noundef %24, i8 noundef zeroext %188, i32 noundef 5)
  %189 = load ptr, ptr %22, align 8, !tbaa !5
  %190 = load i32, ptr %13, align 4, !tbaa !9
  %191 = load ptr, ptr %15, align 8, !tbaa !5
  %192 = load i8, ptr %24, align 1, !tbaa !24
  %193 = zext i8 %192 to i32
  %194 = sub nsw i32 %193, 1
  call void @gsScrambleGet_sscm(ptr noundef %189, i32 noundef %190, ptr noundef %191, i32 noundef %194, i32 noundef 4)
  %195 = load ptr, ptr %19, align 8, !tbaa !5
  %196 = load ptr, ptr %20, align 8, !tbaa !5
  %197 = load ptr, ptr %22, align 8, !tbaa !5
  %198 = load i32, ptr %18, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds i64, ptr %197, i64 %199
  %201 = load ptr, ptr %17, align 8, !tbaa !5
  %202 = call ptr %195(ptr noundef %196, ptr noundef %200, ptr noundef %201)
  %203 = load ptr, ptr %22, align 8, !tbaa !5
  %204 = load i32, ptr %18, align 4, !tbaa !9
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds i64, ptr %203, i64 %205
  %207 = load ptr, ptr %20, align 8, !tbaa !5
  %208 = load i32, ptr %18, align 4, !tbaa !9
  %209 = load i8, ptr %25, align 1, !tbaa !24
  %210 = zext i8 %209 to i64
  %211 = call i64 @cpIsZero_ct(i64 noundef %210)
  %212 = xor i64 %211, -1
  call void @cpMaskedReplace_ct(ptr noundef %206, ptr noundef %207, i32 noundef %208, i64 noundef %212)
  %213 = load ptr, ptr %21, align 8, !tbaa !5
  %214 = load ptr, ptr %21, align 8, !tbaa !5
  %215 = load ptr, ptr %22, align 8, !tbaa !5
  %216 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gfec_point_add(ptr noundef %213, ptr noundef %214, ptr noundef %215, ptr noundef %216)
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  %218 = load ptr, ptr %21, align 8, !tbaa !5
  %219 = load i32, ptr %13, align 4, !tbaa !9
  %220 = call ptr @cpGFpElementCopy(ptr noundef %217, ptr noundef %218, i32 noundef %219)
  %221 = load ptr, ptr %11, align 8, !tbaa !5
  call void @cpEcGFpReleasePool(i32 noundef 2, ptr noundef %221)
  %222 = load ptr, ptr %17, align 8, !tbaa !5
  call void @gsModPoolFree(ptr noundef %222, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  ret void
}

; 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 i64 @IPP_INT_PTR(ptr noundef) #2

declare void @setupTable(ptr noundef, ptr noundef, ptr noundef) #3

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

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

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

declare void @gsScrambleGet_sscm(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) #3

declare void @gfec_point_double(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cpMaskedReplace_ct(ptr noundef, ptr noundef, i32 noundef, i64 noundef) #2

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

declare void @gfec_point_add(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

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

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { "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 = !{!"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 20}
!12 = !{!"_cpGFpEC", !10, i64 0, !10, i64 4, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!13 = !{!12, !6, i64 8}
!14 = !{!15, !6, i64 8}
!15 = !{!"_cpGFp", !10, i64 0, !10, i64 4, !6, i64 8}
!16 = !{!17, !10, i64 16}
!17 = !{!"_gsModEngine", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !18, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !10, i64 96, !10, i64 100, !6, i64 104}
!18 = !{!"long long", !7, i64 0}
!19 = !{!17, !6, i64 32}
!20 = !{!21, !6, i64 56}
!21 = !{!"_gsModMethod", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80}
!22 = !{!23, !23, i64 0}
!23 = !{!"short", !7, i64 0}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"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"

; Function Attrs: nounwind uwtable
define dso_local void @gfec_point_mul(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2, i32 noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #0 {
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = getelementptr inbounds i8, ptr %4, i64 20
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = tail call i64 @IPP_INT_PTR(ptr noundef %5)
  %12 = sub i64 0, %11
  %13 = and i64 %12, 63
  %14 = getelementptr inbounds i8, ptr %5, i64 %13
  tail call void @setupTable(ptr noundef %14, ptr noundef %1, ptr noundef %4) #4
  %15 = getelementptr inbounds i8, ptr %4, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  %20 = load i32, ptr %19, align 8, !tbaa !14
  %21 = getelementptr inbounds i8, ptr %18, i64 32
  %22 = load ptr, ptr %21, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %22, i64 56
  %24 = load ptr, ptr %23, align 8, !tbaa !18
  %25 = tail call ptr @gsModPoolAlloc(ptr noundef %18, i32 noundef 1)
  %26 = tail call ptr @cpEcGFpGetPool(i32 noundef 1, ptr noundef %4)
  %27 = tail call ptr @cpEcGFpGetPool(i32 noundef 1, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #4
  %28 = srem i32 %3, 5
  %29 = sub nsw i32 %3, %28
  %.not = icmp eq i32 %28, %3
  br i1 %.not, label %41, label %30

30:                                               ; preds = %6
  %31 = add nsw i32 %29, -1
  %32 = sdiv i32 %31, 8
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i8, ptr %2, i64 %33
  %35 = load i16, ptr %34, align 2, !tbaa !20
  %36 = zext i16 %35 to i32
  %37 = and i32 %31, 7
  %38 = lshr i32 %36, %37
  %39 = trunc i32 %38 to i8
  %40 = and i8 %39, 63
  br label %41

41:                                               ; preds = %6, %30
  %.0104 = phi i8 [ %40, %30 ], [ 0, %6 ]
  call void @booth_recode(ptr noundef nonnull %8, ptr noundef nonnull %7, i8 noundef zeroext %.0104, i32 noundef 5)
  %42 = load i8, ptr %7, align 1, !tbaa !22
  %43 = zext i8 %42 to i32
  %44 = add nsw i32 %43, -1
  call void @gsScrambleGet_sscm(ptr noundef %26, i32 noundef %10, ptr noundef %14, i32 noundef %44, i32 noundef 4) #4
  %45 = icmp sgt i32 %29, 9
  %46 = sext i32 %20 to i64
  br i1 %45, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %41
  %47 = getelementptr inbounds i64, ptr %27, i64 %46
  br label %48

48:                                               ; preds = %.lr.ph, %48
  %.0.in106 = phi i32 [ %29, %.lr.ph ], [ %.0, %48 ]
  %.0 = add nsw i32 %.0.in106, -5
  call void @gfec_point_double(ptr noundef %26, ptr noundef %26, ptr noundef %4) #4
  call void @gfec_point_double(ptr noundef %26, ptr noundef %26, ptr noundef %4) #4
  call void @gfec_point_double(ptr noundef %26, ptr noundef %26, ptr noundef %4) #4
  call void @gfec_point_double(ptr noundef %26, ptr noundef %26, ptr noundef %4) #4
  call void @gfec_point_double(ptr noundef %26, ptr noundef %26, ptr noundef %4) #4
  %49 = add nsw i32 %.0.in106, -6
  %50 = lshr i32 %49, 3
  %51 = zext nneg i32 %50 to i64
  %52 = getelementptr inbounds i8, ptr %2, i64 %51
  %53 = load i16, ptr %52, align 2, !tbaa !20
  %54 = zext i16 %53 to i32
  %55 = and i32 %49, 7
  %56 = lshr i32 %54, %55
  %57 = trunc i32 %56 to i8
  %58 = and i8 %57, 63
  call void @booth_recode(ptr noundef nonnull %8, ptr noundef nonnull %7, i8 noundef zeroext %58, i32 noundef 5)
  %59 = load i8, ptr %7, align 1, !tbaa !22
  %60 = zext i8 %59 to i32
  %61 = add nsw i32 %60, -1
  call void @gsScrambleGet_sscm(ptr noundef %27, i32 noundef %10, ptr noundef %14, i32 noundef %61, i32 noundef 4) #4
  %62 = call ptr %24(ptr noundef %25, ptr noundef %47, ptr noundef %18) #4
  %63 = load i8, ptr %8, align 1, !tbaa !22
  %64 = zext i8 %63 to i64
  %65 = call i64 @cpIsZero_ct(i64 noundef %64)
  %66 = xor i64 %65, -1
  call void @cpMaskedReplace_ct(ptr noundef %47, ptr noundef %25, i32 noundef %20, i64 noundef %66)
  call void @gfec_point_add(ptr noundef %26, ptr noundef %26, ptr noundef %27, ptr noundef %4) #4
  %67 = icmp ugt i32 %.0.in106, 14
  br i1 %67, label %48, label %._crit_edge, !llvm.loop !23

._crit_edge:                                      ; preds = %48, %41
  call void @gfec_point_double(ptr noundef %26, ptr noundef %26, ptr noundef %4) #4
  call void @gfec_point_double(ptr noundef %26, ptr noundef %26, ptr noundef %4) #4
  call void @gfec_point_double(ptr noundef %26, ptr noundef %26, ptr noundef %4) #4
  call void @gfec_point_double(ptr noundef %26, ptr noundef %26, ptr noundef %4) #4
  call void @gfec_point_double(ptr noundef %26, ptr noundef %26, ptr noundef %4) #4
  %68 = load i16, ptr %2, align 2, !tbaa !20
  %69 = trunc i16 %68 to i8
  %70 = shl i8 %69, 1
  %71 = and i8 %70, 62
  call void @booth_recode(ptr noundef nonnull %8, ptr noundef nonnull %7, i8 noundef zeroext %71, i32 noundef 5)
  %72 = load i8, ptr %7, align 1, !tbaa !22
  %73 = zext i8 %72 to i32
  %74 = add nsw i32 %73, -1
  call void @gsScrambleGet_sscm(ptr noundef %27, i32 noundef %10, ptr noundef %14, i32 noundef %74, i32 noundef 4) #4
  %75 = getelementptr inbounds i64, ptr %27, i64 %46
  %76 = call ptr %24(ptr noundef %25, ptr noundef %75, ptr noundef %18) #4
  %77 = load i8, ptr %8, align 1, !tbaa !22
  %78 = zext i8 %77 to i64
  %79 = call i64 @cpIsZero_ct(i64 noundef %78)
  %80 = xor i64 %79, -1
  call void @cpMaskedReplace_ct(ptr noundef %75, ptr noundef %25, i32 noundef %20, i64 noundef %80)
  call void @gfec_point_add(ptr noundef %26, ptr noundef %26, ptr noundef %27, ptr noundef %4) #4
  %81 = call ptr @cpGFpElementCopy(ptr noundef %0, ptr noundef %26, i32 noundef %10)
  call void @cpEcGFpReleasePool(i32 noundef 2, ptr noundef %4)
  call void @gsModPoolFree(ptr noundef %18, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #4
  ret void
}

; 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 i64 @IPP_INT_PTR(ptr noundef) local_unnamed_addr #2

declare void @setupTable(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

declare void @gsScrambleGet_sscm(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @gfec_point_double(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

declare void @gfec_point_add(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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

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 = { "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 20}
!6 = !{!"_cpGFpEC", !7, i64 0, !7, i64 4, !10, i64 8, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 68, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!13, !10, i64 8}
!13 = !{!"_cpGFp", !7, i64 0, !7, i64 4, !10, i64 8}
!14 = !{!15, !7, i64 16}
!15 = !{!"_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, !16, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !7, i64 96, !7, i64 100, !10, i64 104}
!16 = !{!"long long", !8, i64 0}
!17 = !{!15, !10, i64 32}
!18 = !{!19, !10, i64 56}
!19 = !{!"_gsModMethod", !10, i64 0, !10, i64 8, !10, 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}
!20 = !{!21, !21, i64 0}
!21 = !{!"short", !8, i64 0}
!22 = !{!8, !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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