; LLVM IR from mtsamis/box2d-optimized :: src/collision (b2_polygon_shape)

; 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.b2Vec2 = type { float, float }
%struct.b2Transform = type { %struct.b2Vec2, %struct.b2Rot }
%struct.b2Rot = type { float, float }
%struct.b2RayCastInput = type { %struct.b2Vec2, %struct.b2Vec2, float }
%class.b2PolygonShape = type <{ %class.b2Shape, %struct.b2Vec2, [8 x %struct.b2Vec2], [8 x %struct.b2Vec2], i32, [4 x i8] }>
%class.b2Shape = type { ptr, i32, float }
%struct.b2RayCastOutput = type { %struct.b2Vec2, float }

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [44 x i8], align 1
@__PRETTY_FUNCTION__._ZNK14b2PolygonShape7RayCastEP15b2RayCastOutputRK14b2RayCastInputRK11b2Transform = external hidden unnamed_addr constant [107 x i8], align 1

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z6b2MulTRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK14b2PolygonShape7RayCastEP15b2RayCastOutputRK14b2RayCastInputRK11b2Transform(ptr noundef nonnull align 8 dereferenceable(156) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(20) %2, ptr noundef nonnull align 4 dereferenceable(16) %3) unnamed_addr #5 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.b2Vec2, align 4
  %11 = alloca %struct.b2Vec2, align 4
  %12 = alloca %struct.b2Vec2, align 4
  %13 = alloca %struct.b2Vec2, align 4
  %14 = alloca %struct.b2Vec2, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca float, align 4
  %21 = alloca %struct.b2Vec2, align 4
  %22 = alloca float, align 4
  %23 = alloca %struct.b2Vec2, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  %24 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.b2Transform, ptr %25, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.b2RayCastInput, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.b2Transform, ptr %29, i32 0, i32 0
  %31 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(8) %30)
  store <2 x float> %31, ptr %11, align 4
  %32 = call <2 x float> @_Z6b2MulTRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %26, ptr noundef nonnull align 4 dereferenceable(8) %11)
  store <2 x float> %32, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.b2Transform, ptr %33, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.b2RayCastInput, ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.b2Transform, ptr %37, i32 0, i32 0
  %39 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %36, ptr noundef nonnull align 4 dereferenceable(8) %38)
  store <2 x float> %39, ptr %13, align 4
  %40 = call <2 x float> @_Z6b2MulTRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) %13)
  store <2 x float> %40, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %41 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %41, ptr %14, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store float 0.000000e+00, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.b2RayCastInput, ptr %42, i32 0, i32 2
  %44 = load float, ptr %43, align 4, !tbaa !11
  store float %44, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 -1, ptr %17, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !14
  br label %45

45:                                               ; preds = %112, %4
  %46 = load i32, ptr %18, align 4, !tbaa !14
  %47 = getelementptr inbounds %class.b2PolygonShape, ptr %24, i32 0, i32 4
  %48 = load i32, ptr %47, align 8, !tbaa !16
  %49 = icmp slt i32 %46, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %45
  store i32 2, ptr %19, align 4
  br label %115

51:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %52 = getelementptr inbounds %class.b2PolygonShape, ptr %24, i32 0, i32 3
  %53 = load i32, ptr %18, align 4, !tbaa !14
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %52, i64 0, i64 %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %56 = getelementptr inbounds %class.b2PolygonShape, ptr %24, i32 0, i32 2
  %57 = load i32, ptr %18, align 4, !tbaa !14
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %56, i64 0, i64 %58
  %60 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(8) %10)
  store <2 x float> %60, ptr %21, align 4
  %61 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %55, ptr noundef nonnull align 4 dereferenceable(8) %21)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  store float %61, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %62 = getelementptr inbounds %class.b2PolygonShape, ptr %24, i32 0, i32 3
  %63 = load i32, ptr %18, align 4, !tbaa !14
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %62, i64 0, i64 %64
  %66 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %65, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store float %66, ptr %22, align 4, !tbaa !9
  %67 = load float, ptr %22, align 4, !tbaa !9
  %68 = fcmp oeq float %67, 0.000000e+00
  br i1 %68, label %69, label %74

69:                                               ; preds = %51
  %70 = load float, ptr %20, align 4, !tbaa !9
  %71 = fcmp olt float %70, 0.000000e+00
  br i1 %71, label %72, label %73

72:                                               ; preds = %69
  store i1 false, ptr %5, align 1
  store i32 1, ptr %19, align 4
  br label %109

73:                                               ; preds = %69
  br label %103

74:                                               ; preds = %51
  %75 = load float, ptr %22, align 4, !tbaa !9
  %76 = fcmp olt float %75, 0.000000e+00
  br i1 %76, label %77, label %88

77:                                               ; preds = %74
  %78 = load float, ptr %20, align 4, !tbaa !9
  %79 = load float, ptr %15, align 4, !tbaa !9
  %80 = load float, ptr %22, align 4, !tbaa !9
  %81 = fmul float %79, %80
  %82 = fcmp olt float %78, %81
  br i1 %82, label %83, label %88

83:                                               ; preds = %77
  %84 = load float, ptr %20, align 4, !tbaa !9
  %85 = load float, ptr %22, align 4, !tbaa !9
  %86 = fdiv float %84, %85
  store float %86, ptr %15, align 4, !tbaa !9
  %87 = load i32, ptr %18, align 4, !tbaa !14
  store i32 %87, ptr %17, align 4, !tbaa !14
  br label %102

88:                                               ; preds = %77, %74
  %89 = load float, ptr %22, align 4, !tbaa !9
  %90 = fcmp ogt float %89, 0.000000e+00
  br i1 %90, label %91, label %101

91:                                               ; preds = %88
  %92 = load float, ptr %20, align 4, !tbaa !9
  %93 = load float, ptr %16, align 4, !tbaa !9
  %94 = load float, ptr %22, align 4, !tbaa !9
  %95 = fmul float %93, %94
  %96 = fcmp olt float %92, %95
  br i1 %96, label %97, label %101

97:                                               ; preds = %91
  %98 = load float, ptr %20, align 4, !tbaa !9
  %99 = load float, ptr %22, align 4, !tbaa !9
  %100 = fdiv float %98, %99
  store float %100, ptr %16, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %97, %91, %88
  br label %102

102:                                              ; preds = %101, %83
  br label %103

103:                                              ; preds = %102, %73
  %104 = load float, ptr %16, align 4, !tbaa !9
  %105 = load float, ptr %15, align 4, !tbaa !9
  %106 = fcmp olt float %104, %105
  br i1 %106, label %107, label %108

107:                                              ; preds = %103
  store i1 false, ptr %5, align 1
  store i32 1, ptr %19, align 4
  br label %109

108:                                              ; preds = %103
  store i32 0, ptr %19, align 4
  br label %109

109:                                              ; preds = %108, %107, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  %110 = load i32, ptr %19, align 4
  switch i32 %110, label %115 [
    i32 0, label %111
  ]

111:                                              ; preds = %109
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %18, align 4, !tbaa !14
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %18, align 4, !tbaa !14
  br label %45, !llvm.loop !20

115:                                              ; preds = %109, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  %116 = load i32, ptr %19, align 4
  switch i32 %116, label %148 [
    i32 2, label %117
  ]

117:                                              ; preds = %115
  %118 = load float, ptr %15, align 4, !tbaa !9
  %119 = fcmp ole float 0.000000e+00, %118
  br i1 %119, label %120, label %126

120:                                              ; preds = %117
  %121 = load float, ptr %15, align 4, !tbaa !9
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.b2RayCastInput, ptr %122, i32 0, i32 2
  %124 = load float, ptr %123, align 4, !tbaa !11
  %125 = fcmp ole float %121, %124
  br label %126

126:                                              ; preds = %120, %117
  %127 = phi i1 [ false, %117 ], [ %125, %120 ]
  br i1 %127, label %128, label %129

128:                                              ; preds = %126
  br label %131

129:                                              ; preds = %126
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 361, ptr noundef @__PRETTY_FUNCTION__._ZNK14b2PolygonShape7RayCastEP15b2RayCastOutputRK14b2RayCastInputRK11b2Transform) #7
  unreachable

130:                                              ; No predecessors!
  br label %131

131:                                              ; preds = %130, %128
  %132 = load i32, ptr %17, align 4, !tbaa !14
  %133 = icmp sge i32 %132, 0
  br i1 %133, label %134, label %147

134:                                              ; preds = %131
  %135 = load float, ptr %15, align 4, !tbaa !9
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.b2RayCastOutput, ptr %136, i32 0, i32 1
  store float %135, ptr %137, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.b2Transform, ptr %138, i32 0, i32 1
  %140 = getelementptr inbounds %class.b2PolygonShape, ptr %24, i32 0, i32 3
  %141 = load i32, ptr %17, align 4, !tbaa !14
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %140, i64 0, i64 %142
  %144 = call <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %139, ptr noundef nonnull align 4 dereferenceable(8) %143)
  store <2 x float> %144, ptr %23, align 4
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.b2RayCastOutput, ptr %145, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %146, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  store i1 true, ptr %5, align 1
  store i32 1, ptr %19, align 4
  br label %148

147:                                              ; preds = %131
  store i1 false, ptr %5, align 1
  store i32 1, ptr %19, align 4
  br label %148

148:                                              ; preds = %147, %134, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %149 = load i1, ptr %5, align 1
  ret i1 %149
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 = { noreturn 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 = { 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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { noreturn 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 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTS14b2RayCastInput", !13, i64 0, !13, i64 8, !10, i64 16}
!13 = !{!"_ZTS6b2Vec2", !10, i64 0, !10, i64 4}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!17, !15, i64 152}
!17 = !{!"_ZTS14b2PolygonShape", !18, i64 0, !13, i64 16, !7, i64 24, !7, i64 88, !15, i64 152}
!18 = !{!"_ZTS7b2Shape", !19, i64 8, !10, i64 12}
!19 = !{!"_ZTSN7b2Shape4TypeE", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !10, i64 8}
!23 = !{!"_ZTS15b2RayCastOutput", !13, i64 0, !10, i64 8}
!24 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}


; 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.b2Vec2 = type { float, float }

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [44 x i8], align 1
@__PRETTY_FUNCTION__._ZNK14b2PolygonShape7RayCastEP15b2RayCastOutputRK14b2RayCastInputRK11b2Transform = external hidden unnamed_addr constant [107 x i8], align 1

; 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: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Z6b2MulTRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK14b2PolygonShape7RayCastEP15b2RayCastOutputRK14b2RayCastInputRK11b2Transform(ptr noundef nonnull align 8 dereferenceable(156) %0, ptr nocapture noundef writeonly %1, ptr noundef nonnull align 4 dereferenceable(20) %2, ptr noundef nonnull align 4 dereferenceable(16) %3) unnamed_addr #4 align 2 {
  %5 = alloca %struct.b2Vec2, align 8
  %6 = alloca %struct.b2Vec2, align 8
  %7 = alloca %struct.b2Vec2, align 8
  %8 = alloca %struct.b2Vec2, align 8
  %9 = alloca %struct.b2Vec2, align 8
  %10 = alloca %struct.b2Vec2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %12 = tail call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %3)
  store <2 x float> %12, ptr %6, align 8
  %13 = call <2 x float> @_Z6b2MulTRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %6)
  store <2 x float> %13, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %14 = getelementptr inbounds i8, ptr %2, i64 8
  %15 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(8) %3)
  store <2 x float> %15, ptr %8, align 8
  %16 = call <2 x float> @_Z6b2MulTRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store <2 x float> %16, ptr %7, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %17 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %5)
  store <2 x float> %17, ptr %9, align 8
  %18 = getelementptr inbounds i8, ptr %2, i64 16
  %19 = getelementptr inbounds i8, ptr %0, i64 152
  %20 = load i32, ptr %19, align 8, !tbaa !5
  %.not73 = icmp sgt i32 %20, 0
  %21 = load float, ptr %18, align 4
  br i1 %.not73, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %4
  %22 = getelementptr inbounds i8, ptr %0, i64 88
  %23 = getelementptr inbounds i8, ptr %0, i64 24
  br label %27

24:                                               ; preds = %49
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i32, ptr %19, align 8, !tbaa !5
  %26 = sext i32 %25 to i64
  %.not = icmp slt i64 %indvars.iv.next, %26
  br i1 %.not, label %27, label %._crit_edge, !llvm.loop !14

27:                                               ; preds = %.lr.ph, %24
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %24 ]
  %.04277 = phi float [ 0.000000e+00, %.lr.ph ], [ %.143, %24 ]
  %.04676 = phi float [ %21, %.lr.ph ], [ %.147, %24 ]
  %.05274 = phi i32 [ -1, %.lr.ph ], [ %.153, %24 ]
  %28 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %22, i64 0, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %29 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %23, i64 0, i64 %indvars.iv
  %30 = call <2 x float> @_ZmiRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %29, ptr noundef nonnull align 4 dereferenceable(8) %5)
  store <2 x float> %30, ptr %10, align 8
  %31 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  %32 = call noundef float @_Z5b2DotRK6b2Vec2S1_(ptr noundef nonnull align 4 dereferenceable(8) %28, ptr noundef nonnull align 4 dereferenceable(8) %9)
  %33 = fcmp oeq float %32, 0.000000e+00
  br i1 %33, label %34, label %36

34:                                               ; preds = %27
  %35 = fcmp olt float %31, 0.000000e+00
  br i1 %35, label %.thread68, label %49

36:                                               ; preds = %27
  %37 = fcmp olt float %32, 0.000000e+00
  %38 = fmul float %.04277, %32
  %39 = fcmp olt float %31, %38
  %or.cond = and i1 %37, %39
  br i1 %or.cond, label %40, label %43

40:                                               ; preds = %36
  %41 = fdiv float %31, %32
  %42 = trunc nuw nsw i64 %indvars.iv to i32
  br label %49

43:                                               ; preds = %36
  %44 = fcmp ogt float %32, 0.000000e+00
  %45 = fmul float %.04676, %32
  %46 = fcmp olt float %31, %45
  %or.cond61 = select i1 %44, i1 %46, i1 false
  br i1 %or.cond61, label %47, label %49

47:                                               ; preds = %43
  %48 = fdiv float %31, %32
  br label %49

49:                                               ; preds = %34, %43, %47, %40
  %.153 = phi i32 [ %.05274, %34 ], [ %42, %40 ], [ %.05274, %47 ], [ %.05274, %43 ]
  %.147 = phi float [ %.04676, %34 ], [ %.04676, %40 ], [ %48, %47 ], [ %.04676, %43 ]
  %.143 = phi float [ %.04277, %34 ], [ %41, %40 ], [ %.04277, %47 ], [ %.04277, %43 ]
  %50 = fcmp uge float %.147, %.143
  br i1 %50, label %24, label %.thread68

._crit_edge:                                      ; preds = %24
  %51 = fcmp ult float %.143, 0.000000e+00
  %52 = load float, ptr %18, align 4
  %53 = fcmp ugt float %.143, %52
  %or.cond63 = select i1 %51, i1 true, i1 %53
  br i1 %or.cond63, label %.critedge, label %55

._crit_edge.thread:                               ; preds = %4
  %54 = fcmp ult float %21, 0.000000e+00
  br i1 %54, label %.critedge, label %.thread68

.critedge:                                        ; preds = %._crit_edge.thread, %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 361, ptr noundef nonnull @__PRETTY_FUNCTION__._ZNK14b2PolygonShape7RayCastEP15b2RayCastOutputRK14b2RayCastInputRK11b2Transform) #6
  unreachable

55:                                               ; preds = %._crit_edge
  %56 = icmp sgt i32 %.153, -1
  br i1 %56, label %57, label %.thread68

57:                                               ; preds = %55
  %58 = getelementptr inbounds i8, ptr %1, i64 8
  store float %.143, ptr %58, align 4, !tbaa !16
  %59 = getelementptr inbounds i8, ptr %0, i64 88
  %60 = zext nneg i32 %.153 to i64
  %61 = getelementptr inbounds [8 x %struct.b2Vec2], ptr %59, i64 0, i64 %60
  %62 = call <2 x float> @_Z5b2MulRK5b2RotRK6b2Vec2(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %61)
  store <2 x float> %62, ptr %1, align 4
  br label %.thread68

.thread68:                                        ; preds = %34, %49, %._crit_edge.thread, %55, %57
  %.3 = phi i1 [ true, %57 ], [ false, %55 ], [ false, %._crit_edge.thread ], [ false, %49 ], [ false, %34 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret i1 %.3
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 = { noreturn 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 #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="64" "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 }
attributes #6 = { noreturn 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, !13, i64 152}
!6 = !{!"_ZTS14b2PolygonShape", !7, i64 0, !12, i64 16, !9, i64 24, !9, i64 88, !13, i64 152}
!7 = !{!"_ZTS7b2Shape", !8, i64 8, !11, i64 12}
!8 = !{!"_ZTSN7b2Shape4TypeE", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"_ZTS6b2Vec2", !11, i64 0, !11, i64 4}
!13 = !{!"int", !9, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !11, i64 8}
!17 = !{!"_ZTS15b2RayCastOutput", !12, i64 0, !11, i64 8}


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