; LLVM IR from erincatto/box2d :: src (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.b2ShapeId = type { i32, i16, i16 }
%struct.b2Shape = type { i32, i32, i32, i32, i32, i32, float, float, float, float, float, i32, %struct.b2AABB, %struct.b2AABB, %struct.b2Vec2, i32, %struct.b2Filter, ptr, i32, %union.anon.0, i16, i8, i8, i8, i8, i8 }
%struct.b2AABB = type { %struct.b2Vec2, %struct.b2Vec2 }
%struct.b2Vec2 = type { float, float }
%struct.b2Filter = type { i64, i64, i32 }
%union.anon.0 = type { %struct.b2Polygon }
%struct.b2Polygon = type { [8 x %struct.b2Vec2], [8 x %struct.b2Vec2], %struct.b2Vec2, float, i32 }
%struct.b2World = type { %struct.b2ArenaAllocator, %struct.b2BroadPhase, %struct.b2ConstraintGraph, %struct.b2IdPool, %struct.b2BodyArray, %struct.b2IdPool, %struct.b2SolverSetArray, %struct.b2IdPool, %struct.b2JointArray, %struct.b2IdPool, %struct.b2ContactArray, %struct.b2IdPool, %struct.b2IslandArray, %struct.b2IdPool, %struct.b2IdPool, %struct.b2ShapeArray, %struct.b2ChainShapeArray, %struct.b2SensorArray, %struct.b2TaskContextArray, %struct.b2SensorTaskContextArray, %struct.b2BodyMoveEventArray, %struct.b2SensorBeginTouchEventArray, %struct.b2ContactBeginTouchEventArray, [2 x %struct.b2SensorEndTouchEventArray], [2 x %struct.b2ContactEndTouchEventArray], i32, %struct.b2ContactHitEventArray, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, %struct.b2BitSet, i64, i32, %struct.b2Vec2, float, float, float, float, float, float, float, float, ptr, ptr, i16, %struct.b2Profile, ptr, ptr, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, float, i32, i32, i16, i8, i8, i8, i8, i8, i8 }
%struct.b2ArenaAllocator = type { ptr, i32, i32, i32, i32, %struct.b2ArenaEntryArray }
%struct.b2ArenaEntryArray = type { ptr, i32, i32 }
%struct.b2BroadPhase = type { [3 x %struct.b2DynamicTree], i32, %struct.b2HashSet, %struct.b2IntArray, ptr, ptr, i32, %struct.b2AtomicInt, %struct.b2HashSet }
%struct.b2DynamicTree = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32 }
%struct.b2IntArray = type { ptr, i32, i32 }
%struct.b2AtomicInt = type { i32 }
%struct.b2HashSet = type { ptr, i32, i32 }
%struct.b2ConstraintGraph = type { [12 x %struct.b2GraphColor] }
%struct.b2GraphColor = type { %struct.b2BitSet, %struct.b2ContactSimArray, %struct.b2JointSimArray, %union.anon }
%struct.b2ContactSimArray = type { ptr, i32, i32 }
%struct.b2JointSimArray = type { ptr, i32, i32 }
%union.anon = type { ptr }
%struct.b2BodyArray = type { ptr, i32, i32 }
%struct.b2SolverSetArray = type { ptr, i32, i32 }
%struct.b2JointArray = type { ptr, i32, i32 }
%struct.b2ContactArray = type { ptr, i32, i32 }
%struct.b2IslandArray = type { ptr, i32, i32 }
%struct.b2IdPool = type { %struct.b2IntArray, i32 }
%struct.b2ShapeArray = type { ptr, i32, i32 }
%struct.b2ChainShapeArray = type { ptr, i32, i32 }
%struct.b2SensorArray = type { ptr, i32, i32 }
%struct.b2TaskContextArray = type { ptr, i32, i32 }
%struct.b2SensorTaskContextArray = type { ptr, i32, i32 }
%struct.b2BodyMoveEventArray = type { ptr, i32, i32 }
%struct.b2SensorBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactBeginTouchEventArray = type { ptr, i32, i32 }
%struct.b2SensorEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactEndTouchEventArray = type { ptr, i32, i32 }
%struct.b2ContactHitEventArray = type { ptr, i32, i32 }
%struct.b2BitSet = type { ptr, i32, i32 }
%struct.b2Profile = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
%struct.b2Sensor = type { %struct.b2ShapeRefArray, %struct.b2ShapeRefArray, i32 }
%struct.b2ShapeRefArray = type { ptr, i32, i32 }
%struct.b2ShapeRef = type { i32, i16 }

; 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

declare ptr @b2GetWorldLocked(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @b2GetShape(ptr noundef, i64) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @b2MinInt(i32 noundef, i32 noundef) #4

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

; Function Attrs: nounwind uwtable
define dso_local i32 @b2Shape_GetSensorOverlaps(i64 %0, ptr noundef %1, i32 noundef %2) #3 {
  %4 = alloca i32, align 4
  %5 = alloca %struct.b2ShapeId, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %struct.b2ShapeId, align 4
  store i64 %0, ptr %5, align 4
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %16 = getelementptr inbounds %struct.b2ShapeId, ptr %5, i32 0, i32 1
  %17 = load i16, ptr %16, align 4, !tbaa !11
  %18 = zext i16 %17 to i32
  %19 = call ptr @b2GetWorldLocked(i32 noundef %18)
  store ptr %19, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %83

23:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = load i64, ptr %5, align 4
  %26 = call ptr @b2GetShape(ptr noundef %24, i64 %25)
  store ptr %26, ptr %10, align 8, !tbaa !5
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.b2Shape, ptr %27, i32 0, i32 4
  %29 = load i32, ptr %28, align 8, !tbaa !14
  %30 = icmp eq i32 %29, -1
  br i1 %30, label %31, label %32

31:                                               ; preds = %23
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %82

32:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.b2World, ptr %33, i32 0, i32 17
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.b2Shape, ptr %35, i32 0, i32 4
  %37 = load i32, ptr %36, align 8, !tbaa !14
  %38 = call ptr @b2SensorArray_Get(ptr noundef %34, i32 noundef %37)
  store ptr %38, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.b2Sensor, ptr %39, i32 0, i32 1
  %41 = getelementptr inbounds %struct.b2ShapeRefArray, ptr %40, i32 0, i32 1
  %42 = load i32, ptr %41, align 8, !tbaa !22
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = call i32 @b2MinInt(i32 noundef %42, i32 noundef %43)
  store i32 %44, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.b2Sensor, ptr %45, i32 0, i32 1
  %47 = getelementptr inbounds %struct.b2ShapeRefArray, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !25
  store ptr %48, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %77, %32
  %50 = load i32, ptr %14, align 4, !tbaa !9
  %51 = load i32, ptr %12, align 4, !tbaa !9
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %80

54:                                               ; preds = %49
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load i32, ptr %14, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds %struct.b2ShapeId, ptr %55, i64 %57
  %59 = getelementptr inbounds %struct.b2ShapeId, ptr %15, i32 0, i32 0
  %60 = load ptr, ptr %13, align 8, !tbaa !5
  %61 = load i32, ptr %14, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds %struct.b2ShapeRef, ptr %60, i64 %62
  %64 = getelementptr inbounds %struct.b2ShapeRef, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 4, !tbaa !26
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %59, align 4, !tbaa !28
  %67 = getelementptr inbounds %struct.b2ShapeId, ptr %15, i32 0, i32 1
  %68 = getelementptr inbounds %struct.b2ShapeId, ptr %5, i32 0, i32 1
  %69 = load i16, ptr %68, align 4, !tbaa !11
  store i16 %69, ptr %67, align 4, !tbaa !11
  %70 = getelementptr inbounds %struct.b2ShapeId, ptr %15, i32 0, i32 2
  %71 = load ptr, ptr %13, align 8, !tbaa !5
  %72 = load i32, ptr %14, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct.b2ShapeRef, ptr %71, i64 %73
  %75 = getelementptr inbounds %struct.b2ShapeRef, ptr %74, i32 0, i32 1
  %76 = load i16, ptr %75, align 4, !tbaa !29
  store i16 %76, ptr %70, align 2, !tbaa !30
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %58, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !31
  br label %77

77:                                               ; preds = %54
  %78 = load i32, ptr %14, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %14, align 4, !tbaa !9
  br label %49, !llvm.loop !33

80:                                               ; preds = %53
  %81 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %81, ptr %4, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %82

82:                                               ; preds = %80, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %83

83:                                               ; preds = %82, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %84 = load i32, ptr %4, align 4
  ret i32 %84
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 = { 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 #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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"b2ShapeId", !10, i64 0, !13, i64 4, !13, i64 6}
!13 = !{!"short", !7, i64 0}
!14 = !{!15, !10, i64 16}
!15 = !{!"b2Shape", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !16, i64 24, !16, i64 28, !16, i64 32, !16, i64 36, !16, i64 40, !10, i64 44, !17, i64 48, !17, i64 64, !18, i64 80, !10, i64 88, !19, i64 96, !6, i64 120, !10, i64 128, !7, i64 132, !13, i64 276, !21, i64 278, !21, i64 279, !21, i64 280, !21, i64 281, !21, i64 282}
!16 = !{!"float", !7, i64 0}
!17 = !{!"b2AABB", !18, i64 0, !18, i64 8}
!18 = !{!"b2Vec2", !16, i64 0, !16, i64 4}
!19 = !{!"b2Filter", !20, i64 0, !20, i64 8, !10, i64 16}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_Bool", !7, i64 0}
!22 = !{!23, !10, i64 24}
!23 = !{!"b2Sensor", !24, i64 0, !24, i64 16, !10, i64 32}
!24 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12}
!25 = !{!23, !6, i64 16}
!26 = !{!27, !10, i64 0}
!27 = !{!"b2ShapeRef", !10, i64 0, !13, i64 4}
!28 = !{!12, !10, i64 0}
!29 = !{!27, !13, i64 4}
!30 = !{!12, !13, i64 6}
!31 = !{i64 0, i64 4, !9, i64 4, i64 2, !32, i64 6, i64 2, !32}
!32 = !{!13, !13, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}


; 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.b2ShapeId = type { i32, i16, i16 }
%struct.b2ShapeRef = type { i32, i16 }

declare ptr @b2GetWorldLocked(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @b2GetShape(ptr noundef, i64) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @b2MinInt(i32 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @b2Shape_GetSensorOverlaps(i64 %0, ptr nocapture noundef writeonly %1, i32 noundef %2) local_unnamed_addr #1 {
  %.sroa.218.0.extract.shift = lshr i64 %0, 32
  %.sroa.218.0.extract.trunc = trunc i64 %.sroa.218.0.extract.shift to i16
  %4 = trunc nuw i64 %.sroa.218.0.extract.shift to i32
  %5 = and i32 %4, 65535
  %6 = tail call ptr @b2GetWorldLocked(i32 noundef %5) #3
  %7 = icmp eq ptr %6, null
  br i1 %7, label %.loopexit, label %8

8:                                                ; preds = %3
  %9 = tail call ptr @b2GetShape(ptr noundef nonnull %6, i64 %0)
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = icmp eq i32 %11, -1
  br i1 %12, label %.loopexit, label %13

13:                                               ; preds = %8
  %14 = getelementptr inbounds i8, ptr %6, i64 1288
  %15 = tail call ptr @b2SensorArray_Get(ptr noundef nonnull %14, i32 noundef %11)
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %17 = getelementptr inbounds i8, ptr %15, i64 24
  %18 = load i32, ptr %17, align 8, !tbaa !18
  %19 = tail call i32 @b2MinInt(i32 noundef %18, i32 noundef %2)
  %20 = load ptr, ptr %16, align 8, !tbaa !21
  %21 = icmp sgt i32 %19, 0
  br i1 %21, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %13
  %wide.trip.count = zext nneg i32 %19 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %22 = icmp eq i32 %19, 1
  br i1 %22, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %23 = getelementptr inbounds %struct.b2ShapeId, ptr %1, i64 %indvars.iv
  %24 = getelementptr inbounds %struct.b2ShapeRef, ptr %20, i64 %indvars.iv
  %25 = load i32, ptr %24, align 4, !tbaa !22
  %26 = add nsw i32 %25, 1
  %27 = getelementptr inbounds i8, ptr %24, i64 4
  %28 = load i16, ptr %27, align 4, !tbaa !24
  store i32 %26, ptr %23, align 4, !tbaa !25
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %23, i64 4
  store i16 %.sroa.218.0.extract.trunc, ptr %.sroa.2.0..sroa_idx, align 4, !tbaa !26
  %.sroa.3.0..sroa_idx = getelementptr inbounds i8, ptr %23, i64 6
  store i16 %28, ptr %.sroa.3.0..sroa_idx, align 2, !tbaa !26
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %29 = getelementptr inbounds %struct.b2ShapeId, ptr %1, i64 %indvars.iv.next
  %30 = getelementptr inbounds %struct.b2ShapeRef, ptr %20, i64 %indvars.iv.next
  %31 = load i32, ptr %30, align 4, !tbaa !22
  %32 = add nsw i32 %31, 1
  %33 = getelementptr inbounds i8, ptr %30, i64 4
  %34 = load i16, ptr %33, align 4, !tbaa !24
  store i32 %32, ptr %29, align 4, !tbaa !25
  %.sroa.2.0..sroa_idx.1 = getelementptr inbounds i8, ptr %29, i64 4
  store i16 %.sroa.218.0.extract.trunc, ptr %.sroa.2.0..sroa_idx.1, align 4, !tbaa !26
  %.sroa.3.0..sroa_idx.1 = getelementptr inbounds i8, ptr %29, i64 6
  store i16 %34, ptr %.sroa.3.0..sroa_idx.1, align 2, !tbaa !26
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !27

.loopexit.loopexit.unr-lcssa:                     ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.loopexit.loopexit.unr-lcssa
  %35 = getelementptr inbounds %struct.b2ShapeId, ptr %1, i64 %indvars.iv.unr
  %36 = getelementptr inbounds %struct.b2ShapeRef, ptr %20, i64 %indvars.iv.unr
  %37 = load i32, ptr %36, align 4, !tbaa !22
  %38 = add nsw i32 %37, 1
  %39 = getelementptr inbounds i8, ptr %36, i64 4
  %40 = load i16, ptr %39, align 4, !tbaa !24
  store i32 %38, ptr %35, align 4, !tbaa !25
  %.sroa.2.0..sroa_idx.epil = getelementptr inbounds i8, ptr %35, i64 4
  store i16 %.sroa.218.0.extract.trunc, ptr %.sroa.2.0..sroa_idx.epil, align 4, !tbaa !26
  %.sroa.3.0..sroa_idx.epil = getelementptr inbounds i8, ptr %35, i64 6
  store i16 %40, ptr %.sroa.3.0..sroa_idx.epil, align 2, !tbaa !26
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.epil, %.loopexit.loopexit.unr-lcssa, %13, %8, %3
  %.1 = phi i32 [ 0, %3 ], [ 0, %8 ], [ %19, %13 ], [ %19, %.loopexit.loopexit.unr-lcssa ], [ %19, %.lr.ph.epil ]
  ret i32 %.1
}

attributes #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 = { 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"="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 = { 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 16}
!6 = !{!"b2Shape", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !7, i64 44, !11, i64 48, !11, i64 64, !12, i64 80, !7, i64 88, !13, i64 96, !15, i64 120, !7, i64 128, !8, i64 132, !16, i64 276, !17, i64 278, !17, i64 279, !17, i64 280, !17, i64 281, !17, i64 282}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"b2AABB", !12, i64 0, !12, i64 8}
!12 = !{!"b2Vec2", !10, i64 0, !10, i64 4}
!13 = !{!"b2Filter", !14, i64 0, !14, i64 8, !7, i64 16}
!14 = !{!"long", !8, i64 0}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"short", !8, i64 0}
!17 = !{!"_Bool", !8, i64 0}
!18 = !{!19, !7, i64 24}
!19 = !{!"b2Sensor", !20, i64 0, !20, i64 16, !7, i64 32}
!20 = !{!"", !15, i64 0, !7, i64 8, !7, i64 12}
!21 = !{!19, !15, i64 16}
!22 = !{!23, !7, i64 0}
!23 = !{!"b2ShapeRef", !7, i64 0, !16, i64 4}
!24 = !{!23, !16, i64 4}
!25 = !{!7, !7, i64 0}
!26 = !{!16, !16, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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