; LLVM IR from jingweizhanghuai/Morn :: test/test_list2.ll (Z8test_intv)

; 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 }
%struct.MList = type { i32, ptr }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@__FUNCTION__._Z8test_intv = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8test_intv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %11 = call noalias ptr @malloc(i64 noundef 40000000) #7
  store ptr %11, ptr %2, align 8, !tbaa !5
  store i32 0, ptr %1, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %21, %0
  %13 = load i32, ptr %1, align 4, !tbaa !9
  %14 = icmp slt i32 %13, 10000000
  br i1 %14, label %15, label %24

15:                                               ; preds = %12
  %16 = call i32 @m_Rand(i32 noundef -1, i32 noundef -1)
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = load i32, ptr %1, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i32, ptr %17, i64 %19
  store i32 %16, ptr %20, align 4, !tbaa !9
  br label %21

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

24:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %25 = invoke ptr @ListCreate(i32 noundef -1, ptr noundef null)
          to label %26 unwind label %40

26:                                               ; preds = %24
  store ptr %25, ptr %4, align 8, !tbaa !5
  invoke void @_mTimerBegin(ptr noundef @.str)
          to label %27 unwind label %40

27:                                               ; preds = %26
  store i32 0, ptr %1, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %37, %27
  %29 = load i32, ptr %1, align 4, !tbaa !9
  %30 = icmp slt i32 %29, 10000000
  br i1 %30, label %31, label %44

31:                                               ; preds = %28
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = load i32, ptr %1, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i32, ptr %32, i64 %34
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %35)
          to label %36 unwind label %40

36:                                               ; preds = %31
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %1, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %1, align 4, !tbaa !9
  br label %28, !llvm.loop !13

40:                                               ; preds = %121, %119, %93, %91, %64, %62, %51, %46, %44, %31, %26, %24
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %5, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %6, align 4
  br label %125

44:                                               ; preds = %28
  %45 = invoke float @_mTimerEnd(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 27, ptr noundef @__FUNCTION__._Z8test_intv)
          to label %46 unwind label %40

46:                                               ; preds = %44
  invoke void @_mTimerBegin(ptr noundef @.str.2)
          to label %47 unwind label %40

47:                                               ; preds = %46
  store i32 0, ptr %1, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %59, %47
  %49 = load i32, ptr %1, align 4, !tbaa !9
  %50 = icmp slt i32 %49, 10000000
  br i1 %50, label %51, label %62

51:                                               ; preds = %48
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = load i32, ptr %1, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr %53, i64 %55
  %57 = invoke ptr @mListWrite(ptr noundef %52, i32 noundef -1, ptr noundef %56, i32 noundef 4)
          to label %58 unwind label %40

58:                                               ; preds = %51
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %1, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %1, align 4, !tbaa !9
  br label %48, !llvm.loop !14

62:                                               ; preds = %48
  %63 = invoke float @_mTimerEnd(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 32, ptr noundef @__FUNCTION__._Z8test_intv)
          to label %64 unwind label %40

64:                                               ; preds = %62
  invoke void @_mTimerBegin(ptr noundef @.str.3)
          to label %65 unwind label %40

65:                                               ; preds = %64
  store i32 0, ptr %1, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %79, %65
  %67 = load i32, ptr %1, align 4, !tbaa !9
  %68 = icmp slt i32 %67, 10000000
  br i1 %68, label %69, label %91

69:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %70 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %71 = trunc i64 %70 to i32
  %72 = invoke i32 @m_Rand(i32 noundef 0, i32 noundef %71)
          to label %73 unwind label %82

73:                                               ; preds = %69
  store i32 %72, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %74 = load i32, ptr %7, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %75)
          to label %77 unwind label %86

77:                                               ; preds = %73
  %78 = load i32, ptr %76, align 4, !tbaa !9
  store i32 %78, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %79

79:                                               ; preds = %77
  %80 = load i32, ptr %1, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %1, align 4, !tbaa !9
  br label %66, !llvm.loop !15

82:                                               ; preds = %69
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %5, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %6, align 4
  br label %90

86:                                               ; preds = %73
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %5, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %90

90:                                               ; preds = %86, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %125

91:                                               ; preds = %66
  %92 = invoke float @_mTimerEnd(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 40, ptr noundef @__FUNCTION__._Z8test_intv)
          to label %93 unwind label %40

93:                                               ; preds = %91
  invoke void @_mTimerBegin(ptr noundef @.str.4)
          to label %94 unwind label %40

94:                                               ; preds = %93
  store i32 0, ptr %1, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %112, %94
  %96 = load i32, ptr %1, align 4, !tbaa !9
  %97 = icmp slt i32 %96, 10000000
  br i1 %97, label %98, label %119

98:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.MList, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 8, !tbaa !16
  %102 = invoke i32 @m_Rand(i32 noundef 0, i32 noundef %101)
          to label %103 unwind label %115

103:                                              ; preds = %98
  store i32 %102, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.MList, ptr %104, i32 0, i32 1
  %106 = load ptr, ptr %105, align 8, !tbaa !18
  %107 = load i32, ptr %1, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds ptr, ptr %106, i64 %108
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  %111 = load i32, ptr %110, align 4, !tbaa !9
  store i32 %111, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %112

112:                                              ; preds = %103
  %113 = load i32, ptr %1, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %1, align 4, !tbaa !9
  br label %95, !llvm.loop !19

115:                                              ; preds = %98
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %5, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %125

119:                                              ; preds = %95
  %120 = invoke float @_mTimerEnd(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 48, ptr noundef @__FUNCTION__._Z8test_intv)
          to label %121 unwind label %40

121:                                              ; preds = %119
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @mListRelease(ptr noundef %122)
          to label %123 unwind label %40

123:                                              ; preds = %121
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  call void @free(ptr noundef %124) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void

125:                                              ; preds = %115, %90, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  br label %126

126:                                              ; preds = %125
  %127 = load ptr, ptr %5, align 8
  %128 = load i32, ptr %6, align 4
  %129 = insertvalue { ptr, i32 } poison, ptr %127, 0
  %130 = insertvalue { ptr, i32 } %129, i32 %128, 1
  resume { ptr, i32 } %130
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

declare i32 @m_Rand(i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

declare ptr @ListCreate(i32 noundef, ptr noundef) #3

declare i32 @__gxx_personality_v0(...)

declare void @_mTimerBegin(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

declare float @_mTimerEnd(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare ptr @mListWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

declare void @mListRelease(ptr noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 }
attributes #7 = { nounwind allocsize(0) }

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !10, i64 0}
!17 = !{!"_ZTS5MList", !10, i64 0, !6, i64 8}
!18 = !{!17, !6, i64 8}
!19 = distinct !{!19, !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"

%"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 }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@__FUNCTION__._Z8test_intv = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8test_intv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = tail call noalias dereferenceable_or_null(40000000) ptr @malloc(i64 noundef 40000000) #6
  br label %3

3:                                                ; preds = %0, %3
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %3 ]
  %4 = tail call i32 @m_Rand(i32 noundef -1, i32 noundef -1)
  %5 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv
  store i32 %4, ptr %5, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 10000000
  br i1 %exitcond.not, label %6, label %3, !llvm.loop !9

6:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %7 = invoke ptr @ListCreate(i32 noundef -1, ptr noundef null)
          to label %8 unwind label %.loopexit.split-lp.loopexit.split-lp

8:                                                ; preds = %6
  invoke void @_mTimerBegin(ptr noundef nonnull @.str)
          to label %.preheader33 unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader33:                                     ; preds = %8, %10
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %10 ], [ 0, %8 ]
  %9 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv43
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %10 unwind label %.loopexit.split-lp.loopexit

10:                                               ; preds = %.preheader33
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %exitcond46.not = icmp eq i64 %indvars.iv.next44, 10000000
  br i1 %exitcond46.not, label %11, label %.preheader33, !llvm.loop !11

.loopexit:                                        ; preds = %.preheader32
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %.preheader33
  %lpad.loopexit34 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %43, %41, %34, %32, %19, %17, %13, %11, %8, %6
  %lpad.loopexit.split-lp35 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

11:                                               ; preds = %10
  %12 = invoke float @_mTimerEnd(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 27, ptr noundef nonnull @__FUNCTION__._Z8test_intv)
          to label %13 unwind label %.loopexit.split-lp.loopexit.split-lp

13:                                               ; preds = %11
  invoke void @_mTimerBegin(ptr noundef nonnull @.str.2)
          to label %.preheader32 unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader32:                                     ; preds = %13, %16
  %indvars.iv47 = phi i64 [ %indvars.iv.next48, %16 ], [ 0, %13 ]
  %14 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv47
  %15 = invoke ptr @mListWrite(ptr noundef %7, i32 noundef -1, ptr noundef %14, i32 noundef 4)
          to label %16 unwind label %.loopexit

16:                                               ; preds = %.preheader32
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %exitcond50.not = icmp eq i64 %indvars.iv.next48, 10000000
  br i1 %exitcond50.not, label %17, label %.preheader32, !llvm.loop !12

17:                                               ; preds = %16
  %18 = invoke float @_mTimerEnd(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 32, ptr noundef nonnull @__FUNCTION__._Z8test_intv)
          to label %19 unwind label %.loopexit.split-lp.loopexit.split-lp

19:                                               ; preds = %17
  invoke void @_mTimerBegin(ptr noundef nonnull @.str.3)
          to label %.preheader31 unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader31:                                     ; preds = %19, %26
  %.340 = phi i32 [ %27, %26 ], [ 0, %19 ]
  %20 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %21 = trunc i64 %20 to i32
  %22 = invoke i32 @m_Rand(i32 noundef 0, i32 noundef %21)
          to label %23 unwind label %28

23:                                               ; preds = %.preheader31
  %24 = sext i32 %22 to i64
  %25 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %24)
          to label %26 unwind label %30

26:                                               ; preds = %23
  %27 = add nuw nsw i32 %.340, 1
  %exitcond51.not = icmp eq i32 %27, 10000000
  br i1 %exitcond51.not, label %32, label %.preheader31, !llvm.loop !13

28:                                               ; preds = %.preheader31
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

30:                                               ; preds = %23
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

32:                                               ; preds = %26
  %33 = invoke float @_mTimerEnd(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 40, ptr noundef nonnull @__FUNCTION__._Z8test_intv)
          to label %34 unwind label %.loopexit.split-lp.loopexit.split-lp

34:                                               ; preds = %32
  invoke void @_mTimerBegin(ptr noundef nonnull @.str.4)
          to label %.preheader unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader:                                       ; preds = %34, %37
  %.441 = phi i32 [ %38, %37 ], [ 0, %34 ]
  %35 = load i32, ptr %7, align 8, !tbaa !14
  %36 = invoke i32 @m_Rand(i32 noundef 0, i32 noundef %35)
          to label %37 unwind label %39

37:                                               ; preds = %.preheader
  %38 = add nuw nsw i32 %.441, 1
  %exitcond52.not = icmp eq i32 %38, 10000000
  br i1 %exitcond52.not, label %41, label %.preheader, !llvm.loop !17

39:                                               ; preds = %.preheader
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

41:                                               ; preds = %37
  %42 = invoke float @_mTimerEnd(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 48, ptr noundef nonnull @__FUNCTION__._Z8test_intv)
          to label %43 unwind label %.loopexit.split-lp.loopexit.split-lp

43:                                               ; preds = %41
  invoke void @mListRelease(ptr noundef nonnull %7)
          to label %44 unwind label %.loopexit.split-lp.loopexit.split-lp

44:                                               ; preds = %43
  call void @free(ptr noundef %2) #7
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  ret void

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %28, %30, %39
  %.pn29 = phi { ptr, i32 } [ %40, %39 ], [ %31, %30 ], [ %29, %28 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit34, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp35, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn29
}

; 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

declare i32 @m_Rand(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

declare ptr @ListCreate(i32 noundef, ptr noundef) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

declare void @_mTimerBegin(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

declare float @_mTimerEnd(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare ptr @mListWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

declare void @mListRelease(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 allocsize(0) }
attributes #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !6, i64 0}
!15 = !{!"_ZTS5MList", !6, i64 0, !16, i64 8}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass