; LLVM IR from upupming/algorithm :: kick-start/2019/RoundC/B.  Circuit Board.ll (Z5solvev)

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

@r = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@v = external dso_local global [310 x [310 x i32]], align 16
@d = external dso_local global [310 x [310 x i32]], align 16
@h = external dso_local global [310 x i32], align 16

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3getPi(ptr noundef) #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %92, %0
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = load i32, ptr @r, align 4, !tbaa !5
  %14 = icmp sle i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  br label %95

16:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %88, %16
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr @c, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  store i32 5, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %91

22:                                               ; preds = %17
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %25
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [310 x i32], ptr %26, i64 0, i64 %28
  store i32 %23, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [310 x [310 x i32]], ptr @v, i64 0, i64 %31
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [310 x i32], ptr %32, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  store i32 %36, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %37 = load i32, ptr %1, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [310 x [310 x i32]], ptr @v, i64 0, i64 %38
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [310 x i32], ptr %39, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  store i32 %43, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %6, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %83, %22
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = load i32, ptr @c, align 4, !tbaa !5
  %49 = icmp sle i32 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  store i32 8, ptr %2, align 4
  br label %86

51:                                               ; preds = %46
  %52 = load i32, ptr %1, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [310 x [310 x i32]], ptr @v, i64 0, i64 %53
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [310 x i32], ptr %54, i64 0, i64 %56
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %57)
  %59 = load i32, ptr %58, align 4, !tbaa !5
  store i32 %59, ptr %4, align 4, !tbaa !5
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [310 x [310 x i32]], ptr @v, i64 0, i64 %61
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [310 x i32], ptr %62, i64 0, i64 %64
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %65)
  %67 = load i32, ptr %66, align 4, !tbaa !5
  store i32 %67, ptr %5, align 4, !tbaa !5
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = sub nsw i32 %68, %69
  %71 = load i32, ptr @k, align 4, !tbaa !5
  %72 = icmp sle i32 %70, %71
  br i1 %72, label %73, label %81

73:                                               ; preds = %51
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = load i32, ptr %1, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %76
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [310 x i32], ptr %77, i64 0, i64 %79
  store i32 %74, ptr %80, align 4, !tbaa !5
  br label %82

81:                                               ; preds = %51
  store i32 8, ptr %2, align 4
  br label %86

82:                                               ; preds = %73
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %6, align 4, !tbaa !5
  br label %46, !llvm.loop !9

86:                                               ; preds = %81, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %87

87:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %3, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %3, align 4, !tbaa !5
  br label %17, !llvm.loop !11

91:                                               ; preds = %21
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %1, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %1, align 4, !tbaa !5
  br label %11, !llvm.loop !12

95:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %128, %95
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = load i32, ptr @c, align 4, !tbaa !5
  %99 = icmp sle i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 11, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %131

101:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %121, %101
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = load i32, ptr @r, align 4, !tbaa !5
  %105 = icmp sle i32 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 14, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %124

107:                                              ; preds = %102
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %109
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [310 x i32], ptr %110, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = sub nsw i32 %114, %115
  %117 = add nsw i32 %116, 1
  %118 = load i32, ptr %9, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [310 x i32], ptr @h, i64 0, i64 %119
  store i32 %117, ptr %120, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %107
  %122 = load i32, ptr %9, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %9, align 4, !tbaa !5
  br label %102, !llvm.loop !13

124:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %125 = call noundef i32 @_Z3getPi(ptr noundef @h)
  store i32 %125, ptr %10, align 4, !tbaa !5
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %127 = load i32, ptr %126, align 4, !tbaa !5
  store i32 %127, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %128

128:                                              ; preds = %124
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %8, align 4, !tbaa !5
  br label %96, !llvm.loop !14

131:                                              ; preds = %100
  %132 = load i32, ptr %7, align 4, !tbaa !5
  store i32 1, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret i32 %132
}

; 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)) #2

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


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

@r = external dso_local local_unnamed_addr global i32, align 4
@c = external dso_local local_unnamed_addr global i32, align 4
@k = external dso_local local_unnamed_addr global i32, align 4
@v = external dso_local global [310 x [310 x i32]], align 16
@d = external dso_local local_unnamed_addr global [310 x [310 x i32]], align 16
@h = external dso_local global [310 x i32], align 16

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3getPi(ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = load i32, ptr @r, align 4, !tbaa !5
  %.not46 = icmp slt i32 %5, 1
  %.pre73 = load i32, ptr @c, align 4, !tbaa !5
  br i1 %.not46, label %._crit_edge48, label %.preheader38.lr.ph

.preheader38.lr.ph:                               ; preds = %0
  %6 = icmp slt i32 %.pre73, 1
  br i1 %6, label %._crit_edge48.thread, label %.preheader38

._crit_edge48.thread:                             ; preds = %.preheader38.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  br label %._crit_edge55

.preheader38:                                     ; preds = %.preheader38.lr.ph, %._crit_edge45
  %7 = phi i32 [ %11, %._crit_edge45 ], [ %5, %.preheader38.lr.ph ]
  %8 = phi i32 [ %12, %._crit_edge45 ], [ %.pre73, %.preheader38.lr.ph ]
  %9 = phi i32 [ %13, %._crit_edge45 ], [ %.pre73, %.preheader38.lr.ph ]
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %._crit_edge45 ], [ 1, %.preheader38.lr.ph ]
  %.not3542 = icmp slt i32 %9, 1
  br i1 %.not3542, label %._crit_edge45, label %.lr.ph44

._crit_edge48:                                    ; preds = %._crit_edge45, %0
  %10 = phi i32 [ %.pre73, %0 ], [ %12, %._crit_edge45 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  %.not3353 = icmp slt i32 %10, 1
  br i1 %.not3353, label %._crit_edge55, label %.preheader

._crit_edge45.loopexit:                           ; preds = %._crit_edge
  %.pre72 = load i32, ptr @r, align 4, !tbaa !5
  br label %._crit_edge45

._crit_edge45:                                    ; preds = %._crit_edge45.loopexit, %.preheader38
  %11 = phi i32 [ %.pre72, %._crit_edge45.loopexit ], [ %7, %.preheader38 ]
  %12 = phi i32 [ %32, %._crit_edge45.loopexit ], [ %8, %.preheader38 ]
  %13 = phi i32 [ %32, %._crit_edge45.loopexit ], [ %9, %.preheader38 ]
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %14 = sext i32 %11 to i64
  %.not.not = icmp slt i64 %indvars.iv63, %14
  br i1 %.not.not, label %.preheader38, label %._crit_edge48, !llvm.loop !9

.lr.ph44:                                         ; preds = %.preheader38, %._crit_edge
  %15 = phi i32 [ %32, %._crit_edge ], [ %8, %.preheader38 ]
  %16 = phi i32 [ %32, %._crit_edge ], [ %9, %.preheader38 ]
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %._crit_edge ], [ 1, %.preheader38 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge ], [ 2, %.preheader38 ]
  %17 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %indvars.iv63, i64 %indvars.iv60
  %18 = trunc nuw nsw i64 %indvars.iv60 to i32
  store i32 %18, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #3
  %19 = getelementptr inbounds [310 x [310 x i32]], ptr @v, i64 0, i64 %indvars.iv63, i64 %indvars.iv60
  %20 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %20, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  store i32 %20, ptr %2, align 4, !tbaa !5
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %21 = sext i32 %16 to i64
  %.not3639.not = icmp slt i64 %indvars.iv60, %21
  br i1 %.not3639.not, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph44, %30
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %30 ], [ %indvars.iv, %.lr.ph44 ]
  %22 = getelementptr inbounds [310 x [310 x i32]], ptr @v, i64 0, i64 %indvars.iv63, i64 %indvars.iv57
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %24 = load i32, ptr %23, align 4, !tbaa !5
  store i32 %24, ptr %1, align 4, !tbaa !5
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %26 = load i32, ptr %25, align 4, !tbaa !5
  store i32 %26, ptr %2, align 4, !tbaa !5
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %28 = sub nsw i32 %27, %26
  %29 = load i32, ptr @k, align 4, !tbaa !5
  %.not37 = icmp sgt i32 %28, %29
  %.pre.pre = load i32, ptr @c, align 4, !tbaa !5
  br i1 %.not37, label %._crit_edge, label %30

30:                                               ; preds = %.lr.ph
  %31 = trunc nuw i64 %indvars.iv57 to i32
  store i32 %31, ptr %17, align 4, !tbaa !5
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %.not36.not = icmp sgt i32 %.pre.pre, %31
  br i1 %.not36.not, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %30, %.lr.ph, %.lr.ph44
  %32 = phi i32 [ %15, %.lr.ph44 ], [ %.pre.pre, %.lr.ph ], [ %.pre.pre, %30 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #3
  %33 = sext i32 %32 to i64
  %.not35.not = icmp slt i64 %indvars.iv60, %33
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %.not35.not, label %.lr.ph44, label %._crit_edge45.loopexit, !llvm.loop !13

.preheader:                                       ; preds = %._crit_edge48, %._crit_edge52
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %._crit_edge52 ], [ 1, %._crit_edge48 ]
  %34 = load i32, ptr @r, align 4, !tbaa !5
  %.not3449 = icmp slt i32 %34, 1
  br i1 %.not3449, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %.preheader
  %35 = add nuw i32 %34, 1
  %wide.trip.count = zext i32 %35 to i64
  %36 = trunc nuw nsw i64 %indvars.iv69 to i32
  %37 = zext nneg i32 %34 to i64
  %min.iters.check = icmp ult i32 %34, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph51
  %indvars.iv66.ph = phi i64 [ 1, %.lr.ph51 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph51
  %n.vec = and i64 %37, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %36, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %38 = or disjoint i64 %index, 2
  %39 = or disjoint i64 %index, 3
  %40 = or disjoint i64 %index, 4
  %41 = or disjoint i64 %index, 5
  %42 = or disjoint i64 %index, 6
  %43 = or disjoint i64 %index, 7
  %44 = add i64 %index, 8
  %45 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %offset.idx, i64 %indvars.iv69
  %46 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %38, i64 %indvars.iv69
  %47 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %39, i64 %indvars.iv69
  %48 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %40, i64 %indvars.iv69
  %49 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %41, i64 %indvars.iv69
  %50 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %42, i64 %indvars.iv69
  %51 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %43, i64 %indvars.iv69
  %52 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %44, i64 %indvars.iv69
  %53 = load i32, ptr %45, align 4, !tbaa !5
  %54 = load i32, ptr %46, align 4, !tbaa !5
  %55 = load i32, ptr %47, align 4, !tbaa !5
  %56 = load i32, ptr %48, align 4, !tbaa !5
  %57 = insertelement <4 x i32> poison, i32 %53, i64 0
  %58 = insertelement <4 x i32> %57, i32 %54, i64 1
  %59 = insertelement <4 x i32> %58, i32 %55, i64 2
  %60 = insertelement <4 x i32> %59, i32 %56, i64 3
  %61 = load i32, ptr %49, align 4, !tbaa !5
  %62 = load i32, ptr %50, align 4, !tbaa !5
  %63 = load i32, ptr %51, align 4, !tbaa !5
  %64 = load i32, ptr %52, align 4, !tbaa !5
  %65 = insertelement <4 x i32> poison, i32 %61, i64 0
  %66 = insertelement <4 x i32> %65, i32 %62, i64 1
  %67 = insertelement <4 x i32> %66, i32 %63, i64 2
  %68 = insertelement <4 x i32> %67, i32 %64, i64 3
  %69 = sub <4 x i32> %60, %broadcast.splat
  %70 = sub <4 x i32> %68, %broadcast.splat
  %71 = add <4 x i32> %69, <i32 1, i32 1, i32 1, i32 1>
  %72 = add <4 x i32> %70, <i32 1, i32 1, i32 1, i32 1>
  %73 = getelementptr inbounds [310 x i32], ptr @h, i64 0, i64 %offset.idx
  %74 = getelementptr inbounds i8, ptr %73, i64 16
  store <4 x i32> %71, ptr %73, align 4, !tbaa !5
  store <4 x i32> %72, ptr %74, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %75 = icmp eq i64 %index.next, %n.vec
  br i1 %75, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %37
  br i1 %cmp.n, label %._crit_edge52, label %scalar.ph.preheader

._crit_edge55:                                    ; preds = %._crit_edge52, %._crit_edge48.thread, %._crit_edge48
  %76 = phi i32 [ 0, %._crit_edge48 ], [ 0, %._crit_edge48.thread ], [ %79, %._crit_edge52 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  ret i32 %76

._crit_edge52:                                    ; preds = %scalar.ph, %middle.block, %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %77 = call noundef i32 @_Z3getPi(ptr noundef nonnull @h)
  store i32 %77, ptr %4, align 4, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %79 = load i32, ptr %78, align 4, !tbaa !5
  store i32 %79, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %80 = load i32, ptr @c, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %.not33.not = icmp slt i64 %indvars.iv69, %81
  br i1 %.not33.not, label %.preheader, label %._crit_edge55, !llvm.loop !17

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %scalar.ph ], [ %indvars.iv66.ph, %scalar.ph.preheader ]
  %82 = getelementptr inbounds [310 x [310 x i32]], ptr @d, i64 0, i64 %indvars.iv66, i64 %indvars.iv69
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %reass.sub = sub i32 %83, %36
  %84 = add i32 %reass.sub, 1
  %85 = getelementptr inbounds [310 x i32], ptr @h, i64 0, i64 %indvars.iv66
  store i32 %84, ptr %85, align 4, !tbaa !5
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge52, label %scalar.ph, !llvm.loop !18
}

; 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 #2

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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !16, !15}


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