; LLVM IR from albertobsd/keyhunt :: bsgsd.ll (Z16bsgs_secondcheckP3IntjS0_)

; 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.Point = type { %class.Int, %class.Int, %class.Int }
%class.Int = type { %union.anon }
%union.anon = type { [5 x i64] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl" }
%"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl" = type { %"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.bloom = type { i64, i64, i64, i8, x86_fp80, i8, i8, i8, double, ptr }

@OriginalPointsBSGS = external dso_local global %class.Point, align 8
@bloom_bPx2nd = external dso_local global ptr, align 8
@BSGS_M_double = external dso_local global %class.Int, align 8
@BSGS_AMP2 = external dso_local global %"class.std::vector", align 8
@secp = external dso_local global ptr, align 8

declare void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #1

declare void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN3Int4MultEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #0

declare void @_ZN9Secp256K116ComputePublicKeyEP3Int(ptr dead_on_unwind writable sret(%class.Point) align 8, ptr noundef nonnull align 8 dereferenceable(983240), ptr noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

declare void @_ZN9Secp256K18NegationER5Point(ptr dead_on_unwind writable sret(%class.Point) align 8, ptr noundef nonnull align 8 dereferenceable(983240), ptr noundef nonnull align 8 dereferenceable(120)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(120) ptr @_ZNSt6vectorI5PointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

declare void @_ZN9Secp256K19AddDirectER5PointS1_(ptr dead_on_unwind writable sret(%class.Point) align 8, ptr noundef nonnull align 8 dereferenceable(983240), ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) #0

declare void @_ZN5Point3SetERS_(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) #0

declare void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #0

declare void @_ZN3Int10Get32BytesEPh(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #0

declare i32 @bloom_check(ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z16bsgs_secondcheckP3IntjS0_(ptr noundef %0, i32 noundef %1, ptr noundef %2) #5 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %class.Int, align 8
  %11 = alloca %class.Point, align 8
  %12 = alloca %class.Point, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %class.Point, align 8
  %16 = alloca %class.Point, align 8
  %17 = alloca %class.Point, align 8
  %18 = alloca [32 x i8], align 16
  %19 = alloca %class.Point, align 8
  %20 = alloca %class.Point, align 8
  %21 = alloca %class.Point, align 8
  %22 = alloca %class.Point, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %10) #6
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %10)
  call void @llvm.lifetime.start.p0(i64 120, ptr %11) #6
  call void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %11)
  call void @llvm.lifetime.start.p0(i64 120, ptr %12) #6
  invoke void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %12)
          to label %23 unwind label %65

23:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 120, ptr %15) #6
  invoke void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %15)
          to label %24 unwind label %69

24:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 120, ptr %16) #6
  invoke void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %16)
          to label %25 unwind label %73

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 120, ptr %17) #6
  invoke void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %17)
          to label %26 unwind label %77

26:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #6
  invoke void @_ZN3Int3SetEPS_(ptr noundef nonnull align 8 dereferenceable(40) %10, ptr noundef @BSGS_M_double)
          to label %27 unwind label %81

27:                                               ; preds = %26
  %28 = load i32, ptr %5, align 4, !tbaa !9
  %29 = zext i32 %28 to i64
  invoke void @_ZN3Int4MultEm(ptr noundef nonnull align 8 dereferenceable(40) %10, i64 noundef %29)
          to label %30 unwind label %81

30:                                               ; preds = %27
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40) %10, ptr noundef %31)
          to label %32 unwind label %81

32:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 120, ptr %19) #6
  %33 = load ptr, ptr @secp, align 8, !tbaa !5
  invoke void @_ZN9Secp256K116ComputePublicKeyEP3Int(ptr dead_on_unwind writable sret(%class.Point) align 8 %19, ptr noundef nonnull align 8 dereferenceable(983240) %33, ptr noundef %10)
          to label %34 unwind label %85

34:                                               ; preds = %32
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %19, i64 120, i1 false), !tbaa.struct !11
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %19) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr %20) #6
  %35 = load ptr, ptr @secp, align 8, !tbaa !5
  invoke void @_ZN9Secp256K18NegationER5Point(ptr dead_on_unwind writable sret(%class.Point) align 8 %20, ptr noundef nonnull align 8 dereferenceable(983240) %35, ptr noundef nonnull align 8 dereferenceable(120) %11)
          to label %36 unwind label %89

36:                                               ; preds = %34
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %20, i64 120, i1 false), !tbaa.struct !11
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %20) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr %21) #6
  %37 = load ptr, ptr @secp, align 8, !tbaa !5
  invoke void @_ZN9Secp256K19AddDirectER5PointS1_(ptr dead_on_unwind writable sret(%class.Point) align 8 %21, ptr noundef nonnull align 8 dereferenceable(983240) %37, ptr noundef nonnull align 8 dereferenceable(120) @OriginalPointsBSGS, ptr noundef nonnull align 8 dereferenceable(120) %12)
          to label %38 unwind label %93

38:                                               ; preds = %36
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %21, i64 120, i1 false), !tbaa.struct !11
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %21) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %21) #6
  invoke void @_ZN5Point3SetERS_(ptr noundef nonnull align 8 dereferenceable(120) %15, ptr noundef nonnull align 8 dereferenceable(120) %16)
          to label %39 unwind label %81

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %111, %39
  call void @llvm.lifetime.start.p0(i64 120, ptr %22) #6
  %41 = load ptr, ptr @secp, align 8, !tbaa !5
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNSt6vectorI5PointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @BSGS_AMP2, i64 noundef %43) #6
  invoke void @_ZN9Secp256K19AddDirectER5PointS1_(ptr dead_on_unwind writable sret(%class.Point) align 8 %22, ptr noundef nonnull align 8 dereferenceable(983240) %41, ptr noundef nonnull align 8 dereferenceable(120) %15, ptr noundef nonnull align 8 dereferenceable(120) %44)
          to label %45 unwind label %97

45:                                               ; preds = %40
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %22, i64 120, i1 false), !tbaa.struct !11
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %22) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %22) #6
  invoke void @_ZN5Point3SetERS_(ptr noundef nonnull align 8 dereferenceable(120) %16, ptr noundef nonnull align 8 dereferenceable(120) %17)
          to label %46 unwind label %81

46:                                               ; preds = %45
  %47 = getelementptr inbounds %class.Point, ptr %16, i32 0, i32 0
  %48 = getelementptr inbounds [32 x i8], ptr %18, i64 0, i64 0
  invoke void @_ZN3Int10Get32BytesEPh(ptr noundef nonnull align 8 dereferenceable(40) %47, ptr noundef %48)
          to label %49 unwind label %81

49:                                               ; preds = %46
  %50 = load ptr, ptr @bloom_bPx2nd, align 8, !tbaa !5
  %51 = getelementptr inbounds [32 x i8], ptr %18, i64 0, i64 0
  %52 = load i8, ptr %51, align 16, !tbaa !12
  %53 = zext i8 %52 to i64
  %54 = getelementptr inbounds %struct.bloom, ptr %50, i64 %53
  %55 = getelementptr inbounds [32 x i8], ptr %18, i64 0, i64 0
  %56 = invoke i32 @bloom_check(ptr noundef %54, ptr noundef %55, i32 noundef 32)
          to label %57 unwind label %81

57:                                               ; preds = %49
  store i32 %56, ptr %9, align 4, !tbaa !9
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %101

60:                                               ; preds = %57
  %61 = load i32, ptr %7, align 4, !tbaa !9
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = invoke noundef i32 @_Z15bsgs_thirdcheckP3IntjS0_(ptr noundef %10, i32 noundef %61, ptr noundef %62)
          to label %64 unwind label %81

64:                                               ; preds = %60
  store i32 %63, ptr %8, align 4, !tbaa !9
  br label %101

65:                                               ; preds = %3
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %13, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %14, align 4
  br label %119

69:                                               ; preds = %23
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %13, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %14, align 4
  br label %118

73:                                               ; preds = %24
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %13, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %14, align 4
  br label %117

77:                                               ; preds = %25
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %13, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %14, align 4
  br label %116

81:                                               ; preds = %60, %49, %46, %45, %38, %30, %27, %26
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %13, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %14, align 4
  br label %115

85:                                               ; preds = %32
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %13, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 120, ptr %19) #6
  br label %115

89:                                               ; preds = %34
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %13, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 120, ptr %20) #6
  br label %115

93:                                               ; preds = %36
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %13, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 120, ptr %21) #6
  br label %115

97:                                               ; preds = %40
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %13, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 120, ptr %22) #6
  br label %115

101:                                              ; preds = %64, %57
  %102 = load i32, ptr %7, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %7, align 4, !tbaa !9
  br label %104

104:                                              ; preds = %101
  %105 = load i32, ptr %7, align 4, !tbaa !9
  %106 = icmp slt i32 %105, 32
  br i1 %106, label %107, label %111

107:                                              ; preds = %104
  %108 = load i32, ptr %8, align 4, !tbaa !9
  %109 = icmp ne i32 %108, 0
  %110 = xor i1 %109, true
  br label %111

111:                                              ; preds = %107, %104
  %112 = phi i1 [ false, %104 ], [ %110, %107 ]
  br i1 %112, label %40, label %113, !llvm.loop !13

113:                                              ; preds = %111
  %114 = load i32, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %17) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %17) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %16) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %16) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %15) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %15) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %12) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %12) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %11) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  ret i32 %114

115:                                              ; preds = %97, %93, %89, %85, %81
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %17) #6
  br label %116

116:                                              ; preds = %115, %77
  call void @llvm.lifetime.end.p0(i64 120, ptr %17) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %16) #6
  br label %117

117:                                              ; preds = %116, %73
  call void @llvm.lifetime.end.p0(i64 120, ptr %16) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %15) #6
  br label %118

118:                                              ; preds = %117, %69
  call void @llvm.lifetime.end.p0(i64 120, ptr %15) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %12) #6
  br label %119

119:                                              ; preds = %118, %65
  call void @llvm.lifetime.end.p0(i64 120, ptr %12) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %11) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %120

120:                                              ; preds = %119
  %121 = load ptr, ptr %13, align 8
  %122 = load i32, ptr %14, align 4
  %123 = insertvalue { ptr, i32 } poison, ptr %121, 0
  %124 = insertvalue { ptr, i32 } %123, i32 %122, 1
  resume { ptr, i32 } %124
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z15bsgs_thirdcheckP3IntjS0_(ptr noundef, i32 noundef, ptr noundef) #5

attributes #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 40, !12, i64 40, i64 40, !12, i64 80, i64 40, !12}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

%class.Point = type { %class.Int, %class.Int, %class.Int }
%class.Int = type { %union.anon }
%union.anon = type { [5 x i64] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl" }
%"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl" = type { %"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.bloom = type { i64, i64, i64, i8, x86_fp80, i8, i8, i8, double, ptr }

@OriginalPointsBSGS = external dso_local global %class.Point, align 8
@bloom_bPx2nd = external dso_local local_unnamed_addr global ptr, align 8
@BSGS_M_double = external dso_local global %class.Int, align 8
@BSGS_AMP2 = external dso_local global %"class.std::vector", align 8
@secp = external dso_local local_unnamed_addr global ptr, align 8

declare void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #0

; Function Attrs: nounwind
declare void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120)) unnamed_addr #1

declare void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN3Int4MultEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #0

declare void @_ZN9Secp256K116ComputePublicKeyEP3Int(ptr dead_on_unwind writable sret(%class.Point) align 8, ptr noundef nonnull align 8 dereferenceable(983240), ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

declare void @_ZN9Secp256K18NegationER5Point(ptr dead_on_unwind writable sret(%class.Point) align 8, ptr noundef nonnull align 8 dereferenceable(983240), ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #0

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

declare void @_ZN9Secp256K19AddDirectER5PointS1_(ptr dead_on_unwind writable sret(%class.Point) align 8, ptr noundef nonnull align 8 dereferenceable(983240), ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #0

declare void @_ZN5Point3SetERS_(ptr noundef nonnull align 8 dereferenceable(120), ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #0

declare void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #0

declare void @_ZN3Int10Get32BytesEPh(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #0

declare i32 @bloom_check(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z16bsgs_secondcheckP3IntjS0_(ptr noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.Int, align 8
  %5 = alloca %class.Point, align 8
  %6 = alloca %class.Point, align 8
  %7 = alloca %class.Point, align 8
  %8 = alloca %class.Point, align 8
  %9 = alloca %class.Point, align 8
  %10 = alloca [32 x i8], align 16
  %11 = alloca %class.Point, align 8
  %12 = alloca %class.Point, align 8
  %13 = alloca %class.Point, align 8
  %14 = alloca %class.Point, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %4) #6
  call void @_ZN3IntC1Ev(ptr noundef nonnull align 8 dereferenceable(40) %4)
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %5) #6
  call void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %5)
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %6) #6
  invoke void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %6)
          to label %15 unwind label %43

15:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %7) #6
  invoke void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %7)
          to label %16 unwind label %45

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %8) #6
  invoke void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %8)
          to label %17 unwind label %47

17:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %9) #6
  invoke void @_ZN5PointC1Ev(ptr noundef nonnull align 8 dereferenceable(120) %9)
          to label %18 unwind label %49

18:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #6
  invoke void @_ZN3Int3SetEPS_(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef nonnull @BSGS_M_double)
          to label %19 unwind label %.loopexit.split-lp

19:                                               ; preds = %18
  %20 = zext i32 %1 to i64
  invoke void @_ZN3Int4MultEm(ptr noundef nonnull align 8 dereferenceable(40) %4, i64 noundef %20)
          to label %21 unwind label %.loopexit.split-lp

21:                                               ; preds = %19
  invoke void @_ZN3Int3AddEPS_(ptr noundef nonnull align 8 dereferenceable(40) %4, ptr noundef %0)
          to label %22 unwind label %.loopexit.split-lp

22:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %11) #6
  %23 = load ptr, ptr @secp, align 8, !tbaa !5
  invoke void @_ZN9Secp256K116ComputePublicKeyEP3Int(ptr dead_on_unwind nonnull writable sret(%class.Point) align 8 %11, ptr noundef nonnull align 8 dereferenceable(983240) %23, ptr noundef nonnull %4)
          to label %24 unwind label %51

24:                                               ; preds = %22
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %5, ptr noundef nonnull align 8 dereferenceable(120) %11, i64 120, i1 false), !tbaa.struct !9
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %11) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %12) #6
  %25 = load ptr, ptr @secp, align 8, !tbaa !5
  invoke void @_ZN9Secp256K18NegationER5Point(ptr dead_on_unwind nonnull writable sret(%class.Point) align 8 %12, ptr noundef nonnull align 8 dereferenceable(983240) %25, ptr noundef nonnull align 8 dereferenceable(120) %5)
          to label %26 unwind label %53

26:                                               ; preds = %24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %6, ptr noundef nonnull align 8 dereferenceable(120) %12, i64 120, i1 false), !tbaa.struct !9
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %12) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %13) #6
  %27 = load ptr, ptr @secp, align 8, !tbaa !5
  invoke void @_ZN9Secp256K19AddDirectER5PointS1_(ptr dead_on_unwind nonnull writable sret(%class.Point) align 8 %13, ptr noundef nonnull align 8 dereferenceable(983240) %27, ptr noundef nonnull align 8 dereferenceable(120) @OriginalPointsBSGS, ptr noundef nonnull align 8 dereferenceable(120) %6)
          to label %28 unwind label %55

28:                                               ; preds = %26
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %8, ptr noundef nonnull align 8 dereferenceable(120) %13, i64 120, i1 false), !tbaa.struct !9
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %13) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %13) #6
  invoke void @_ZN5Point3SetERS_(ptr noundef nonnull align 8 dereferenceable(120) %7, ptr noundef nonnull align 8 dereferenceable(120) %8)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %28, %59
  %indvars.iv = phi i64 [ %indvars.iv.next, %59 ], [ 0, %28 ]
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %14) #6
  %29 = load ptr, ptr @secp, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(120) ptr @_ZNSt6vectorI5PointSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @BSGS_AMP2, i64 noundef %indvars.iv) #6
  invoke void @_ZN9Secp256K19AddDirectER5PointS1_(ptr dead_on_unwind nonnull writable sret(%class.Point) align 8 %14, ptr noundef nonnull align 8 dereferenceable(983240) %29, ptr noundef nonnull align 8 dereferenceable(120) %7, ptr noundef nonnull align 8 dereferenceable(120) %30)
          to label %31 unwind label %57

31:                                               ; preds = %.preheader
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %9, ptr noundef nonnull align 8 dereferenceable(120) %14, i64 120, i1 false), !tbaa.struct !9
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %14) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %14) #6
  invoke void @_ZN5Point3SetERS_(ptr noundef nonnull align 8 dereferenceable(120) %8, ptr noundef nonnull align 8 dereferenceable(120) %9)
          to label %32 unwind label %.loopexit

32:                                               ; preds = %31
  invoke void @_ZN3Int10Get32BytesEPh(ptr noundef nonnull align 8 dereferenceable(40) %8, ptr noundef nonnull %10)
          to label %33 unwind label %.loopexit

33:                                               ; preds = %32
  %34 = load ptr, ptr @bloom_bPx2nd, align 8, !tbaa !5
  %35 = load i8, ptr %10, align 16, !tbaa !10
  %36 = zext i8 %35 to i64
  %37 = getelementptr inbounds %struct.bloom, ptr %34, i64 %36
  %38 = invoke i32 @bloom_check(ptr noundef %37, ptr noundef nonnull %10, i32 noundef 32)
          to label %39 unwind label %.loopexit

39:                                               ; preds = %33
  %.not = icmp eq i32 %38, 0
  br i1 %.not, label %59, label %40

40:                                               ; preds = %39
  %41 = trunc nuw nsw i64 %indvars.iv to i32
  %42 = invoke noundef i32 @_Z15bsgs_thirdcheckP3IntjS0_(ptr noundef nonnull %4, i32 noundef %41, ptr noundef %2)
          to label %59 unwind label %.loopexit

43:                                               ; preds = %3
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %67

45:                                               ; preds = %15
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %66

47:                                               ; preds = %16
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %65

49:                                               ; preds = %17
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %64

.loopexit:                                        ; preds = %31, %32, %33, %40
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %63

.loopexit.split-lp:                               ; preds = %18, %19, %21, %28
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %63

51:                                               ; preds = %22
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %11) #6
  br label %63

53:                                               ; preds = %24
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %12) #6
  br label %63

55:                                               ; preds = %26
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %13) #6
  br label %63

57:                                               ; preds = %.preheader
  %58 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %14) #6
  br label %63

59:                                               ; preds = %40, %39
  %.117 = phi i32 [ 0, %39 ], [ %42, %40 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %60 = icmp ult i64 %indvars.iv, 31
  %.not25 = icmp eq i32 %.117, 0
  %61 = and i1 %60, %.not25
  br i1 %61, label %.preheader, label %62, !llvm.loop !11

62:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %9) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %9) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %8) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %8) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %7) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %7) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %6) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %6) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %5) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  ret i32 %.117

63:                                               ; preds = %.loopexit, %.loopexit.split-lp, %57, %55, %53, %51
  %.pn = phi { ptr, i32 } [ %58, %57 ], [ %56, %55 ], [ %54, %53 ], [ %52, %51 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %9) #6
  br label %64

64:                                               ; preds = %63, %49
  %.pn.pn = phi { ptr, i32 } [ %.pn, %63 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %9) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %8) #6
  br label %65

65:                                               ; preds = %64, %47
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %64 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %8) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %7) #6
  br label %66

66:                                               ; preds = %65, %45
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %65 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %7) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %6) #6
  br label %67

67:                                               ; preds = %66, %43
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %66 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %6) #6
  call void @_ZN5PointD1Ev(ptr noundef nonnull align 8 dereferenceable(120) %5) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn.pn.pn.pn.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z15bsgs_thirdcheckP3IntjS0_(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

attributes #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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 = { 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 = !{i64 0, i64 40, !10, i64 40, i64 40, !10, i64 80, i64 40, !10}
!10 = !{!7, !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass