; LLVM IR from gbanegas/CryptoSith :: gf/GFieldPol.ll (ZN11galoisfield9GFieldPolmLERKS0_)

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

%"class.galoisfield::GFieldPol" = type { ptr, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<galoisfield::GFieldElement, std::allocator<galoisfield::GFieldElement>>::_Vector_impl" }
%"struct.std::_Vector_base<galoisfield::GFieldElement, std::allocator<galoisfield::GFieldElement>>::_Vector_impl" = type { %"struct.std::_Vector_base<galoisfield::GFieldElement, std::allocator<galoisfield::GFieldElement>>::_Vector_impl_data" }
%"struct.std::_Vector_base<galoisfield::GFieldElement, std::allocator<galoisfield::GFieldElement>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.galoisfield::GFieldElement" = type <{ ptr, i32, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIN11galoisfield13GFieldElementESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN11galoisfield13GFieldElementESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11galoisfield9GFieldPol3degEv(ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZN11galoisfield13GFieldElementpLERKS0_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11galoisfield9GFieldPol8simplifyERS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN11galoisfield9GFieldPolmLERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.galoisfield::GFieldPol", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.galoisfield::GFieldElement", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  %13 = getelementptr inbounds %"class.galoisfield::GFieldPol", ptr %12, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.galoisfield::GFieldPol", ptr %15, i32 0, i32 0
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = icmp eq ptr %14, %17
  br i1 %18, label %19, label %89

19:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #5
  %20 = getelementptr inbounds %"class.galoisfield::GFieldPol", ptr %12, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = call noundef i32 @_ZNK11galoisfield9GFieldPol3degEv(ptr noundef nonnull align 8 dereferenceable(32) %12)
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = call noundef i32 @_ZNK11galoisfield9GFieldPol3degEv(ptr noundef nonnull align 8 dereferenceable(32) %23)
  %25 = add i32 %22, %24
  %26 = add i32 %25, 1
  call void @_ZN11galoisfield9GFieldPolC1EPNS_6GFieldEjPNS_13GFieldElementE(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef %21, i32 noundef %26, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !15
  br label %27

27:                                               ; preds = %75, %19
  %28 = load i32, ptr %6, align 4, !tbaa !15
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds %"class.galoisfield::GFieldPol", ptr %12, i32 0, i32 1
  %31 = call noundef i64 @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  %32 = icmp ult i64 %29, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %27
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %78

34:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !15
  br label %35

35:                                               ; preds = %62, %34
  %36 = load i32, ptr %8, align 4, !tbaa !15
  %37 = zext i32 %36 to i64
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %"class.galoisfield::GFieldPol", ptr %38, i32 0, i32 1
  %40 = call noundef i64 @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #5
  %41 = icmp ult i64 %37, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %35
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %74

43:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  %44 = getelementptr inbounds %"class.galoisfield::GFieldPol", ptr %12, i32 0, i32 1
  %45 = load i32, ptr %6, align 4, !tbaa !15
  %46 = zext i32 %45 to i64
  %47 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIN11galoisfield13GFieldElementESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %44, i64 noundef %46) #5
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.galoisfield::GFieldPol", ptr %48, i32 0, i32 1
  %50 = load i32, ptr %8, align 4, !tbaa !15
  %51 = zext i32 %50 to i64
  %52 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %49, i64 noundef %51) #5
  invoke void @_ZN11galoisfieldmlERKNS_13GFieldElementES2_(ptr dead_on_unwind writable sret(%"class.galoisfield::GFieldElement") align 8 %9, ptr noundef nonnull align 8 dereferenceable(12) %47, ptr noundef nonnull align 8 dereferenceable(12) %52)
          to label %53 unwind label %65

53:                                               ; preds = %43
  %54 = getelementptr inbounds %"class.galoisfield::GFieldPol", ptr %5, i32 0, i32 1
  %55 = load i32, ptr %6, align 4, !tbaa !15
  %56 = load i32, ptr %8, align 4, !tbaa !15
  %57 = add i32 %55, %56
  %58 = zext i32 %57 to i64
  %59 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIN11galoisfield13GFieldElementESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %54, i64 noundef %58) #5
  %60 = invoke noundef nonnull align 8 dereferenceable(12) ptr @_ZN11galoisfield13GFieldElementpLERKS0_(ptr noundef nonnull align 8 dereferenceable(12) %59, ptr noundef nonnull align 8 dereferenceable(12) %9)
          to label %61 unwind label %69

61:                                               ; preds = %53
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %8, align 4, !tbaa !15
  %64 = add i32 %63, 1
  store i32 %64, ptr %8, align 4, !tbaa !15
  br label %35, !llvm.loop !17

65:                                               ; preds = %43
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %10, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %11, align 4
  br label %73

69:                                               ; preds = %53
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %10, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %11, align 4
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %9) #5
  br label %73

73:                                               ; preds = %69, %65
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %88

74:                                               ; preds = %42
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %6, align 4, !tbaa !15
  %77 = add i32 %76, 1
  store i32 %77, ptr %6, align 4, !tbaa !15
  br label %27, !llvm.loop !19

78:                                               ; preds = %33
  invoke void @_ZN11galoisfield9GFieldPol8simplifyERS0_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %79 unwind label %84

79:                                               ; preds = %78
  %80 = getelementptr inbounds %"class.galoisfield::GFieldPol", ptr %5, i32 0, i32 1
  %81 = getelementptr inbounds %"class.galoisfield::GFieldPol", ptr %12, i32 0, i32 1
  %82 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN11galoisfield13GFieldElementESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %81, ptr noundef nonnull align 8 dereferenceable(24) %80)
          to label %83 unwind label %84

83:                                               ; preds = %79
  call void @_ZN11galoisfield9GFieldPolD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  br label %89

84:                                               ; preds = %79, %78
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %10, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %11, align 4
  br label %88

88:                                               ; preds = %84, %73
  call void @_ZN11galoisfield9GFieldPolD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  br label %90

89:                                               ; preds = %83, %2
  ret ptr %12

90:                                               ; preds = %88
  %91 = load ptr, ptr %10, align 8
  %92 = load i32, ptr %11, align 4
  %93 = insertvalue { ptr, i32 } poison, ptr %91, 0
  %94 = insertvalue { ptr, i32 } %93, i32 %92, 1
  resume { ptr, i32 } %94
}

declare void @_ZN11galoisfieldmlERKNS_13GFieldElementES2_(ptr dead_on_unwind writable sret(%"class.galoisfield::GFieldElement") align 8, ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11galoisfield9GFieldPolD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare void @_ZN11galoisfield9GFieldPolC1EPNS_6GFieldEjPNS_13GFieldElementE(ptr, ptr, i32, ptr)

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN11galoisfield9GFieldPolE", !6, i64 0, !11, i64 8}
!11 = !{!"_ZTSSt6vectorIN11galoisfield13GFieldElementESaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIN11galoisfield13GFieldElementESaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN11galoisfield13GFieldElementESaIS1_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN11galoisfield13GFieldElementESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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

%"class.galoisfield::GFieldPol" = type { ptr, %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<galoisfield::GFieldElement, std::allocator<galoisfield::GFieldElement>>::_Vector_impl" }
%"struct.std::_Vector_base<galoisfield::GFieldElement, std::allocator<galoisfield::GFieldElement>>::_Vector_impl" = type { %"struct.std::_Vector_base<galoisfield::GFieldElement, std::allocator<galoisfield::GFieldElement>>::_Vector_impl_data" }
%"struct.std::_Vector_base<galoisfield::GFieldElement, std::allocator<galoisfield::GFieldElement>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.galoisfield::GFieldElement" = type <{ ptr, i32, [4 x i8] }>

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIN11galoisfield13GFieldElementESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN11galoisfield13GFieldElementESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK11galoisfield9GFieldPol3degEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZN11galoisfield13GFieldElementpLERKS0_(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11galoisfield9GFieldPol8simplifyERS0_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN11galoisfield9GFieldPolmLERKS0_(ptr noundef nonnull returned align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.galoisfield::GFieldPol", align 8
  %4 = alloca %"class.galoisfield::GFieldElement", align 8
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = icmp eq ptr %5, %6
  br i1 %7, label %8, label %44

8:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  %9 = tail call noundef i32 @_ZNK11galoisfield9GFieldPol3degEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %10 = tail call noundef i32 @_ZNK11galoisfield9GFieldPol3degEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %11 = add i32 %9, 1
  %12 = add i32 %11, %10
  call void @_ZN11galoisfield9GFieldPolC1EPNS_6GFieldEjPNS_13GFieldElementE(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef %5, i32 noundef %12, ptr noundef null)
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = call noundef i64 @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %.not = icmp eq i64 %14, 0
  br i1 %.not, label %._crit_edge23, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %8
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = getelementptr inbounds i8, ptr %3, i64 8
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge
  %17 = phi i64 [ 0, %.preheader.lr.ph ], [ %20, %._crit_edge ]
  %.01622 = phi i32 [ 0, %.preheader.lr.ph ], [ %19, %._crit_edge ]
  %18 = call noundef i64 @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %.not24 = icmp eq i64 %18, 0
  br i1 %.not24, label %._crit_edge, label %.lr.ph

._crit_edge23:                                    ; preds = %._crit_edge, %8
  invoke void @_ZN11galoisfield9GFieldPol8simplifyERS0_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %37 unwind label %41

._crit_edge:                                      ; preds = %26, %.preheader
  %19 = add i32 %.01622, 1
  %20 = zext i32 %19 to i64
  %21 = call noundef i64 @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %22 = icmp ugt i64 %21, %20
  br i1 %22, label %.preheader, label %._crit_edge23, !llvm.loop !14

.lr.ph:                                           ; preds = %.preheader, %26
  %23 = phi i64 [ %32, %26 ], [ 0, %.preheader ]
  %.01521 = phi i32 [ %31, %26 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %24 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIN11galoisfield13GFieldElementESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %17) #5
  %25 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %23) #5
  invoke void @_ZN11galoisfieldmlERKNS_13GFieldElementES2_(ptr dead_on_unwind nonnull writable sret(%"class.galoisfield::GFieldElement") align 8 %4, ptr noundef nonnull align 8 dereferenceable(12) %24, ptr noundef nonnull align 8 dereferenceable(12) %25)
          to label %26 unwind label %35

26:                                               ; preds = %.lr.ph
  %27 = add i32 %.01521, %.01622
  %28 = zext i32 %27 to i64
  %29 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt6vectorIN11galoisfield13GFieldElementESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %28) #5
  %30 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZN11galoisfield13GFieldElementpLERKS0_(ptr noundef nonnull align 8 dereferenceable(12) %29, ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %31 = add i32 %.01521, 1
  %32 = zext i32 %31 to i64
  %33 = call noundef i64 @_ZNKSt6vectorIN11galoisfield13GFieldElementESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %34 = icmp ugt i64 %33, %32
  br i1 %34, label %.lr.ph, label %._crit_edge, !llvm.loop !16

35:                                               ; preds = %.lr.ph
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %43

37:                                               ; preds = %._crit_edge23
  %38 = getelementptr inbounds i8, ptr %3, i64 8
  %39 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIN11galoisfield13GFieldElementESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %38)
          to label %40 unwind label %41

40:                                               ; preds = %37
  call void @_ZN11galoisfield9GFieldPolD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  br label %44

41:                                               ; preds = %37, %._crit_edge23
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %43

43:                                               ; preds = %41, %35
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %42, %41 ]
  call void @_ZN11galoisfield9GFieldPolD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn

44:                                               ; preds = %40, %2
  ret ptr %0
}

declare void @_ZN11galoisfieldmlERKNS_13GFieldElementES2_(ptr dead_on_unwind writable sret(%"class.galoisfield::GFieldElement") align 8, ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11galoisfield9GFieldPolD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

declare void @_ZN11galoisfield9GFieldPolC1EPNS_6GFieldEjPNS_13GFieldElementE(ptr, ptr, i32, ptr) local_unnamed_addr

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN11galoisfield9GFieldPolE", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIN11galoisfield13GFieldElementESaIS1_EE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIN11galoisfield13GFieldElementESaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIN11galoisfield13GFieldElementESaIS1_EE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN11galoisfield13GFieldElementESaIS1_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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