; LLVM IR from ahr9n/psolving-paradigms :: 1.brute-force/1.1.iterative-brute-force (CodeForces 106B - Choosing Laptop)

; 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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %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 i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %22 = load i32, ptr %2, align 4, !tbaa !8
  %23 = zext i32 %22 to i64
  %24 = call ptr @llvm.stacksave.p0()
  store ptr %24, ptr %3, align 8
  %25 = alloca [4 x i32], i64 %23, align 16
  store i64 %23, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1000000000, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %26

26:                                               ; preds = %48, %0
  %27 = load i32, ptr %9, align 4, !tbaa !8
  %28 = load i32, ptr %2, align 4, !tbaa !8
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %51

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !8
  br label %32

32:                                               ; preds = %44, %31
  %33 = load i32, ptr %11, align 4, !tbaa !8
  %34 = icmp slt i32 %33, 4
  br i1 %34, label %36, label %35

35:                                               ; preds = %32
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %47

36:                                               ; preds = %32
  %37 = load i32, ptr %9, align 4, !tbaa !8
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [4 x i32], ptr %25, i64 %38
  %40 = load i32, ptr %11, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [4 x i32], ptr %39, i64 0, i64 %41
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %42)
  br label %44

44:                                               ; preds = %36
  %45 = load i32, ptr %11, align 4, !tbaa !8
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %11, align 4, !tbaa !8
  br label %32, !llvm.loop !11

47:                                               ; preds = %35
  br label %48

48:                                               ; preds = %47
  %49 = load i32, ptr %9, align 4, !tbaa !8
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %9, align 4, !tbaa !8
  br label %26, !llvm.loop !13

51:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !8
  br label %52

52:                                               ; preds = %119, %51
  %53 = load i32, ptr %12, align 4, !tbaa !8
  %54 = load i32, ptr %2, align 4, !tbaa !8
  %55 = icmp slt i32 %53, %54
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %122

57:                                               ; preds = %52
  store i32 1, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !8
  br label %58

58:                                               ; preds = %96, %57
  %59 = load i32, ptr %13, align 4, !tbaa !8
  %60 = load i32, ptr %2, align 4, !tbaa !8
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %99

63:                                               ; preds = %58
  store i32 0, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !8
  br label %64

64:                                               ; preds = %88, %63
  %65 = load i32, ptr %14, align 4, !tbaa !8
  %66 = icmp slt i32 %65, 4
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %91

68:                                               ; preds = %64
  %69 = load i32, ptr %13, align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [4 x i32], ptr %25, i64 %70
  %72 = load i32, ptr %14, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [4 x i32], ptr %71, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !8
  %76 = load i32, ptr %12, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [4 x i32], ptr %25, i64 %77
  %79 = load i32, ptr %14, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [4 x i32], ptr %78, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !8
  %83 = icmp sgt i32 %75, %82
  br i1 %83, label %84, label %87

84:                                               ; preds = %68
  %85 = load i32, ptr %5, align 4, !tbaa !8
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %5, align 4, !tbaa !8
  br label %87

87:                                               ; preds = %84, %68
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %14, align 4, !tbaa !8
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %14, align 4, !tbaa !8
  br label %64, !llvm.loop !14

91:                                               ; preds = %67
  %92 = load i32, ptr %5, align 4, !tbaa !8
  %93 = icmp eq i32 %92, 4
  br i1 %93, label %94, label %95

94:                                               ; preds = %91
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %95

95:                                               ; preds = %94, %91
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %13, align 4, !tbaa !8
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %13, align 4, !tbaa !8
  br label %58, !llvm.loop !15

99:                                               ; preds = %62
  %100 = load i32, ptr %6, align 4, !tbaa !8
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %118

102:                                              ; preds = %99
  %103 = load i32, ptr %7, align 4, !tbaa !8
  %104 = load i32, ptr %12, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [4 x i32], ptr %25, i64 %105
  %107 = getelementptr inbounds [4 x i32], ptr %106, i64 0, i64 3
  %108 = load i32, ptr %107, align 4, !tbaa !8
  %109 = icmp sgt i32 %103, %108
  br i1 %109, label %110, label %118

110:                                              ; preds = %102
  %111 = load i32, ptr %12, align 4, !tbaa !8
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [4 x i32], ptr %25, i64 %112
  %114 = getelementptr inbounds [4 x i32], ptr %113, i64 0, i64 3
  %115 = load i32, ptr %114, align 4, !tbaa !8
  store i32 %115, ptr %7, align 4, !tbaa !8
  %116 = load i32, ptr %12, align 4, !tbaa !8
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %8, align 4, !tbaa !8
  br label %118

118:                                              ; preds = %110, %102, %99
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %12, align 4, !tbaa !8
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %12, align 4, !tbaa !8
  br label %52, !llvm.loop !16

122:                                              ; preds = %56
  %123 = load i32, ptr %8, align 4, !tbaa !8
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %123)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %125 = load ptr, ptr %3, align 8
  call void @llvm.stackrestore.p0(ptr %125)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %126 = load i32, ptr %1, align 4
  ret i32 %126
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

attributes #0 = { 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 #1 = { "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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !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}


; 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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %3 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %4 = getelementptr i8, ptr %3, i64 -24
  %5 = load i64, ptr %4, align 8
  %6 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %5
  %7 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %6, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %9 = load i32, ptr %1, align 4, !tbaa !8
  %10 = zext i32 %9 to i64
  %11 = call ptr @llvm.stacksave.p0()
  %12 = alloca [4 x i32], i64 %10, align 16
  %13 = load i32, ptr %1, align 4, !tbaa !8
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.preheader42, label %.preheader41

.preheader42:                                     ; preds = %0, %.preheader42
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader42 ], [ 0, %0 ]
  %15 = getelementptr inbounds [4 x i32], ptr %12, i64 %indvars.iv, i64 0
  %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) %15)
  %17 = getelementptr inbounds [4 x i32], ptr %12, i64 %indvars.iv, i64 1
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %19 = getelementptr inbounds [4 x i32], ptr %12, i64 %indvars.iv, i64 2
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %21 = getelementptr inbounds [4 x i32], ptr %12, i64 %indvars.iv, i64 3
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr %1, align 4, !tbaa !8
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next, %24
  br i1 %25, label %.preheader42, label %.preheader41, !llvm.loop !11

.preheader41:                                     ; preds = %.preheader42, %0
  %.lcssa = phi i32 [ %13, %0 ], [ %23, %.preheader42 ]
  %26 = icmp sgt i32 %.lcssa, 0
  call void @llvm.assume(i1 %26)
  %wide.trip.count67 = zext nneg i32 %.lcssa to i64
  %min.iters.check = icmp ult i32 %.lcssa, 8
  %n.vec = and i64 %wide.trip.count67, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count67
  br label %.preheader40.us

.preheader40.us:                                  ; preds = %.preheader41, %164
  %indvars.iv64 = phi i64 [ 0, %.preheader41 ], [ %indvars.iv.next65.pre-phi, %164 ]
  %.02951.us = phi i32 [ undef, %.preheader41 ], [ %.1.us, %164 ]
  %.03050.us = phi i32 [ 1000000000, %.preheader41 ], [ %.131.us, %164 ]
  %.phi.trans.insert = getelementptr inbounds [4 x i32], ptr %12, i64 %indvars.iv64, i64 0
  %27 = load <4 x i32>, ptr %.phi.trans.insert, align 16, !tbaa !8
  br i1 %min.iters.check, label %.preheader.us.preheader, label %vector.ph

.preheader.us.preheader:                          ; preds = %middle.block, %.preheader40.us
  %indvars.iv61.ph = phi i64 [ 0, %.preheader40.us ], [ %n.vec, %middle.block ]
  %.03247.us.ph = phi i32 [ 1, %.preheader40.us ], [ %rdx.select, %middle.block ]
  br label %.preheader.us

vector.ph:                                        ; preds = %.preheader40.us
  %broadcast.splat = shufflevector <4 x i32> %27, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splat80 = shufflevector <4 x i32> %27, <4 x i32> poison, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
  %broadcast.splat82 = shufflevector <4 x i32> %27, <4 x i32> poison, <4 x i32> <i32 2, i32 2, i32 2, i32 2>
  %broadcast.splat84 = shufflevector <4 x i32> %27, <4 x i32> poison, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %155, %vector.body ]
  %vec.phi78 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %156, %vector.body ]
  %28 = or disjoint i64 %index, 1
  %29 = or disjoint i64 %index, 2
  %30 = or disjoint i64 %index, 3
  %31 = or disjoint i64 %index, 4
  %32 = or disjoint i64 %index, 5
  %33 = or disjoint i64 %index, 6
  %34 = or disjoint i64 %index, 7
  %35 = getelementptr inbounds [4 x i32], ptr %12, i64 %index, i64 0
  %36 = getelementptr inbounds [4 x i32], ptr %12, i64 %28, i64 0
  %37 = getelementptr inbounds [4 x i32], ptr %12, i64 %29, i64 0
  %38 = getelementptr inbounds [4 x i32], ptr %12, i64 %30, i64 0
  %39 = getelementptr inbounds [4 x i32], ptr %12, i64 %31, i64 0
  %40 = getelementptr inbounds [4 x i32], ptr %12, i64 %32, i64 0
  %41 = getelementptr inbounds [4 x i32], ptr %12, i64 %33, i64 0
  %42 = getelementptr inbounds [4 x i32], ptr %12, i64 %34, i64 0
  %43 = load i32, ptr %35, align 16, !tbaa !8
  %44 = load i32, ptr %36, align 16, !tbaa !8
  %45 = load i32, ptr %37, align 16, !tbaa !8
  %46 = load i32, ptr %38, align 16, !tbaa !8
  %47 = insertelement <4 x i32> poison, i32 %43, i64 0
  %48 = insertelement <4 x i32> %47, i32 %44, i64 1
  %49 = insertelement <4 x i32> %48, i32 %45, i64 2
  %50 = insertelement <4 x i32> %49, i32 %46, i64 3
  %51 = load i32, ptr %39, align 16, !tbaa !8
  %52 = load i32, ptr %40, align 16, !tbaa !8
  %53 = load i32, ptr %41, align 16, !tbaa !8
  %54 = load i32, ptr %42, align 16, !tbaa !8
  %55 = insertelement <4 x i32> poison, i32 %51, i64 0
  %56 = insertelement <4 x i32> %55, i32 %52, i64 1
  %57 = insertelement <4 x i32> %56, i32 %53, i64 2
  %58 = insertelement <4 x i32> %57, i32 %54, i64 3
  %59 = icmp sgt <4 x i32> %50, %broadcast.splat
  %60 = icmp sgt <4 x i32> %58, %broadcast.splat
  %61 = zext <4 x i1> %59 to <4 x i32>
  %62 = zext <4 x i1> %60 to <4 x i32>
  %63 = getelementptr inbounds [4 x i32], ptr %12, i64 %index, i64 1
  %64 = getelementptr inbounds [4 x i32], ptr %12, i64 %28, i64 1
  %65 = getelementptr inbounds [4 x i32], ptr %12, i64 %29, i64 1
  %66 = getelementptr inbounds [4 x i32], ptr %12, i64 %30, i64 1
  %67 = getelementptr inbounds [4 x i32], ptr %12, i64 %31, i64 1
  %68 = getelementptr inbounds [4 x i32], ptr %12, i64 %32, i64 1
  %69 = getelementptr inbounds [4 x i32], ptr %12, i64 %33, i64 1
  %70 = getelementptr inbounds [4 x i32], ptr %12, i64 %34, i64 1
  %71 = load i32, ptr %63, align 4, !tbaa !8
  %72 = load i32, ptr %64, align 4, !tbaa !8
  %73 = load i32, ptr %65, align 4, !tbaa !8
  %74 = load i32, ptr %66, align 4, !tbaa !8
  %75 = insertelement <4 x i32> poison, i32 %71, i64 0
  %76 = insertelement <4 x i32> %75, i32 %72, i64 1
  %77 = insertelement <4 x i32> %76, i32 %73, i64 2
  %78 = insertelement <4 x i32> %77, i32 %74, i64 3
  %79 = load i32, ptr %67, align 4, !tbaa !8
  %80 = load i32, ptr %68, align 4, !tbaa !8
  %81 = load i32, ptr %69, align 4, !tbaa !8
  %82 = load i32, ptr %70, align 4, !tbaa !8
  %83 = insertelement <4 x i32> poison, i32 %79, i64 0
  %84 = insertelement <4 x i32> %83, i32 %80, i64 1
  %85 = insertelement <4 x i32> %84, i32 %81, i64 2
  %86 = insertelement <4 x i32> %85, i32 %82, i64 3
  %87 = icmp sgt <4 x i32> %78, %broadcast.splat80
  %88 = icmp sgt <4 x i32> %86, %broadcast.splat80
  %89 = zext <4 x i1> %87 to <4 x i32>
  %90 = zext <4 x i1> %88 to <4 x i32>
  %91 = add nuw nsw <4 x i32> %61, %89
  %92 = add nuw nsw <4 x i32> %62, %90
  %93 = getelementptr inbounds [4 x i32], ptr %12, i64 %index, i64 2
  %94 = getelementptr inbounds [4 x i32], ptr %12, i64 %28, i64 2
  %95 = getelementptr inbounds [4 x i32], ptr %12, i64 %29, i64 2
  %96 = getelementptr inbounds [4 x i32], ptr %12, i64 %30, i64 2
  %97 = getelementptr inbounds [4 x i32], ptr %12, i64 %31, i64 2
  %98 = getelementptr inbounds [4 x i32], ptr %12, i64 %32, i64 2
  %99 = getelementptr inbounds [4 x i32], ptr %12, i64 %33, i64 2
  %100 = getelementptr inbounds [4 x i32], ptr %12, i64 %34, i64 2
  %101 = load i32, ptr %93, align 8, !tbaa !8
  %102 = load i32, ptr %94, align 8, !tbaa !8
  %103 = load i32, ptr %95, align 8, !tbaa !8
  %104 = load i32, ptr %96, align 8, !tbaa !8
  %105 = insertelement <4 x i32> poison, i32 %101, i64 0
  %106 = insertelement <4 x i32> %105, i32 %102, i64 1
  %107 = insertelement <4 x i32> %106, i32 %103, i64 2
  %108 = insertelement <4 x i32> %107, i32 %104, i64 3
  %109 = load i32, ptr %97, align 8, !tbaa !8
  %110 = load i32, ptr %98, align 8, !tbaa !8
  %111 = load i32, ptr %99, align 8, !tbaa !8
  %112 = load i32, ptr %100, align 8, !tbaa !8
  %113 = insertelement <4 x i32> poison, i32 %109, i64 0
  %114 = insertelement <4 x i32> %113, i32 %110, i64 1
  %115 = insertelement <4 x i32> %114, i32 %111, i64 2
  %116 = insertelement <4 x i32> %115, i32 %112, i64 3
  %117 = icmp sgt <4 x i32> %108, %broadcast.splat82
  %118 = icmp sgt <4 x i32> %116, %broadcast.splat82
  %119 = zext <4 x i1> %117 to <4 x i32>
  %120 = zext <4 x i1> %118 to <4 x i32>
  %121 = add nuw nsw <4 x i32> %91, %119
  %122 = add nuw nsw <4 x i32> %92, %120
  %123 = getelementptr inbounds [4 x i32], ptr %12, i64 %index, i64 3
  %124 = getelementptr inbounds [4 x i32], ptr %12, i64 %28, i64 3
  %125 = getelementptr inbounds [4 x i32], ptr %12, i64 %29, i64 3
  %126 = getelementptr inbounds [4 x i32], ptr %12, i64 %30, i64 3
  %127 = getelementptr inbounds [4 x i32], ptr %12, i64 %31, i64 3
  %128 = getelementptr inbounds [4 x i32], ptr %12, i64 %32, i64 3
  %129 = getelementptr inbounds [4 x i32], ptr %12, i64 %33, i64 3
  %130 = getelementptr inbounds [4 x i32], ptr %12, i64 %34, i64 3
  %131 = load i32, ptr %123, align 4, !tbaa !8
  %132 = load i32, ptr %124, align 4, !tbaa !8
  %133 = load i32, ptr %125, align 4, !tbaa !8
  %134 = load i32, ptr %126, align 4, !tbaa !8
  %135 = insertelement <4 x i32> poison, i32 %131, i64 0
  %136 = insertelement <4 x i32> %135, i32 %132, i64 1
  %137 = insertelement <4 x i32> %136, i32 %133, i64 2
  %138 = insertelement <4 x i32> %137, i32 %134, i64 3
  %139 = load i32, ptr %127, align 4, !tbaa !8
  %140 = load i32, ptr %128, align 4, !tbaa !8
  %141 = load i32, ptr %129, align 4, !tbaa !8
  %142 = load i32, ptr %130, align 4, !tbaa !8
  %143 = insertelement <4 x i32> poison, i32 %139, i64 0
  %144 = insertelement <4 x i32> %143, i32 %140, i64 1
  %145 = insertelement <4 x i32> %144, i32 %141, i64 2
  %146 = insertelement <4 x i32> %145, i32 %142, i64 3
  %147 = icmp sgt <4 x i32> %138, %broadcast.splat84
  %148 = icmp sgt <4 x i32> %146, %broadcast.splat84
  %149 = zext <4 x i1> %147 to <4 x i32>
  %150 = zext <4 x i1> %148 to <4 x i32>
  %151 = add nuw nsw <4 x i32> %121, %149
  %152 = add nuw nsw <4 x i32> %122, %150
  %153 = icmp eq <4 x i32> %151, <i32 4, i32 4, i32 4, i32 4>
  %154 = icmp eq <4 x i32> %152, <i32 4, i32 4, i32 4, i32 4>
  %155 = or <4 x i1> %vec.phi, %153
  %156 = or <4 x i1> %vec.phi78, %154
  %index.next = add nuw i64 %index, 8
  %157 = icmp eq i64 %index.next, %n.vec
  br i1 %157, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = or <4 x i1> %156, %155
  %bin.rdx.fr = freeze <4 x i1> %bin.rdx
  %158 = bitcast <4 x i1> %bin.rdx.fr to i4
  %.not = icmp eq i4 %158, 0
  %rdx.select = zext i1 %.not to i32
  br i1 %cmp.n, label %._crit_edge.us, label %.preheader.us.preheader

159:                                              ; preds = %._crit_edge.us
  %160 = extractelement <4 x i32> %27, i64 3
  %161 = icmp sgt i32 %.03050.us, %160
  %162 = add nuw nsw i64 %indvars.iv64, 1
  %spec.select38.us = call i32 @llvm.smin.i32(i32 %.03050.us, i32 %160)
  %163 = trunc nuw nsw i64 %162 to i32
  %spec.select39.us = select i1 %161, i32 %163, i32 %.02951.us
  br label %164

164:                                              ; preds = %._crit_edge.us._crit_edge, %159
  %indvars.iv.next65.pre-phi = phi i64 [ %.pre75, %._crit_edge.us._crit_edge ], [ %162, %159 ]
  %.131.us = phi i32 [ %.03050.us, %._crit_edge.us._crit_edge ], [ %spec.select38.us, %159 ]
  %.1.us = phi i32 [ %.02951.us, %._crit_edge.us._crit_edge ], [ %spec.select39.us, %159 ]
  %exitcond68.not = icmp eq i64 %indvars.iv.next65.pre-phi, %wide.trip.count67
  br i1 %exitcond68.not, label %._crit_edge53, label %.preheader40.us, !llvm.loop !16

.preheader.us:                                    ; preds = %.preheader.us.preheader, %.preheader.us
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.preheader.us ], [ %indvars.iv61.ph, %.preheader.us.preheader ]
  %.03247.us = phi i32 [ %spec.select.us, %.preheader.us ], [ %.03247.us.ph, %.preheader.us.preheader ]
  %165 = getelementptr inbounds [4 x i32], ptr %12, i64 %indvars.iv61, i64 0
  %166 = load <4 x i32>, ptr %165, align 16, !tbaa !8
  %167 = icmp sle <4 x i32> %166, %27
  %168 = bitcast <4 x i1> %167 to i4
  %169 = icmp eq i4 %168, 0
  %spec.select.us = select i1 %169, i32 0, i32 %.03247.us
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count67
  br i1 %exitcond.not, label %._crit_edge.us, label %.preheader.us, !llvm.loop !17

._crit_edge.us:                                   ; preds = %.preheader.us, %middle.block
  %spec.select.us.lcssa = phi i32 [ %rdx.select, %middle.block ], [ %spec.select.us, %.preheader.us ]
  %.not.us = icmp eq i32 %spec.select.us.lcssa, 0
  br i1 %.not.us, label %._crit_edge.us._crit_edge, label %159

._crit_edge.us._crit_edge:                        ; preds = %._crit_edge.us
  %.pre75 = add nuw nsw i64 %indvars.iv64, 1
  br label %164

._crit_edge53:                                    ; preds = %164
  %170 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.1.us)
  call void @llvm.stackrestore.p0(ptr %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

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

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 #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #6

attributes #0 = { 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 #1 = { "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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, 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}
!17 = distinct !{!17, !12, !15, !14}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass