; LLVM IR from ravireddy07/cpp-book :: src/Code-Chef/VBR_Vibrating-Paths.ll (Z8prework2v)

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

%struct.EDGE = type { i32, i32, i32 }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@ed = external dso_local global [100005 x %struct.EDGE], align 16
@dgr = external dso_local global [100005 x i32], align 16
@fa = external dso_local global [100005 x i32], align 16
@bn = external dso_local global [100005 x i32], align 16
@vis2 = external dso_local global [100005 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmp24EDGES_(i64, i32, i64, i32) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4findi(i32 noundef) #1

; 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: mustprogress uwtable
declare dso_local void @_Z5doit2i(i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8prework2v() #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 = load i32, ptr @m, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds %struct.EDGE, ptr @ed, i64 %8
  %10 = getelementptr inbounds %struct.EDGE, ptr %9, i64 1
  call void @_ZSt4sortIP4EDGEPFbS0_S0_EEvT_S4_T0_(ptr noundef getelementptr inbounds (%struct.EDGE, ptr @ed, i64 1), ptr noundef %10, ptr noundef @_Z4cmp24EDGES_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %23, %0
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = add nsw i32 %13, %14
  %16 = icmp sle i32 %12, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %26

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

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

26:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %114, %26
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = load i32, ptr @m, align 4, !tbaa !5
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %117

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100005 x %struct.EDGE], ptr @ed, i64 0, i64 %34
  %36 = getelementptr inbounds %struct.EDGE, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 4, !tbaa !11
  store i32 %37, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100005 x %struct.EDGE], ptr @ed, i64 0, i64 %39
  %41 = getelementptr inbounds %struct.EDGE, ptr %40, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !13
  store i32 %42, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100005 x i32], ptr @bn, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %54, label %48

48:                                               ; preds = %32
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100005 x i32], ptr @bn, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %48, %32
  store i32 7, ptr %3, align 4
  br label %111

55:                                               ; preds = %48
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = add nsw i32 %56, %57
  %59 = call noundef i32 @_Z4findi(i32 noundef %58)
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = load i32, ptr @n, align 4, !tbaa !5
  %62 = add nsw i32 %60, %61
  %63 = call noundef i32 @_Z4findi(i32 noundef %62)
  %64 = icmp eq i32 %59, %63
  br i1 %64, label %71, label %65

65:                                               ; preds = %55
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = call noundef i32 @_Z4findi(i32 noundef %66)
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = call noundef i32 @_Z4findi(i32 noundef %68)
  %70 = icmp eq i32 %67, %69
  br i1 %70, label %71, label %78

71:                                               ; preds = %65, %55
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100005 x i32], ptr @bn, i64 0, i64 %73
  store i32 1, ptr %74, align 4, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100005 x i32], ptr @bn, i64 0, i64 %76
  store i32 1, ptr %77, align 4, !tbaa !5
  store i32 7, ptr %3, align 4
  br label %111

78:                                               ; preds = %65
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = call noundef i32 @_Z4findi(i32 noundef %79)
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = add nsw i32 %81, %82
  %84 = call noundef i32 @_Z4findi(i32 noundef %83)
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100005 x i32], ptr @fa, i64 0, i64 %85
  store i32 %80, ptr %86, align 4, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = call noundef i32 @_Z4findi(i32 noundef %87)
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %91 = add nsw i32 %89, %90
  %92 = call noundef i32 @_Z4findi(i32 noundef %91)
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100005 x i32], ptr @fa, i64 0, i64 %93
  store i32 %88, ptr %94, align 4, !tbaa !5
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100005 x %struct.EDGE], ptr @ed, i64 0, i64 %96
  %98 = getelementptr inbounds %struct.EDGE, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 4, !tbaa !14
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100005 x i32], ptr @dgr, i64 0, i64 %101
  store i32 %99, ptr %102, align 4, !tbaa !5
  %103 = load i32, ptr %2, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100005 x %struct.EDGE], ptr @ed, i64 0, i64 %104
  %106 = getelementptr inbounds %struct.EDGE, ptr %105, i32 0, i32 2
  %107 = load i32, ptr %106, align 4, !tbaa !14
  %108 = load i32, ptr %5, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100005 x i32], ptr @dgr, i64 0, i64 %109
  store i32 %107, ptr %110, align 4, !tbaa !5
  store i32 0, ptr %3, align 4
  br label %111

111:                                              ; preds = %78, %71, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %112 = load i32, ptr %3, align 4
  switch i32 %112, label %136 [
    i32 0, label %113
    i32 7, label %114
  ]

113:                                              ; preds = %111
  br label %114

114:                                              ; preds = %113, %111
  %115 = load i32, ptr %2, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %2, align 4, !tbaa !5
  br label %27, !llvm.loop !15

117:                                              ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %132, %117
  %119 = load i32, ptr %6, align 4, !tbaa !5
  %120 = load i32, ptr @n, align 4, !tbaa !5
  %121 = icmp sle i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %135

123:                                              ; preds = %118
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100005 x i32], ptr @vis2, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %131, label %129

129:                                              ; preds = %123
  %130 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z5doit2i(i32 noundef %130)
  br label %131

131:                                              ; preds = %129, %123
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %6, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %6, align 4, !tbaa !5
  br label %118, !llvm.loop !16

135:                                              ; preds = %122
  ret void

136:                                              ; preds = %111
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4EDGEPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, 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 = { 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 = { 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 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4EDGE", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!12, !6, i64 4}
!14 = !{!12, !6, i64 8}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !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"

%struct.EDGE = type { i32, i32, i32 }

@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@ed = external dso_local global [100005 x %struct.EDGE], align 16
@dgr = external dso_local local_unnamed_addr global [100005 x i32], align 16
@fa = external dso_local local_unnamed_addr global [100005 x i32], align 16
@bn = external dso_local local_unnamed_addr global [100005 x i32], align 16
@vis2 = external dso_local local_unnamed_addr global [100005 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmp24EDGES_(i64, i32, i64, i32) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8prework2v() local_unnamed_addr #1 {
  %1 = load i32, ptr @m, align 4, !tbaa !5
  %2 = sext i32 %1 to i64
  %3 = getelementptr inbounds %struct.EDGE, ptr @ed, i64 %2
  %4 = getelementptr inbounds i8, ptr %3, i64 12
  tail call void @_ZSt4sortIP4EDGEPFbS0_S0_EEvT_S4_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @ed, i64 12), ptr noundef nonnull %4, ptr noundef nonnull @_Z4cmp24EDGES_)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not36 = icmp slt i32 %5, 1
  br i1 %.not36, label %.preheader35, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %6 = shl nuw i32 %5, 1
  %smax = tail call i32 @llvm.smax.i32(i32 %6, i32 1)
  %7 = add nuw nsw i32 %smax, 1
  %wide.trip.count = zext nneg i32 %7 to i64
  %8 = zext nneg i32 %smax to i64
  %min.iters.check = icmp slt i32 %6, 8
  br i1 %min.iters.check, label %.lr.ph.preheader53, label %vector.ph

.lr.ph.preheader53:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

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

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %8
  br i1 %cmp.n, label %.preheader35, label %.lr.ph.preheader53

.preheader35:                                     ; preds = %.lr.ph, %middle.block, %0
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %.not3038 = icmp slt i32 %12, 1
  br i1 %.not3038, label %.preheader, label %.lr.ph40

.lr.ph:                                           ; preds = %.lr.ph.preheader53, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader53 ]
  %13 = getelementptr inbounds [100005 x i32], ptr @fa, i64 0, i64 %indvars.iv
  %14 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %14, ptr %13, 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 %.preheader35, label %.lr.ph, !llvm.loop !13

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

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader35
  %15 = phi i32 [ %.pre, %.preheader.loopexit ], [ %5, %.preheader35 ]
  %.not3141 = icmp slt i32 %15, 1
  br i1 %.not3141, label %._crit_edge, label %.lr.ph43

.lr.ph40:                                         ; preds = %.preheader35, %57
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %57 ], [ 1, %.preheader35 ]
  %16 = getelementptr inbounds [100005 x %struct.EDGE], ptr @ed, i64 0, i64 %indvars.iv45
  %17 = load i32, ptr %16, align 4, !tbaa !14
  %18 = getelementptr inbounds i8, ptr %16, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !16
  %20 = sext i32 %17 to i64
  %21 = getelementptr inbounds [100005 x i32], ptr @bn, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %.not33 = icmp eq i32 %22, 0
  br i1 %.not33, label %23, label %57

23:                                               ; preds = %.lr.ph40
  %24 = sext i32 %19 to i64
  %25 = getelementptr inbounds [100005 x i32], ptr @bn, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %.not34 = icmp eq i32 %26, 0
  br i1 %.not34, label %27, label %57

27:                                               ; preds = %23
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = add nsw i32 %28, %17
  %30 = tail call noundef i32 @_Z4findi(i32 noundef %29)
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = add nsw i32 %31, %19
  %33 = tail call noundef i32 @_Z4findi(i32 noundef %32)
  %34 = icmp eq i32 %30, %33
  br i1 %34, label %39, label %35

35:                                               ; preds = %27
  %36 = tail call noundef i32 @_Z4findi(i32 noundef %17)
  %37 = tail call noundef i32 @_Z4findi(i32 noundef %19)
  %38 = icmp eq i32 %36, %37
  br i1 %38, label %39, label %40

39:                                               ; preds = %35, %27
  store i32 1, ptr %25, align 4, !tbaa !5
  store i32 1, ptr %21, align 4, !tbaa !5
  br label %57

40:                                               ; preds = %35
  %41 = tail call noundef i32 @_Z4findi(i32 noundef %19)
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = add nsw i32 %42, %17
  %44 = tail call noundef i32 @_Z4findi(i32 noundef %43)
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100005 x i32], ptr @fa, i64 0, i64 %45
  store i32 %41, ptr %46, align 4, !tbaa !5
  %47 = tail call noundef i32 @_Z4findi(i32 noundef %17)
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = add nsw i32 %48, %19
  %50 = tail call noundef i32 @_Z4findi(i32 noundef %49)
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100005 x i32], ptr @fa, i64 0, i64 %51
  store i32 %47, ptr %52, align 4, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %16, i64 8
  %54 = load i32, ptr %53, align 4, !tbaa !17
  %55 = getelementptr inbounds [100005 x i32], ptr @dgr, i64 0, i64 %20
  store i32 %54, ptr %55, align 4, !tbaa !5
  %56 = getelementptr inbounds [100005 x i32], ptr @dgr, i64 0, i64 %24
  store i32 %54, ptr %56, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %.lr.ph40, %23, %40, %39
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %58 = load i32, ptr @m, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %.not30.not = icmp slt i64 %indvars.iv45, %59
  br i1 %.not30.not, label %.lr.ph40, label %.preheader.loopexit, !llvm.loop !18

._crit_edge:                                      ; preds = %65, %.preheader
  ret void

.lr.ph43:                                         ; preds = %.preheader, %65
  %60 = phi i32 [ %66, %65 ], [ %15, %.preheader ]
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %65 ], [ 1, %.preheader ]
  %61 = getelementptr inbounds [100005 x i32], ptr @vis2, i64 0, i64 %indvars.iv48
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %.not32 = icmp eq i32 %62, 0
  br i1 %.not32, label %63, label %65

63:                                               ; preds = %.lr.ph43
  %64 = trunc nuw nsw i64 %indvars.iv48 to i32
  tail call void @_Z5doit2i(i32 noundef %64)
  %.pre51 = load i32, ptr @n, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %.lr.ph43, %63
  %66 = phi i32 [ %60, %.lr.ph43 ], [ %.pre51, %63 ]
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %67 = sext i32 %66 to i64
  %.not31.not = icmp slt i64 %indvars.iv48, %67
  br i1 %.not31.not, label %.lr.ph43, label %._crit_edge, !llvm.loop !19
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #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 = { 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 = { 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 #3 = { 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, !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 = !{!15, !6, i64 0}
!15 = !{!"_ZTS4EDGE", !6, i64 0, !6, i64 4, !6, i64 8}
!16 = !{!15, !6, i64 4}
!17 = !{!15, !6, i64 8}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass