; LLVM IR from upupming/algorithm :: kick-start/2019/2019B-B.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"

@n = external dso_local global i32, align 4
@s = external dso_local global [110 x i32], align 16
@e = external dso_local global [110 x i32], align 16
@l = external dso_local global [110 x i32], align 16
@idx = external dso_local global [110 x i32], align 16
@dp = external dso_local global [10010 x i32], align 16
@ts = external dso_local global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3cmpii(i32 noundef, i32 noundef) #0

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

12:                                               ; preds = %22, %0
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %12
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [110 x i32], ptr @idx, i64 0, i64 %20
  store i32 %18, ptr %21, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %17
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %1, align 4, !tbaa !5
  br label %12, !llvm.loop !9

25:                                               ; preds = %16
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr @idx, i64 %27
  call void @_ZSt4sortIPiPFiiiEEvT_S3_T0_(ptr noundef @idx, ptr noundef %28, ptr noundef @_Z3cmpii)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %38, %25
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr @ts, align 4, !tbaa !5
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %41

34:                                               ; preds = %29
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %36
  store i32 0, ptr %37, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %34
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !5
  br label %29, !llvm.loop !11

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

42:                                               ; preds = %102, %41
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %105

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [110 x i32], ptr @idx, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  store i32 %51, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %52 = load i32, ptr @ts, align 4, !tbaa !5
  store i32 %52, ptr %6, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %98, %47
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [110 x i32], ptr @s, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp sge i32 %54, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %53
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %101

61:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [110 x i32], ptr @s, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = sub nsw i32 %62, %66
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %68
  %70 = load i32, ptr %69, 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
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [110 x i32], ptr @e, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [110 x i32], ptr @l, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [110 x i32], ptr @s, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = sub nsw i32 %79, %83
  %85 = mul nsw i32 %78, %84
  %86 = sub nsw i32 %74, %85
  store i32 %86, ptr %9, align 4, !tbaa !5
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %70, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  store i32 %89, ptr %7, align 4, !tbaa !5
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %91
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %92, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %96
  store i32 %94, ptr %97, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %98

98:                                               ; preds = %61
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = add nsw i32 %99, -1
  store i32 %100, ptr %6, align 4, !tbaa !5
  br label %53, !llvm.loop !12

101:                                              ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %3, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %3, align 4, !tbaa !5
  br label %42, !llvm.loop !13

105:                                              ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %117, %105
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = load i32, ptr @ts, align 4, !tbaa !5
  %109 = icmp sle i32 %107, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %106
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %120

111:                                              ; preds = %106
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %113
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %114)
  %116 = load i32, ptr %115, align 4, !tbaa !5
  store i32 %116, ptr %10, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %111
  %118 = load i32, ptr %11, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %11, align 4, !tbaa !5
  br label %106, !llvm.loop !14

120:                                              ; preds = %110
  %121 = load i32, ptr %10, align 4, !tbaa !5
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  ret i32 %121
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFiiiEEvT_S3_T0_(ptr noundef, ptr noundef, ptr noundef) #3

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

attributes #0 = { 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 #1 = { 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 = { 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 #4 = { 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 #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}
!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"

@n = external dso_local local_unnamed_addr global i32, align 4
@s = external dso_local local_unnamed_addr global [110 x i32], align 16
@e = external dso_local local_unnamed_addr global [110 x i32], align 16
@l = external dso_local local_unnamed_addr global [110 x i32], align 16
@idx = external dso_local global [110 x i32], align 16
@dp = external dso_local global [10010 x i32], align 16
@ts = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3cmpii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5solvev() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph.preheader, label %._crit_edge

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

.lr.ph.preheader65:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.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.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %7 = getelementptr inbounds [110 x i32], ptr @idx, i64 0, i64 %index
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  store <4 x i32> %vec.ind, ptr %7, align 16, !tbaa !5
  store <4 x i32> %step.add, ptr %8, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %9 = icmp eq i64 %index.next, %n.vec
  br i1 %9, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader65

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %0
  %10 = sext i32 %5 to i64
  %11 = getelementptr inbounds i32, ptr @idx, i64 %10
  tail call void @_ZSt4sortIPiPFiiiEEvT_S3_T0_(ptr noundef nonnull @idx, ptr noundef nonnull %11, ptr noundef nonnull @_Z3cmpii)
  %12 = load i32, ptr @ts, align 4, !tbaa !5
  %.not33 = icmp slt i32 %12, 0
  br i1 %.not33, label %.preheader, label %.lr.ph36.preheader

.lr.ph36.preheader:                               ; preds = %._crit_edge
  %13 = add nuw i32 %12, 1
  %14 = zext i32 %13 to i64
  %15 = shl nuw nsw i64 %14, 2
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @dp, i8 0, i64 %15, i1 false), !tbaa !5
  br label %.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader65, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader65 ]
  %16 = getelementptr inbounds [110 x i32], ptr @idx, i64 0, i64 %indvars.iv
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %17, ptr %16, align 4, !tbaa !5
  %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 !13

.preheader:                                       ; preds = %.lr.ph36.preheader, %._crit_edge
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph43, label %._crit_edge44

._crit_edge44.loopexit:                           ; preds = %._crit_edge41
  %.pre63 = load i32, ptr @ts, align 4, !tbaa !5
  br label %._crit_edge44

._crit_edge44:                                    ; preds = %._crit_edge44.loopexit, %.preheader
  %20 = phi i32 [ %.pre63, %._crit_edge44.loopexit ], [ %12, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  %.not2945 = icmp slt i32 %20, 0
  br i1 %.not2945, label %._crit_edge49, label %.lr.ph48

.lr.ph43:                                         ; preds = %.preheader, %._crit_edge41
  %21 = phi i32 [ %31, %._crit_edge41 ], [ %18, %.preheader ]
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %._crit_edge41 ], [ 0, %.preheader ]
  %22 = getelementptr inbounds [110 x i32], ptr @idx, i64 0, i64 %indvars.iv57
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = load i32, ptr @ts, align 4, !tbaa !5
  %25 = sext i32 %23 to i64
  %26 = getelementptr inbounds [110 x i32], ptr @s, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %.not3037 = icmp slt i32 %24, %27
  br i1 %.not3037, label %._crit_edge41, label %.lr.ph40

.lr.ph40:                                         ; preds = %.lr.ph43
  %28 = getelementptr inbounds [110 x i32], ptr @e, i64 0, i64 %25
  %29 = getelementptr inbounds [110 x i32], ptr @l, i64 0, i64 %25
  %30 = sext i32 %24 to i64
  br label %34

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

._crit_edge41:                                    ; preds = %._crit_edge41.loopexit, %.lr.ph43
  %31 = phi i32 [ %.pre, %._crit_edge41.loopexit ], [ %21, %.lr.ph43 ]
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next58, %32
  br i1 %33, label %.lr.ph43, label %._crit_edge44.loopexit, !llvm.loop !14

34:                                               ; preds = %.lr.ph40, %34
  %indvars.iv54 = phi i64 [ %30, %.lr.ph40 ], [ %indvars.iv.next55, %34 ]
  %35 = phi i32 [ %27, %.lr.ph40 ], [ %50, %34 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %36 = sext i32 %35 to i64
  %37 = sub nsw i64 %indvars.iv54, %36
  %38 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %40 = load i32, ptr %28, align 4, !tbaa !5
  %41 = load i32, ptr %29, align 4, !tbaa !5
  %42 = trunc nsw i64 %indvars.iv54 to i32
  %.neg = sub i32 %35, %42
  %.neg31 = mul i32 %41, %.neg
  %43 = add i32 %.neg31, %40
  store i32 %43, ptr %3, align 4, !tbaa !5
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = add nsw i32 %45, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  store i32 %46, ptr %1, align 4, !tbaa !5
  %47 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %indvars.iv54
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %47, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %49 = load i32, ptr %48, align 4, !tbaa !5
  store i32 %49, ptr %47, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %indvars.iv.next55 = add nsw i64 %indvars.iv54, -1
  %50 = load i32, ptr %26, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %.not30.not = icmp sgt i64 %indvars.iv54, %51
  br i1 %.not30.not, label %34, label %._crit_edge41.loopexit, !llvm.loop !15

._crit_edge49:                                    ; preds = %.lr.ph48, %._crit_edge44
  %52 = phi i32 [ 0, %._crit_edge44 ], [ %55, %.lr.ph48 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  ret i32 %52

.lr.ph48:                                         ; preds = %._crit_edge44, %.lr.ph48
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %.lr.ph48 ], [ 0, %._crit_edge44 ]
  %53 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %indvars.iv60
  %54 = 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) %53)
  %55 = load i32, ptr %54, align 4, !tbaa !5
  store i32 %55, ptr %4, align 4, !tbaa !5
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %56 = load i32, ptr @ts, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %.not29.not = icmp slt i64 %indvars.iv60, %57
  br i1 %.not29.not, label %.lr.ph48, label %._crit_edge49, !llvm.loop !16
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFiiiEEvT_S3_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

attributes #0 = { 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 #1 = { 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 = { 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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