; LLVM IR from tangjz/acm-icpc :: lydsy/1039.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"

@m = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@idx = external dso_local global [400020 x i32], align 16
@fir = external dso_local global [400020 x i32], align 16
@sz = external dso_local global [400020 x i32], align 16
@len = external dso_local global i32, align 4
@pL = external dso_local global i32, align 4
@pR = external dso_local global i32, align 4
@ans = external dso_local global [200010 x i32], align 16
@sa = external dso_local global [1650050 x i32], align 16
@rk = external dso_local global [1650050 x i32], align 16
@ht = external dso_local global [1650050 x i32], align 16
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8seg_initii(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9seg_findLiiiiRi(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9seg_findRiiiiRi(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #1 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = load i32, ptr @len, align 4, !tbaa !5
  %9 = sub nsw i32 %8, 1
  call void @_Z8seg_initii(i32 noundef 0, i32 noundef %9)
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  store ptr @ht, ptr %1, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %43, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @len, 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) #3
  br label %46

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %25

18:                                               ; preds = %15
  %19 = load ptr, ptr %1, align 8, !tbaa !9
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sub nsw i32 %20, 1
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i32, ptr %19, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  br label %26

25:                                               ; preds = %15
  br label %26

26:                                               ; preds = %25, %18
  %27 = phi i32 [ %24, %18 ], [ 0, %25 ]
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1650050 x i32], ptr @sa, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = load i32, ptr @tot, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [400020 x i32], ptr @fir, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = icmp sge i32 %31, %35
  %37 = zext i1 %36 to i32
  %38 = add nsw i32 %27, %37
  %39 = load ptr, ptr %1, align 8, !tbaa !9
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr %39, i64 %41
  store i32 %38, ptr %42, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %26
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !11

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

47:                                               ; preds = %121, %46
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = load i32, ptr @tot, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %124

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [400020 x i32], ptr @fir, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [1650050 x i32], ptr @rk, i64 0, i64 %57
  store ptr %58, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [400020 x i32], ptr @sz, i64 0, i64 %60
  store ptr %61, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %62 = load i32, ptr @len, align 4, !tbaa !5
  %63 = sub nsw i32 %62, 1
  %64 = load ptr, ptr %4, align 8, !tbaa !9
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load ptr, ptr %5, align 8, !tbaa !9
  %67 = load i32, ptr %66, align 4, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @_Z9seg_findLiiiiRi(i32 noundef 0, i32 noundef %63, i32 noundef %65, i32 noundef %67, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %70, label %71

70:                                               ; preds = %52
  store i32 0, ptr @pL, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %70, %52
  %72 = load ptr, ptr %4, align 8, !tbaa !9
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  %75 = load i32, ptr @len, align 4, !tbaa !5
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %77, label %91

77:                                               ; preds = %71
  %78 = load i32, ptr @len, align 4, !tbaa !5
  %79 = sub nsw i32 %78, 1
  %80 = load ptr, ptr %4, align 8, !tbaa !9
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  %83 = load ptr, ptr %5, align 8, !tbaa !9
  %84 = load i32, ptr %83, align 4, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @_Z9seg_findRiiiiRi(i32 noundef 0, i32 noundef %79, i32 noundef %82, i32 noundef %84, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = icmp eq i32 %85, 1
  br i1 %86, label %87, label %90

87:                                               ; preds = %77
  %88 = load i32, ptr @len, align 4, !tbaa !5
  %89 = sub nsw i32 %88, 1
  store i32 %89, ptr @pR, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %87, %77
  br label %94

91:                                               ; preds = %71
  %92 = load ptr, ptr %4, align 8, !tbaa !9
  %93 = load i32, ptr %92, align 4, !tbaa !5
  store i32 %93, ptr @pR, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %91, %90
  %95 = load ptr, ptr %1, align 8, !tbaa !9
  %96 = load i32, ptr @pR, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i32, ptr %95, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = load i32, ptr @pL, align 4, !tbaa !5
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %109

102:                                              ; preds = %94
  %103 = load ptr, ptr %1, align 8, !tbaa !9
  %104 = load i32, ptr @pL, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i32, ptr %103, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  br label %110

109:                                              ; preds = %94
  br label %110

110:                                              ; preds = %109, %102
  %111 = phi i32 [ %108, %102 ], [ 0, %109 ]
  %112 = sub nsw i32 %99, %111
  %113 = load i32, ptr %3, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [400020 x i32], ptr @idx, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = add nsw i32 %119, %112
  store i32 %120, ptr %118, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  br label %121

121:                                              ; preds = %110
  %122 = load i32, ptr %3, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %3, align 4, !tbaa !5
  br label %47, !llvm.loop !13

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

125:                                              ; preds = %136, %124
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = load i32, ptr @m, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %139

130:                                              ; preds = %125
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %134)
  br label %136

136:                                              ; preds = %130
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %7, align 4, !tbaa !5
  br label %125, !llvm.loop !14

139:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  ret void
}

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@m = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@idx = external dso_local local_unnamed_addr global [400020 x i32], align 16
@fir = external dso_local local_unnamed_addr global [400020 x i32], align 16
@sz = external dso_local local_unnamed_addr global [400020 x i32], align 16
@len = external dso_local local_unnamed_addr global i32, align 4
@pL = external dso_local local_unnamed_addr global i32, align 4
@pR = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global [200010 x i32], align 16
@sa = external dso_local local_unnamed_addr global [1650050 x i32], align 16
@rk = external dso_local local_unnamed_addr global [1650050 x i32], align 16
@ht = external dso_local local_unnamed_addr global [1650050 x i32], align 16
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8seg_initii(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9seg_findLiiiiRi(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9seg_findRiiiiRi(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = load i32, ptr @len, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  tail call void @_Z8seg_initii(i32 noundef 0, i32 noundef %3)
  %4 = load i32, ptr @len, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br i1 %5, label %6, label %.preheader29

6:                                                ; preds = %0
  %7 = sext i32 %.pre to i64
  %8 = getelementptr inbounds [400020 x i32], ptr @fir, i64 0, i64 %7
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = load i32, ptr @sa, align 16, !tbaa !5
  %11 = icmp sge i32 %10, %9
  %12 = zext i1 %11 to i32
  store i32 %12, ptr @ht, align 16, !tbaa !5
  %exitcond.peel.not = icmp eq i32 %4, 1
  br i1 %exitcond.peel.not, label %.preheader29, label %.peel.next.preheader

.peel.next.preheader:                             ; preds = %6
  %wide.trip.count = zext nneg i32 %4 to i64
  %load_initial = load i32, ptr @ht, align 16
  %13 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %13, 1
  %14 = icmp eq i32 %4, 2
  br i1 %14, label %.preheader29.loopexit.unr-lcssa, label %.peel.next.preheader.new

.peel.next.preheader.new:                         ; preds = %.peel.next.preheader
  %unroll_iter = and i64 %13, -2
  br label %.peel.next

.preheader29.loopexit.unr-lcssa:                  ; preds = %.peel.next, %.peel.next.preheader
  %store_forwarded.unr = phi i32 [ %load_initial, %.peel.next.preheader ], [ %32, %.peel.next ]
  %indvars.iv.unr = phi i64 [ 1, %.peel.next.preheader ], [ %indvars.iv.next.1, %.peel.next ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader29, label %.peel.next.epil

.peel.next.epil:                                  ; preds = %.preheader29.loopexit.unr-lcssa
  %15 = getelementptr inbounds [1650050 x i32], ptr @sa, i64 0, i64 %indvars.iv.unr
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = icmp sge i32 %16, %9
  %18 = zext i1 %17 to i32
  %19 = add nsw i32 %store_forwarded.unr, %18
  %20 = getelementptr inbounds i32, ptr @ht, i64 %indvars.iv.unr
  store i32 %19, ptr %20, align 4, !tbaa !5
  br label %.preheader29

.preheader29:                                     ; preds = %.peel.next.epil, %.preheader29.loopexit.unr-lcssa, %6, %0
  %21 = icmp sgt i32 %.pre, 0
  br i1 %21, label %.lr.ph33, label %.preheader

.peel.next:                                       ; preds = %.peel.next, %.peel.next.preheader.new
  %store_forwarded = phi i32 [ %load_initial, %.peel.next.preheader.new ], [ %32, %.peel.next ]
  %indvars.iv = phi i64 [ 1, %.peel.next.preheader.new ], [ %indvars.iv.next.1, %.peel.next ]
  %niter = phi i64 [ 0, %.peel.next.preheader.new ], [ %niter.next.1, %.peel.next ]
  %22 = getelementptr inbounds [1650050 x i32], ptr @sa, i64 0, i64 %indvars.iv
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = icmp sge i32 %23, %9
  %25 = zext i1 %24 to i32
  %26 = add nsw i32 %store_forwarded, %25
  %27 = getelementptr inbounds i32, ptr @ht, i64 %indvars.iv
  store i32 %26, ptr %27, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = getelementptr inbounds [1650050 x i32], ptr @sa, i64 0, i64 %indvars.iv.next
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = icmp sge i32 %29, %9
  %31 = zext i1 %30 to i32
  %32 = add nsw i32 %26, %31
  %33 = getelementptr inbounds i32, ptr @ht, i64 %indvars.iv.next
  store i32 %32, ptr %33, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader29.loopexit.unr-lcssa, label %.peel.next, !llvm.loop !9

.preheader:                                       ; preds = %71, %.preheader29
  %34 = load i32, ptr @m, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph35, label %._crit_edge

.lr.ph33:                                         ; preds = %.preheader29, %71
  %36 = phi i32 [ %63, %71 ], [ %4, %.preheader29 ]
  %indvars.iv38 = phi i64 [ %indvars.iv.next39, %71 ], [ 0, %.preheader29 ]
  %37 = getelementptr inbounds [400020 x i32], ptr @fir, i64 0, i64 %indvars.iv38
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [1650050 x i32], ptr @rk, i64 0, i64 %39
  %41 = getelementptr inbounds [400020 x i32], ptr @sz, i64 0, i64 %indvars.iv38
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #3
  %42 = add nsw i32 %36, -1
  %43 = load i32, ptr %40, align 4, !tbaa !5
  %44 = load i32, ptr %41, align 4, !tbaa !5
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @_Z9seg_findLiiiiRi(i32 noundef 0, i32 noundef %42, i32 noundef %43, i32 noundef %44, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %45 = load i32, ptr %1, align 4, !tbaa !5
  %46 = icmp eq i32 %45, 1
  br i1 %46, label %47, label %48

47:                                               ; preds = %.lr.ph33
  store i32 0, ptr @pL, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %47, %.lr.ph33
  %49 = load i32, ptr %40, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  %51 = load i32, ptr @len, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %53, label %60

53:                                               ; preds = %48
  %54 = add nsw i32 %51, -1
  %55 = load i32, ptr %41, align 4, !tbaa !5
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @_Z9seg_findRiiiiRi(i32 noundef 0, i32 noundef %54, i32 noundef %50, i32 noundef %55, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %56 = load i32, ptr %1, align 4, !tbaa !5
  %57 = icmp eq i32 %56, 1
  %.pre45 = load i32, ptr @len, align 4, !tbaa !5
  br i1 %57, label %58, label %._crit_edge47

._crit_edge47:                                    ; preds = %53
  %.pre48 = load i32, ptr @pR, align 4, !tbaa !5
  br label %61

58:                                               ; preds = %53
  %59 = add nsw i32 %.pre45, -1
  store i32 %59, ptr @pR, align 4, !tbaa !5
  br label %61

60:                                               ; preds = %48
  store i32 %49, ptr @pR, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %._crit_edge47, %58, %60
  %62 = phi i32 [ %.pre48, %._crit_edge47 ], [ %59, %58 ], [ %49, %60 ]
  %63 = phi i32 [ %.pre45, %._crit_edge47 ], [ %.pre45, %58 ], [ %51, %60 ]
  %64 = sext i32 %62 to i64
  %65 = getelementptr inbounds i32, ptr @ht, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = load i32, ptr @pL, align 4, !tbaa !5
  %.not = icmp eq i32 %67, 0
  br i1 %.not, label %71, label %68

68:                                               ; preds = %61
  %69 = sext i32 %67 to i64
  %gep31 = getelementptr i32, ptr getelementptr (i8, ptr @ht, i64 -4), i64 %69
  %70 = load i32, ptr %gep31, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %61, %68
  %72 = phi i32 [ %70, %68 ], [ 0, %61 ]
  %73 = sub i32 %66, %72
  %74 = getelementptr inbounds [400020 x i32], ptr @idx, i64 0, i64 %indvars.iv38
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add nsw i32 %73, %78
  store i32 %79, ptr %77, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #3
  %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1
  %80 = load i32, ptr @tot, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next39, %81
  br i1 %82, label %.lr.ph33, label %.preheader, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph35, %.preheader
  ret void

.lr.ph35:                                         ; preds = %.preheader, %.lr.ph35
  %indvars.iv41 = phi i64 [ %indvars.iv.next42, %.lr.ph35 ], [ 0, %.preheader ]
  %83 = getelementptr inbounds [200010 x i32], ptr @ans, i64 0, i64 %indvars.iv41
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %84)
  %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
  %86 = load i32, ptr @m, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = icmp slt i64 %indvars.iv.next42, %87
  br i1 %88, label %.lr.ph35, label %._crit_edge, !llvm.loop !13
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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