; LLVM IR from tangjz/acm-icpc :: hdu/5682.ll (Z5checki)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@leaf = external dso_local global [50000 x i32], align 16
@val = external dso_local global [50000 x i32], align 16
@pos = external dso_local global [50000 x i32], align 16
@que = external dso_local global [50001 x i32], align 16
@minB = external dso_local global [50000 x i32], align 16
@maxB = external dso_local global [50000 x i32], align 16
@e = external dso_local global [50001 x %"class.std::vector"], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z5checki(i32 noundef %0) #0 {
  %2 = alloca i1, align 1
  %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 %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %26, %1
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %29

19:                                               ; preds = %14
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %21
  store i32 1, ptr %22, align 4, !tbaa !5
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %24
  store i32 1000000000, ptr %25, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %19
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %4, align 4, !tbaa !5
  br label %14, !llvm.loop !9

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

30:                                               ; preds = %52, %29
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = load i32, ptr @m, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %55

35:                                               ; preds = %30
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [50000 x i32], ptr @val, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [50000 x i32], ptr @leaf, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %44
  store i32 %39, ptr %45, align 4, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [50000 x i32], ptr @leaf, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %50
  store i32 %39, ptr %51, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %35
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %5, align 4, !tbaa !5
  br label %30, !llvm.loop !11

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

56:                                               ; preds = %149, %55
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 8, ptr %7, align 4
  br label %152

61:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [50001 x i32], ptr @que, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  store i32 %65, ptr %8, align 4, !tbaa !5
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = load i32, ptr %8, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp sgt i32 %69, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %61
  store i1 false, ptr %2, align 1
  store i32 1, ptr %7, align 4
  br label %146

76:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %3, align 4, !tbaa !5
  %82 = sub nsw i32 %80, %81
  store i32 %82, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %3, align 4, !tbaa !5
  %88 = add nsw i32 %86, %87
  store i32 %88, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %90
  %92 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %91) #3
  %93 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  br label %94

94:                                               ; preds = %143, %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %96
  %98 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %97) #3
  %99 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %98, ptr %99, align 8
  %100 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br i1 %100, label %102, label %101

101:                                              ; preds = %94
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  br label %145

102:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  %104 = load i32, ptr %103, align 4, !tbaa !5
  store i32 %104, ptr %13, align 4, !tbaa !5
  %105 = load i32, ptr %13, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [50000 x i32], ptr @pos, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [50000 x i32], ptr @pos, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = icmp sle i32 %108, %112
  br i1 %113, label %114, label %115

114:                                              ; preds = %102
  store i32 13, ptr %7, align 4
  br label %140

115:                                              ; preds = %102
  %116 = load i32, ptr %13, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %122, label %127

122:                                              ; preds = %115
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = load i32, ptr %13, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %125
  store i32 %123, ptr %126, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %122, %115
  %128 = load i32, ptr %13, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = icmp sgt i32 %131, %132
  br i1 %133, label %134, label %139

134:                                              ; preds = %127
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = load i32, ptr %13, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %137
  store i32 %135, ptr %138, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %134, %127
  store i32 0, ptr %7, align 4
  br label %140

140:                                              ; preds = %139, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  %141 = load i32, ptr %7, align 4
  switch i32 %141, label %157 [
    i32 0, label %142
    i32 13, label %143
  ]

142:                                              ; preds = %140
  br label %143

143:                                              ; preds = %142, %140
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  br label %94, !llvm.loop !12

145:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  store i32 0, ptr %7, align 4
  br label %146

146:                                              ; preds = %145, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %147 = load i32, ptr %7, align 4
  switch i32 %147, label %152 [
    i32 0, label %148
  ]

148:                                              ; preds = %146
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %6, align 4, !tbaa !5
  br label %56, !llvm.loop !13

152:                                              ; preds = %146, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %153 = load i32, ptr %7, align 4
  switch i32 %153, label %157 [
    i32 8, label %154
    i32 1, label %155
  ]

154:                                              ; preds = %152
  store i1 true, ptr %2, align 1
  br label %155

155:                                              ; preds = %154, %152
  %156 = load i1, ptr %2, align 1
  ret i1 %156

157:                                              ; preds = %152, %140
  unreachable
}

; 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 nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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 = { 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 #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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@leaf = external dso_local local_unnamed_addr global [50000 x i32], align 16
@val = external dso_local local_unnamed_addr global [50000 x i32], align 16
@pos = external dso_local local_unnamed_addr global [50000 x i32], align 16
@que = external dso_local local_unnamed_addr global [50001 x i32], align 16
@minB = external dso_local local_unnamed_addr global [50000 x i32], align 16
@maxB = external dso_local local_unnamed_addr global [50000 x i32], align 16
@e = external dso_local global [50001 x %"class.std::vector"], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z5checki(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph.preheader, label %.preheader43

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

.lr.ph.preheader62:                               ; 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 ]
  %6 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %index
  %7 = getelementptr inbounds i8, ptr %6, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %6, align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %7, align 16, !tbaa !5
  %8 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %index
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %8, align 16, !tbaa !5
  store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %9, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %10 = icmp eq i64 %index.next, %n.vec
  br i1 %10, label %middle.block, label %vector.body, !llvm.loop !9

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

.preheader43:                                     ; preds = %.lr.ph, %middle.block, %1
  %11 = load i32, ptr @m, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph46.preheader, label %.preheader

.lr.ph46.preheader:                               ; preds = %.preheader43
  %wide.trip.count58 = zext nneg i32 %11 to i64
  %xtraiter = and i64 %wide.trip.count58, 1
  %13 = icmp eq i32 %11, 1
  br i1 %13, label %.preheader.loopexit.unr-lcssa, label %.lr.ph46.preheader.new

.lr.ph46.preheader.new:                           ; preds = %.lr.ph46.preheader
  %unroll_iter = and i64 %wide.trip.count58, 2147483646
  br label %.lr.ph46

.lr.ph:                                           ; preds = %.lr.ph.preheader62, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader62 ]
  %14 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %indvars.iv
  store i32 1, ptr %14, align 4, !tbaa !5
  %15 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %indvars.iv
  store i32 1000000000, ptr %15, 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 %.preheader43, label %.lr.ph, !llvm.loop !13

.preheader.loopexit.unr-lcssa:                    ; preds = %.lr.ph46, %.lr.ph46.preheader
  %indvars.iv55.unr = phi i64 [ 0, %.lr.ph46.preheader ], [ %indvars.iv.next56.1, %.lr.ph46 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph46.epil

.lr.ph46.epil:                                    ; preds = %.preheader.loopexit.unr-lcssa
  %16 = getelementptr inbounds [50000 x i32], ptr @val, i64 0, i64 %indvars.iv55.unr
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = getelementptr inbounds [50000 x i32], ptr @leaf, i64 0, i64 %indvars.iv55.unr
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %20
  store i32 %17, ptr %21, align 4, !tbaa !5
  %22 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %20
  store i32 %17, ptr %22, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph46.epil, %.preheader.loopexit.unr-lcssa, %.preheader43
  %.not48 = icmp slt i32 %4, 1
  br i1 %.not48, label %.critedge, label %.lr.ph51

.lr.ph46:                                         ; preds = %.lr.ph46, %.lr.ph46.preheader.new
  %indvars.iv55 = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %indvars.iv.next56.1, %.lr.ph46 ]
  %niter = phi i64 [ 0, %.lr.ph46.preheader.new ], [ %niter.next.1, %.lr.ph46 ]
  %23 = getelementptr inbounds [50000 x i32], ptr @val, i64 0, i64 %indvars.iv55
  %24 = load i32, ptr %23, align 8, !tbaa !5
  %25 = getelementptr inbounds [50000 x i32], ptr @leaf, i64 0, i64 %indvars.iv55
  %26 = load i32, ptr %25, align 8, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %27
  store i32 %24, ptr %28, align 4, !tbaa !5
  %29 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %27
  store i32 %24, ptr %29, align 4, !tbaa !5
  %indvars.iv.next56 = or disjoint i64 %indvars.iv55, 1
  %30 = getelementptr inbounds [50000 x i32], ptr @val, i64 0, i64 %indvars.iv.next56
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = getelementptr inbounds [50000 x i32], ptr @leaf, i64 0, i64 %indvars.iv.next56
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %34
  store i32 %31, ptr %35, align 4, !tbaa !5
  %36 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %34
  store i32 %31, ptr %36, align 4, !tbaa !5
  %indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 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 %.preheader.loopexit.unr-lcssa, label %.lr.ph46, !llvm.loop !14

.lr.ph51:                                         ; preds = %.preheader, %._crit_edge
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %._crit_edge ], [ 1, %.preheader ]
  %37 = getelementptr inbounds [50001 x i32], ptr @que, i64 0, i64 %indvars.iv60
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %39
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %.not42 = icmp sle i32 %41, %43
  br i1 %.not42, label %44, label %.critedge

44:                                               ; preds = %.lr.ph51
  %45 = sub nsw i32 %41, %0
  %46 = add nsw i32 %43, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %47 = getelementptr inbounds [50001 x %"class.std::vector"], ptr @e, i64 0, i64 %39
  %48 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #3
  store ptr %48, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %49 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #3
  store ptr %49, ptr %3, align 8
  %50 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br i1 %50, label %.lr.ph47, label %._crit_edge

.lr.ph47:                                         ; preds = %44
  %51 = getelementptr inbounds [50000 x i32], ptr @pos, i64 0, i64 %39
  br label %52

52:                                               ; preds = %.lr.ph47, %69
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [50000 x i32], ptr @pos, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = load i32, ptr %51, align 4, !tbaa !5
  %.not41 = icmp sgt i32 %57, %58
  br i1 %.not41, label %59, label %69

59:                                               ; preds = %52
  %60 = getelementptr inbounds [50000 x i32], ptr @minB, i64 0, i64 %55
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = icmp slt i32 %61, %45
  br i1 %62, label %63, label %64

63:                                               ; preds = %59
  store i32 %45, ptr %60, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %63, %59
  %65 = getelementptr inbounds [50000 x i32], ptr @maxB, i64 0, i64 %55
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp sgt i32 %66, %46
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  store i32 %46, ptr %65, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %64, %68, %52
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %71 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #3
  store ptr %71, ptr %3, align 8
  %72 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  br i1 %72, label %52, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %69, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  %73 = load i32, ptr @n, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %.not.not = icmp slt i64 %indvars.iv60, %74
  br i1 %.not.not, label %.lr.ph51, label %.critedge, !llvm.loop !16

.critedge:                                        ; preds = %._crit_edge, %.lr.ph51, %.preheader
  %.not.lcssa = phi i1 [ true, %.preheader ], [ %.not42, %._crit_edge ], [ false, %.lr.ph51 ]
  ret i1 %.not.lcssa
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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, !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: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass