; LLVM IR from Immortale-dev/NerOne :: test/mtest.ll (Z29create_labeled_inputs_zones_2v)

; 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<Point, std::allocator<Point>>::_Vector_impl" }
%"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl" = type { %"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Point = type { double, double, i8 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z11rand_doublev() #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z29create_labeled_inputs_zones_2v(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0) #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i1, align 1
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca %struct.Point, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca %struct.Point, align 8
  store ptr %0, ptr %2, align 8
  store i1 false, ptr %3, align 1
  call void @_ZNSt6vectorI5PointSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %14

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

17:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %45

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %19 = call noundef float @_Z11rand_doublev()
  %20 = fmul float %19, 1.500000e+01
  %21 = fpext float %20 to double
  store double %21, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %22 = call noundef float @_Z11rand_doublev()
  %23 = fpext float %22 to double
  %24 = fmul double %23, 3.141500e+00
  %25 = fmul double %24, 2.000000e+00
  store double %25, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  %26 = getelementptr inbounds %struct.Point, ptr %7, i32 0, i32 0
  %27 = load double, ptr %5, align 8, !tbaa !9
  %28 = load double, ptr %6, align 8, !tbaa !9
  %29 = call double @sin(double noundef %28) #5
  %30 = call double @llvm.fmuladd.f64(double %27, double %29, double 6.500000e+01)
  store double %30, ptr %26, align 8, !tbaa !11
  %31 = getelementptr inbounds %struct.Point, ptr %7, i32 0, i32 1
  %32 = load double, ptr %5, align 8, !tbaa !9
  %33 = load double, ptr %6, align 8, !tbaa !9
  %34 = call double @cos(double noundef %33) #5
  %35 = call double @llvm.fmuladd.f64(double %32, double %34, double 3.500000e+01)
  store double %35, ptr %31, align 8, !tbaa !14
  %36 = getelementptr inbounds %struct.Point, ptr %7, i32 0, i32 2
  store i8 1, ptr %36, align 8, !tbaa !15
  invoke void @_ZNSt6vectorI5PointSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %37 unwind label %41

37:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %38

38:                                               ; preds = %37
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %4, align 4, !tbaa !5
  br label %14, !llvm.loop !16

41:                                               ; preds = %18
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %8, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %81

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

46:                                               ; preds = %70, %45
  %47 = load i32, ptr %10, align 4, !tbaa !5
  %48 = icmp slt i32 %47, 100
  br i1 %48, label %50, label %49

49:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %77

50:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %51 = call noundef float @_Z11rand_doublev()
  %52 = fmul float %51, 1.500000e+01
  %53 = fpext float %52 to double
  store double %53, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %54 = call noundef float @_Z11rand_doublev()
  %55 = fpext float %54 to double
  %56 = fmul double %55, 3.141500e+00
  %57 = fmul double %56, 2.000000e+00
  store double %57, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %58 = getelementptr inbounds %struct.Point, ptr %13, i32 0, i32 0
  %59 = load double, ptr %11, align 8, !tbaa !9
  %60 = load double, ptr %12, align 8, !tbaa !9
  %61 = call double @sin(double noundef %60) #5
  %62 = call double @llvm.fmuladd.f64(double %59, double %61, double 3.500000e+01)
  store double %62, ptr %58, align 8, !tbaa !11
  %63 = getelementptr inbounds %struct.Point, ptr %13, i32 0, i32 1
  %64 = load double, ptr %11, align 8, !tbaa !9
  %65 = load double, ptr %12, align 8, !tbaa !9
  %66 = call double @cos(double noundef %65) #5
  %67 = call double @llvm.fmuladd.f64(double %64, double %66, double 6.500000e+01)
  store double %67, ptr %63, align 8, !tbaa !14
  %68 = getelementptr inbounds %struct.Point, ptr %13, i32 0, i32 2
  store i8 0, ptr %68, align 8, !tbaa !15
  invoke void @_ZNSt6vectorI5PointSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %69 unwind label %73

69:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %10, align 4, !tbaa !5
  br label %46, !llvm.loop !18

73:                                               ; preds = %50
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %8, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %81

77:                                               ; preds = %49
  store i1 true, ptr %3, align 1
  %78 = load i1, ptr %3, align 1
  br i1 %78, label %80, label %79

79:                                               ; preds = %77
  call void @_ZNSt6vectorI5PointSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %80

80:                                               ; preds = %79, %77
  ret void

81:                                               ; preds = %73, %41
  call void @_ZNSt6vectorI5PointSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %8, align 8
  %84 = load i32, ptr %9, align 4
  %85 = insertvalue { ptr, i32 } poison, ptr %83, 0
  %86 = insertvalue { ptr, i32 } %85, i32 %84, 1
  resume { ptr, i32 } %86
}

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

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

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

; Function Attrs: nounwind
declare double @sin(double noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: nounwind
declare double @cos(double noundef) #3

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI5PointSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 = !{!"double", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS5Point", !10, i64 0, !10, i64 8, !13, i64 16}
!13 = !{!"bool", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !13, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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<Point, std::allocator<Point>>::_Vector_impl" }
%"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl" = type { %"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Point, std::allocator<Point>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Point = type { double, double, i8 }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z29create_labeled_inputs_zones_2v(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector") align 8 %0) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.Point, align 8
  %3 = alloca %struct.Point, align 8
  tail call void @_ZNSt6vectorI5PointSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %4 = getelementptr inbounds i8, ptr %2, i64 8
  %5 = getelementptr inbounds i8, ptr %2, i64 16
  br label %8

.preheader:                                       ; preds = %20
  %6 = getelementptr inbounds i8, ptr %3, i64 8
  %7 = getelementptr inbounds i8, ptr %3, i64 16
  br label %24

8:                                                ; preds = %1, %20
  %.018 = phi i32 [ 0, %1 ], [ %21, %20 ]
  %9 = call noundef float @_Z11rand_doublev()
  %10 = fmul float %9, 1.500000e+01
  %11 = fpext float %10 to double
  %12 = call noundef float @_Z11rand_doublev()
  %13 = fpext float %12 to double
  %14 = fmul double %13, 3.141500e+00
  %15 = fmul double %14, 2.000000e+00
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %16 = call double @sin(double noundef %15) #5
  %17 = call double @llvm.fmuladd.f64(double %11, double %16, double 6.500000e+01)
  store double %17, ptr %2, align 8, !tbaa !5
  %18 = call double @cos(double noundef %15) #5
  %19 = call double @llvm.fmuladd.f64(double %11, double %18, double 3.500000e+01)
  store double %19, ptr %4, align 8, !tbaa !11
  store i8 1, ptr %5, align 8, !tbaa !12
  invoke void @_ZNSt6vectorI5PointSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %20 unwind label %22

20:                                               ; preds = %8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  %21 = add nuw nsw i32 %.018, 1
  %exitcond.not = icmp eq i32 %21, 100
  br i1 %exitcond.not, label %.preheader, label %8, !llvm.loop !13

22:                                               ; preds = %8
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  br label %41

24:                                               ; preds = %.preheader, %36
  %.01419 = phi i32 [ 0, %.preheader ], [ %37, %36 ]
  %25 = call noundef float @_Z11rand_doublev()
  %26 = fmul float %25, 1.500000e+01
  %27 = fpext float %26 to double
  %28 = call noundef float @_Z11rand_doublev()
  %29 = fpext float %28 to double
  %30 = fmul double %29, 3.141500e+00
  %31 = fmul double %30, 2.000000e+00
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  %32 = call double @sin(double noundef %31) #5
  %33 = call double @llvm.fmuladd.f64(double %27, double %32, double 3.500000e+01)
  store double %33, ptr %3, align 8, !tbaa !5
  %34 = call double @cos(double noundef %31) #5
  %35 = call double @llvm.fmuladd.f64(double %27, double %34, double 6.500000e+01)
  store double %35, ptr %6, align 8, !tbaa !11
  store i8 0, ptr %7, align 8, !tbaa !12
  invoke void @_ZNSt6vectorI5PointSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %36 unwind label %38

36:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  %37 = add nuw nsw i32 %.01419, 1
  %exitcond20.not = icmp eq i32 %37, 100
  br i1 %exitcond20.not, label %40, label %24, !llvm.loop !15

38:                                               ; preds = %24
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  br label %41

40:                                               ; preds = %36
  ret void

41:                                               ; preds = %38, %22
  %.pn = phi { ptr, i32 } [ %23, %22 ], [ %39, %38 ]
  call void @_ZNSt6vectorI5PointSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  resume { ptr, i32 } %.pn
}

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI5PointSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !7, i64 0}
!6 = !{!"_ZTS5Point", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !10, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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