; LLVM IR from gbanegas/CryptoSith :: gf/avr (GaloisFieldPolExample)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.galoisfield::GField" = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.galoisfield::GFieldElement" = type <{ ptr, i32, [4 x i8] }>
%"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 }

@poly = external dso_local global [9 x i32], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.galoisfield::GField", align 8
  %7 = alloca [9 x %"class.galoisfield::GFieldElement"], align 16
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.galoisfield::GFieldPol", align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 64, ptr %6) #8
  call void @_ZN11galoisfield6GFieldC1EiPKj(ptr noundef nonnull align 8 dereferenceable(64) %6, i32 noundef 8, ptr noundef @poly)
  call void @llvm.lifetime.start.p0(i64 144, ptr %7) #8
  store ptr %7, ptr %8, align 8
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %7, ptr noundef %6, i32 noundef 0)
          to label %12 unwind label %35

12:                                               ; preds = %2
  %13 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %7, i64 1
  store ptr %13, ptr %8, align 8
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %13, ptr noundef %6, i32 noundef 1)
          to label %14 unwind label %35

14:                                               ; preds = %12
  %15 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %7, i64 2
  store ptr %15, ptr %8, align 8
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %15, ptr noundef %6, i32 noundef 2)
          to label %16 unwind label %35

16:                                               ; preds = %14
  %17 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %7, i64 3
  store ptr %17, ptr %8, align 8
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %17, ptr noundef %6, i32 noundef 3)
          to label %18 unwind label %35

18:                                               ; preds = %16
  %19 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %7, i64 4
  store ptr %19, ptr %8, align 8
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %19, ptr noundef %6, i32 noundef 4)
          to label %20 unwind label %35

20:                                               ; preds = %18
  %21 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %7, i64 5
  store ptr %21, ptr %8, align 8
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %21, ptr noundef %6, i32 noundef 5)
          to label %22 unwind label %35

22:                                               ; preds = %20
  %23 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %7, i64 6
  store ptr %23, ptr %8, align 8
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %23, ptr noundef %6, i32 noundef 6)
          to label %24 unwind label %35

24:                                               ; preds = %22
  %25 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %7, i64 7
  store ptr %25, ptr %8, align 8
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %25, ptr noundef %6, i32 noundef 7)
          to label %26 unwind label %35

26:                                               ; preds = %24
  %27 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %7, i64 8
  store ptr %27, ptr %8, align 8
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %27, ptr noundef %6, i32 noundef 8)
          to label %28 unwind label %35

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #8
  %29 = getelementptr inbounds [9 x %"class.galoisfield::GFieldElement"], ptr %7, i64 0, i64 0
  invoke void @_ZN11galoisfield9GFieldPolC1EPNS_6GFieldEjPNS_13GFieldElementE(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef %6, i32 noundef 8, ptr noundef %29)
          to label %30 unwind label %46

30:                                               ; preds = %28
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN11galoisfieldlsERSoRKNS_9GFieldPolE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %32 unwind label %50

32:                                               ; preds = %30
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %34 unwind label %50

34:                                               ; preds = %32
  call void @exit(i32 noundef 0) #9
  unreachable

35:                                               ; preds = %26, %24, %22, %20, %18, %16, %14, %12, %2
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %9, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %10, align 4
  %39 = load ptr, ptr %8, align 8
  %40 = icmp eq ptr %7, %39
  br i1 %40, label %45, label %41

41:                                               ; preds = %41, %35
  %42 = phi ptr [ %39, %35 ], [ %43, %41 ]
  %43 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %42, i64 -1
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %43) #8
  %44 = icmp eq ptr %43, %7
  br i1 %44, label %45, label %41

45:                                               ; preds = %41, %35
  br label %62

46:                                               ; preds = %28
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %9, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %10, align 4
  br label %54

50:                                               ; preds = %32, %30
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %9, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %10, align 4
  call void @_ZN11galoisfield9GFieldPolD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #8
  br label %54

54:                                               ; preds = %50, %46
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #8
  %55 = getelementptr inbounds [9 x %"class.galoisfield::GFieldElement"], ptr %7, i32 0, i32 0
  %56 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %55, i64 9
  br label %57

57:                                               ; preds = %57, %54
  %58 = phi ptr [ %56, %54 ], [ %59, %57 ]
  %59 = getelementptr inbounds %"class.galoisfield::GFieldElement", ptr %58, i64 -1
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %59) #8
  %60 = icmp eq ptr %59, %55
  br i1 %60, label %61, label %57

61:                                               ; preds = %57
  br label %62

62:                                               ; preds = %61, %45
  call void @llvm.lifetime.end.p0(i64 144, ptr %7) #8
  call void @_ZN11galoisfield6GFieldD1Ev(ptr noundef nonnull align 8 dereferenceable(64) %6) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr %6) #8
  br label %63

63:                                               ; preds = %62
  %64 = load ptr, ptr %9, align 8
  %65 = load i32, ptr %10, align 4
  %66 = insertvalue { ptr, i32 } poison, ptr %64, 0
  %67 = insertvalue { ptr, i32 } %66, i32 %65, 1
  resume { ptr, i32 } %67
}

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

declare void @_ZN11galoisfield6GFieldC1EiPKj(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, ptr noundef) unnamed_addr #2

declare void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef, i32 noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN11galoisfield9GFieldPolC1EPNS_6GFieldEjPNS_13GFieldElementE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef) unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN11galoisfieldlsERSoRKNS_9GFieldPolE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

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

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

; Function Attrs: nounwind
declare void @_ZN11galoisfield6GFieldD1Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #7

attributes #0 = { mustprogress norecurse 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 = { "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 = { 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 = { 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 #5 = { inlinehint 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 #6 = { noreturn nounwind "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 #7 = { nounwind "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 #8 = { nounwind }
attributes #9 = { noreturn 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.galoisfield::GField" = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.galoisfield::GFieldElement" = type <{ ptr, i32, [4 x i8] }>
%"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 }

@poly = external dso_local global [9 x i32], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse noreturn uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.galoisfield::GField", align 8
  %4 = alloca [9 x %"class.galoisfield::GFieldElement"], align 16
  %5 = alloca %"class.galoisfield::GFieldPol", align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #8
  call void @_ZN11galoisfield6GFieldC1EiPKj(ptr noundef nonnull align 8 dereferenceable(64) %3, i32 noundef 8, ptr noundef nonnull @poly)
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %4) #8
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %4, ptr noundef nonnull %3, i32 noundef 0)
          to label %7 unwind label %.thread

.thread:                                          ; preds = %2
  %6 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %4, i64 16
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %8, ptr noundef nonnull %3, i32 noundef 1)
          to label %9 unwind label %29

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %4, i64 32
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %10, ptr noundef nonnull %3, i32 noundef 2)
          to label %11 unwind label %29

11:                                               ; preds = %9
  %12 = getelementptr inbounds i8, ptr %4, i64 48
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %12, ptr noundef nonnull %3, i32 noundef 3)
          to label %13 unwind label %29

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %4, i64 64
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %14, ptr noundef nonnull %3, i32 noundef 4)
          to label %15 unwind label %29

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %4, i64 80
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %16, ptr noundef nonnull %3, i32 noundef 5)
          to label %17 unwind label %29

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %4, i64 96
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %18, ptr noundef nonnull %3, i32 noundef 6)
          to label %19 unwind label %29

19:                                               ; preds = %17
  %20 = getelementptr inbounds i8, ptr %4, i64 112
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %20, ptr noundef nonnull %3, i32 noundef 7)
          to label %21 unwind label %29

21:                                               ; preds = %19
  %22 = getelementptr inbounds i8, ptr %4, i64 128
  invoke void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12) %22, ptr noundef nonnull %3, i32 noundef 8)
          to label %23 unwind label %29

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  invoke void @_ZN11galoisfield9GFieldPolC1EPNS_6GFieldEjPNS_13GFieldElementE(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull %3, i32 noundef 8, ptr noundef nonnull %4)
          to label %24 unwind label %35

24:                                               ; preds = %23
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN11galoisfieldlsERSoRKNS_9GFieldPolE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %26 unwind label %37

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %28 unwind label %37

28:                                               ; preds = %26
  call void @exit(i32 noundef 0) #9
  unreachable

29:                                               ; preds = %21, %19, %17, %15, %13, %11, %9, %7
  %.04 = phi ptr [ %22, %21 ], [ %20, %19 ], [ %18, %17 ], [ %16, %15 ], [ %14, %13 ], [ %12, %11 ], [ %10, %9 ], [ %8, %7 ]
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %31

31:                                               ; preds = %29, %31
  %32 = phi ptr [ %.04, %29 ], [ %33, %31 ]
  %33 = getelementptr inbounds i8, ptr %32, i64 -16
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %33) #8
  %34 = icmp eq ptr %33, %4
  br i1 %34, label %.loopexit, label %31

35:                                               ; preds = %23
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.loopexit

37:                                               ; preds = %26, %24
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN11galoisfield9GFieldPolD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  br label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %37, %35
  %.pn = phi { ptr, i32 } [ %38, %37 ], [ %36, %35 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  %39 = getelementptr inbounds i8, ptr %4, i64 128
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %39) #8
  %40 = getelementptr inbounds i8, ptr %4, i64 112
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %40) #8
  %41 = getelementptr inbounds i8, ptr %4, i64 96
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %41) #8
  %42 = getelementptr inbounds i8, ptr %4, i64 80
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %42) #8
  %43 = getelementptr inbounds i8, ptr %4, i64 64
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %43) #8
  %44 = getelementptr inbounds i8, ptr %4, i64 48
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %44) #8
  %45 = getelementptr inbounds i8, ptr %4, i64 32
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %45) #8
  %46 = getelementptr inbounds i8, ptr %4, i64 16
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %46) #8
  call void @_ZN11galoisfield13GFieldElementD2Ev(ptr noundef nonnull align 8 dereferenceable(12) %4) #8
  br label %.loopexit

.loopexit:                                        ; preds = %31, %.loopexit.loopexit, %.thread
  %.pn.pn = phi { ptr, i32 } [ %6, %.thread ], [ %.pn, %.loopexit.loopexit ], [ %30, %31 ]
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %4) #8
  call void @_ZN11galoisfield6GFieldD1Ev(ptr noundef nonnull align 8 dereferenceable(64) %3) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #8
  resume { ptr, i32 } %.pn.pn
}

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

declare void @_ZN11galoisfield6GFieldC1EiPKj(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, ptr noundef) unnamed_addr #2

declare void @_ZN11galoisfield13GFieldElementC1EPNS_6GFieldEi(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef, i32 noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN11galoisfield9GFieldPolC1EPNS_6GFieldEjPNS_13GFieldElementE(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef, ptr noundef) unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN11galoisfieldlsERSoRKNS_9GFieldPolE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6

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

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

; Function Attrs: nounwind
declare void @_ZN11galoisfield6GFieldD1Ev(ptr noundef nonnull align 8 dereferenceable(64)) unnamed_addr #7

attributes #0 = { mustprogress norecurse noreturn 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 = { "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 = { 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 = { 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 #5 = { inlinehint 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 #6 = { noreturn nounwind "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 #7 = { nounwind "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 #8 = { nounwind }
attributes #9 = { noreturn 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)"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass