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

; 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._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 ptr @cpGFpxInv(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %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 ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._gsModEngine, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %36

31:                                               ; preds = %3
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call ptr @cpGFpInv(ptr noundef %32, ptr noundef %33, ptr noundef %34)
  store ptr %35, ptr %4, align 8
  br label %197

36:                                               ; preds = %3
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = call i32 @degree(ptr noundef %37, ptr noundef %38)
  %40 = icmp eq i32 0, %39
  br i1 %40, label %41, label %62

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._gsModEngine, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  store ptr %44, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = call ptr @gsModPoolAlloc(ptr noundef %45, i32 noundef 1)
  store ptr %46, ptr %9, align 8, !tbaa !5
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = call ptr @cpGFpxInv(ptr noundef %47, ptr noundef %48, ptr noundef %49)
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._gsModEngine, ptr %52, i32 0, i32 3
  %54 = load i32, ptr %53, align 8, !tbaa !13
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._gsModEngine, ptr %56, i32 0, i32 3
  %58 = load i32, ptr %57, align 8, !tbaa !13
  %59 = call ptr @cpGFpElementCopyPad(ptr noundef %51, i32 noundef %54, ptr noundef %55, i32 noundef %58)
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  call void @gsModPoolFree(ptr noundef %60, i32 noundef 1)
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %61, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %197

62:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct._gsModEngine, ptr %63, i32 0, i32 3
  %65 = load i32, ptr %64, align 8, !tbaa !13
  store i32 %65, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._gsModEngine, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !9
  store ptr %68, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = call ptr @cpGFpBasic(ptr noundef %69)
  store ptr %70, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 6, ptr %13, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._gsModEngine, ptr %71, i32 0, i32 5
  %73 = load i32, ptr %72, align 8, !tbaa !15
  store i32 %73, ptr %14, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = load i32, ptr %13, align 4, !tbaa !14
  %76 = call ptr @gsModPoolAlloc(ptr noundef %74, i32 noundef %75)
  store ptr %76, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %77 = load ptr, ptr %15, align 8, !tbaa !5
  %78 = load i32, ptr %14, align 4, !tbaa !14
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i64, ptr %77, i64 %79
  store ptr %80, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %81 = load ptr, ptr %16, align 8, !tbaa !5
  %82 = load i32, ptr %14, align 4, !tbaa !14
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i64, ptr %81, i64 %83
  store ptr %84, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %85 = load ptr, ptr %17, align 8, !tbaa !5
  %86 = load i32, ptr %14, align 4, !tbaa !14
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i64, ptr %85, i64 %87
  store ptr %88, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %89 = load ptr, ptr %18, align 8, !tbaa !5
  %90 = load i32, ptr %14, align 4, !tbaa !14
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i64, ptr %89, i64 %91
  store ptr %92, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %93 = load ptr, ptr %19, align 8, !tbaa !5
  %94 = load i32, ptr %14, align 4, !tbaa !14
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i64, ptr %93, i64 %95
  store ptr %96, ptr %20, align 8, !tbaa !5
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = load i32, ptr %10, align 4, !tbaa !14
  %100 = call ptr @cpGFpElementCopy(ptr noundef %97, ptr noundef %98, i32 noundef %99)
  %101 = load ptr, ptr %18, align 8, !tbaa !5
  %102 = load i32, ptr %10, align 4, !tbaa !14
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._gsModEngine, ptr %103, i32 0, i32 10
  %105 = load ptr, ptr %104, align 8, !tbaa !16
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct._gsModEngine, ptr %106, i32 0, i32 3
  %108 = load i32, ptr %107, align 8, !tbaa !13
  %109 = call ptr @cpGFpElementCopyPad(ptr noundef %101, i32 noundef %102, ptr noundef %105, i32 noundef %108)
  %110 = load ptr, ptr %17, align 8, !tbaa !5
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = call ptr @gfpxGeneratorDiv(ptr noundef %110, ptr noundef %111, ptr noundef %112, ptr noundef %113)
  %115 = load ptr, ptr %19, align 8, !tbaa !5
  %116 = load ptr, ptr %17, align 8, !tbaa !5
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = call ptr @cpGFpxNeg(ptr noundef %115, ptr noundef %116, ptr noundef %117)
  br label %119

119:                                              ; preds = %124, %62
  %120 = load ptr, ptr %16, align 8, !tbaa !5
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = call i32 @degree(ptr noundef %120, ptr noundef %121)
  %123 = icmp sgt i32 %122, 0
  br i1 %123, label %124, label %172

124:                                              ; preds = %119
  %125 = load ptr, ptr %17, align 8, !tbaa !5
  %126 = load ptr, ptr %20, align 8, !tbaa !5
  %127 = load ptr, ptr %15, align 8, !tbaa !5
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = call ptr @gfpxPolyDiv(ptr noundef %125, ptr noundef %126, ptr noundef %127, ptr noundef %128, ptr noundef %129)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %131 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %131, ptr %21, align 8, !tbaa !5
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %132, ptr %16, align 8, !tbaa !5
  %133 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %133, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %134 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %134, ptr %22, align 8, !tbaa !5
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %135, ptr %20, align 8, !tbaa !5
  %136 = load ptr, ptr %22, align 8, !tbaa !5
  store ptr %136, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._gsModEngine, ptr %137, i32 0, i32 6
  %139 = load ptr, ptr %138, align 8, !tbaa !17
  %140 = getelementptr inbounds %struct._gsModMethod, ptr %139, i32 0, i32 7
  %141 = load ptr, ptr %140, align 8, !tbaa !18
  %142 = load ptr, ptr %17, align 8, !tbaa !5
  %143 = load ptr, ptr %17, align 8, !tbaa !5
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = call ptr %141(ptr noundef %142, ptr noundef %143, ptr noundef %144)
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._gsModEngine, ptr %146, i32 0, i32 6
  %148 = load ptr, ptr %147, align 8, !tbaa !17
  %149 = getelementptr inbounds %struct._gsModMethod, ptr %148, i32 0, i32 2
  %150 = load ptr, ptr %149, align 8, !tbaa !20
  %151 = load ptr, ptr %20, align 8, !tbaa !5
  %152 = load ptr, ptr %17, align 8, !tbaa !5
  %153 = load ptr, ptr %19, align 8, !tbaa !5
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = call ptr %150(ptr noundef %151, ptr noundef %152, ptr noundef %153, ptr noundef %154)
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct._gsModEngine, ptr %156, i32 0, i32 6
  %158 = load ptr, ptr %157, align 8, !tbaa !17
  %159 = getelementptr inbounds %struct._gsModMethod, ptr %158, i32 0, i32 5
  %160 = load ptr, ptr %159, align 8, !tbaa !21
  %161 = load ptr, ptr %20, align 8, !tbaa !5
  %162 = load ptr, ptr %18, align 8, !tbaa !5
  %163 = load ptr, ptr %20, align 8, !tbaa !5
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = call ptr %160(ptr noundef %161, ptr noundef %162, ptr noundef %163, ptr noundef %164)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %166 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %166, ptr %23, align 8, !tbaa !5
  %167 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %167, ptr %19, align 8, !tbaa !5
  %168 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %168, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %169 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %169, ptr %24, align 8, !tbaa !5
  %170 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %170, ptr %20, align 8, !tbaa !5
  %171 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %171, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  br label %119, !llvm.loop !22

172:                                              ; preds = %119
  %173 = load ptr, ptr %16, align 8, !tbaa !5
  %174 = load i32, ptr %10, align 4, !tbaa !14
  %175 = call i32 @cpGFpElementIsEquChunk(ptr noundef %173, i32 noundef %174, i64 noundef 0)
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %177, label %180

177:                                              ; preds = %172
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = load i32, ptr %13, align 4, !tbaa !14
  call void @gsModPoolFree(ptr noundef %178, i32 noundef %179)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %196

180:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %181 = load ptr, ptr %11, align 8, !tbaa !5
  %182 = call ptr @gsModPoolAlloc(ptr noundef %181, i32 noundef 1)
  store ptr %182, ptr %26, align 8, !tbaa !5
  %183 = load ptr, ptr %26, align 8, !tbaa !5
  %184 = load ptr, ptr %16, align 8, !tbaa !5
  %185 = load ptr, ptr %11, align 8, !tbaa !5
  %186 = call ptr @cpGFpxInv(ptr noundef %183, ptr noundef %184, ptr noundef %185)
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = load ptr, ptr %19, align 8, !tbaa !5
  %189 = load ptr, ptr %26, align 8, !tbaa !5
  %190 = load ptr, ptr %7, align 8, !tbaa !5
  %191 = call ptr @cpGFpxMul_GFE(ptr noundef %187, ptr noundef %188, ptr noundef %189, ptr noundef %190)
  %192 = load ptr, ptr %11, align 8, !tbaa !5
  call void @gsModPoolFree(ptr noundef %192, i32 noundef 1)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  %193 = load ptr, ptr %7, align 8, !tbaa !5
  %194 = load i32, ptr %13, align 4, !tbaa !14
  call void @gsModPoolFree(ptr noundef %193, i32 noundef %194)
  %195 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %195, ptr %4, align 8
  store i32 1, ptr %25, align 4
  br label %196

196:                                              ; preds = %180, %177
  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 8, 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
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %197

197:                                              ; preds = %196, %41, %31
  %198 = load ptr, ptr %4, align 8
  ret ptr %198
}

declare ptr @cpGFpInv(ptr noundef, ptr noundef, ptr noundef) #1

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

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

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

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

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

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

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

declare ptr @cpGFpxNeg(ptr noundef, ptr noundef, ptr noundef) #1

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

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

declare ptr @cpGFpxMul_GFE(ptr noundef, ptr noundef, ptr noundef, ptr 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 = { "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 = { 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 nosync nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!10 = !{!"_gsModEngine", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !11, i64 96, !11, i64 100, !6, i64 104}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!10, !11, i64 16}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !11, i64 24}
!16 = !{!10, !6, i64 64}
!17 = !{!10, !6, i64 32}
!18 = !{!19, !6, i64 56}
!19 = !{!"_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}
!20 = !{!19, !6, i64 16}
!21 = !{!19, !6, i64 40}
!22 = distinct !{!22, !23}
!23 = !{!"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 ptr @cpGFpxInv(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = icmp eq ptr %4, null
  br i1 %5, label %6, label %8

6:                                                ; preds = %3
  %7 = tail call ptr @cpGFpInv(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %2) #3
  br label %common.ret107

8:                                                ; preds = %3
  %9 = tail call i32 @degree(ptr noundef %1, ptr noundef nonnull %2)
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %11, label %20

common.ret107:                                    ; preds = %62, %6, %63, %11
  %common.ret107.op = phi ptr [ %0, %11 ], [ %0, %63 ], [ %7, %6 ], [ null, %62 ]
  ret ptr %common.ret107.op

11:                                               ; preds = %8
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = tail call ptr @gsModPoolAlloc(ptr noundef %12, i32 noundef 1)
  %14 = tail call ptr @cpGFpxInv(ptr noundef %13, ptr noundef %1, ptr noundef %12)
  %15 = getelementptr inbounds i8, ptr %2, i64 16
  %16 = load i32, ptr %15, align 8, !tbaa !12
  %17 = getelementptr inbounds i8, ptr %12, i64 16
  %18 = load i32, ptr %17, align 8, !tbaa !12
  %19 = tail call ptr @cpGFpElementCopyPad(ptr noundef %0, i32 noundef %16, ptr noundef %13, i32 noundef %18)
  tail call void @gsModPoolFree(ptr noundef %12, i32 noundef 1)
  br label %common.ret107

20:                                               ; preds = %8
  %21 = getelementptr inbounds i8, ptr %2, i64 16
  %22 = load i32, ptr %21, align 8, !tbaa !12
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = tail call ptr @cpGFpBasic(ptr noundef nonnull %2)
  %25 = getelementptr inbounds i8, ptr %2, i64 24
  %26 = load i32, ptr %25, align 8, !tbaa !13
  %27 = tail call ptr @gsModPoolAlloc(ptr noundef nonnull %2, i32 noundef 6)
  %28 = sext i32 %26 to i64
  %29 = getelementptr inbounds i64, ptr %27, i64 %28
  %30 = getelementptr inbounds i64, ptr %29, i64 %28
  %31 = getelementptr inbounds i64, ptr %30, i64 %28
  %32 = getelementptr inbounds i64, ptr %31, i64 %28
  %33 = tail call ptr @cpGFpElementCopy(ptr noundef %27, ptr noundef %1, i32 noundef %22)
  %34 = getelementptr inbounds i8, ptr %24, i64 64
  %35 = load ptr, ptr %34, align 8, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %24, i64 16
  %37 = load i32, ptr %36, align 8, !tbaa !12
  %38 = tail call ptr @cpGFpElementCopyPad(ptr noundef %31, i32 noundef %22, ptr noundef %35, i32 noundef %37)
  %39 = tail call ptr @gfpxGeneratorDiv(ptr noundef %30, ptr noundef %29, ptr noundef %1, ptr noundef nonnull %2)
  %40 = tail call ptr @cpGFpxNeg(ptr noundef %32, ptr noundef %30, ptr noundef nonnull %2) #3
  %41 = tail call i32 @degree(ptr noundef %29, ptr noundef nonnull %2)
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %20
  %43 = getelementptr inbounds i64, ptr %32, i64 %28
  %44 = getelementptr inbounds i8, ptr %2, i64 32
  br label %45

45:                                               ; preds = %.lr.ph, %45
  %.096105 = phi ptr [ %27, %.lr.ph ], [ %.097104, %45 ]
  %.097104 = phi ptr [ %29, %.lr.ph ], [ %.0100101, %45 ]
  %.098103 = phi ptr [ %31, %.lr.ph ], [ %.099102, %45 ]
  %.099102 = phi ptr [ %32, %.lr.ph ], [ %.096105, %45 ]
  %.0100101 = phi ptr [ %43, %.lr.ph ], [ %.098103, %45 ]
  %46 = tail call ptr @gfpxPolyDiv(ptr noundef %30, ptr noundef %.0100101, ptr noundef %.096105, ptr noundef %.097104, ptr noundef nonnull %2)
  %47 = load ptr, ptr %44, align 8, !tbaa !15
  %48 = getelementptr inbounds i8, ptr %47, i64 56
  %49 = load ptr, ptr %48, align 8, !tbaa !16
  %50 = tail call ptr %49(ptr noundef %30, ptr noundef %30, ptr noundef nonnull %2) #3
  %51 = load ptr, ptr %44, align 8, !tbaa !15
  %52 = getelementptr inbounds i8, ptr %51, i64 16
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  %54 = tail call ptr %53(ptr noundef %.096105, ptr noundef %30, ptr noundef %.099102, ptr noundef nonnull %2) #3
  %55 = load ptr, ptr %44, align 8, !tbaa !15
  %56 = getelementptr inbounds i8, ptr %55, i64 40
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = tail call ptr %57(ptr noundef %.096105, ptr noundef %.098103, ptr noundef %.096105, ptr noundef nonnull %2) #3
  %59 = tail call i32 @degree(ptr noundef %.0100101, ptr noundef nonnull %2)
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %45, label %._crit_edge, !llvm.loop !20

._crit_edge:                                      ; preds = %45, %20
  %.099.lcssa = phi ptr [ %32, %20 ], [ %.096105, %45 ]
  %.097.lcssa = phi ptr [ %29, %20 ], [ %.0100101, %45 ]
  %61 = tail call i32 @cpGFpElementIsEquChunk(ptr noundef %.097.lcssa, i32 noundef %22, i64 noundef 0)
  %.not = icmp eq i32 %61, 0
  br i1 %.not, label %63, label %62

62:                                               ; preds = %._crit_edge
  tail call void @gsModPoolFree(ptr noundef nonnull %2, i32 noundef 6)
  br label %common.ret107

63:                                               ; preds = %._crit_edge
  %64 = tail call ptr @gsModPoolAlloc(ptr noundef %23, i32 noundef 1)
  %65 = tail call ptr @cpGFpxInv(ptr noundef %64, ptr noundef %.097.lcssa, ptr noundef %23)
  %66 = tail call ptr @cpGFpxMul_GFE(ptr noundef %0, ptr noundef %.099.lcssa, ptr noundef %64, ptr noundef nonnull %2) #3
  tail call void @gsModPoolFree(ptr noundef %23, i32 noundef 1)
  tail call void @gsModPoolFree(ptr noundef nonnull %2, i32 noundef 6)
  br label %common.ret107
}

declare ptr @cpGFpInv(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; 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 @cpGFpElementCopyPad(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

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

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

declare ptr @cpGFpxNeg(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

declare ptr @cpGFpxMul_GFE(ptr noundef, ptr noundef, ptr noundef, ptr 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 = { "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 = { 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 = { 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 = !{!"_gsModEngine", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !11, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !10, i64 96, !10, i64 100, !7, i64 104}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!6, !10, i64 16}
!13 = !{!6, !10, i64 24}
!14 = !{!6, !7, i64 64}
!15 = !{!6, !7, i64 32}
!16 = !{!17, !7, i64 56}
!17 = !{!"_gsModMethod", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80}
!18 = !{!17, !7, i64 16}
!19 = !{!17, !7, i64 40}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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