; LLVM IR from jdeokkim/ferox :: src (collision)

; 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.frTransform_ = type { %struct.frVector2_, %struct.anon, float }
%struct.frVector2_ = type { float, float }
%struct.anon = type { float, float }
%struct.frRay_ = type { %struct.frVector2_, %struct.frVector2_, float }
%struct.frRaycastHit_ = type { ptr, %struct.frVector2_, %struct.frVector2_, float, i8 }
%struct.frVertices_ = type { [8 x %struct.frVector2_], i32 }

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

declare ptr @frGetBodyShape(ptr noundef) #1

declare void @frGetBodyTransform(ptr dead_on_unwind writable sret(%struct.frTransform_) align 4, ptr noundef) #1

declare i32 @frGetShapeType(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @frComputeRaycast(ptr noundef %0, ptr noundef byval(%struct.frRay_) align 8 %1, ptr noundef %2) #2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.frVector2_, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %struct.frTransform_, align 8
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca %struct.frVector2_, align 4
  %15 = alloca %struct.frVector2_, align 4
  %16 = alloca %struct.frVector2_, align 4
  %17 = alloca %struct.frVector2_, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca float, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %struct.frVector2_, align 4
  %25 = alloca %struct.frVector2_, align 4
  %26 = alloca %struct.frVector2_, align 4
  %27 = alloca i8, align 1
  %28 = alloca %struct.frVector2_, align 4
  %29 = alloca %struct.frVector2_, align 4
  %30 = alloca %struct.frVector2_, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  br label %211

34:                                               ; preds = %3
  %35 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %36 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 1
  %37 = load <2 x float>, ptr %36, align 8
  %38 = call <2 x float> @frVector2Normalize(<2 x float> %37)
  store <2 x float> %38, ptr %7, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 4 %7, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call ptr @frGetBodyShape(ptr noundef %39)
  store ptr %40, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr %9) #5
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  call void @frGetBodyTransform(ptr dead_on_unwind writable sret(%struct.frTransform_) align 4 %9, ptr noundef %41)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = call i32 @frGetShapeType(ptr noundef %42)
  store i32 %43, ptr %10, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store float 0x47EFFFFFE0000000, ptr %11, align 4, !tbaa !10
  %44 = load i32, ptr %10, align 4, !tbaa !12
  %45 = icmp eq i32 %44, 1
  br i1 %45, label %46, label %104

46:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  %47 = getelementptr inbounds %struct.frTransform_, ptr %9, i32 0, i32 0
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = call float @frGetCircleRadius(ptr noundef %48)
  %50 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 0
  %51 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 1
  %52 = load <2 x float>, ptr %47, align 4
  %53 = load <2 x float>, ptr %50, align 8
  %54 = load <2 x float>, ptr %51, align 8
  %55 = call zeroext i1 @frComputeIntersectionCircleLine(<2 x float> %52, float noundef %49, <2 x float> %53, <2 x float> %54, ptr noundef %11)
  %56 = zext i1 %55 to i8
  store i8 %56, ptr %12, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  %57 = load float, ptr %11, align 4, !tbaa !10
  %58 = fcmp oge float %57, 0.000000e+00
  br i1 %58, label %59, label %64

59:                                               ; preds = %46
  %60 = load float, ptr %11, align 4, !tbaa !10
  %61 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 2
  %62 = load float, ptr %61, align 8, !tbaa !16
  %63 = fcmp ole float %60, %62
  br label %64

64:                                               ; preds = %59, %46
  %65 = phi i1 [ false, %46 ], [ %63, %59 ]
  %66 = zext i1 %65 to i8
  store i8 %66, ptr %13, align 1, !tbaa !14
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = icmp ne ptr %67, null
  br i1 %68, label %69, label %101

69:                                               ; preds = %64
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = load ptr, ptr %6, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.frRaycastHit_, ptr %71, i32 0, i32 0
  store ptr %70, ptr %72, align 8, !tbaa !19
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.frRaycastHit_, ptr %73, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %75 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 0
  %76 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 1
  %77 = load float, ptr %11, align 4, !tbaa !10
  %78 = load <2 x float>, ptr %76, align 8
  %79 = call <2 x float> @frVector2ScalarMultiply(<2 x float> %78, float noundef %77)
  store <2 x float> %79, ptr %15, align 4
  %80 = load <2 x float>, ptr %75, align 8
  %81 = load <2 x float>, ptr %15, align 4
  %82 = call <2 x float> @frVector2Add(<2 x float> %80, <2 x float> %81)
  store <2 x float> %82, ptr %14, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %74, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.frRaycastHit_, ptr %83, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %85 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 0
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.frRaycastHit_, ptr %86, i32 0, i32 1
  %88 = load <2 x float>, ptr %85, align 8
  %89 = load <2 x float>, ptr %87, align 8
  %90 = call <2 x float> @frVector2Subtract(<2 x float> %88, <2 x float> %89)
  store <2 x float> %90, ptr %17, align 4
  %91 = load <2 x float>, ptr %17, align 4
  %92 = call <2 x float> @frVector2LeftNormal(<2 x float> %91)
  store <2 x float> %92, ptr %16, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %84, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %93 = load float, ptr %11, align 4, !tbaa !10
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.frRaycastHit_, ptr %94, i32 0, i32 3
  store float %93, ptr %95, align 8, !tbaa !21
  %96 = load float, ptr %11, align 4, !tbaa !10
  %97 = fcmp olt float %96, 0.000000e+00
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.frRaycastHit_, ptr %98, i32 0, i32 4
  %100 = zext i1 %97 to i8
  store i8 %100, ptr %99, align 4, !tbaa !22
  br label %101

101:                                              ; preds = %69, %64
  %102 = load i8, ptr %13, align 1, !tbaa !14, !range !23, !noundef !24
  %103 = trunc i8 %102 to i1
  store i1 %103, ptr %4, align 1
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  br label %210

104:                                              ; preds = %34
  %105 = load i32, ptr %10, align 4, !tbaa !12
  %106 = icmp eq i32 %105, 2
  br i1 %106, label %107, label %209

107:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = call ptr @frGetPolygonVertices(ptr noundef %108)
  store ptr %109, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store float 0x47EFFFFFE0000000, ptr %21, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %110 = load ptr, ptr %19, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.frVertices_, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !25
  %113 = sub nsw i32 %112, 1
  store i32 %113, ptr %22, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !12
  br label %114

114:                                              ; preds = %182, %107
  %115 = load i32, ptr %23, align 4, !tbaa !12
  %116 = load ptr, ptr %19, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.frVertices_, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !25
  %119 = icmp slt i32 %115, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %114
  store i32 2, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %186

121:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %122 = load ptr, ptr %19, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.frVertices_, ptr %122, i32 0, i32 0
  %124 = load i32, ptr %23, align 4, !tbaa !12
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [8 x %struct.frVector2_], ptr %123, i64 0, i64 %125
  %127 = load <2 x float>, ptr %126, align 4
  %128 = call <2 x float> @frVector2Transform(<2 x float> %127, ptr noundef byval(%struct.frTransform_) align 8 %9)
  store <2 x float> %128, ptr %24, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %129 = load ptr, ptr %19, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.frVertices_, ptr %129, i32 0, i32 0
  %131 = load i32, ptr %22, align 4, !tbaa !12
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [8 x %struct.frVector2_], ptr %130, i64 0, i64 %132
  %134 = load <2 x float>, ptr %133, align 4
  %135 = call <2 x float> @frVector2Transform(<2 x float> %134, ptr noundef byval(%struct.frTransform_) align 8 %9)
  store <2 x float> %135, ptr %25, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %136 = load <2 x float>, ptr %24, align 4
  %137 = load <2 x float>, ptr %25, align 4
  %138 = call <2 x float> @frVector2Subtract(<2 x float> %136, <2 x float> %137)
  store <2 x float> %138, ptr %26, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #5
  %139 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 0
  %140 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 1
  %141 = load <2 x float>, ptr %139, align 8
  %142 = load <2 x float>, ptr %140, align 8
  %143 = load <2 x float>, ptr %25, align 4
  %144 = load <2 x float>, ptr %26, align 4
  %145 = call zeroext i1 @frComputeIntersectionLines(<2 x float> %141, <2 x float> %142, <2 x float> %143, <2 x float> %144, ptr noundef %11)
  %146 = zext i1 %145 to i8
  store i8 %146, ptr %27, align 1, !tbaa !14
  %147 = load i8, ptr %27, align 1, !tbaa !14, !range !23, !noundef !24
  %148 = trunc i8 %147 to i1
  br i1 %148, label %149, label %181

149:                                              ; preds = %121
  %150 = load float, ptr %11, align 4, !tbaa !10
  %151 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 2
  %152 = load float, ptr %151, align 8, !tbaa !16
  %153 = fcmp ole float %150, %152
  br i1 %153, label %154, label %181

154:                                              ; preds = %149
  %155 = load float, ptr %21, align 4, !tbaa !10
  %156 = load float, ptr %11, align 4, !tbaa !10
  %157 = fcmp ogt float %155, %156
  br i1 %157, label %158, label %178

158:                                              ; preds = %154
  %159 = load float, ptr %11, align 4, !tbaa !10
  store float %159, ptr %21, align 4, !tbaa !10
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = icmp ne ptr %160, null
  br i1 %161, label %162, label %177

162:                                              ; preds = %158
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.frRaycastHit_, ptr %163, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %165 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 0
  %166 = getelementptr inbounds %struct.frRay_, ptr %1, i32 0, i32 1
  %167 = load float, ptr %21, align 4, !tbaa !10
  %168 = load <2 x float>, ptr %166, align 8
  %169 = call <2 x float> @frVector2ScalarMultiply(<2 x float> %168, float noundef %167)
  store <2 x float> %169, ptr %29, align 4
  %170 = load <2 x float>, ptr %165, align 8
  %171 = load <2 x float>, ptr %29, align 4
  %172 = call <2 x float> @frVector2Add(<2 x float> %170, <2 x float> %171)
  store <2 x float> %172, ptr %28, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %164, ptr align 4 %28, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  %173 = load ptr, ptr %6, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.frRaycastHit_, ptr %173, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %175 = load <2 x float>, ptr %26, align 4
  %176 = call <2 x float> @frVector2LeftNormal(<2 x float> %175)
  store <2 x float> %176, ptr %30, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %174, ptr align 4 %30, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  br label %177

177:                                              ; preds = %162, %158
  br label %178

178:                                              ; preds = %177, %154
  %179 = load i32, ptr %20, align 4, !tbaa !12
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %20, align 4, !tbaa !12
  br label %181

181:                                              ; preds = %178, %149, %121
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %23, align 4, !tbaa !12
  store i32 %183, ptr %22, align 4, !tbaa !12
  %184 = load i32, ptr %23, align 4, !tbaa !12
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %23, align 4, !tbaa !12
  br label %114, !llvm.loop !27

186:                                              ; preds = %120
  %187 = load ptr, ptr %6, align 8, !tbaa !5
  %188 = icmp ne ptr %187, null
  br i1 %188, label %189, label %199

189:                                              ; preds = %186
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = load ptr, ptr %6, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.frRaycastHit_, ptr %191, i32 0, i32 0
  store ptr %190, ptr %192, align 8, !tbaa !19
  %193 = load i32, ptr %20, align 4, !tbaa !12
  %194 = and i32 %193, 1
  %195 = icmp ne i32 %194, 0
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.frRaycastHit_, ptr %196, i32 0, i32 4
  %198 = zext i1 %195 to i8
  store i8 %198, ptr %197, align 4, !tbaa !22
  br label %199

199:                                              ; preds = %189, %186
  %200 = load ptr, ptr %6, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.frRaycastHit_, ptr %200, i32 0, i32 4
  %202 = load i8, ptr %201, align 4, !tbaa !22, !range !23, !noundef !24
  %203 = trunc i8 %202 to i1
  br i1 %203, label %207, label %204

204:                                              ; preds = %199
  %205 = load i32, ptr %20, align 4, !tbaa !12
  %206 = icmp sgt i32 %205, 0
  br label %207

207:                                              ; preds = %204, %199
  %208 = phi i1 [ false, %199 ], [ %206, %204 ]
  store i1 %208, ptr %4, align 1
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %210

209:                                              ; preds = %104
  store i1 false, ptr %4, align 1
  store i32 1, ptr %18, align 4
  br label %210

210:                                              ; preds = %209, %207, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %211

211:                                              ; preds = %210, %33
  %212 = load i1, ptr %4, align 1
  ret i1 %212
}

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Normalize(<2 x float>) #3

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @frComputeIntersectionCircleLine(<2 x float>, float noundef, <2 x float>, <2 x float>, ptr noundef) #2

declare float @frGetCircleRadius(ptr noundef) #1

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Add(<2 x float>, <2 x float>) #3

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2ScalarMultiply(<2 x float>, float noundef) #3

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2LeftNormal(<2 x float>) #3

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Subtract(<2 x float>, <2 x float>) #3

declare ptr @frGetPolygonVertices(ptr noundef) #1

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Transform(<2 x float>, ptr noundef byval(%struct.frTransform_) align 8) #3

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @frComputeIntersectionLines(<2 x float>, <2 x float>, <2 x float>, <2 x float>, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { alwaysinline 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{i64 0, i64 4, !10, i64 4, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!17, !11, i64 16}
!17 = !{!"frRay_", !18, i64 0, !18, i64 8, !11, i64 16}
!18 = !{!"frVector2_", !11, i64 0, !11, i64 4}
!19 = !{!20, !6, i64 0}
!20 = !{!"frRaycastHit_", !6, i64 0, !18, i64 8, !18, i64 16, !11, i64 24, !15, i64 28}
!21 = !{!20, !11, i64 24}
!22 = !{!20, !15, i64 28}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!26, !13, i64 64}
!26 = !{!"frVertices_", !7, i64 0, !13, i64 64}
!27 = distinct !{!27, !28}
!28 = !{!"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.frTransform_ = type { %struct.frVector2_, %struct.anon, float }
%struct.frVector2_ = type { float, float }
%struct.anon = type { float, float }
%struct.frRay_ = type { %struct.frVector2_, %struct.frVector2_, float }

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

declare ptr @frGetBodyShape(ptr noundef) local_unnamed_addr #1

declare void @frGetBodyTransform(ptr dead_on_unwind writable sret(%struct.frTransform_) align 4, ptr noundef) local_unnamed_addr #1

declare i32 @frGetShapeType(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @frComputeRaycast(ptr noundef %0, ptr nocapture noundef readonly byval(%struct.frRay_) align 8 %1, ptr noundef writeonly %2) local_unnamed_addr #2 {
  %4 = alloca %struct.frTransform_, align 8
  %5 = alloca float, align 4
  %6 = icmp eq ptr %0, null
  br i1 %6, label %98, label %7

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load <2 x float>, ptr %8, align 8
  %10 = tail call <2 x float> @frVector2Normalize(<2 x float> %9)
  %11 = tail call ptr @frGetBodyShape(ptr noundef nonnull %0) #4
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %4) #4
  call void @frGetBodyTransform(ptr dead_on_unwind nonnull writable sret(%struct.frTransform_) align 4 %4, ptr noundef nonnull %0) #4
  %12 = call i32 @frGetShapeType(ptr noundef %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store float 0x47EFFFFFE0000000, ptr %5, align 4, !tbaa !5
  switch i32 %12, label %97 [
    i32 1, label %13
    i32 2, label %36
  ]

13:                                               ; preds = %7
  %14 = call float @frGetCircleRadius(ptr noundef %11) #4
  %15 = load <2 x float>, ptr %4, align 8
  %16 = load <2 x float>, ptr %1, align 8
  %17 = call zeroext i1 @frComputeIntersectionCircleLine(<2 x float> %15, float noundef %14, <2 x float> %16, <2 x float> %10, ptr noundef nonnull %5)
  %18 = load float, ptr %5, align 4
  %19 = fcmp oge float %18, 0.000000e+00
  %20 = getelementptr inbounds i8, ptr %1, i64 16
  %21 = load float, ptr %20, align 8
  %22 = fcmp ole float %18, %21
  %23 = select i1 %19, i1 %22, i1 false
  %.not65 = icmp eq ptr %2, null
  br i1 %.not65, label %97, label %24

24:                                               ; preds = %13
  store ptr %0, ptr %2, align 8, !tbaa !9
  %25 = getelementptr inbounds i8, ptr %2, i64 8
  %26 = call <2 x float> @frVector2ScalarMultiply(<2 x float> %10, float noundef %18)
  %27 = call <2 x float> @frVector2Add(<2 x float> %16, <2 x float> %26)
  store <2 x float> %27, ptr %25, align 8
  %28 = getelementptr inbounds i8, ptr %2, i64 16
  %29 = call <2 x float> @frVector2Subtract(<2 x float> %16, <2 x float> %27)
  %30 = call <2 x float> @frVector2LeftNormal(<2 x float> %29)
  store <2 x float> %30, ptr %28, align 8
  %31 = load float, ptr %5, align 4, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %2, i64 24
  store float %31, ptr %32, align 8, !tbaa !14
  %33 = fcmp olt float %31, 0.000000e+00
  %34 = getelementptr inbounds i8, ptr %2, i64 28
  %35 = zext i1 %33 to i8
  store i8 %35, ptr %34, align 4, !tbaa !15
  br label %97

36:                                               ; preds = %7
  %37 = call ptr @frGetPolygonVertices(ptr noundef %11) #4
  %38 = getelementptr inbounds i8, ptr %37, i64 64
  %39 = load i32, ptr %38, align 4, !tbaa !16
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %36
  %41 = add nsw i32 %39, -1
  %42 = load <2 x float>, ptr %1, align 8
  %43 = getelementptr inbounds i8, ptr %1, i64 16
  %44 = load float, ptr %43, align 8
  %.not64 = icmp eq ptr %2, null
  %45 = getelementptr inbounds i8, ptr %2, i64 8
  %46 = getelementptr inbounds i8, ptr %2, i64 16
  br i1 %.not64, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.lr.ph.split.us
  %indvars.iv72 = phi i64 [ %indvars.iv.next73, %.lr.ph.split.us ], [ 0, %.lr.ph ]
  %.05269.us = phi i32 [ %.153.us, %.lr.ph.split.us ], [ 0, %.lr.ph ]
  %.05667.us = phi i32 [ %62, %.lr.ph.split.us ], [ %41, %.lr.ph ]
  %47 = getelementptr inbounds [8 x %struct.frVector2_], ptr %37, i64 0, i64 %indvars.iv72
  %48 = load <2 x float>, ptr %47, align 4
  %49 = call <2 x float> @frVector2Transform(<2 x float> %48, ptr noundef nonnull byval(%struct.frTransform_) align 8 %4)
  %50 = sext i32 %.05667.us to i64
  %51 = getelementptr inbounds [8 x %struct.frVector2_], ptr %37, i64 0, i64 %50
  %52 = load <2 x float>, ptr %51, align 4
  %53 = call <2 x float> @frVector2Transform(<2 x float> %52, ptr noundef nonnull byval(%struct.frTransform_) align 8 %4)
  %54 = call <2 x float> @frVector2Subtract(<2 x float> %49, <2 x float> %53)
  %55 = call zeroext i1 @frComputeIntersectionLines(<2 x float> %42, <2 x float> %10, <2 x float> %53, <2 x float> %54, ptr noundef nonnull %5)
  %56 = load float, ptr %5, align 4
  %57 = fcmp ole float %56, %44
  %or.cond.not = select i1 %55, i1 %57, i1 false
  %58 = zext i1 %or.cond.not to i32
  %.153.us = add nuw nsw i32 %.05269.us, %58
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %59 = load i32, ptr %38, align 4, !tbaa !16
  %60 = sext i32 %59 to i64
  %61 = icmp slt i64 %indvars.iv.next73, %60
  %62 = trunc nuw nsw i64 %indvars.iv72 to i32
  br i1 %61, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %83, %.lr.ph.split.us, %36
  %.052.lcssa = phi i32 [ 0, %36 ], [ %.153.us, %.lr.ph.split.us ], [ %.153, %83 ]
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %._crit_edge._crit_edge, label %88

._crit_edge._crit_edge:                           ; preds = %._crit_edge
  %.pre = load i8, ptr inttoptr (i64 28 to ptr), align 4, !tbaa !15, !range !21
  br label %92

.lr.ph.split:                                     ; preds = %.lr.ph, %83
  %indvars.iv = phi i64 [ %indvars.iv.next, %83 ], [ 0, %.lr.ph ]
  %.05269 = phi i32 [ %.153, %83 ], [ 0, %.lr.ph ]
  %.05468 = phi float [ %.2, %83 ], [ 0x47EFFFFFE0000000, %.lr.ph ]
  %.05667 = phi i32 [ %87, %83 ], [ %41, %.lr.ph ]
  %63 = getelementptr inbounds [8 x %struct.frVector2_], ptr %37, i64 0, i64 %indvars.iv
  %64 = load <2 x float>, ptr %63, align 4
  %65 = call <2 x float> @frVector2Transform(<2 x float> %64, ptr noundef nonnull byval(%struct.frTransform_) align 8 %4)
  %66 = sext i32 %.05667 to i64
  %67 = getelementptr inbounds [8 x %struct.frVector2_], ptr %37, i64 0, i64 %66
  %68 = load <2 x float>, ptr %67, align 4
  %69 = call <2 x float> @frVector2Transform(<2 x float> %68, ptr noundef nonnull byval(%struct.frTransform_) align 8 %4)
  %70 = call <2 x float> @frVector2Subtract(<2 x float> %65, <2 x float> %69)
  %71 = call zeroext i1 @frComputeIntersectionLines(<2 x float> %42, <2 x float> %10, <2 x float> %69, <2 x float> %70, ptr noundef nonnull %5)
  br i1 %71, label %72, label %83

72:                                               ; preds = %.lr.ph.split
  %73 = load float, ptr %5, align 4, !tbaa !5
  %74 = fcmp ugt float %73, %44
  br i1 %74, label %83, label %75

75:                                               ; preds = %72
  %76 = fcmp ogt float %.05468, %73
  br i1 %76, label %77, label %81

77:                                               ; preds = %75
  %78 = call <2 x float> @frVector2ScalarMultiply(<2 x float> %10, float noundef %73)
  %79 = call <2 x float> @frVector2Add(<2 x float> %42, <2 x float> %78)
  store <2 x float> %79, ptr %45, align 8
  %80 = call <2 x float> @frVector2LeftNormal(<2 x float> %70)
  store <2 x float> %80, ptr %46, align 8
  br label %81

81:                                               ; preds = %77, %75
  %.155 = phi float [ %73, %77 ], [ %.05468, %75 ]
  %82 = add nsw i32 %.05269, 1
  br label %83

83:                                               ; preds = %81, %72, %.lr.ph.split
  %.2 = phi float [ %.155, %81 ], [ %.05468, %72 ], [ %.05468, %.lr.ph.split ]
  %.153 = phi i32 [ %82, %81 ], [ %.05269, %72 ], [ %.05269, %.lr.ph.split ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %84 = load i32, ptr %38, align 4, !tbaa !16
  %85 = sext i32 %84 to i64
  %86 = icmp slt i64 %indvars.iv.next, %85
  %87 = trunc nuw nsw i64 %indvars.iv to i32
  br i1 %86, label %.lr.ph.split, label %._crit_edge, !llvm.loop !19

88:                                               ; preds = %._crit_edge
  store ptr %0, ptr %2, align 8, !tbaa !9
  %89 = getelementptr inbounds i8, ptr %2, i64 28
  %90 = trunc i32 %.052.lcssa to i8
  %91 = and i8 %90, 1
  store i8 %91, ptr %89, align 4, !tbaa !15
  br label %92

92:                                               ; preds = %._crit_edge._crit_edge, %88
  %93 = phi i8 [ %.pre, %._crit_edge._crit_edge ], [ %91, %88 ]
  %94 = trunc nuw i8 %93 to i1
  %95 = icmp sgt i32 %.052.lcssa, 0
  %not. = xor i1 %94, true
  %96 = select i1 %not., i1 %95, i1 false
  br label %97

97:                                               ; preds = %7, %13, %24, %92
  %.0 = phi i1 [ %96, %92 ], [ %23, %24 ], [ %23, %13 ], [ false, %7 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %4) #4
  br label %98

98:                                               ; preds = %3, %97
  %.1 = phi i1 [ %.0, %97 ], [ false, %3 ]
  ret i1 %.1
}

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Normalize(<2 x float>) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @frComputeIntersectionCircleLine(<2 x float>, float noundef, <2 x float>, <2 x float>, ptr noundef) local_unnamed_addr #2

declare float @frGetCircleRadius(ptr noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Add(<2 x float>, <2 x float>) local_unnamed_addr #3

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2ScalarMultiply(<2 x float>, float noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2LeftNormal(<2 x float>) local_unnamed_addr #3

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Subtract(<2 x float>, <2 x float>) local_unnamed_addr #3

declare ptr @frGetPolygonVertices(ptr noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare <2 x float> @frVector2Transform(<2 x float>, ptr noundef byval(%struct.frTransform_) align 8) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @frComputeIntersectionLines(<2 x float>, <2 x float>, <2 x float>, <2 x float>, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { alwaysinline 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 #4 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"frRaycastHit_", !11, i64 0, !12, i64 8, !12, i64 16, !6, i64 24, !13, i64 28}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"frVector2_", !6, i64 0, !6, i64 4}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!10, !6, i64 24}
!15 = !{!10, !13, i64 28}
!16 = !{!17, !18, i64 64}
!17 = !{!"frVertices_", !7, i64 0, !18, i64 64}
!18 = !{!"int", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{i8 0, i8 2}


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