; LLVM IR from seikhchilli/codeforces-solution :: 1348A (main)

; 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 i32, align 4
  %4 = alloca [30 x i32], align 16
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %12 = 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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 120, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 2, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %24, %0
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %15 = icmp slt i32 %14, 30
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %27

17:                                               ; preds = %13
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = load i32, ptr %6, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [30 x i32], ptr %4, i64 0, i64 %20
  store i32 %18, ptr %21, align 4, !tbaa !5
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = mul nsw i32 %22, 2
  store i32 %23, ptr %5, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %17
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %6, align 4, !tbaa !5
  br label %13, !llvm.loop !9

27:                                               ; preds = %16
  br label %28

28:                                               ; preds = %91, %27
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr %2, align 4, !tbaa !5
  %31 = icmp ne i32 %29, 0
  br i1 %31, label %32, label %96

32:                                               ; preds = %28
  %33 = 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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %48, %32
  %35 = load i32, ptr %9, align 4, !tbaa !5
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sdiv i32 %36, 2
  %38 = sub nsw i32 %37, 1
  %39 = icmp slt i32 %35, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %51

41:                                               ; preds = %34
  %42 = load i32, ptr %9, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [30 x i32], ptr %4, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = add nsw i32 %46, %45
  store i32 %47, ptr %7, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %41
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %9, align 4, !tbaa !5
  br label %34, !llvm.loop !11

51:                                               ; preds = %40
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [30 x i32], ptr %4, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = add nsw i32 %57, %56
  store i32 %58, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sdiv i32 %59, 2
  %61 = sub nsw i32 %60, 1
  store i32 %61, ptr %10, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %75, %51
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = sub nsw i32 %64, 1
  %66 = icmp slt i32 %63, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %78

68:                                               ; preds = %62
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [30 x i32], ptr %4, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = add nsw i32 %73, %72
  store i32 %74, ptr %8, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %68
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %10, align 4, !tbaa !5
  br label %62, !llvm.loop !12

78:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = sub nsw i32 %79, %80
  %82 = icmp sge i32 %81, 0
  br i1 %82, label %83, label %87

83:                                               ; preds = %78
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = sub nsw i32 %84, %85
  br label %91

87:                                               ; preds = %78
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = sub nsw i32 %88, %89
  br label %91

91:                                               ; preds = %87, %83
  %92 = phi i32 [ %86, %83 ], [ %90, %87 ]
  store i32 %92, ptr %11, align 4, !tbaa !5
  %93 = load i32, ptr %11, align 4, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %93)
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %28, !llvm.loop !13

96:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 120, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 = { inlinehint 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 #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 = !{!"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}


; 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 {
.preheader:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  %2 = alloca [30 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #6
  %3 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %2) #6
  store <4 x i32> <i32 2, i32 4, i32 8, i32 16>, ptr %2, align 16, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %2, i64 16
  store <4 x i32> <i32 32, i32 64, i32 128, i32 256>, ptr %4, align 16, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %2, i64 32
  store <4 x i32> <i32 512, i32 1024, i32 2048, i32 4096>, ptr %5, align 16, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %2, i64 48
  store <4 x i32> <i32 8192, i32 16384, i32 32768, i32 65536>, ptr %6, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %2, i64 64
  store <4 x i32> <i32 131072, i32 262144, i32 524288, i32 1048576>, ptr %7, align 16, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %2, i64 80
  store <4 x i32> <i32 2097152, i32 4194304, i32 8388608, i32 16777216>, ptr %8, align 16, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %2, i64 96
  store <4 x i32> <i32 33554432, i32 67108864, i32 134217728, i32 268435456>, ptr %9, align 16, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %2, i64 112
  store i32 536870912, ptr %10, align 16, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %2, i64 116
  store i32 1073741824, ptr %11, align 4, !tbaa !5
  %12 = load i32, ptr %0, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr %0, align 4, !tbaa !5
  %.not41 = icmp eq i32 %12, 0
  br i1 %.not41, label %._crit_edge43, label %.lr.ph42

.lr.ph42:                                         ; preds = %.preheader, %._crit_edge39
  %14 = 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)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sdiv i32 %15, 2
  %17 = icmp sgt i32 %15, 3
  br i1 %17, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph42
  %18 = call i32 @llvm.smax.i32(i32 %16, i32 2)
  %smax = add nsw i32 %18, -1
  %wide.trip.count = zext nneg i32 %smax to i64
  %min.iters.check59 = icmp slt i32 %15, 18
  br i1 %min.iters.check59, label %.lr.ph.preheader75, label %vector.ph60

.lr.ph.preheader75:                               ; preds = %middle.block57, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec62, %middle.block57 ]
  %.02431.ph = phi i32 [ 0, %.lr.ph.preheader ], [ %24, %middle.block57 ]
  br label %.lr.ph

vector.ph60:                                      ; preds = %.lr.ph.preheader
  %n.vec62 = and i64 %wide.trip.count, 2147483640
  br label %vector.body64

vector.body64:                                    ; preds = %vector.body64, %vector.ph60
  %index65 = phi i64 [ 0, %vector.ph60 ], [ %index.next70, %vector.body64 ]
  %vec.phi66 = phi <4 x i32> [ zeroinitializer, %vector.ph60 ], [ %21, %vector.body64 ]
  %vec.phi67 = phi <4 x i32> [ zeroinitializer, %vector.ph60 ], [ %22, %vector.body64 ]
  %19 = getelementptr inbounds [30 x i32], ptr %2, i64 0, i64 %index65
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  %wide.load68 = load <4 x i32>, ptr %19, align 16, !tbaa !5
  %wide.load69 = load <4 x i32>, ptr %20, align 16, !tbaa !5
  %21 = add <4 x i32> %wide.load68, %vec.phi66
  %22 = add <4 x i32> %wide.load69, %vec.phi67
  %index.next70 = add nuw i64 %index65, 8
  %23 = icmp eq i64 %index.next70, %n.vec62
  br i1 %23, label %middle.block57, label %vector.body64, !llvm.loop !9

middle.block57:                                   ; preds = %vector.body64
  %bin.rdx71 = add <4 x i32> %22, %21
  %24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx71)
  %cmp.n72 = icmp eq i64 %n.vec62, %wide.trip.count
  br i1 %cmp.n72, label %._crit_edge, label %.lr.ph.preheader75

._crit_edge:                                      ; preds = %.lr.ph, %middle.block57, %.lr.ph42
  %.024.lcssa = phi i32 [ 0, %.lr.ph42 ], [ %24, %middle.block57 ], [ %43, %.lr.ph ]
  %25 = add nsw i32 %15, -1
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [30 x i32], ptr %2, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = add nsw i32 %28, %.024.lcssa
  %30 = icmp sgt i32 %15, 0
  br i1 %30, label %.lr.ph38.preheader, label %._crit_edge39

.lr.ph38.preheader:                               ; preds = %._crit_edge
  %31 = zext nneg i32 %16 to i64
  %32 = add nsw i64 %31, -1
  %smax50 = call i32 @llvm.smax.i32(i32 %16, i32 %25)
  %wide.trip.count51 = zext nneg i32 %smax50 to i64
  %33 = add nuw nsw i64 %wide.trip.count51, 1
  %34 = sub nsw i64 %33, %31
  %min.iters.check = icmp ult i64 %34, 8
  br i1 %min.iters.check, label %.lr.ph38.preheader74, label %vector.ph

.lr.ph38.preheader74:                             ; preds = %middle.block, %.lr.ph38.preheader
  %indvars.iv47.ph = phi i64 [ %32, %.lr.ph38.preheader ], [ %ind.end, %middle.block ]
  %.02335.ph = phi i32 [ 0, %.lr.ph38.preheader ], [ %40, %middle.block ]
  br label %.lr.ph38

vector.ph:                                        ; preds = %.lr.ph38.preheader
  %n.vec = and i64 %34, -8
  %ind.end = add nsw i64 %32, %n.vec
  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 i32> [ zeroinitializer, %vector.ph ], [ %37, %vector.body ]
  %vec.phi55 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %38, %vector.body ]
  %offset.idx = add i64 %32, %index
  %35 = getelementptr inbounds [30 x i32], ptr %2, i64 0, i64 %offset.idx
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  %wide.load = load <4 x i32>, ptr %35, align 4, !tbaa !5
  %wide.load56 = load <4 x i32>, ptr %36, align 4, !tbaa !5
  %37 = add <4 x i32> %wide.load, %vec.phi
  %38 = add <4 x i32> %wide.load56, %vec.phi55
  %index.next = add nuw i64 %index, 8
  %39 = icmp eq i64 %index.next, %n.vec
  br i1 %39, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %38, %37
  %40 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %34, %n.vec
  br i1 %cmp.n, label %._crit_edge39, label %.lr.ph38.preheader74

.lr.ph:                                           ; preds = %.lr.ph.preheader75, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader75 ]
  %.02431 = phi i32 [ %43, %.lr.ph ], [ %.02431.ph, %.lr.ph.preheader75 ]
  %41 = getelementptr inbounds [30 x i32], ptr %2, i64 0, i64 %indvars.iv
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, %.02431
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14

._crit_edge39:                                    ; preds = %.lr.ph38, %middle.block, %._crit_edge
  %.023.lcssa = phi i32 [ 0, %._crit_edge ], [ %40, %middle.block ], [ %52, %.lr.ph38 ]
  %44 = sub i32 %29, %.023.lcssa
  %45 = call i32 @llvm.abs.i32(i32 %44, i1 false)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %45)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %48 = load i32, ptr %0, align 4, !tbaa !5
  %49 = add nsw i32 %48, -1
  store i32 %49, ptr %0, align 4, !tbaa !5
  %.not = icmp eq i32 %48, 0
  br i1 %.not, label %._crit_edge43, label %.lr.ph42, !llvm.loop !15

.lr.ph38:                                         ; preds = %.lr.ph38.preheader74, %.lr.ph38
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %.lr.ph38 ], [ %indvars.iv47.ph, %.lr.ph38.preheader74 ]
  %.02335 = phi i32 [ %52, %.lr.ph38 ], [ %.02335.ph, %.lr.ph38.preheader74 ]
  %50 = getelementptr inbounds [30 x i32], ptr %2, i64 0, i64 %indvars.iv47
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, %.02335
  %indvars.iv.next48 = add nsw i64 %indvars.iv47, 1
  %exitcond52.not = icmp eq i64 %indvars.iv.next48, %wide.trip.count51
  br i1 %exitcond52.not, label %._crit_edge39, label %.lr.ph38, !llvm.loop !16

._crit_edge43:                                    ; preds = %._crit_edge39, %.preheader
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #6
  ret i32 0
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 = { inlinehint 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !11, !12}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !12, !11}


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