; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/IPC/IPC15P1A/Problem A/A.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"

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@a = external dso_local global [50 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 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)) #1

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

10:                                               ; preds = %20, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %23

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %17
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %18)
  br label %20

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !9

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

24:                                               ; preds = %36, %23
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = load i32, ptr %1, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %34, %33
  store i32 %35, ptr %3, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %29
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %4, align 4, !tbaa !5
  br label %24, !llvm.loop !11

39:                                               ; preds = %28
  %40 = load i32, ptr %1, align 4, !tbaa !5
  %41 = load i32, ptr %1, align 4, !tbaa !5
  %42 = sub nsw i32 %41, 1
  %43 = mul nsw i32 %40, %42
  %44 = sdiv i32 %43, 2
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sub nsw i32 %45, %44
  store i32 %46, ptr %3, align 4, !tbaa !5
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = icmp slt i32 %47, 0
  br i1 %48, label %54, label %49

49:                                               ; preds = %39
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = load i32, ptr %1, align 4, !tbaa !5
  %52 = srem i32 %50, %51
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %57

54:                                               ; preds = %49, %39
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 1, ptr %5, align 4
  br label %92

57:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = load i32, ptr %1, align 4, !tbaa !5
  %60 = sdiv i32 %58, %59
  store i32 %60, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %87, %57
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = load i32, ptr %1, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %90

66:                                               ; preds = %61
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = add nsw i32 %71, %72
  %74 = icmp sgt i32 %70, %73
  br i1 %74, label %75, label %86

75:                                               ; preds = %66
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = sub nsw i32 %79, %80
  %82 = load i32, ptr %8, align 4, !tbaa !5
  %83 = sub nsw i32 %81, %82
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = add nsw i32 %84, %83
  store i32 %85, ptr %7, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %75, %66
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %8, align 4, !tbaa !5
  br label %61, !llvm.loop !12

90:                                               ; preds = %65
  %91 = load i32, ptr %7, align 4, !tbaa !5
  call void @_Z2trIiJEEvT_DpRKT0_(i32 noundef %91)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  store i32 0, ptr %5, align 4
  br label %92

92:                                               ; preds = %90, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  %93 = load i32, ptr %5, align 4
  switch i32 %93, label %95 [
    i32 0, label %94
    i32 1, label %94
  ]

94:                                               ; preds = %92, %92
  ret void

95:                                               ; preds = %92
  unreachable
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2trIiJEEvT_DpRKT0_(i32 noundef) #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 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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}


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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@a = external dso_local global [50 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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 #0 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)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %2 = 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)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph
  %5 = icmp sgt i32 %14, 0
  br i1 %5, label %.lr.ph31.preheader, label %._crit_edge

.lr.ph31.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %14 to i64
  %min.iters.check = icmp ult i32 %14, 8
  br i1 %min.iters.check, label %.lr.ph31.preheader76, label %vector.ph

.lr.ph31.preheader76:                             ; preds = %middle.block, %.lr.ph31.preheader
  %indvars.iv42.ph = phi i64 [ 0, %.lr.ph31.preheader ], [ %n.vec, %middle.block ]
  %.02429.ph = phi i32 [ 0, %.lr.ph31.preheader ], [ %11, %middle.block ]
  br label %.lr.ph31

vector.ph:                                        ; preds = %.lr.ph31.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  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 ], [ %8, %vector.body ]
  %vec.phi54 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
  %6 = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %index
  %7 = getelementptr inbounds i8, ptr %6, i64 16
  %wide.load = load <4 x i32>, ptr %6, align 16, !tbaa !5
  %wide.load55 = load <4 x i32>, ptr %7, align 16, !tbaa !5
  %8 = add <4 x i32> %wide.load, %vec.phi
  %9 = add <4 x i32> %wide.load55, %vec.phi54
  %index.next = add nuw i64 %index, 8
  %10 = icmp eq i64 %index.next, %n.vec
  br i1 %10, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %9, %8
  %11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph31.preheader76

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %indvars.iv
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = icmp slt i64 %indvars.iv.next, %15
  br i1 %16, label %.lr.ph, label %.preheader, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph31, %middle.block, %0, %.preheader
  %17 = phi i1 [ false, %.preheader ], [ false, %0 ], [ %5, %middle.block ], [ %5, %.lr.ph31 ]
  %.lcssa51 = phi i32 [ %14, %.preheader ], [ %3, %0 ], [ %14, %middle.block ], [ %14, %.lr.ph31 ]
  %.024.lcssa = phi i32 [ 0, %.preheader ], [ 0, %0 ], [ %11, %middle.block ], [ %24, %.lr.ph31 ]
  %18 = add nsw i32 %.lcssa51, -1
  %19 = mul nsw i32 %18, %.lcssa51
  %.neg = sdiv i32 %19, -2
  %20 = add i32 %.024.lcssa, %.neg
  %21 = icmp slt i32 %20, 0
  br i1 %21, label %27, label %25

.lr.ph31:                                         ; preds = %.lr.ph31.preheader76, %.lr.ph31
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %.lr.ph31 ], [ %indvars.iv42.ph, %.lr.ph31.preheader76 ]
  %.02429 = phi i32 [ %24, %.lr.ph31 ], [ %.02429.ph, %.lr.ph31.preheader76 ]
  %22 = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %indvars.iv42
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = add nsw i32 %23, %.02429
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph31, !llvm.loop !14

25:                                               ; preds = %._crit_edge
  %26 = srem i32 %20, %.lcssa51
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %30, label %27

27:                                               ; preds = %25, %._crit_edge
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %53

30:                                               ; preds = %25
  br i1 %17, label %.lr.ph36.preheader, label %._crit_edge37

.lr.ph36.preheader:                               ; preds = %30
  %31 = udiv i32 %20, %.lcssa51
  %wide.trip.count48 = zext nneg i32 %.lcssa51 to i64
  %min.iters.check58 = icmp ult i32 %.lcssa51, 8
  br i1 %min.iters.check58, label %.lr.ph36.preheader74, label %vector.ph59

.lr.ph36.preheader74:                             ; preds = %middle.block56, %.lr.ph36.preheader
  %indvars.iv45.ph = phi i64 [ 0, %.lr.ph36.preheader ], [ %n.vec61, %middle.block56 ]
  %.02133.ph = phi i32 [ 0, %.lr.ph36.preheader ], [ %45, %middle.block56 ]
  br label %.lr.ph36

vector.ph59:                                      ; preds = %.lr.ph36.preheader
  %n.vec61 = and i64 %wide.trip.count48, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %31, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body63

vector.body63:                                    ; preds = %vector.body63, %vector.ph59
  %index64 = phi i64 [ 0, %vector.ph59 ], [ %index.next70, %vector.body63 ]
  %vec.phi65 = phi <4 x i32> [ zeroinitializer, %vector.ph59 ], [ %42, %vector.body63 ]
  %vec.phi66 = phi <4 x i32> [ zeroinitializer, %vector.ph59 ], [ %43, %vector.body63 ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph59 ], [ %vec.ind.next, %vector.body63 ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %32 = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %index64
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  %wide.load68 = load <4 x i32>, ptr %32, align 16, !tbaa !5
  %wide.load69 = load <4 x i32>, ptr %33, align 16, !tbaa !5
  %34 = add <4 x i32> %broadcast.splat, %vec.ind
  %35 = add <4 x i32> %broadcast.splat, %step.add
  %36 = icmp sgt <4 x i32> %wide.load68, %34
  %37 = icmp sgt <4 x i32> %wide.load69, %35
  %38 = sub <4 x i32> %wide.load68, %34
  %39 = sub <4 x i32> %wide.load69, %35
  %40 = select <4 x i1> %36, <4 x i32> %38, <4 x i32> zeroinitializer
  %41 = select <4 x i1> %37, <4 x i32> %39, <4 x i32> zeroinitializer
  %42 = add <4 x i32> %40, %vec.phi65
  %43 = add <4 x i32> %41, %vec.phi66
  %index.next70 = add nuw i64 %index64, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %44 = icmp eq i64 %index.next70, %n.vec61
  br i1 %44, label %middle.block56, label %vector.body63, !llvm.loop !15

middle.block56:                                   ; preds = %vector.body63
  %bin.rdx71 = add <4 x i32> %43, %42
  %45 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx71)
  %cmp.n72 = icmp eq i64 %n.vec61, %wide.trip.count48
  br i1 %cmp.n72, label %._crit_edge37, label %.lr.ph36.preheader74

._crit_edge37:                                    ; preds = %.lr.ph36, %middle.block56, %30
  %.021.lcssa = phi i32 [ 0, %30 ], [ %45, %middle.block56 ], [ %.1, %.lr.ph36 ]
  call void @_Z2trIiJEEvT_DpRKT0_(i32 noundef %.021.lcssa)
  br label %53

.lr.ph36:                                         ; preds = %.lr.ph36.preheader74, %.lr.ph36
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %.lr.ph36 ], [ %indvars.iv45.ph, %.lr.ph36.preheader74 ]
  %.02133 = phi i32 [ %.1, %.lr.ph36 ], [ %.02133.ph, %.lr.ph36.preheader74 ]
  %46 = getelementptr inbounds [50 x i32], ptr @a, i64 0, i64 %indvars.iv45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = trunc i64 %indvars.iv45 to i32
  %49 = add i32 %31, %48
  %50 = icmp sgt i32 %47, %49
  %51 = sub i32 %47, %49
  %52 = select i1 %50, i32 %51, i32 0
  %.1 = add nsw i32 %52, %.02133
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %exitcond49.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count48
  br i1 %exitcond49.not, label %._crit_edge37, label %.lr.ph36, !llvm.loop !16

53:                                               ; preds = %._crit_edge37, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret void
}

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

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

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

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

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

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

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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !10, !12, !11}


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