; LLVM IR from tangjz/acm-icpc :: lydsy (5438)

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

@t = external dso_local global i32, align 4
@mx = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dt = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@b = external dso_local global [100001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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 i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %13

13:                                               ; preds = %128, %126, %0
  %14 = load i32, ptr @t, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr @t, align 4, !tbaa !5
  %16 = icmp ne i32 %14, 0
  br i1 %16, label %17, label %129

17:                                               ; preds = %13
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @mx, ptr noundef @n, ptr noundef @m, ptr noundef @dt)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %29, %17
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds i32, ptr @a, i64 %26
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %27)
  br label %29

29:                                               ; preds = %24
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !9

32:                                               ; preds = %23
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i32, ptr @a, i64 %34
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @a, ptr noundef %35)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %46, %32
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr @m, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %49

41:                                               ; preds = %36
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i32, ptr @b, i64 %43
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %44)
  br label %46

46:                                               ; preds = %41
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %3, align 4, !tbaa !5
  br label %36, !llvm.loop !11

49:                                               ; preds = %40
  %50 = load i32, ptr @m, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr @b, i64 %51
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @b, ptr noundef %52)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %54 = load i32, ptr %53, align 4, !tbaa !5
  store i32 %54, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = call noundef i32 @_Z5solvei(i32 noundef %55)
  store i32 %56, ptr %6, align 4, !tbaa !5
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %59, label %84

59:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = load i32, ptr @a, align 16, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = mul nsw i64 %61, %63
  store i64 %64, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %78, %59
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %81

70:                                               ; preds = %65
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = load i64, ptr %7, align 8, !tbaa !12
  %77 = add nsw i64 %76, %75
  store i64 %77, ptr %7, align 8, !tbaa !12
  br label %78

78:                                               ; preds = %70
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %8, align 4, !tbaa !5
  br label %65, !llvm.loop !14

81:                                               ; preds = %69
  %82 = load i64, ptr %7, align 8, !tbaa !12
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %82)
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %126

84:                                               ; preds = %49
  br label %85

85:                                               ; preds = %103, %84
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %89, label %104

89:                                               ; preds = %85
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = add nsw i32 %90, %91
  %93 = add nsw i32 %92, 1
  %94 = ashr i32 %93, 1
  store i32 %94, ptr %6, align 4, !tbaa !5
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = call noundef i32 @_Z5solvei(i32 noundef %95)
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %101

98:                                               ; preds = %89
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  store i32 %100, ptr %5, align 4, !tbaa !5
  br label %103

101:                                              ; preds = %89
  %102 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %102, ptr %4, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %101, %98
  br label %85, !llvm.loop !15

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

105:                                              ; preds = %120, %104
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = sub nsw i32 %107, %108
  %110 = icmp slt i32 %106, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %105
  store i32 15, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %123

112:                                              ; preds = %105
  %113 = load i32, ptr %11, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = load i64, ptr %10, align 8, !tbaa !12
  %119 = add nsw i64 %118, %117
  store i64 %119, ptr %10, align 8, !tbaa !12
  br label %120

120:                                              ; preds = %112
  %121 = load i32, ptr %11, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %11, align 4, !tbaa !5
  br label %105, !llvm.loop !16

123:                                              ; preds = %111
  %124 = load i64, ptr %10, align 8, !tbaa !12
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %124)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  store i32 0, ptr %9, align 4
  br label %126

126:                                              ; preds = %123, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %127 = load i32, ptr %9, align 4
  switch i32 %127, label %130 [
    i32 0, label %128
    i32 2, label %13
  ]

128:                                              ; preds = %126
  br label %13, !llvm.loop !17

129:                                              ; preds = %13
  ret i32 0

130:                                              ; preds = %126
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

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

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

declare i32 @printf(ptr noundef, ...) #3

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { 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 = { 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 #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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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"

@t = external dso_local global i32, align 4
@mx = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@dt = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@b = external dso_local global [100001 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not62 = icmp eq i32 %2, 0
  br i1 %.not62, label %._crit_edge65, label %.lr.ph64

.lr.ph64:                                         ; preds = %0, %._crit_edge60
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @mx, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @dt)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.lr.ph64.._crit_edge_crit_edge

.lr.ph64.._crit_edge_crit_edge:                   ; preds = %.lr.ph64
  %.pre = sext i32 %5 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph64.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.lr.ph64.._crit_edge_crit_edge ], [ %13, %.lr.ph ]
  %7 = getelementptr inbounds i32, ptr @a, i64 %.pre-phi
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @a, ptr noundef nonnull %7)
  %8 = load i32, ptr @m, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph44, label %._crit_edge.._crit_edge45_crit_edge

._crit_edge.._crit_edge45_crit_edge:              ; preds = %._crit_edge
  %.pre82 = sext i32 %8 to i64
  br label %._crit_edge45

.lr.ph:                                           ; preds = %.lr.ph64, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph64 ]
  %10 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %10)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = icmp slt i64 %indvars.iv.next, %13
  br i1 %14, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge45:                                    ; preds = %.lr.ph44, %._crit_edge.._crit_edge45_crit_edge
  %.pre-phi83 = phi i64 [ %.pre82, %._crit_edge.._crit_edge45_crit_edge ], [ %24, %.lr.ph44 ]
  %15 = getelementptr inbounds i32, ptr @b, i64 %.pre-phi83
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @b, ptr noundef nonnull %15)
  %16 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @n, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = tail call noundef i32 @_Z5solvei(i32 noundef 1)
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %26, label %.preheader39

.preheader39:                                     ; preds = %._crit_edge45
  %20 = icmp sgt i32 %17, 1
  br i1 %20, label %.lr.ph49, label %.preheader

.lr.ph44:                                         ; preds = %._crit_edge, %.lr.ph44
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %.lr.ph44 ], [ 0, %._crit_edge ]
  %21 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv71
  %22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %21)
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %23 = load i32, ptr @m, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = icmp slt i64 %indvars.iv.next72, %24
  br i1 %25, label %.lr.ph44, label %._crit_edge45, !llvm.loop !11

26:                                               ; preds = %._crit_edge45
  %27 = zext nneg i32 %18 to i64
  %28 = load i32, ptr @a, align 16, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = mul nsw i64 %29, %27
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 1
  br i1 %32, label %.lr.ph59.preheader, label %._crit_edge60

.lr.ph59.preheader:                               ; preds = %26
  %wide.trip.count80 = zext nneg i32 %31 to i64
  %33 = add nsw i64 %wide.trip.count80, -1
  %min.iters.check = icmp ult i32 %31, 5
  br i1 %min.iters.check, label %.lr.ph59.preheader110, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph59.preheader
  %n.vec = and i64 %33, -4
  %ind.end = or disjoint i64 %n.vec, 1
  %34 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %30, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ %34, %vector.ph ], [ %39, %vector.body ]
  %vec.phi91 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %40, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %35 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %offset.idx
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %wide.load = load <2 x i32>, ptr %35, align 4, !tbaa !5
  %wide.load92 = load <2 x i32>, ptr %36, align 4, !tbaa !5
  %37 = sext <2 x i32> %wide.load to <2 x i64>
  %38 = sext <2 x i32> %wide.load92 to <2 x i64>
  %39 = add <2 x i64> %vec.phi, %37
  %40 = add <2 x i64> %vec.phi91, %38
  %index.next = add nuw i64 %index, 4
  %41 = icmp eq i64 %index.next, %n.vec
  br i1 %41, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %40, %39
  %42 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %33, %n.vec
  br i1 %cmp.n, label %._crit_edge60, label %.lr.ph59.preheader110

.lr.ph59.preheader110:                            ; preds = %middle.block, %.lr.ph59.preheader
  %indvars.iv77.ph = phi i64 [ 1, %.lr.ph59.preheader ], [ %ind.end, %middle.block ]
  %.02956.ph = phi i64 [ %30, %.lr.ph59.preheader ], [ %42, %middle.block ]
  br label %.lr.ph59

.lr.ph59:                                         ; preds = %.lr.ph59.preheader110, %.lr.ph59
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %.lr.ph59 ], [ %indvars.iv77.ph, %.lr.ph59.preheader110 ]
  %.02956 = phi i64 [ %46, %.lr.ph59 ], [ %.02956.ph, %.lr.ph59.preheader110 ]
  %43 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv77
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = add nsw i64 %.02956, %45
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond81.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count80
  br i1 %exitcond81.not, label %._crit_edge60, label %.lr.ph59, !llvm.loop !15

.preheader:                                       ; preds = %.lr.ph49, %.preheader39
  %.031.lcssa = phi i32 [ 1, %.preheader39 ], [ %.132, %.lr.ph49 ]
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sub nsw i32 %47, %.031.lcssa
  %49 = icmp sgt i32 %48, 0
  br i1 %49, label %.lr.ph53.preheader, label %._crit_edge60

.lr.ph53.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %48 to i64
  %min.iters.check95 = icmp ult i32 %48, 4
  br i1 %min.iters.check95, label %.lr.ph53.preheader111, label %vector.ph96

.lr.ph53.preheader111:                            ; preds = %middle.block93, %.lr.ph53.preheader
  %indvars.iv74.ph = phi i64 [ 0, %.lr.ph53.preheader ], [ %n.vec98, %middle.block93 ]
  %.02751.ph = phi i64 [ 0, %.lr.ph53.preheader ], [ %57, %middle.block93 ]
  br label %.lr.ph53

vector.ph96:                                      ; preds = %.lr.ph53.preheader
  %n.vec98 = and i64 %wide.trip.count, 2147483644
  br label %vector.body100

vector.body100:                                   ; preds = %vector.body100, %vector.ph96
  %index101 = phi i64 [ 0, %vector.ph96 ], [ %index.next106, %vector.body100 ]
  %vec.phi102 = phi <2 x i64> [ zeroinitializer, %vector.ph96 ], [ %54, %vector.body100 ]
  %vec.phi103 = phi <2 x i64> [ zeroinitializer, %vector.ph96 ], [ %55, %vector.body100 ]
  %50 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %index101
  %51 = getelementptr inbounds i8, ptr %50, i64 8
  %wide.load104 = load <2 x i32>, ptr %50, align 16, !tbaa !5
  %wide.load105 = load <2 x i32>, ptr %51, align 8, !tbaa !5
  %52 = sext <2 x i32> %wide.load104 to <2 x i64>
  %53 = sext <2 x i32> %wide.load105 to <2 x i64>
  %54 = add <2 x i64> %vec.phi102, %52
  %55 = add <2 x i64> %vec.phi103, %53
  %index.next106 = add nuw i64 %index101, 4
  %56 = icmp eq i64 %index.next106, %n.vec98
  br i1 %56, label %middle.block93, label %vector.body100, !llvm.loop !16

middle.block93:                                   ; preds = %vector.body100
  %bin.rdx107 = add <2 x i64> %55, %54
  %57 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx107)
  %cmp.n108 = icmp eq i64 %n.vec98, %wide.trip.count
  br i1 %cmp.n108, label %._crit_edge60, label %.lr.ph53.preheader111

.lr.ph49:                                         ; preds = %.preheader39, %.lr.ph49
  %.03048 = phi i32 [ %.1, %.lr.ph49 ], [ %17, %.preheader39 ]
  %.03147 = phi i32 [ %.132, %.lr.ph49 ], [ 1, %.preheader39 ]
  %58 = add nuw nsw i32 %.03147, 1
  %59 = add nuw nsw i32 %58, %.03048
  %60 = lshr i32 %59, 1
  %61 = tail call noundef i32 @_Z5solvei(i32 noundef %60)
  %.not38 = icmp eq i32 %61, 0
  %62 = add nsw i32 %60, -1
  %.132 = select i1 %.not38, i32 %60, i32 %.03147
  %.1 = select i1 %.not38, i32 %.03048, i32 %62
  %63 = icmp slt i32 %.132, %.1
  br i1 %63, label %.lr.ph49, label %.preheader, !llvm.loop !17

.lr.ph53:                                         ; preds = %.lr.ph53.preheader111, %.lr.ph53
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph53 ], [ %indvars.iv74.ph, %.lr.ph53.preheader111 ]
  %.02751 = phi i64 [ %67, %.lr.ph53 ], [ %.02751.ph, %.lr.ph53.preheader111 ]
  %64 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv74
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = add nsw i64 %.02751, %66
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge60, label %.lr.ph53, !llvm.loop !18

._crit_edge60:                                    ; preds = %.lr.ph53, %.lr.ph59, %middle.block93, %middle.block, %.preheader, %26
  %.027.lcssa.sink = phi i64 [ %30, %26 ], [ 0, %.preheader ], [ %42, %middle.block ], [ %57, %middle.block93 ], [ %46, %.lr.ph59 ], [ %67, %.lr.ph53 ]
  %68 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.027.lcssa.sink)
  %69 = load i32, ptr @t, align 4, !tbaa !5
  %70 = add nsw i32 %69, -1
  store i32 %70, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %69, 0
  br i1 %.not, label %._crit_edge65, label %.lr.ph64

._crit_edge65:                                    ; preds = %._crit_edge60, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 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 #2 = { nofree nounwind "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 = { 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 nosync nounwind speculatable willreturn memory(none) }

!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, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}
!16 = distinct !{!16, !10, !13, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !14, !13}


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