; LLVM IR from tangjz/acm-icpc :: 51nod/1614.ll (Z4calcii)

; 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"

%struct.Node = type { i32, i32, i32, i64 }
%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@fb = external dso_local global [801 x i32], align 16
@fc = external dso_local global [801 x i32], align 16
@p = external dso_local global [401 x %struct.Node], align 16
@f = external dso_local global [801 x i64], align 16
@ans = external dso_local global i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z4calcii(i32 noundef %0, i32 noundef %1) #0 {
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = add nsw i32 %12, 1
  %14 = sext i32 %13 to i64
  %15 = mul i64 %14, 8
  call void @llvm.memset.p0.i64(ptr align 16 @f, i8 63, i64 %15, i1 false)
  store i32 0, ptr @fc, align 16, !tbaa !5
  store i32 0, ptr @fb, align 16, !tbaa !5
  store i64 0, ptr @f, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %128, %2
  %17 = load i32, ptr %6, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %131

21:                                               ; preds = %16
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %25
  %27 = getelementptr inbounds %struct.Node, ptr %26, i32 0, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = sext i32 %28 to i64
  %30 = mul nsw i64 %23, %29
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %34
  %36 = getelementptr inbounds %struct.Node, ptr %35, i32 0, i32 2
  %37 = load i32, ptr %36, align 8, !tbaa !13
  %38 = sext i32 %37 to i64
  %39 = mul nsw i64 %32, %38
  %40 = add nsw i64 %30, %39
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.Node, ptr %43, i32 0, i32 3
  store i64 %40, ptr %44, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %45 = load i32, ptr @m, align 4, !tbaa !5
  %46 = sub nsw i32 %45, 1
  store i32 %46, ptr %8, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %124, %21
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = icmp sge i32 %48, 0
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %127

51:                                               ; preds = %47
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [801 x i64], ptr @f, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = icmp eq i64 %55, 4557430888798830399
  br i1 %56, label %57, label %58

57:                                               ; preds = %51
  br label %124

58:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %61
  %63 = getelementptr inbounds %struct.Node, ptr %62, i32 0, i32 0
  %64 = load i32, ptr %63, align 8, !tbaa !15
  %65 = add nsw i32 %59, %64
  store i32 %65, ptr %10, align 4, !tbaa !5
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %67 = load i32, ptr %66, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  store i32 %67, ptr %9, align 4, !tbaa !5
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [801 x i64], ptr @f, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [801 x i64], ptr @f, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !9
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %77
  %79 = getelementptr inbounds %struct.Node, ptr %78, i32 0, i32 3
  %80 = load i64, ptr %79, align 8, !tbaa !14
  %81 = add nsw i64 %75, %80
  %82 = icmp sgt i64 %71, %81
  br i1 %82, label %83, label %123

83:                                               ; preds = %58
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [801 x i64], ptr @f, i64 0, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !9
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %89
  %91 = getelementptr inbounds %struct.Node, ptr %90, i32 0, i32 3
  %92 = load i64, ptr %91, align 8, !tbaa !14
  %93 = add nsw i64 %87, %92
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [801 x i64], ptr @f, i64 0, i64 %95
  store i64 %93, ptr %96, align 8, !tbaa !9
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [801 x i32], ptr @fb, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %102
  %104 = getelementptr inbounds %struct.Node, ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !11
  %106 = add nsw i32 %100, %105
  %107 = load i32, ptr %9, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [801 x i32], ptr @fb, i64 0, i64 %108
  store i32 %106, ptr %109, align 4, !tbaa !5
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [801 x i32], ptr @fc, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %115
  %117 = getelementptr inbounds %struct.Node, ptr %116, i32 0, i32 2
  %118 = load i32, ptr %117, align 8, !tbaa !13
  %119 = add nsw i32 %113, %118
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [801 x i32], ptr @fc, i64 0, i64 %121
  store i32 %119, ptr %122, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %83, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %124

124:                                              ; preds = %123, %57
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %8, align 4, !tbaa !5
  br label %47, !llvm.loop !16

127:                                              ; preds = %50
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %6, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %6, align 4, !tbaa !5
  br label %16, !llvm.loop !18

131:                                              ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %132 = load i32, ptr @m, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [801 x i32], ptr @fb, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = load i32, ptr @m, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [801 x i32], ptr @fc, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = mul nsw i64 %136, %141
  store i64 %142, ptr %11, align 8, !tbaa !9
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %144 = load i64, ptr %143, align 8, !tbaa !9
  store i64 %144, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %145 = load i32, ptr @m, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [801 x i32], ptr @fb, i64 0, i64 %146
  %148 = load i32, ptr @m, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [801 x i32], ptr @fc, i64 0, i64 %149
  %151 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %147, ptr noundef nonnull align 4 dereferenceable(4) %150)
  store i64 %151, ptr %3, align 4
  %152 = load i64, ptr %3, align 4
  ret i64 %152
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #0

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !10, i64 16}
!15 = !{!12, !6, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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"

%struct.Node = type { i32, i32, i32, i64 }

@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local global i32, align 4
@fb = external dso_local global [801 x i32], align 16
@fc = external dso_local global [801 x i32], align 16
@p = external dso_local local_unnamed_addr global [401 x %struct.Node], align 16
@f = external dso_local local_unnamed_addr global [801 x i64], align 16
@ans = external dso_local global i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z4calcii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = load i32, ptr @m, align 4, !tbaa !5
  %6 = add nsw i32 %5, 1
  %7 = sext i32 %6 to i64
  %8 = shl nsw i64 %7, 3
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @f, i8 63, i64 %8, i1 false)
  store i32 0, ptr @fc, align 16, !tbaa !5
  store i32 0, ptr @fb, align 16, !tbaa !5
  store i64 0, ptr @f, align 16, !tbaa !9
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %.not28 = icmp slt i32 %9, 1
  br i1 %.not28, label %._crit_edge32, label %.lr.ph31

.lr.ph31:                                         ; preds = %2
  %10 = sext i32 %0 to i64
  %11 = sext i32 %1 to i64
  %12 = icmp sgt i32 %5, 0
  br i1 %12, label %.lr.ph31.split, label %.lr.ph31.split.us

.lr.ph31.split.us:                                ; preds = %.lr.ph31
  %13 = zext nneg i32 %9 to i64
  %xtraiter = and i64 %13, 1
  %14 = icmp eq i32 %9, 1
  br i1 %14, label %._crit_edge32.loopexit44.unr-lcssa, label %.lr.ph31.split.us.new

.lr.ph31.split.us.new:                            ; preds = %.lr.ph31.split.us
  %unroll_iter = and i64 %13, 2147483646
  br label %15

15:                                               ; preds = %15, %.lr.ph31.split.us.new
  %indvars.iv = phi i64 [ 1, %.lr.ph31.split.us.new ], [ %indvars.iv.next.1, %15 ]
  %niter = phi i64 [ 0, %.lr.ph31.split.us.new ], [ %niter.next.1, %15 ]
  %16 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %indvars.iv
  %17 = getelementptr inbounds i8, ptr %16, i64 4
  %18 = load i32, ptr %17, align 4, !tbaa !11
  %19 = sext i32 %18 to i64
  %20 = mul nsw i64 %19, %10
  %21 = getelementptr inbounds i8, ptr %16, i64 8
  %22 = load i32, ptr %21, align 8, !tbaa !13
  %23 = sext i32 %22 to i64
  %24 = mul nsw i64 %23, %11
  %25 = add nsw i64 %24, %20
  %26 = getelementptr inbounds i8, ptr %16, i64 16
  store i64 %25, ptr %26, align 8, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %indvars.iv.next
  %28 = getelementptr inbounds i8, ptr %27, i64 4
  %29 = load i32, ptr %28, align 4, !tbaa !11
  %30 = sext i32 %29 to i64
  %31 = mul nsw i64 %30, %10
  %32 = getelementptr inbounds i8, ptr %27, i64 8
  %33 = load i32, ptr %32, align 8, !tbaa !13
  %34 = sext i32 %33 to i64
  %35 = mul nsw i64 %34, %11
  %36 = add nsw i64 %35, %31
  %37 = getelementptr inbounds i8, ptr %27, i64 16
  store i64 %36, ptr %37, align 8, !tbaa !14
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 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_edge32.loopexit44.unr-lcssa, label %15, !llvm.loop !15

._crit_edge32.loopexit:                           ; preds = %._crit_edge
  %.pre41 = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge32

._crit_edge32.loopexit44.unr-lcssa:               ; preds = %15, %.lr.ph31.split.us
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph31.split.us ], [ %indvars.iv.next.1, %15 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge32, label %._crit_edge32.loopexit44.epilog-lcssa

._crit_edge32.loopexit44.epilog-lcssa:            ; preds = %._crit_edge32.loopexit44.unr-lcssa
  %38 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %indvars.iv.unr
  %39 = getelementptr inbounds i8, ptr %38, i64 4
  %40 = load i32, ptr %39, align 4, !tbaa !11
  %41 = sext i32 %40 to i64
  %42 = mul nsw i64 %41, %10
  %43 = getelementptr inbounds i8, ptr %38, i64 8
  %44 = load i32, ptr %43, align 8, !tbaa !13
  %45 = sext i32 %44 to i64
  %46 = mul nsw i64 %45, %11
  %47 = add nsw i64 %46, %42
  %48 = getelementptr inbounds i8, ptr %38, i64 16
  store i64 %47, ptr %48, align 8, !tbaa !14
  br label %._crit_edge32

._crit_edge32:                                    ; preds = %._crit_edge32.loopexit44.epilog-lcssa, %._crit_edge32.loopexit44.unr-lcssa, %._crit_edge32.loopexit, %2
  %49 = phi i32 [ %.pre41, %._crit_edge32.loopexit ], [ %5, %2 ], [ %5, %._crit_edge32.loopexit44.unr-lcssa ], [ %5, %._crit_edge32.loopexit44.epilog-lcssa ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [801 x i32], ptr @fb, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [801 x i32], ptr @fc, i64 0, i64 %50
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = mul nsw i64 %56, %53
  store i64 %57, ptr %4, align 8, !tbaa !9
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %59 = load i64, ptr %58, align 8, !tbaa !9
  store i64 %59, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  %60 = load i32, ptr @m, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [801 x i32], ptr @fb, i64 0, i64 %61
  %63 = getelementptr inbounds [801 x i32], ptr @fc, i64 0, i64 %61
  %64 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %62, ptr noundef nonnull align 4 dereferenceable(4) %63)
  ret i64 %64

.lr.ph31.split:                                   ; preds = %.lr.ph31, %._crit_edge
  %65 = phi i32 [ %80, %._crit_edge ], [ %9, %.lr.ph31 ]
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %._crit_edge ], [ 1, %.lr.ph31 ]
  %66 = getelementptr inbounds [401 x %struct.Node], ptr @p, i64 0, i64 %indvars.iv38
  %67 = getelementptr inbounds i8, ptr %66, i64 4
  %68 = load i32, ptr %67, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = mul nsw i64 %69, %10
  %71 = getelementptr inbounds i8, ptr %66, i64 8
  %72 = load i32, ptr %71, align 8, !tbaa !13
  %73 = sext i32 %72 to i64
  %74 = mul nsw i64 %73, %11
  %75 = add nsw i64 %74, %70
  %76 = getelementptr inbounds i8, ptr %66, i64 16
  store i64 %75, ptr %76, align 8, !tbaa !14
  %77 = load i32, ptr @m, align 4, !tbaa !5
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph31.split
  %79 = zext nneg i32 %77 to i64
  br label %.lr.ph

._crit_edge.loopexit:                             ; preds = %109
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph31.split
  %80 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %65, %.lr.ph31.split ]
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %81 = sext i32 %80 to i64
  %.not.not = icmp slt i64 %indvars.iv38, %81
  br i1 %.not.not, label %.lr.ph31.split, label %._crit_edge32.loopexit, !llvm.loop !17

.lr.ph:                                           ; preds = %.lr.ph.preheader, %109
  %indvars.iv35 = phi i64 [ %79, %.lr.ph.preheader ], [ %indvars.iv.next36, %109 ]
  %indvars.iv.next36 = add nsw i64 %indvars.iv35, -1
  %82 = getelementptr inbounds [801 x i64], ptr @f, i64 0, i64 %indvars.iv.next36
  %83 = load i64, ptr %82, align 8, !tbaa !9
  %84 = icmp eq i64 %83, 4557430888798830399
  br i1 %84, label %109, label %85

85:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %86 = load i32, ptr %66, align 8, !tbaa !19
  %87 = trunc nuw nsw i64 %indvars.iv.next36 to i32
  %88 = add nsw i32 %86, %87
  store i32 %88, ptr %3, align 4, !tbaa !5
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %90 = load i32, ptr %89, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [801 x i64], ptr @f, i64 0, i64 %91
  %93 = load i64, ptr %92, align 8, !tbaa !9
  %94 = load i64, ptr %82, align 8, !tbaa !9
  %95 = load i64, ptr %76, align 8, !tbaa !14
  %96 = add nsw i64 %95, %94
  %97 = icmp sgt i64 %93, %96
  br i1 %97, label %98, label %109

98:                                               ; preds = %85
  store i64 %96, ptr %92, align 8, !tbaa !9
  %99 = getelementptr inbounds [801 x i32], ptr @fb, i64 0, i64 %indvars.iv.next36
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %67, align 4, !tbaa !11
  %102 = add nsw i32 %101, %100
  %103 = getelementptr inbounds [801 x i32], ptr @fb, i64 0, i64 %91
  store i32 %102, ptr %103, align 4, !tbaa !5
  %104 = getelementptr inbounds [801 x i32], ptr @fc, i64 0, i64 %indvars.iv.next36
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = load i32, ptr %71, align 8, !tbaa !13
  %107 = add nsw i32 %106, %105
  %108 = getelementptr inbounds [801 x i32], ptr @fc, i64 0, i64 %91
  store i32 %107, ptr %108, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %85, %98, %.lr.ph
  %110 = icmp ugt i64 %indvars.iv35, 1
  br i1 %110, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !20
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !10, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16, !18}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = !{!12, !6, i64 0}
!20 = distinct !{!20, !16}


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