; LLVM IR from Simple-XX/SimplePhysicsEngine :: test/system_test/demo_old/RigidBodySimulation (cbody)

; 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.clib::vec2" = type { double, double }
%"class.clib::polygon_body" = type { %"class.clib::cbody", %"class.std::vector" }
%"class.clib::cbody" = type { ptr, i16, double, double, double, double, %"struct.clib::vec2", %"struct.clib::vec2", %"struct.clib::mat22", %"struct.clib::vec2", double, %"struct.clib::vec2", double, double }
%"struct.clib::mat22" = type { %"struct.std::array" }
%"struct.std::array" = type { [2 x %"struct.clib::vec2"] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<clib::vec2, std::allocator<clib::vec2>>::_Vector_impl" }
%"struct.std::_Vector_base<clib::vec2, std::allocator<clib::vec2>>::_Vector_impl" = type { %"struct.std::_Vector_base<clib::vec2, std::allocator<clib::vec2>>::_Vector_impl_data" }
%"struct.std::_Vector_base<clib::vec2, std::allocator<clib::vec2>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK4clib5cbody14local_to_worldERKNS_4vec2E(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK4clib12polygon_bodyixEm(ptr noundef nonnull align 8 dereferenceable(192), i64 noundef) #1 align 2

declare { double, double } @_ZN4clibmiERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #3

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK4clib12polygon_body4edgeEm(ptr noundef nonnull align 8 dereferenceable(192), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK4clib12polygon_body19min_separating_axisERmRKS0_(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(192) %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.clib::vec2", align 8
  %11 = alloca %"struct.clib::vec2", align 8
  %12 = alloca %"struct.clib::vec2", align 8
  %13 = alloca %"struct.clib::vec2", align 8
  %14 = alloca double, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"struct.clib::vec2", align 8
  %17 = alloca %"struct.clib::vec2", align 8
  %18 = alloca double, align 8
  %19 = alloca %"struct.clib::vec2", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store double 0xFFF0000000000000, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !11
  br label %21

21:                                               ; preds = %90, %3
  %22 = load i64, ptr %8, align 8, !tbaa !11
  %23 = getelementptr inbounds %"class.clib::polygon_body", ptr %20, i32 0, i32 1
  %24 = call noundef i64 @_ZNKSt6vectorIN4clib4vec2ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #5
  %25 = icmp ult i64 %22, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %21
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %93

27:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %28 = load i64, ptr %8, align 8, !tbaa !11
  %29 = call { double, double } @_ZNK4clib12polygon_bodyixEm(ptr noundef nonnull align 8 dereferenceable(192) %20, i64 noundef %28)
  %30 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %31 = extractvalue { double, double } %29, 0
  store double %31, ptr %30, align 8
  %32 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %33 = extractvalue { double, double } %29, 1
  store double %33, ptr %32, align 8
  %34 = call { double, double } @_ZNK4clib5cbody14local_to_worldERKNS_4vec2E(ptr noundef nonnull align 8 dereferenceable(168) %20, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %35 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  %36 = extractvalue { double, double } %34, 0
  store double %36, ptr %35, align 8
  %37 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  %38 = extractvalue { double, double } %34, 1
  store double %38, ptr %37, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  %39 = load i64, ptr %8, align 8, !tbaa !11
  %40 = call { double, double } @_ZNK4clib12polygon_body4edgeEm(ptr noundef nonnull align 8 dereferenceable(192) %20, i64 noundef %39)
  %41 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %42 = extractvalue { double, double } %40, 0
  store double %42, ptr %41, align 8
  %43 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %44 = extractvalue { double, double } %40, 1
  store double %44, ptr %43, align 8
  %45 = call { double, double } @_ZNK4clib4vec26normalEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %46 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %47 = extractvalue { double, double } %45, 0
  store double %47, ptr %46, align 8
  %48 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %49 = extractvalue { double, double } %45, 1
  store double %49, ptr %48, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store double 0x7FF0000000000000, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !11
  br label %50

50:                                               ; preds = %78, %27
  %51 = load i64, ptr %15, align 8, !tbaa !11
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = call noundef i64 @_ZNK4clib12polygon_body5countEv(ptr noundef nonnull align 8 dereferenceable(192) %52)
  %54 = icmp ult i64 %51, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %50
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %81

56:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = load i64, ptr %15, align 8, !tbaa !11
  %60 = call { double, double } @_ZNK4clib12polygon_bodyixEm(ptr noundef nonnull align 8 dereferenceable(192) %58, i64 noundef %59)
  %61 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %62 = extractvalue { double, double } %60, 0
  store double %62, ptr %61, align 8
  %63 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %64 = extractvalue { double, double } %60, 1
  store double %64, ptr %63, align 8
  %65 = call { double, double } @_ZNK4clib5cbody14local_to_worldERKNS_4vec2E(ptr noundef nonnull align 8 dereferenceable(168) %57, ptr noundef nonnull align 8 dereferenceable(16) %17)
  %66 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %67 = extractvalue { double, double } %65, 0
  store double %67, ptr %66, align 8
  %68 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %69 = extractvalue { double, double } %65, 1
  store double %69, ptr %68, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  %70 = call { double, double } @_ZN4clibmiERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %10)
  %71 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %72 = extractvalue { double, double } %70, 0
  store double %72, ptr %71, align 8
  %73 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %74 = extractvalue { double, double } %70, 1
  store double %74, ptr %73, align 8
  %75 = call noundef double @_ZN4clib3dotERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %12)
  store double %75, ptr %18, align 8, !tbaa !9
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %77 = load double, ptr %76, align 8, !tbaa !9
  store double %77, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  br label %78

78:                                               ; preds = %56
  %79 = load i64, ptr %15, align 8, !tbaa !11
  %80 = add i64 %79, 1
  store i64 %80, ptr %15, align 8, !tbaa !11
  br label %50, !llvm.loop !13

81:                                               ; preds = %55
  %82 = load double, ptr %14, align 8, !tbaa !9
  %83 = load double, ptr %7, align 8, !tbaa !9
  %84 = fcmp ogt double %82, %83
  br i1 %84, label %85, label %89

85:                                               ; preds = %81
  %86 = load double, ptr %14, align 8, !tbaa !9
  store double %86, ptr %7, align 8, !tbaa !9
  %87 = load i64, ptr %8, align 8, !tbaa !11
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  store i64 %87, ptr %88, align 8, !tbaa !11
  br label %89

89:                                               ; preds = %85, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %8, align 8, !tbaa !11
  %92 = add i64 %91, 1
  store i64 %92, ptr %8, align 8, !tbaa !11
  br label %21, !llvm.loop !15

93:                                               ; preds = %26
  %94 = load double, ptr %7, align 8, !tbaa !9
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret double %94
}

declare { double, double } @_ZNK4clib4vec26normalEv(ptr noundef nonnull align 8 dereferenceable(16)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

declare noundef double @_ZN4clib3dotERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 = { 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 #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 = !{!"any pointer", !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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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.clib::vec2" = type { double, double }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK4clib5cbody14local_to_worldERKNS_4vec2E(ptr noundef nonnull align 8 dereferenceable(168), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK4clib12polygon_bodyixEm(ptr noundef nonnull align 8 dereferenceable(192), i64 noundef) local_unnamed_addr #1 align 2

declare { double, double } @_ZN4clibmiERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local { double, double } @_ZNK4clib12polygon_body4edgeEm(ptr noundef nonnull align 8 dereferenceable(192), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK4clib12polygon_body19min_separating_axisERmRKS0_(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(192) %2) local_unnamed_addr #1 align 2 {
  %4 = alloca %"struct.clib::vec2", align 8
  %5 = alloca %"struct.clib::vec2", align 8
  %6 = alloca %"struct.clib::vec2", align 8
  %7 = alloca %"struct.clib::vec2", align 8
  %8 = alloca double, align 8
  %9 = alloca %"struct.clib::vec2", align 8
  %10 = alloca %"struct.clib::vec2", align 8
  %11 = alloca double, align 8
  %12 = alloca %"struct.clib::vec2", align 8
  %13 = getelementptr inbounds i8, ptr %0, i64 168
  %14 = tail call noundef i64 @_ZNKSt6vectorIN4clib4vec2ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %.not = icmp eq i64 %14, 0
  br i1 %.not, label %._crit_edge22, label %.lr.ph21

.lr.ph21:                                         ; preds = %3
  %15 = getelementptr inbounds i8, ptr %5, i64 8
  %16 = getelementptr inbounds i8, ptr %4, i64 8
  %17 = getelementptr inbounds i8, ptr %7, i64 8
  %18 = getelementptr inbounds i8, ptr %6, i64 8
  %19 = getelementptr inbounds i8, ptr %10, i64 8
  %20 = getelementptr inbounds i8, ptr %9, i64 8
  %21 = getelementptr inbounds i8, ptr %12, i64 8
  br label %22

._crit_edge22:                                    ; preds = %54, %3
  %.015.lcssa = phi double [ 0xFFF0000000000000, %3 ], [ %.1, %54 ]
  ret double %.015.lcssa

22:                                               ; preds = %.lr.ph21, %54
  %.01419 = phi i64 [ 0, %.lr.ph21 ], [ %55, %54 ]
  %.01518 = phi double [ 0xFFF0000000000000, %.lr.ph21 ], [ %.1, %54 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %23 = call { double, double } @_ZNK4clib12polygon_bodyixEm(ptr noundef nonnull align 8 dereferenceable(192) %0, i64 noundef %.01419)
  %24 = extractvalue { double, double } %23, 0
  store double %24, ptr %5, align 8
  %25 = extractvalue { double, double } %23, 1
  store double %25, ptr %15, align 8
  %26 = call { double, double } @_ZNK4clib5cbody14local_to_worldERKNS_4vec2E(ptr noundef nonnull align 8 dereferenceable(168) %0, ptr noundef nonnull align 8 dereferenceable(16) %5)
  %27 = extractvalue { double, double } %26, 0
  store double %27, ptr %4, align 8
  %28 = extractvalue { double, double } %26, 1
  store double %28, ptr %16, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  %29 = call { double, double } @_ZNK4clib12polygon_body4edgeEm(ptr noundef nonnull align 8 dereferenceable(192) %0, i64 noundef %.01419)
  %30 = extractvalue { double, double } %29, 0
  store double %30, ptr %7, align 8
  %31 = extractvalue { double, double } %29, 1
  store double %31, ptr %17, align 8
  %32 = call { double, double } @_ZNK4clib4vec26normalEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %33 = extractvalue { double, double } %32, 0
  store double %33, ptr %6, align 8
  %34 = extractvalue { double, double } %32, 1
  store double %34, ptr %18, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  store double 0x7FF0000000000000, ptr %8, align 8, !tbaa !5
  %35 = call noundef i64 @_ZNK4clib12polygon_body5countEv(ptr noundef nonnull align 8 dereferenceable(192) %2)
  %.not23 = icmp eq i64 %35, 0
  br i1 %.not23, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %22
  %36 = load double, ptr %8, align 8, !tbaa !5
  %37 = fcmp ogt double %36, %.01518
  br i1 %37, label %53, label %54

.lr.ph:                                           ; preds = %22, %.lr.ph
  %.017 = phi i64 [ %50, %.lr.ph ], [ 0, %22 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  %38 = call { double, double } @_ZNK4clib12polygon_bodyixEm(ptr noundef nonnull align 8 dereferenceable(192) %2, i64 noundef %.017)
  %39 = extractvalue { double, double } %38, 0
  store double %39, ptr %10, align 8
  %40 = extractvalue { double, double } %38, 1
  store double %40, ptr %19, align 8
  %41 = call { double, double } @_ZNK4clib5cbody14local_to_worldERKNS_4vec2E(ptr noundef nonnull align 8 dereferenceable(168) %2, ptr noundef nonnull align 8 dereferenceable(16) %10)
  %42 = extractvalue { double, double } %41, 0
  store double %42, ptr %9, align 8
  %43 = extractvalue { double, double } %41, 1
  store double %43, ptr %20, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #5
  %44 = call { double, double } @_ZN4clibmiERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %45 = extractvalue { double, double } %44, 0
  store double %45, ptr %12, align 8
  %46 = extractvalue { double, double } %44, 1
  store double %46, ptr %21, align 8
  %47 = call noundef double @_ZN4clib3dotERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(16) %6)
  store double %47, ptr %11, align 8, !tbaa !5
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %49 = load double, ptr %48, align 8, !tbaa !5
  store double %49, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  %50 = add nuw i64 %.017, 1
  %51 = call noundef i64 @_ZNK4clib12polygon_body5countEv(ptr noundef nonnull align 8 dereferenceable(192) %2)
  %52 = icmp ult i64 %50, %51
  br i1 %52, label %.lr.ph, label %._crit_edge, !llvm.loop !9

53:                                               ; preds = %._crit_edge
  store i64 %.01419, ptr %1, align 8, !tbaa !11
  br label %54

54:                                               ; preds = %53, %._crit_edge
  %.1 = phi double [ %36, %53 ], [ %.01518, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %55 = add nuw i64 %.01419, 1
  %56 = call noundef i64 @_ZNKSt6vectorIN4clib4vec2ESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %57 = icmp ult i64 %55, %56
  br i1 %57, label %22, label %._crit_edge22, !llvm.loop !13
}

declare { double, double } @_ZNK4clib4vec26normalEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

declare noundef double @_ZN4clib3dotERKNS_4vec2ES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 = { 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 #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass