; LLVM IR from ravireddy07/cpp-book :: src/Coding-Blocks (Cashflow)

; 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_istream" = type { ptr, i64, %"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 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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 uwtable
declare dso_local void @_Z8cashflowPii(ptr noundef, i32 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  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 4, ptr %6) #6
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %18, i64 8)
  %20 = extractvalue { i64, i1 } %19, 1
  %21 = extractvalue { i64, i1 } %19, 0
  %22 = select i1 %20, i64 -1, i64 %21
  %23 = call noalias noundef nonnull ptr @_Znam(i64 noundef %22) #7
  store ptr %23, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %41, %2
  %25 = load i32, ptr %8, align 4, !tbaa !5
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %44

29:                                               ; preds = %24
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %31, i64 4)
  %33 = extractvalue { i64, i1 } %32, 1
  %34 = extractvalue { i64, i1 } %32, 0
  %35 = select i1 %33, i64 -1, i64 %34
  %36 = call noalias noundef nonnull ptr @_Znam(i64 noundef %35) #7
  %37 = load ptr, ptr %7, align 8, !tbaa !9
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds ptr, ptr %37, i64 %39
  store ptr %36, ptr %40, align 8, !tbaa !9
  br label %41

41:                                               ; preds = %29
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %8, align 4, !tbaa !5
  br label %24, !llvm.loop !11

44:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %70, %44
  %46 = load i32, ptr %9, align 4, !tbaa !5
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %73

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %66, %50
  %52 = load i32, ptr %11, align 4, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %69

56:                                               ; preds = %51
  %57 = load ptr, ptr %7, align 8, !tbaa !9
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds ptr, ptr %57, i64 %59
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = load i32, ptr %11, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i32, ptr %61, i64 %63
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %64)
  br label %66

66:                                               ; preds = %56
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %11, align 4, !tbaa !5
  br label %51, !llvm.loop !13

69:                                               ; preds = %55
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %9, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %9, align 4, !tbaa !5
  br label %45, !llvm.loop !14

73:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %75, i64 4)
  %77 = extractvalue { i64, i1 } %76, 1
  %78 = extractvalue { i64, i1 } %76, 0
  %79 = select i1 %77, i64 -1, i64 %78
  %80 = call noalias noundef nonnull ptr @_Znam(i64 noundef %79) #7
  store ptr %80, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %91, %73
  %82 = load i32, ptr %13, align 4, !tbaa !5
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %94

86:                                               ; preds = %81
  %87 = load ptr, ptr %12, align 8, !tbaa !9
  %88 = load i32, ptr %13, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i32, ptr %87, i64 %89
  store i32 0, ptr %90, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %86
  %92 = load i32, ptr %13, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %13, align 4, !tbaa !5
  br label %81, !llvm.loop !15

94:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %141, %94
  %96 = load i32, ptr %14, align 4, !tbaa !5
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %144

100:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %137, %100
  %102 = load i32, ptr %15, align 4, !tbaa !5
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %101
  store i32 17, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %140

106:                                              ; preds = %101
  %107 = load i32, ptr %14, align 4, !tbaa !5
  %108 = load i32, ptr %15, align 4, !tbaa !5
  %109 = icmp eq i32 %107, %108
  br i1 %109, label %110, label %111

110:                                              ; preds = %106
  br label %137

111:                                              ; preds = %106
  %112 = load ptr, ptr %7, align 8, !tbaa !9
  %113 = load i32, ptr %14, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds ptr, ptr %112, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = load i32, ptr %15, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i32, ptr %116, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = load ptr, ptr %7, align 8, !tbaa !9
  %122 = load i32, ptr %15, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds ptr, ptr %121, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = load i32, ptr %14, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %125, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = sub nsw i32 %120, %129
  %131 = load ptr, ptr %12, align 8, !tbaa !9
  %132 = load i32, ptr %14, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %131, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = add nsw i32 %135, %130
  store i32 %136, ptr %134, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %111, %110
  %138 = load i32, ptr %15, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %15, align 4, !tbaa !5
  br label %101, !llvm.loop !16

140:                                              ; preds = %105
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %14, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %14, align 4, !tbaa !5
  br label %95, !llvm.loop !17

144:                                              ; preds = %99
  %145 = load ptr, ptr %12, align 8, !tbaa !9
  %146 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z8cashflowPii(ptr noundef %145, i32 noundef %146)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %147 = load i32, ptr %3, align 4
  ret i32 %147
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin allocsize(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 }
attributes #7 = { builtin allocsize(0) }

!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}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; 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_istream" = type { ptr, i64, %"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 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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 uwtable
declare dso_local void @_Z8cashflowPii(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %5 = load i32, ptr %3, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = icmp slt i32 %5, 0
  %8 = shl nsw i64 %6, 3
  %9 = select i1 %7, i64 -1, i64 %8
  %10 = call noalias noundef nonnull ptr @_Znam(i64 noundef %9) #7
  %11 = icmp sgt i32 %5, 0
  br i1 %11, label %.lr.ph, label %._crit_edge45

.lr.ph:                                           ; preds = %2
  %12 = shl nuw nsw i64 %6, 2
  %wide.trip.count = zext nneg i32 %5 to i64
  br label %13

.preheader40:                                     ; preds = %13
  br i1 %11, label %.preheader39, label %._crit_edge45

13:                                               ; preds = %.lr.ph, %13
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %13 ]
  %14 = call noalias noundef nonnull ptr @_Znam(i64 noundef %12) #7
  %15 = getelementptr inbounds ptr, ptr %10, i64 %indvars.iv
  store ptr %14, ptr %15, align 8, !tbaa !9
  %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 %.preheader40, label %13, !llvm.loop !11

.preheader39:                                     ; preds = %.preheader40, %._crit_edge
  %16 = phi i32 [ %26, %._crit_edge ], [ %5, %.preheader40 ]
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %._crit_edge ], [ 0, %.preheader40 ]
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph43, label %.preheader39.._crit_edge_crit_edge

.preheader39.._crit_edge_crit_edge:               ; preds = %.preheader39
  %.pre = sext i32 %16 to i64
  br label %._crit_edge

.lr.ph43:                                         ; preds = %.preheader39
  %18 = getelementptr inbounds ptr, ptr %10, i64 %indvars.iv60
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  br label %28

._crit_edge45:                                    ; preds = %._crit_edge, %2, %.preheader40
  %.lcssa = phi i32 [ %5, %.preheader40 ], [ %5, %2 ], [ %26, %._crit_edge ]
  %20 = sext i32 %.lcssa to i64
  %21 = icmp slt i32 %.lcssa, 0
  %22 = shl nsw i64 %20, 2
  %23 = select i1 %21, i64 -1, i64 %22
  %24 = call noalias noundef nonnull ptr @_Znam(i64 noundef %23) #7
  %25 = icmp sgt i32 %.lcssa, 0
  br i1 %25, label %.preheader.us.preheader, label %._crit_edge53

._crit_edge:                                      ; preds = %28, %.preheader39.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader39.._crit_edge_crit_edge ], [ %32, %28 ]
  %26 = phi i32 [ %16, %.preheader39.._crit_edge_crit_edge ], [ %31, %28 ]
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %27 = icmp slt i64 %indvars.iv.next61, %.pre-phi
  br i1 %27, label %.preheader39, label %._crit_edge45, !llvm.loop !13

28:                                               ; preds = %.lr.ph43, %28
  %indvars.iv57 = phi i64 [ 0, %.lr.ph43 ], [ %indvars.iv.next58, %28 ]
  %29 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv57
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next58, %32
  br i1 %33, label %28, label %._crit_edge, !llvm.loop !15

.preheader.us.preheader:                          ; preds = %._crit_edge45
  %34 = zext nneg i32 %.lcssa to i64
  %35 = shl nuw nsw i64 %34, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %24, i8 0, i64 %35, i1 false), !tbaa !5
  %wide.trip.count74 = zext nneg i32 %.lcssa to i64
  %xtraiter = and i64 %wide.trip.count74, 1
  %36 = icmp eq i32 %.lcssa, 1
  %unroll_iter = and i64 %wide.trip.count74, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge51.us
  %indvars.iv71 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next72, %._crit_edge51.us ]
  %37 = getelementptr inbounds ptr, ptr %10, i64 %indvars.iv71
  %38 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv71
  br i1 %36, label %._crit_edge51.us.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %64
  %indvars.iv66 = phi i64 [ %indvars.iv.next67.1, %64 ], [ 0, %.preheader.us ]
  %niter = phi i64 [ %niter.next.1, %64 ], [ 0, %.preheader.us ]
  %39 = icmp eq i64 %indvars.iv71, %indvars.iv66
  br i1 %39, label %51, label %40

40:                                               ; preds = %.preheader.us.new
  %41 = load ptr, ptr %37, align 8, !tbaa !9
  %42 = getelementptr inbounds i32, ptr %41, i64 %indvars.iv66
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = getelementptr inbounds ptr, ptr %10, i64 %indvars.iv66
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = getelementptr inbounds i32, ptr %45, i64 %indvars.iv71
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sub i32 %43, %47
  %49 = load i32, ptr %38, align 4, !tbaa !5
  %50 = add nsw i32 %48, %49
  store i32 %50, ptr %38, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %40, %.preheader.us.new
  %indvars.iv.next67 = or disjoint i64 %indvars.iv66, 1
  %52 = icmp eq i64 %indvars.iv71, %indvars.iv.next67
  br i1 %52, label %64, label %53

53:                                               ; preds = %51
  %54 = load ptr, ptr %37, align 8, !tbaa !9
  %55 = getelementptr inbounds i32, ptr %54, i64 %indvars.iv.next67
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = getelementptr inbounds ptr, ptr %10, i64 %indvars.iv.next67
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = getelementptr inbounds i32, ptr %58, i64 %indvars.iv71
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sub i32 %56, %60
  %62 = load i32, ptr %38, align 4, !tbaa !5
  %63 = add nsw i32 %61, %62
  store i32 %63, ptr %38, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %53, %51
  %indvars.iv.next67.1 = add nuw nsw i64 %indvars.iv66, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge51.us.unr-lcssa, label %.preheader.us.new, !llvm.loop !16

._crit_edge51.us.unr-lcssa:                       ; preds = %64, %.preheader.us
  %indvars.iv66.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next67.1, %64 ]
  %65 = icmp eq i64 %indvars.iv71, %indvars.iv66.unr
  %or.cond = select i1 %lcmp.mod.not, i1 true, i1 %65
  br i1 %or.cond, label %._crit_edge51.us, label %66

66:                                               ; preds = %._crit_edge51.us.unr-lcssa
  %67 = load ptr, ptr %37, align 8, !tbaa !9
  %68 = getelementptr inbounds i32, ptr %67, i64 %indvars.iv66.unr
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = getelementptr inbounds ptr, ptr %10, i64 %indvars.iv66.unr
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  %72 = getelementptr inbounds i32, ptr %71, i64 %indvars.iv71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = sub i32 %69, %73
  %75 = load i32, ptr %38, align 4, !tbaa !5
  %76 = add nsw i32 %74, %75
  store i32 %76, ptr %38, align 4, !tbaa !5
  br label %._crit_edge51.us

._crit_edge51.us:                                 ; preds = %66, %._crit_edge51.us.unr-lcssa
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
  br i1 %exitcond75.not, label %._crit_edge53, label %.preheader.us, !llvm.loop !17

._crit_edge53:                                    ; preds = %._crit_edge51.us, %._crit_edge45
  call void @_Z8cashflowPii(ptr noundef nonnull %24, i32 noundef %.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 = { nobuiltin allocsize(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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }

!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}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass