; LLVM IR from albertobsd/keyhunt :: secp256k1/IntMod.ll (ZN3Int7ModSqrtEv)

; 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.Int = type { %union.anon }
%union.anon = type { [5 x i64] }

@_ZL2_P = external hidden global %class.Int, align 8

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

declare void @_ZN3Int3SetEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #1

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

declare void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) unnamed_addr #1

declare noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40)) #1

declare void @_ZN3Int5CLEAREv(ptr noundef nonnull align 8 dereferenceable(40)) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3Int7HasSqrtEv(ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

declare void @_ZN3Int6SubOneEv(ptr noundef nonnull align 8 dereferenceable(40)) #1

declare void @_ZN3Int6ShiftREj(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3Int7ModSqrtEv(ptr noundef nonnull align 8 dereferenceable(40) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %class.Int, align 8
  %4 = alloca i64, align 8
  %5 = alloca %class.Int, align 8
  %6 = alloca %class.Int, align 8
  %7 = alloca %class.Int, align 8
  %8 = alloca %class.Int, align 8
  %9 = alloca %class.Int, align 8
  %10 = alloca %class.Int, align 8
  %11 = alloca i64, align 8
  %12 = alloca %class.Int, align 8
  %13 = alloca i64, align 8
  %14 = alloca %class.Int, align 8
  %15 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %16 = load ptr, ptr %2, align 8
  %17 = call noundef zeroext i1 @_ZN3Int6IsEvenEv(ptr noundef nonnull align 8 dereferenceable(40) @_ZL2_P)
  br i1 %17, label %18, label %19

18:                                               ; preds = %1
  call void @_ZN3Int5CLEAREv(ptr noundef nonnull align 8 dereferenceable(40) %16)
  br label %70

19:                                               ; preds = %1
  %20 = call noundef zeroext i1 @_ZN3Int7HasSqrtEv(ptr noundef nonnull align 8 dereferenceable(40) %16)
  br i1 %20, label %22, label %21

21:                                               ; preds = %19
  call void @_ZN3Int5CLEAREv(ptr noundef nonnull align 8 dereferenceable(40) %16)
  br label %70

22:                                               ; preds = %19
  %23 = load i64, ptr @_ZL2_P, align 8, !tbaa !9
  %24 = and i64 %23, 3
  %25 = icmp eq i64 %24, 3
  br i1 %25, label %26, label %27

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 40, ptr %3) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %3, ptr noundef @_ZL2_P)
  call void @_ZN3Int6AddOneEv(ptr noundef nonnull align 8 dereferenceable(40) %3)
  call void @_ZN3Int6ShiftREj(ptr noundef nonnull align 8 dereferenceable(40) %3, i32 noundef 2)
  call void @_ZN3Int6ModExpEPS_(ptr noundef nonnull align 8 dereferenceable(40) %16, ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 40, ptr %3) #3
  br label %70

27:                                               ; preds = %22
  %28 = load i64, ptr @_ZL2_P, align 8, !tbaa !9
  %29 = and i64 %28, 3
  %30 = icmp eq i64 %29, 1
  br i1 %30, label %31, label %69

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  store i64 0, ptr %4, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 40, ptr %5) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef @_ZL2_P)
  call void @_ZN3Int6SubOneEv(ptr noundef nonnull align 8 dereferenceable(40) %5)
  br label %32

32:                                               ; preds = %34, %31
  %33 = call noundef zeroext i1 @_ZN3Int6IsEvenEv(ptr noundef nonnull align 8 dereferenceable(40) %5)
  br i1 %33, label %34, label %37

34:                                               ; preds = %32
  call void @_ZN3Int6ShiftREj(ptr noundef nonnull align 8 dereferenceable(40) %5, i32 noundef 1)
  %35 = load i64, ptr %4, align 8, !tbaa !10
  %36 = add i64 %35, 1
  store i64 %36, ptr %4, align 8, !tbaa !10
  br label %32, !llvm.loop !12

37:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 40, ptr %6) #3
  call void @_ZN3IntC1Em(ptr noundef nonnull align 8 dereferenceable(40) %6, i64 noundef 1)
  br label %38

38:                                               ; preds = %39, %37
  call void @_ZN3Int6AddOneEv(ptr noundef nonnull align 8 dereferenceable(40) %6)
  br label %39

39:                                               ; preds = %38
  %40 = call noundef zeroext i1 @_ZN3Int7HasSqrtEv(ptr noundef nonnull align 8 dereferenceable(40) %6)
  br i1 %40, label %38, label %41, !llvm.loop !14

41:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef %6)
  call void @_ZN3Int6ModExpEPS_(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 40, ptr %8) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef %16)
  call void @_ZN3Int6ModExpEPS_(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef %5)
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef %16)
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %10, ptr noundef %5)
  call void @_ZN3Int6AddOneEv(ptr noundef nonnull align 8 dereferenceable(40) %10)
  call void @_ZN3Int6ShiftREj(ptr noundef nonnull align 8 dereferenceable(40) %10, i32 noundef 1)
  call void @_ZN3Int6ModExpEPS_(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %42 = load i64, ptr %4, align 8, !tbaa !10
  store i64 %42, ptr %11, align 8, !tbaa !10
  br label %43

43:                                               ; preds = %66, %41
  %44 = call noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40) %8)
  %45 = xor i1 %44, true
  br i1 %45, label %46, label %68

46:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store i64 0, ptr %13, align 8, !tbaa !10
  br label %47

47:                                               ; preds = %50, %46
  %48 = call noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40) %12)
  %49 = xor i1 %48, true
  br i1 %49, label %50, label %53

50:                                               ; preds = %47
  call void @_ZN3Int9ModSquareEPS_(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef %12)
  %51 = load i64, ptr %13, align 8, !tbaa !10
  %52 = add i64 %51, 1
  store i64 %52, ptr %13, align 8, !tbaa !10
  br label %47, !llvm.loop !15

53:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %14, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store i64 0, ptr %15, align 8, !tbaa !10
  br label %54

54:                                               ; preds = %63, %53
  %55 = load i64, ptr %15, align 8, !tbaa !10
  %56 = load i64, ptr %11, align 8, !tbaa !10
  %57 = load i64, ptr %13, align 8, !tbaa !10
  %58 = sub i64 %56, %57
  %59 = sub i64 %58, 1
  %60 = icmp ult i64 %55, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %66

62:                                               ; preds = %54
  call void @_ZN3Int9ModSquareEPS_(ptr noundef nonnull align 8 dereferenceable(40) %14, ptr noundef %14)
  br label %63

63:                                               ; preds = %62
  %64 = load i64, ptr %15, align 8, !tbaa !10
  %65 = add i64 %64, 1
  store i64 %65, ptr %15, align 8, !tbaa !10
  br label %54, !llvm.loop !16

66:                                               ; preds = %61
  %67 = load i64, ptr %13, align 8, !tbaa !10
  store i64 %67, ptr %11, align 8, !tbaa !10
  call void @_ZN3Int9ModSquareEPS_(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef %14)
  call void @_ZN3Int6ModMulEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef %8, ptr noundef %7)
  call void @_ZN3Int6ModMulEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef %9, ptr noundef %14)
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #3
  br label %43, !llvm.loop !17

68:                                               ; preds = %43
  call void @_ZN3Int3SetEPS_(ptr noundef nonnull align 8 dereferenceable(40) %16, ptr noundef %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  br label %69

69:                                               ; preds = %68, %27
  br label %70

70:                                               ; preds = %69, %26, %21, %18
  ret void
}

declare noundef zeroext i1 @_ZN3Int6IsEvenEv(ptr noundef nonnull align 8 dereferenceable(40)) #1

declare void @_ZN3Int6AddOneEv(ptr noundef nonnull align 8 dereferenceable(40)) #1

declare void @_ZN3IntC1Em(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) unnamed_addr #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


; 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.Int = type { %union.anon }
%union.anon = type { [5 x i64] }

@_ZL2_P = external hidden global %class.Int, align 8

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

declare void @_ZN3Int3SetEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #1

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

declare void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) unnamed_addr #1

declare noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1

declare void @_ZN3Int5CLEAREv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3Int7HasSqrtEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

declare void @_ZN3Int6SubOneEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1

declare void @_ZN3Int6ShiftREj(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3Int7ModSqrtEv(ptr noundef nonnull align 8 dereferenceable(40) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca %class.Int, align 8
  %3 = alloca %class.Int, align 8
  %4 = alloca %class.Int, align 8
  %5 = alloca %class.Int, align 8
  %6 = alloca %class.Int, align 8
  %7 = alloca %class.Int, align 8
  %8 = alloca %class.Int, align 8
  %9 = alloca %class.Int, align 8
  %10 = alloca %class.Int, align 8
  %11 = tail call noundef zeroext i1 @_ZN3Int6IsEvenEv(ptr noundef nonnull align 8 dereferenceable(40) @_ZL2_P)
  br i1 %11, label %12, label %13

12:                                               ; preds = %1
  tail call void @_ZN3Int5CLEAREv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  br label %35

13:                                               ; preds = %1
  %14 = tail call noundef zeroext i1 @_ZN3Int7HasSqrtEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  br i1 %14, label %16, label %15

15:                                               ; preds = %13
  tail call void @_ZN3Int5CLEAREv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  br label %35

16:                                               ; preds = %13
  %17 = load i64, ptr @_ZL2_P, align 8, !tbaa !5
  %18 = and i64 %17, 3
  switch i64 %18, label %35 [
    i64 3, label %19
    i64 1, label %20
  ]

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %2) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %2, ptr noundef nonnull @_ZL2_P)
  call void @_ZN3Int6AddOneEv(ptr noundef nonnull align 8 dereferenceable(40) %2)
  call void @_ZN3Int6ShiftREj(ptr noundef nonnull align 8 dereferenceable(40) %2, i32 noundef 2)
  call void @_ZN3Int6ModExpEPS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull %2)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %2) #3
  br label %35

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %3) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %3, ptr noundef nonnull @_ZL2_P)
  call void @_ZN3Int6SubOneEv(ptr noundef nonnull align 8 dereferenceable(40) %3)
  %21 = call noundef zeroext i1 @_ZN3Int6IsEvenEv(ptr noundef nonnull align 8 dereferenceable(40) %3)
  br i1 %21, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %20, %.lr.ph
  %.01012 = phi i64 [ %22, %.lr.ph ], [ 0, %20 ]
  call void @_ZN3Int6ShiftREj(ptr noundef nonnull align 8 dereferenceable(40) %3, i32 noundef 1)
  %22 = add i64 %.01012, 1
  %23 = call noundef zeroext i1 @_ZN3Int6IsEvenEv(ptr noundef nonnull align 8 dereferenceable(40) %3)
  br i1 %23, label %.lr.ph, label %._crit_edge, !llvm.loop !8

._crit_edge:                                      ; preds = %.lr.ph, %20
  %.010.lcssa = phi i64 [ 0, %20 ], [ %22, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #3
  call void @_ZN3IntC1Em(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef 1)
  br label %24

24:                                               ; preds = %24, %._crit_edge
  call void @_ZN3Int6AddOneEv(ptr noundef nonnull align 8 dereferenceable(40) %4)
  %25 = call noundef zeroext i1 @_ZN3Int7HasSqrtEv(ptr noundef nonnull align 8 dereferenceable(40) %4)
  br i1 %25, label %24, label %26, !llvm.loop !10

26:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull %4)
  call void @_ZN3Int6ModExpEPS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef nonnull %0)
  call void @_ZN3Int6ModExpEPS_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull %0)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull %3)
  call void @_ZN3Int6AddOneEv(ptr noundef nonnull align 8 dereferenceable(40) %8)
  call void @_ZN3Int6ShiftREj(ptr noundef nonnull align 8 dereferenceable(40) %8, i32 noundef 1)
  call void @_ZN3Int6ModExpEPS_(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull %8)
  %27 = call noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40) %6)
  br i1 %27, label %._crit_edge25, label %.lr.ph24

.lr.ph24:                                         ; preds = %26, %._crit_edge21
  %.0922 = phi i64 [ %.08.lcssa, %._crit_edge21 ], [ %.010.lcssa, %26 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull %6)
  %28 = call noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40) %9)
  br i1 %28, label %._crit_edge16, label %.lr.ph15

.lr.ph15:                                         ; preds = %.lr.ph24, %.lr.ph15
  %.0813 = phi i64 [ %29, %.lr.ph15 ], [ 0, %.lr.ph24 ]
  call void @_ZN3Int9ModSquareEPS_(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull %9)
  %29 = add i64 %.0813, 1
  %30 = call noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40) %9)
  br i1 %30, label %._crit_edge16, label %.lr.ph15, !llvm.loop !11

._crit_edge16:                                    ; preds = %.lr.ph15, %.lr.ph24
  %.08.lcssa = phi i64 [ 0, %.lr.ph24 ], [ %29, %.lr.ph15 ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %10) #3
  call void @_ZN3IntC1EPS_(ptr noundef nonnull align 8 dereferenceable(40) %10, ptr noundef nonnull %5)
  %31 = xor i64 %.08.lcssa, -1
  %32 = add i64 %.0922, %31
  %.not = icmp eq i64 %32, 0
  br i1 %.not, label %._crit_edge21, label %.lr.ph20

._crit_edge21:                                    ; preds = %.lr.ph20, %._crit_edge16
  call void @_ZN3Int9ModSquareEPS_(ptr noundef nonnull align 8 dereferenceable(40) %5, ptr noundef nonnull %10)
  call void @_ZN3Int6ModMulEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef nonnull %6, ptr noundef nonnull %5)
  call void @_ZN3Int6ModMulEPS_S0_(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull %7, ptr noundef nonnull %10)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #3
  %33 = call noundef zeroext i1 @_ZN3Int5IsOneEv(ptr noundef nonnull align 8 dereferenceable(40) %6)
  br i1 %33, label %._crit_edge25, label %.lr.ph24, !llvm.loop !12

.lr.ph20:                                         ; preds = %._crit_edge16, %.lr.ph20
  %.018 = phi i64 [ %34, %.lr.ph20 ], [ 0, %._crit_edge16 ]
  call void @_ZN3Int9ModSquareEPS_(ptr noundef nonnull align 8 dereferenceable(40) %10, ptr noundef nonnull %10)
  %34 = add nuw i64 %.018, 1
  %exitcond.not = icmp eq i64 %34, %32
  br i1 %exitcond.not, label %._crit_edge21, label %.lr.ph20, !llvm.loop !13

._crit_edge25:                                    ; preds = %._crit_edge21, %26
  call void @_ZN3Int3SetEPS_(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef nonnull %7)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %3) #3
  br label %35

35:                                               ; preds = %16, %._crit_edge25, %19, %15, %12
  ret void
}

declare noundef zeroext i1 @_ZN3Int6IsEvenEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1

declare void @_ZN3Int6AddOneEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1

declare void @_ZN3IntC1Em(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !9}


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