; LLVM IR from mvr/jiggle :: src (Area)

; 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.jgVector2 = type { float, float }
%struct.jgArea = type { ptr, %struct.jgAABB, %struct.jgVector2, ptr, i8, %struct.jgVector2, %struct.jgVector2, float, i8, float, float, i8 }
%struct.jgAABB = type { %struct.jgVector2, %struct.jgVector2, i8 }
%struct.jgList = type { ptr, i32, i32 }
%struct.jgParticle = type { float, %struct.jgVector2, %struct.jgVector2, %struct.jgVector2, %struct.jgVector2, %struct.jgVector2, float, float, i8, i8, ptr }

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @jgListGet(ptr noundef, i32 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @jgVector2Add(<2 x float>, <2 x float>) #2

; 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) #3

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @jgVector2Divide(<2 x float>, float noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @jgVector2Subtract(<2 x float>, <2 x float>) #2

; Function Attrs: nounwind uwtable
define dso_local void @jgAreaDerive(ptr noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.jgVector2, align 4
  %4 = alloca %struct.jgVector2, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.jgVector2, align 4
  %8 = alloca %struct.jgVector2, align 4
  %9 = alloca %struct.jgVector2, align 4
  %10 = alloca %struct.jgVector2, align 4
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca %struct.jgVector2, align 4
  %18 = alloca float, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.jgArea, ptr %20, i32 0, i32 4
  %22 = load i8, ptr %21, align 8, !tbaa !9, !range !15, !noundef !16
  %23 = trunc i8 %22 to i1
  br i1 %23, label %24, label %25

24:                                               ; preds = %1
  br label %169

25:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %26 = call <2 x float> @jgVector2Zero()
  store <2 x float> %26, ptr %3, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %27 = call <2 x float> @jgVector2Zero()
  store <2 x float> %27, ptr %4, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.jgArea, ptr %28, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !17
  %31 = call ptr @jgListGet(ptr noundef %30, i32 noundef 0)
  store ptr %31, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !18
  br label %32

32:                                               ; preds = %52, %25
  %33 = load i32, ptr %6, align 4, !tbaa !18
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.jgArea, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !17
  %37 = getelementptr inbounds %struct.jgList, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 8, !tbaa !20
  %39 = icmp slt i32 %33, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %60

41:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.jgParticle, ptr %42, i32 0, i32 1
  %44 = load <2 x float>, ptr %3, align 4
  %45 = load <2 x float>, ptr %43, align 4
  %46 = call <2 x float> @jgVector2Add(<2 x float> %44, <2 x float> %45)
  store <2 x float> %46, ptr %7, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.jgParticle, ptr %47, i32 0, i32 3
  %49 = load <2 x float>, ptr %4, align 4
  %50 = load <2 x float>, ptr %48, align 4
  %51 = call <2 x float> @jgVector2Add(<2 x float> %49, <2 x float> %50)
  store <2 x float> %51, ptr %8, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %52

52:                                               ; preds = %41
  %53 = load i32, ptr %6, align 4, !tbaa !18
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %6, align 4, !tbaa !18
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.jgArea, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  %58 = load i32, ptr %6, align 4, !tbaa !18
  %59 = call ptr @jgListGet(ptr noundef %57, i32 noundef %58)
  store ptr %59, ptr %5, align 8, !tbaa !5
  br label %32, !llvm.loop !24

60:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.jgArea, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !17
  %64 = getelementptr inbounds %struct.jgList, ptr %63, i32 0, i32 1
  %65 = load i32, ptr %64, align 8, !tbaa !20
  %66 = sitofp i32 %65 to float
  %67 = load <2 x float>, ptr %3, align 4
  %68 = call <2 x float> @jgVector2Divide(<2 x float> %67, float noundef %66)
  store <2 x float> %68, ptr %9, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 %9, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.jgArea, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !17
  %72 = getelementptr inbounds %struct.jgList, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 8, !tbaa !20
  %74 = sitofp i32 %73 to float
  %75 = load <2 x float>, ptr %4, align 4
  %76 = call <2 x float> @jgVector2Divide(<2 x float> %75, float noundef %74)
  store <2 x float> %76, ptr %10, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %10, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.jgArea, ptr %77, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %78, ptr align 4 %3, i64 8, i1 false), !tbaa.struct !22
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.jgArea, ptr %79, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %80, ptr align 4 %4, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store float 0.000000e+00, ptr %11, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store float 0.000000e+00, ptr %13, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store float 0x400921FB60000000, ptr %14, align 4, !tbaa !23
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.jgArea, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !17
  %84 = call ptr @jgListGet(ptr noundef %83, i32 noundef 0)
  store ptr %84, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !18
  br label %85

85:                                               ; preds = %150, %60
  %86 = load i32, ptr %15, align 4, !tbaa !18
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.jgArea, ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !17
  %90 = getelementptr inbounds %struct.jgList, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 8, !tbaa !20
  %92 = icmp slt i32 %86, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %158

94:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.jgArea, ptr %95, i32 0, i32 3
  %97 = load ptr, ptr %96, align 8, !tbaa !26
  %98 = load i32, ptr %15, align 4, !tbaa !18
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds %struct.jgVector2, ptr %97, i64 %99
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.jgParticle, ptr %101, i32 0, i32 1
  %103 = load <2 x float>, ptr %102, align 4
  %104 = load <2 x float>, ptr %3, align 4
  %105 = call <2 x float> @jgVector2Subtract(<2 x float> %103, <2 x float> %104)
  store <2 x float> %105, ptr %17, align 4
  %106 = load <2 x float>, ptr %100, align 4
  %107 = load <2 x float>, ptr %17, align 4
  %108 = call float @jgVector2AngleBetween(<2 x float> %106, <2 x float> %107)
  store float %108, ptr %16, align 4, !tbaa !23
  %109 = load i32, ptr %15, align 4, !tbaa !18
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %111, label %117

111:                                              ; preds = %94
  %112 = load float, ptr %16, align 4, !tbaa !23
  %113 = fcmp oge float %112, 0.000000e+00
  %114 = zext i1 %113 to i64
  %115 = select i1 %113, i32 1, i32 -1
  store i32 %115, ptr %12, align 4, !tbaa !18
  %116 = load float, ptr %16, align 4, !tbaa !23
  store float %116, ptr %13, align 4, !tbaa !23
  br label %146

117:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %118 = load float, ptr %16, align 4, !tbaa !23
  %119 = load float, ptr %13, align 4, !tbaa !23
  %120 = fsub float %118, %119
  store float %120, ptr %18, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %121 = load float, ptr %16, align 4, !tbaa !23
  %122 = fcmp oge float %121, 0.000000e+00
  %123 = zext i1 %122 to i64
  %124 = select i1 %122, i32 1, i32 -1
  store i32 %124, ptr %19, align 4, !tbaa !18
  %125 = load float, ptr %18, align 4, !tbaa !23
  %126 = fptosi float %125 to i32
  %127 = call i32 @llvm.abs.i32(i32 %126, i1 true)
  %128 = sitofp i32 %127 to float
  %129 = fcmp ogt float %128, 0x400921FB60000000
  br i1 %129, label %130, label %145

130:                                              ; preds = %117
  %131 = load i32, ptr %19, align 4, !tbaa !18
  %132 = load i32, ptr %12, align 4, !tbaa !18
  %133 = icmp ne i32 %131, %132
  br i1 %133, label %134, label %145

134:                                              ; preds = %130
  %135 = load i32, ptr %19, align 4, !tbaa !18
  %136 = icmp eq i32 %135, -1
  br i1 %136, label %137, label %140

137:                                              ; preds = %134
  %138 = load float, ptr %16, align 4, !tbaa !23
  %139 = fadd float %138, 0x401921FB60000000
  br label %143

140:                                              ; preds = %134
  %141 = load float, ptr %16, align 4, !tbaa !23
  %142 = fsub float %141, 0x401921FB60000000
  br label %143

143:                                              ; preds = %140, %137
  %144 = phi float [ %139, %137 ], [ %142, %140 ]
  store float %144, ptr %16, align 4, !tbaa !23
  br label %145

145:                                              ; preds = %143, %130, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %146

146:                                              ; preds = %145, %111
  %147 = load float, ptr %16, align 4, !tbaa !23
  %148 = load float, ptr %11, align 4, !tbaa !23
  %149 = fadd float %148, %147
  store float %149, ptr %11, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %150

150:                                              ; preds = %146
  %151 = load i32, ptr %15, align 4, !tbaa !18
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %15, align 4, !tbaa !18
  %153 = load ptr, ptr %2, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.jgArea, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !17
  %156 = load i32, ptr %15, align 4, !tbaa !18
  %157 = call ptr @jgListGet(ptr noundef %155, i32 noundef %156)
  store ptr %157, ptr %5, align 8, !tbaa !5
  br label %85, !llvm.loop !27

158:                                              ; preds = %93
  %159 = load float, ptr %11, align 4, !tbaa !23
  %160 = load ptr, ptr %2, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.jgArea, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !17
  %163 = getelementptr inbounds %struct.jgList, ptr %162, i32 0, i32 1
  %164 = load i32, ptr %163, align 8, !tbaa !20
  %165 = sitofp i32 %164 to float
  %166 = fdiv float %159, %165
  %167 = load ptr, ptr %2, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.jgArea, ptr %167, i32 0, i32 7
  store float %166, ptr %168, align 4, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %169

169:                                              ; preds = %158, %24
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @jgVector2AngleBetween(<2 x float>, <2 x float>) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @jgVector2Zero() #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { inlinehint nounwind 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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/C++ TBAA"}
!9 = !{!10, !14, i64 48}
!10 = !{!"jgArea", !6, i64 0, !11, i64 8, !12, i64 28, !6, i64 40, !14, i64 48, !12, i64 52, !12, i64 60, !13, i64 68, !14, i64 72, !13, i64 76, !13, i64 80, !14, i64 84}
!11 = !{!"jgAABB", !12, i64 0, !12, i64 8, !14, i64 16}
!12 = !{!"jgVector2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!10, !6, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!21, !19, i64 8}
!21 = !{!"jgList", !6, i64 0, !19, i64 8, !19, i64 12}
!22 = !{i64 0, i64 4, !23, i64 4, i64 4, !23}
!23 = !{!13, !13, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!10, !6, i64 40}
!27 = distinct !{!27, !25}
!28 = !{!10, !13, i64 68}


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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @jgListGet(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @jgVector2Add(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @jgVector2Divide(<2 x float>, float noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @jgVector2Subtract(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @jgAreaDerive(ptr nocapture noundef %0) local_unnamed_addr #2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 48
  %3 = load i8, ptr %2, align 8, !tbaa !5, !range !14, !noundef !15
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %83, label %5

5:                                                ; preds = %1
  %6 = tail call <2 x float> @jgVector2Zero()
  %7 = tail call <2 x float> @jgVector2Zero()
  %8 = load ptr, ptr %0, align 8, !tbaa !16
  %9 = tail call ptr @jgListGet(ptr noundef %8, i32 noundef 0)
  %10 = load ptr, ptr %0, align 8, !tbaa !16
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %12 = load i32, ptr %11, align 8, !tbaa !17
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %5
  %.sroa.028.0.lcssa = phi <2 x float> [ %7, %5 ], [ %50, %.lr.ph ]
  %.sroa.030.0.lcssa = phi <2 x float> [ %6, %5 ], [ %47, %.lr.ph ]
  %.lcssa59 = phi i32 [ %12, %5 ], [ %56, %.lr.ph ]
  %14 = sitofp i32 %.lcssa59 to float
  %15 = tail call <2 x float> @jgVector2Divide(<2 x float> %.sroa.030.0.lcssa, float noundef %14)
  %16 = load ptr, ptr %0, align 8, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load i32, ptr %17, align 8, !tbaa !17
  %19 = sitofp i32 %18 to float
  %20 = tail call <2 x float> @jgVector2Divide(<2 x float> %.sroa.028.0.lcssa, float noundef %19)
  %21 = getelementptr inbounds i8, ptr %0, i64 52
  store <2 x float> %15, ptr %21, align 4
  %22 = getelementptr inbounds i8, ptr %0, i64 60
  store <2 x float> %20, ptr %22, align 4
  %23 = load ptr, ptr %0, align 8, !tbaa !16
  %24 = tail call ptr @jgListGet(ptr noundef %23, i32 noundef 0)
  %25 = load ptr, ptr %0, align 8, !tbaa !16
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load i32, ptr %26, align 8, !tbaa !17
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %29, label %._crit_edge73

29:                                               ; preds = %._crit_edge
  %30 = getelementptr inbounds i8, ptr %0, i64 40
  %31 = load ptr, ptr %30, align 8, !tbaa !20
  %32 = getelementptr inbounds i8, ptr %24, i64 4
  %33 = load <2 x float>, ptr %32, align 4
  %34 = tail call <2 x float> @jgVector2Subtract(<2 x float> %33, <2 x float> %15)
  %35 = load <2 x float>, ptr %31, align 4
  %36 = tail call float @jgVector2AngleBetween(<2 x float> %35, <2 x float> %34)
  %37 = fcmp oge float %36, 0.000000e+00
  %38 = fadd float %36, 0.000000e+00
  %39 = load ptr, ptr %0, align 8, !tbaa !16
  %40 = tail call ptr @jgListGet(ptr noundef %39, i32 noundef 1)
  %41 = load ptr, ptr %0, align 8, !tbaa !16
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load i32, ptr %42, align 8, !tbaa !17
  %44 = icmp sgt i32 %43, 1
  br i1 %44, label %.peel.next, label %._crit_edge73

.lr.ph:                                           ; preds = %5, %.lr.ph
  %.sroa.030.063 = phi <2 x float> [ %47, %.lr.ph ], [ %6, %5 ]
  %.sroa.028.062 = phi <2 x float> [ %50, %.lr.ph ], [ %7, %5 ]
  %.061 = phi ptr [ %53, %.lr.ph ], [ %9, %5 ]
  %.05060 = phi i32 [ %51, %.lr.ph ], [ 0, %5 ]
  %45 = getelementptr inbounds i8, ptr %.061, i64 4
  %46 = load <2 x float>, ptr %45, align 4
  %47 = tail call <2 x float> @jgVector2Add(<2 x float> %.sroa.030.063, <2 x float> %46)
  %48 = getelementptr inbounds i8, ptr %.061, i64 20
  %49 = load <2 x float>, ptr %48, align 4
  %50 = tail call <2 x float> @jgVector2Add(<2 x float> %.sroa.028.062, <2 x float> %49)
  %51 = add nuw nsw i32 %.05060, 1
  %52 = load ptr, ptr %0, align 8, !tbaa !16
  %53 = tail call ptr @jgListGet(ptr noundef %52, i32 noundef %51)
  %54 = load ptr, ptr %0, align 8, !tbaa !16
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = load i32, ptr %55, align 8, !tbaa !17
  %57 = icmp slt i32 %51, %56
  br i1 %57, label %.lr.ph, label %._crit_edge, !llvm.loop !21

._crit_edge73:                                    ; preds = %.peel.next, %29, %._crit_edge
  %.055.lcssa = phi float [ 0.000000e+00, %._crit_edge ], [ %38, %29 ], [ %74, %.peel.next ]
  %.lcssa = phi i32 [ %27, %._crit_edge ], [ %43, %29 ], [ %80, %.peel.next ]
  %58 = sitofp i32 %.lcssa to float
  %59 = fdiv float %.055.lcssa, %58
  %60 = getelementptr inbounds i8, ptr %0, i64 68
  store float %59, ptr %60, align 4, !tbaa !23
  br label %83

.peel.next:                                       ; preds = %29, %.peel.next
  %indvars.iv = phi i64 [ %indvars.iv.next, %.peel.next ], [ 1, %29 ]
  %.170 = phi ptr [ %77, %.peel.next ], [ %40, %29 ]
  %.05566 = phi float [ %74, %.peel.next ], [ %38, %29 ]
  %61 = load ptr, ptr %30, align 8, !tbaa !20
  %62 = getelementptr inbounds %struct.jgVector2, ptr %61, i64 %indvars.iv
  %63 = getelementptr inbounds i8, ptr %.170, i64 4
  %64 = load <2 x float>, ptr %63, align 4
  %65 = tail call <2 x float> @jgVector2Subtract(<2 x float> %64, <2 x float> %15)
  %66 = load <2 x float>, ptr %62, align 4
  %67 = tail call float @jgVector2AngleBetween(<2 x float> %66, <2 x float> %65)
  %68 = fsub float %67, %36
  %69 = fptosi float %68 to i32
  %70 = tail call i32 @llvm.abs.i32(i32 %69, i1 true)
  %71 = icmp ult i32 %70, 4
  %72 = fcmp ult float %67, 0.000000e+00
  %.not = xor i1 %37, %72
  %or.cond = select i1 %71, i1 true, i1 %.not
  %.v = select i1 %72, float 0x401921FB60000000, float 0xC01921FB60000000
  %73 = fadd float %67, %.v
  %.047 = select i1 %or.cond, float %67, float %73
  %74 = fadd float %.05566, %.047
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %75 = load ptr, ptr %0, align 8, !tbaa !16
  %76 = trunc nuw nsw i64 %indvars.iv.next to i32
  %77 = tail call ptr @jgListGet(ptr noundef %75, i32 noundef %76)
  %78 = load ptr, ptr %0, align 8, !tbaa !16
  %79 = getelementptr inbounds i8, ptr %78, i64 8
  %80 = load i32, ptr %79, align 8, !tbaa !17
  %81 = sext i32 %80 to i64
  %82 = icmp slt i64 %indvars.iv.next, %81
  br i1 %82, label %.peel.next, label %._crit_edge73, !llvm.loop !24

83:                                               ; preds = %1, %._crit_edge73
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @jgVector2AngleBetween(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @jgVector2Zero() local_unnamed_addr #1

attributes #0 = { inlinehint 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 = { inlinehint nounwind 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 = { nounwind 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 48}
!6 = !{!"jgArea", !7, i64 0, !10, i64 8, !11, i64 28, !7, i64 40, !13, i64 48, !11, i64 52, !11, i64 60, !12, i64 68, !13, i64 72, !12, i64 76, !12, i64 80, !13, i64 84}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"jgAABB", !11, i64 0, !11, i64 8, !13, i64 16}
!11 = !{!"jgVector2", !12, i64 0, !12, i64 4}
!12 = !{!"float", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!6, !7, i64 0}
!17 = !{!18, !19, i64 8}
!18 = !{!"jgList", !7, i64 0, !19, i64 8, !19, i64 12}
!19 = !{!"int", !8, i64 0}
!20 = !{!6, !7, i64 40}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!6, !12, i64 68}
!24 = distinct !{!24, !22, !25}
!25 = !{!"llvm.loop.peeled.count", i32 1}


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