; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ/1134（高精度卡特兰数）.ll (ZNK6BigNummiERKS_)

; 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.BigNum = type { [500 x i32], i32 }

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

; 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 nonnull align 4 dereferenceable(2004) ptr @_ZN6BigNumaSERKS_(ptr noundef nonnull align 4 dereferenceable(2004), ptr noundef nonnull align 4 dereferenceable(2004)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6BigNummiERKS_(ptr dead_on_unwind noalias writable sret(%class.BigNum) align 4 %0, ptr noundef nonnull align 4 dereferenceable(2004) %1, ptr noundef nonnull align 4 dereferenceable(2004) %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca %class.BigNum, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %12 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  call void @_ZN6BigNumC2Ev(ptr noundef nonnull align 4 dereferenceable(2004) %0)
  call void @llvm.lifetime.start.p0(i64 2004, ptr %11) #3
  call void @_ZN6BigNumC2Ev(ptr noundef nonnull align 4 dereferenceable(2004) %11)
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = call noundef zeroext i1 @_ZNK6BigNumgtERKS_(ptr noundef nonnull align 4 dereferenceable(2004) %12, ptr noundef nonnull align 4 dereferenceable(2004) %13)
  br i1 %14, label %15, label %19

15:                                               ; preds = %3
  %16 = call noundef nonnull align 4 dereferenceable(2004) ptr @_ZN6BigNumaSERKS_(ptr noundef nonnull align 4 dereferenceable(2004) %0, ptr noundef nonnull align 4 dereferenceable(2004) %12)
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = call noundef nonnull align 4 dereferenceable(2004) ptr @_ZN6BigNumaSERKS_(ptr noundef nonnull align 4 dereferenceable(2004) %11, ptr noundef nonnull align 4 dereferenceable(2004) %17)
  store i8 0, ptr %10, align 1, !tbaa !9
  br label %23

19:                                               ; preds = %3
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call noundef nonnull align 4 dereferenceable(2004) ptr @_ZN6BigNumaSERKS_(ptr noundef nonnull align 4 dereferenceable(2004) %0, ptr noundef nonnull align 4 dereferenceable(2004) %20)
  %22 = call noundef nonnull align 4 dereferenceable(2004) ptr @_ZN6BigNumaSERKS_(ptr noundef nonnull align 4 dereferenceable(2004) %11, ptr noundef nonnull align 4 dereferenceable(2004) %12)
  store i8 1, ptr %10, align 1, !tbaa !9
  br label %23

23:                                               ; preds = %19, %15
  %24 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !11
  store i32 %25, ptr %9, align 4, !tbaa !14
  store i32 0, ptr %7, align 4, !tbaa !14
  br label %26

26:                                               ; preds = %101, %23
  %27 = load i32, ptr %7, align 4, !tbaa !14
  %28 = load i32, ptr %9, align 4, !tbaa !14
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %30, label %104

30:                                               ; preds = %26
  %31 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 0
  %32 = load i32, ptr %7, align 4, !tbaa !14
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [500 x i32], ptr %31, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !14
  %36 = getelementptr inbounds %class.BigNum, ptr %11, i32 0, i32 0
  %37 = load i32, ptr %7, align 4, !tbaa !14
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [500 x i32], ptr %36, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !14
  %41 = icmp slt i32 %35, %40
  br i1 %41, label %42, label %88

42:                                               ; preds = %30
  %43 = load i32, ptr %7, align 4, !tbaa !14
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %8, align 4, !tbaa !14
  br label %45

45:                                               ; preds = %52, %42
  %46 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 0
  %47 = load i32, ptr %8, align 4, !tbaa !14
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [500 x i32], ptr %46, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !14
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %55

52:                                               ; preds = %45
  %53 = load i32, ptr %8, align 4, !tbaa !14
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %8, align 4, !tbaa !14
  br label %45, !llvm.loop !15

55:                                               ; preds = %45
  %56 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 0
  %57 = load i32, ptr %8, align 4, !tbaa !14
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %8, align 4, !tbaa !14
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [500 x i32], ptr %56, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !14
  %62 = add nsw i32 %61, -1
  store i32 %62, ptr %60, align 4, !tbaa !14
  br label %63

63:                                               ; preds = %67, %55
  %64 = load i32, ptr %8, align 4, !tbaa !14
  %65 = load i32, ptr %7, align 4, !tbaa !14
  %66 = icmp sgt i32 %64, %65
  br i1 %66, label %67, label %75

67:                                               ; preds = %63
  %68 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 0
  %69 = load i32, ptr %8, align 4, !tbaa !14
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr %8, align 4, !tbaa !14
  %71 = sext i32 %69 to i64
  %72 = getelementptr inbounds [500 x i32], ptr %68, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !14
  %74 = add nsw i32 %73, 9999
  store i32 %74, ptr %72, align 4, !tbaa !14
  br label %63, !llvm.loop !17

75:                                               ; preds = %63
  %76 = getelementptr inbounds %class.BigNum, ptr %11, i32 0, i32 0
  %77 = load i32, ptr %7, align 4, !tbaa !14
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [500 x i32], ptr %76, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !14
  %81 = sub nsw i32 10000, %80
  %82 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 0
  %83 = load i32, ptr %7, align 4, !tbaa !14
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [500 x i32], ptr %82, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !14
  %87 = add nsw i32 %86, %81
  store i32 %87, ptr %85, align 4, !tbaa !14
  br label %100

88:                                               ; preds = %30
  %89 = getelementptr inbounds %class.BigNum, ptr %11, i32 0, i32 0
  %90 = load i32, ptr %7, align 4, !tbaa !14
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [500 x i32], ptr %89, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !14
  %94 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 0
  %95 = load i32, ptr %7, align 4, !tbaa !14
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [500 x i32], ptr %94, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !14
  %99 = sub nsw i32 %98, %93
  store i32 %99, ptr %97, align 4, !tbaa !14
  br label %100

100:                                              ; preds = %88, %75
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %7, align 4, !tbaa !14
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %7, align 4, !tbaa !14
  br label %26, !llvm.loop !18

104:                                              ; preds = %26
  %105 = load i32, ptr %9, align 4, !tbaa !14
  %106 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 1
  store i32 %105, ptr %106, align 4, !tbaa !11
  br label %107

107:                                              ; preds = %122, %104
  %108 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 0
  %109 = getelementptr inbounds %class.BigNum, ptr %12, i32 0, i32 1
  %110 = load i32, ptr %109, align 4, !tbaa !11
  %111 = sub nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [500 x i32], ptr %108, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !14
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %120

116:                                              ; preds = %107
  %117 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !11
  %119 = icmp sgt i32 %118, 1
  br label %120

120:                                              ; preds = %116, %107
  %121 = phi i1 [ false, %107 ], [ %119, %116 ]
  br i1 %121, label %122, label %128

122:                                              ; preds = %120
  %123 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 1
  %124 = load i32, ptr %123, align 4, !tbaa !11
  %125 = add nsw i32 %124, -1
  store i32 %125, ptr %123, align 4, !tbaa !11
  %126 = load i32, ptr %9, align 4, !tbaa !14
  %127 = add nsw i32 %126, -1
  store i32 %127, ptr %9, align 4, !tbaa !14
  br label %107, !llvm.loop !19

128:                                              ; preds = %120
  %129 = load i8, ptr %10, align 1, !tbaa !9, !range !20, !noundef !21
  %130 = trunc i8 %129 to i1
  br i1 %130, label %131, label %144

131:                                              ; preds = %128
  %132 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 0
  %133 = load i32, ptr %9, align 4, !tbaa !14
  %134 = sub nsw i32 %133, 1
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [500 x i32], ptr %132, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !14
  %138 = sub nsw i32 0, %137
  %139 = getelementptr inbounds %class.BigNum, ptr %0, i32 0, i32 0
  %140 = load i32, ptr %9, align 4, !tbaa !14
  %141 = sub nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [500 x i32], ptr %139, i64 0, i64 %142
  store i32 %138, ptr %143, align 4, !tbaa !14
  br label %144

144:                                              ; preds = %131, %128
  call void @llvm.lifetime.end.p0(i64 2004, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BigNumC2Ev(ptr noundef nonnull align 4 dereferenceable(2004)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6BigNumgtERKS_(ptr noundef nonnull align 4 dereferenceable(2004), ptr noundef nonnull align 4 dereferenceable(2004)) #1 align 2

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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !13, i64 2000}
!12 = !{!"_ZTS6BigNum", !7, i64 0, !13, i64 2000}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = !{i8 0, i8 2}
!21 = !{}


; 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.BigNum = type { [500 x i32], i32 }

; 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 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 nonnull align 4 dereferenceable(2004) ptr @_ZN6BigNumaSERKS_(ptr noundef nonnull align 4 dereferenceable(2004), ptr noundef nonnull align 4 dereferenceable(2004)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZNK6BigNummiERKS_(ptr dead_on_unwind noalias nonnull writable sret(%class.BigNum) align 4 %0, ptr noundef nonnull align 4 dereferenceable(2004) %1, ptr noundef nonnull align 4 dereferenceable(2004) %2) local_unnamed_addr #1 align 2 {
  %4 = alloca %class.BigNum, align 4
  tail call void @_ZN6BigNumC2Ev(ptr noundef nonnull align 4 dereferenceable(2004) %0)
  call void @llvm.lifetime.start.p0(i64 2004, ptr nonnull %4) #3
  call void @_ZN6BigNumC2Ev(ptr noundef nonnull align 4 dereferenceable(2004) %4)
  %5 = call noundef zeroext i1 @_ZNK6BigNumgtERKS_(ptr noundef nonnull align 4 dereferenceable(2004) %1, ptr noundef nonnull align 4 dereferenceable(2004) %2)
  %. = select i1 %5, ptr %1, ptr %2
  %.57 = select i1 %5, ptr %2, ptr %1
  %6 = call noundef nonnull align 4 dereferenceable(2004) ptr @_ZN6BigNumaSERKS_(ptr noundef nonnull align 4 dereferenceable(2004) %0, ptr noundef nonnull align 4 dereferenceable(2004) %.)
  %7 = call noundef nonnull align 4 dereferenceable(2004) ptr @_ZN6BigNumaSERKS_(ptr noundef nonnull align 4 dereferenceable(2004) %4, ptr noundef nonnull align 4 dereferenceable(2004) %.57)
  %8 = getelementptr inbounds i8, ptr %0, i64 2000
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph38.preheader, label %._crit_edge39

.lr.ph38.preheader:                               ; preds = %3
  %wide.trip.count = zext nneg i32 %9 to i64
  br label %.lr.ph38

.lr.ph38:                                         ; preds = %.lr.ph38.preheader, %41
  %indvars.iv = phi i64 [ 0, %.lr.ph38.preheader ], [ %indvars.iv.next, %41 ]
  %11 = add nsw i64 %indvars.iv, -1
  %12 = getelementptr inbounds [500 x i32], ptr %0, i64 0, i64 %indvars.iv
  %13 = load i32, ptr %12, align 4, !tbaa !10
  %14 = getelementptr inbounds [500 x i32], ptr %4, i64 0, i64 %indvars.iv
  %15 = load i32, ptr %14, align 4, !tbaa !10
  %16 = icmp slt i32 %13, %15
  br i1 %16, label %.preheader, label %39

.preheader:                                       ; preds = %.lr.ph38, %.preheader
  %indvar = phi i64 [ %indvar.next, %.preheader ], [ 0, %.lr.ph38 ]
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %.preheader ], [ %indvars.iv, %.lr.ph38 ]
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %17 = getelementptr inbounds [500 x i32], ptr %0, i64 0, i64 %indvars.iv.next48
  %18 = load i32, ptr %17, align 4, !tbaa !10
  %19 = icmp eq i32 %18, 0
  %indvar.next = add i64 %indvar, 1
  br i1 %19, label %.preheader, label %20, !llvm.loop !11

20:                                               ; preds = %.preheader
  %21 = getelementptr inbounds [500 x i32], ptr %0, i64 0, i64 %indvars.iv.next48
  %22 = add nsw i32 %18, -1
  store i32 %22, ptr %21, align 4, !tbaa !10
  %23 = and i64 %indvars.iv47, 4294967295
  %24 = icmp ugt i64 %23, %indvars.iv
  br i1 %24, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %20
  %25 = add i64 %indvar, %11
  %smin = call i64 @llvm.smin.i64(i64 %indvars.iv, i64 %25)
  %26 = sub i64 %indvars.iv47, %smin
  %min.iters.check = icmp ult i64 %26, 8
  br i1 %min.iters.check, label %.lr.ph.preheader63, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %26, -8
  %ind.end = sub i64 %indvars.iv47, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %indvars.iv47, %index
  %27 = getelementptr inbounds [500 x i32], ptr %0, i64 0, i64 %offset.idx
  %28 = getelementptr inbounds i8, ptr %27, i64 -12
  %29 = getelementptr inbounds i8, ptr %27, i64 -28
  %wide.load = load <4 x i32>, ptr %28, align 4, !tbaa !10
  %wide.load59 = load <4 x i32>, ptr %29, align 4, !tbaa !10
  %30 = add nsw <4 x i32> %wide.load, <i32 9999, i32 9999, i32 9999, i32 9999>
  %31 = add nsw <4 x i32> %wide.load59, <i32 9999, i32 9999, i32 9999, i32 9999>
  store <4 x i32> %30, ptr %28, align 4, !tbaa !10
  store <4 x i32> %31, ptr %29, align 4, !tbaa !10
  %index.next = add nuw i64 %index, 8
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %26, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader63

.lr.ph.preheader63:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv50.ph = phi i64 [ %indvars.iv47, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader63, %.lr.ph
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %.lr.ph ], [ %indvars.iv50.ph, %.lr.ph.preheader63 ]
  %indvars.iv.next51 = add nsw i64 %indvars.iv50, -1
  %33 = getelementptr inbounds [500 x i32], ptr %0, i64 0, i64 %indvars.iv50
  %34 = load i32, ptr %33, align 4, !tbaa !10
  %35 = add nsw i32 %34, 9999
  store i32 %35, ptr %33, align 4, !tbaa !10
  %36 = icmp sgt i64 %indvars.iv.next51, %indvars.iv
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %20
  %37 = load i32, ptr %12, align 4, !tbaa !10
  %reass.sub44 = sub i32 %37, %15
  %38 = add i32 %reass.sub44, 10000
  br label %41

39:                                               ; preds = %.lr.ph38
  %40 = sub nsw i32 %13, %15
  br label %41

41:                                               ; preds = %._crit_edge, %39
  %storemerge = phi i32 [ %40, %39 ], [ %38, %._crit_edge ]
  store i32 %storemerge, ptr %12, align 4, !tbaa !10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge39, label %.lr.ph38, !llvm.loop !17

._crit_edge39:                                    ; preds = %41, %3
  store i32 %9, ptr %8, align 4, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %1, i64 2000
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i32 %43, -1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [500 x i32], ptr %0, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !10
  %48 = icmp eq i32 %47, 0
  %49 = icmp sgt i32 %9, 1
  %50 = and i1 %48, %49
  br i1 %50, label %.lr.ph42, label %._crit_edge43

.lr.ph42:                                         ; preds = %._crit_edge39, %.lr.ph42
  %51 = phi i32 [ %52, %.lr.ph42 ], [ %9, %._crit_edge39 ]
  %.02440 = phi i32 [ %53, %.lr.ph42 ], [ %9, %._crit_edge39 ]
  %52 = add nsw i32 %51, -1
  store i32 %52, ptr %8, align 4, !tbaa !5
  %53 = add nsw i32 %.02440, -1
  %54 = load i32, ptr %46, align 4, !tbaa !10
  %55 = icmp eq i32 %54, 0
  %56 = icmp ugt i32 %51, 2
  %57 = select i1 %55, i1 %56, i1 false
  br i1 %57, label %.lr.ph42, label %._crit_edge43, !llvm.loop !18

._crit_edge43:                                    ; preds = %.lr.ph42, %._crit_edge39
  %.024.lcssa = phi i32 [ %9, %._crit_edge39 ], [ %53, %.lr.ph42 ]
  br i1 %5, label %64, label %58

58:                                               ; preds = %._crit_edge43
  %59 = add nsw i32 %.024.lcssa, -1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [500 x i32], ptr %0, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !10
  %63 = sub nsw i32 0, %62
  store i32 %63, ptr %61, align 4, !tbaa !10
  br label %64

64:                                               ; preds = %58, %._crit_edge43
  call void @llvm.lifetime.end.p0(i64 2004, ptr nonnull %4) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BigNumC2Ev(ptr noundef nonnull align 4 dereferenceable(2004)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6BigNumgtERKS_(ptr noundef nonnull align 4 dereferenceable(2004), ptr noundef nonnull align 4 dereferenceable(2004)) local_unnamed_addr #1 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #2

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !9, i64 2000}
!6 = !{!"_ZTS6BigNum", !7, i64 0, !9, i64 2000}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!9, !9, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !15, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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