; LLVM IR from Slingshot-Physics/slingshot-community :: common/geometry/src (polygon)

; 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"

%class.Vector3 = type { [3 x float] }
%"struct.geometry::types::polygon50_t" = type { i32, [50 x %class.Vector3] }

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Vector3miERKS_(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Vector312crossProductERKS_(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8geometry7polygon9halfPlaneERK7Vector3S3_S3_S3_b(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i1 noundef zeroext) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8geometry5types11polygon50_tC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(604), ptr noundef nonnull align 4 dereferenceable(604)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8geometry7polygon13orderVertsCcwERNS_5types11polygon50_tE(ptr noundef nonnull align 4 dereferenceable(604)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8geometry7polygon21clipSutherlandHodgmanERKNS_5types11polygon50_tES4_RS2_(ptr noundef nonnull align 4 dereferenceable(604) %0, ptr noundef nonnull align 4 dereferenceable(604) %1, ptr noundef nonnull align 4 dereferenceable(604) %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %class.Vector3, align 4
  %8 = alloca i32, align 4
  %9 = alloca %class.Vector3, align 4
  %10 = alloca float, align 4
  %11 = alloca %class.Vector3, align 4
  %12 = alloca %class.Vector3, align 4
  %13 = alloca %class.Vector3, align 4
  %14 = alloca %"struct.geometry::types::polygon50_t", align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.geometry::types::polygon50_t", align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %class.Vector3, align 4
  %25 = alloca %class.Vector3, align 4
  %26 = alloca i32, align 4
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca %class.Vector3, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %31, i32 0, i32 0
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = icmp ult i32 %33, 3
  br i1 %34, label %40, label %35

35:                                               ; preds = %3
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 4, !tbaa !9
  %39 = icmp ult i32 %38, 3
  br i1 %39, label %40, label %43

40:                                               ; preds = %35, %3
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %41, i32 0, i32 0
  store i32 0, ptr %42, align 4, !tbaa !9
  br label %245

43:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #5
  call void @_ZN7Vector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !12
  br label %44

44:                                               ; preds = %62, %43
  %45 = load i32, ptr %8, align 4, !tbaa !12
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %46, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = icmp ult i32 %45, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %65

51:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #5
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %52, i32 0, i32 1
  %54 = load i32, ptr %8, align 4, !tbaa !12
  %55 = zext i32 %54 to i64
  %56 = getelementptr inbounds [50 x %class.Vector3], ptr %53, i64 0, i64 %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %60 = uitofp i32 %59 to float
  store float %60, ptr %10, align 4, !tbaa !13
  call void @_ZNK7Vector3dvERKf(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %9, ptr noundef nonnull align 4 dereferenceable(12) %56, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %61 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3pLERKS_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #5
  br label %62

62:                                               ; preds = %51
  %63 = load i32, ptr %8, align 4, !tbaa !12
  %64 = add i32 %63, 1
  store i32 %64, ptr %8, align 4, !tbaa !12
  br label %44, !llvm.loop !15

65:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %66, i32 0, i32 1
  %68 = getelementptr inbounds [50 x %class.Vector3], ptr %67, i64 0, i64 0
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %68, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #5
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %69, i32 0, i32 1
  %71 = getelementptr inbounds [50 x %class.Vector3], ptr %70, i64 0, i64 1
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %71, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @_ZNK7Vector312crossProductERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %11, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %13)
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 604, ptr %14) #5
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN8geometry5types11polygon50_tC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(604) %14, ptr noundef nonnull align 4 dereferenceable(604) %72)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %73 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %14, i32 0, i32 0
  store ptr %73, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !12
  br label %74

74:                                               ; preds = %180, %65
  %75 = load i32, ptr %16, align 4, !tbaa !12
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %76, i32 0, i32 0
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = icmp ult i32 %75, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %74
  store i32 5, ptr %17, align 4
  br label %183

81:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 604, ptr %18) #5
  call void @_ZN8geometry5types11polygon50_tC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(604) %18, ptr noundef nonnull align 4 dereferenceable(604) %14)
  %82 = load ptr, ptr %15, align 8, !tbaa !5
  store i32 0, ptr %82, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %83, i32 0, i32 1
  %85 = load i32, ptr %16, align 4, !tbaa !12
  %86 = sub i32 %85, 1
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 4, !tbaa !9
  %90 = add i32 %86, %89
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %91, i32 0, i32 0
  %93 = load i32, ptr %92, align 4, !tbaa !9
  %94 = urem i32 %90, %93
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds [50 x %class.Vector3], ptr %84, i64 0, i64 %95
  store ptr %96, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %97, i32 0, i32 1
  %99 = load i32, ptr %16, align 4, !tbaa !12
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds [50 x %class.Vector3], ptr %98, i64 0, i64 %100
  store ptr %101, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !12
  br label %102

102:                                              ; preds = %171, %81
  %103 = load i32, ptr %21, align 4, !tbaa !12
  %104 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %18, i32 0, i32 0
  %105 = load i32, ptr %104, align 4, !tbaa !9
  %106 = icmp ult i32 %103, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %102
  store i32 8, ptr %17, align 4
  br label %174

108:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %109 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %18, i32 0, i32 1
  %110 = load i32, ptr %21, align 4, !tbaa !12
  %111 = sub i32 %110, 1
  %112 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %18, i32 0, i32 0
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = add i32 %111, %113
  %115 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %18, i32 0, i32 0
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = urem i32 %114, %116
  %118 = zext i32 %117 to i64
  %119 = getelementptr inbounds [50 x %class.Vector3], ptr %109, i64 0, i64 %118
  store ptr %119, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %120 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %18, i32 0, i32 1
  %121 = load i32, ptr %21, align 4, !tbaa !12
  %122 = zext i32 %121 to i64
  %123 = getelementptr inbounds [50 x %class.Vector3], ptr %120, i64 0, i64 %122
  store ptr %123, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #5
  call void @_ZN7Vector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %24)
  call void @llvm.lifetime.start.p0(i64 12, ptr %25) #5
  call void @_ZN7Vector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %124 = load ptr, ptr %19, align 8, !tbaa !5
  %125 = load ptr, ptr %20, align 8, !tbaa !5
  %126 = load ptr, ptr %22, align 8, !tbaa !5
  %127 = load ptr, ptr %23, align 8, !tbaa !5
  %128 = call noundef i32 @_ZN8geometry4line19segmentIntersectionERK7Vector3S3_S3_S3_RS1_S4_(ptr noundef nonnull align 4 dereferenceable(12) %124, ptr noundef nonnull align 4 dereferenceable(12) %125, ptr noundef nonnull align 4 dereferenceable(12) %126, ptr noundef nonnull align 4 dereferenceable(12) %127, ptr noundef nonnull align 4 dereferenceable(12) %24, ptr noundef nonnull align 4 dereferenceable(12) %25)
  store i32 %128, ptr %26, align 4, !tbaa !12
  %129 = load i32, ptr %26, align 4, !tbaa !12
  %130 = icmp sgt i32 %129, 0
  br i1 %130, label %131, label %146

131:                                              ; preds = %108
  %132 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %14, i32 0, i32 1
  %133 = load ptr, ptr %15, align 8, !tbaa !5
  %134 = load i32, ptr %133, align 4, !tbaa !12
  %135 = zext i32 %134 to i64
  %136 = getelementptr inbounds [50 x %class.Vector3], ptr %132, i64 0, i64 %135
  %137 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %136, ptr noundef nonnull align 4 dereferenceable(12) %24)
  %138 = load ptr, ptr %15, align 8, !tbaa !5
  %139 = load i32, ptr %138, align 4, !tbaa !12
  %140 = add i32 %139, 1
  store i32 %140, ptr %138, align 4, !tbaa !12
  %141 = load ptr, ptr %15, align 8, !tbaa !5
  %142 = load i32, ptr %141, align 4, !tbaa !12
  %143 = icmp eq i32 %142, 49
  br i1 %143, label %144, label %145

144:                                              ; preds = %131
  store i32 1, ptr %17, align 4
  br label %168

145:                                              ; preds = %131
  br label %146

146:                                              ; preds = %145, %108
  %147 = load ptr, ptr %19, align 8, !tbaa !5
  %148 = load ptr, ptr %20, align 8, !tbaa !5
  %149 = load ptr, ptr %23, align 8, !tbaa !5
  %150 = call noundef zeroext i1 @_ZN8geometry7polygon9halfPlaneERK7Vector3S3_S3_S3_b(ptr noundef nonnull align 4 dereferenceable(12) %147, ptr noundef nonnull align 4 dereferenceable(12) %148, ptr noundef nonnull align 4 dereferenceable(12) %149, ptr noundef nonnull align 4 dereferenceable(12) %11, i1 noundef zeroext true)
  br i1 %150, label %151, label %167

151:                                              ; preds = %146
  %152 = load ptr, ptr %23, align 8, !tbaa !5
  %153 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %14, i32 0, i32 1
  %154 = load ptr, ptr %15, align 8, !tbaa !5
  %155 = load i32, ptr %154, align 4, !tbaa !12
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds [50 x %class.Vector3], ptr %153, i64 0, i64 %156
  %158 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %157, ptr noundef nonnull align 4 dereferenceable(12) %152)
  %159 = load ptr, ptr %15, align 8, !tbaa !5
  %160 = load i32, ptr %159, align 4, !tbaa !12
  %161 = add i32 %160, 1
  store i32 %161, ptr %159, align 4, !tbaa !12
  %162 = load ptr, ptr %15, align 8, !tbaa !5
  %163 = load i32, ptr %162, align 4, !tbaa !12
  %164 = icmp eq i32 %163, 49
  br i1 %164, label %165, label %166

165:                                              ; preds = %151
  store i32 1, ptr %17, align 4
  br label %168

166:                                              ; preds = %151
  br label %167

167:                                              ; preds = %166, %146
  store i32 0, ptr %17, align 4
  br label %168

168:                                              ; preds = %167, %165, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  %169 = load i32, ptr %17, align 4
  switch i32 %169, label %174 [
    i32 0, label %170
  ]

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %21, align 4, !tbaa !12
  %173 = add i32 %172, 1
  store i32 %173, ptr %21, align 4, !tbaa !12
  br label %102, !llvm.loop !17

174:                                              ; preds = %168, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  %175 = load i32, ptr %17, align 4
  switch i32 %175, label %177 [
    i32 8, label %176
  ]

176:                                              ; preds = %174
  store i32 0, ptr %17, align 4
  br label %177

177:                                              ; preds = %176, %174
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 604, ptr %18) #5
  %178 = load i32, ptr %17, align 4
  switch i32 %178, label %183 [
    i32 0, label %179
  ]

179:                                              ; preds = %177
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %16, align 4, !tbaa !12
  %182 = add i32 %181, 1
  store i32 %182, ptr %16, align 4, !tbaa !12
  br label %74, !llvm.loop !18

183:                                              ; preds = %177, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %184 = load i32, ptr %17, align 4
  switch i32 %184, label %243 [
    i32 5, label %185
  ]

185:                                              ; preds = %183
  call void @_ZN8geometry7polygon13orderVertsCcwERNS_5types11polygon50_tE(ptr noundef nonnull align 4 dereferenceable(604) %14)
  %186 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %14, i32 0, i32 0
  %187 = load i32, ptr %186, align 4, !tbaa !9
  %188 = icmp eq i32 %187, 0
  br i1 %188, label %189, label %192

189:                                              ; preds = %185
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = call noundef nonnull align 4 dereferenceable(604) ptr @_ZN8geometry5types11polygon50_taSERKS1_(ptr noundef nonnull align 4 dereferenceable(604) %190, ptr noundef nonnull align 4 dereferenceable(604) %14)
  store i32 1, ptr %17, align 4
  br label %243

192:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %193 = load ptr, ptr %6, align 8, !tbaa !5
  %194 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %193, i32 0, i32 0
  store ptr %194, ptr %27, align 8, !tbaa !5
  %195 = load ptr, ptr %27, align 8, !tbaa !5
  store i32 1, ptr %195, align 4, !tbaa !12
  %196 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %14, i32 0, i32 1
  %197 = getelementptr inbounds [50 x %class.Vector3], ptr %196, i64 0, i64 0
  %198 = load ptr, ptr %6, align 8, !tbaa !5
  %199 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %198, i32 0, i32 1
  %200 = getelementptr inbounds [50 x %class.Vector3], ptr %199, i64 0, i64 0
  %201 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %200, ptr noundef nonnull align 4 dereferenceable(12) %197)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 1, ptr %28, align 4, !tbaa !12
  br label %202

202:                                              ; preds = %239, %192
  %203 = load i32, ptr %28, align 4, !tbaa !12
  %204 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %14, i32 0, i32 0
  %205 = load i32, ptr %204, align 4, !tbaa !9
  %206 = icmp ult i32 %203, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %202
  store i32 11, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %242

208:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %209 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %14, i32 0, i32 1
  %210 = load i32, ptr %28, align 4, !tbaa !12
  %211 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %14, i32 0, i32 0
  %212 = load i32, ptr %211, align 4, !tbaa !9
  %213 = urem i32 %210, %212
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds [50 x %class.Vector3], ptr %209, i64 0, i64 %214
  store ptr %215, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr %30) #5
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  %217 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %216, i32 0, i32 1
  %218 = load ptr, ptr %27, align 8, !tbaa !5
  %219 = load i32, ptr %218, align 4, !tbaa !12
  %220 = sub i32 %219, 1
  %221 = zext i32 %220 to i64
  %222 = getelementptr inbounds [50 x %class.Vector3], ptr %217, i64 0, i64 %221
  %223 = load ptr, ptr %29, align 8, !tbaa !5
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %30, ptr noundef nonnull align 4 dereferenceable(12) %222, ptr noundef nonnull align 4 dereferenceable(12) %223)
  %224 = call noundef float @_ZNK7Vector39magnitudeEv(ptr noundef nonnull align 4 dereferenceable(12) %30)
  %225 = fcmp ogt float %224, 0x3EB0C6F7A0000000
  call void @llvm.lifetime.end.p0(i64 12, ptr %30) #5
  br i1 %225, label %226, label %238

226:                                              ; preds = %208
  %227 = load ptr, ptr %29, align 8, !tbaa !5
  %228 = load ptr, ptr %6, align 8, !tbaa !5
  %229 = getelementptr inbounds %"struct.geometry::types::polygon50_t", ptr %228, i32 0, i32 1
  %230 = load ptr, ptr %27, align 8, !tbaa !5
  %231 = load i32, ptr %230, align 4, !tbaa !12
  %232 = zext i32 %231 to i64
  %233 = getelementptr inbounds [50 x %class.Vector3], ptr %229, i64 0, i64 %232
  %234 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %233, ptr noundef nonnull align 4 dereferenceable(12) %227)
  %235 = load ptr, ptr %27, align 8, !tbaa !5
  %236 = load i32, ptr %235, align 4, !tbaa !12
  %237 = add i32 %236, 1
  store i32 %237, ptr %235, align 4, !tbaa !12
  br label %238

238:                                              ; preds = %226, %208
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %239

239:                                              ; preds = %238
  %240 = load i32, ptr %28, align 4, !tbaa !12
  %241 = add i32 %240, 1
  store i32 %241, ptr %28, align 4, !tbaa !12
  br label %202, !llvm.loop !19

242:                                              ; preds = %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  store i32 0, ptr %17, align 4
  br label %243

243:                                              ; preds = %242, %189, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 604, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #5
  %244 = load i32, ptr %17, align 4
  switch i32 %244, label %246 [
    i32 0, label %245
    i32 1, label %245
  ]

245:                                              ; preds = %243, %243, %40
  ret void

246:                                              ; preds = %243
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Vector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Vector3dvERKf(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3pLERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

declare noundef i32 @_ZN8geometry4line19segmentIntersectionERK7Vector3S3_S3_S3_RS1_S4_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(604) ptr @_ZN8geometry5types11polygon50_taSERKS1_(ptr noundef nonnull align 4 dereferenceable(604), ptr noundef nonnull align 4 dereferenceable(604)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK7Vector39magnitudeEv(ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN8geometry5types11polygon50_tE", !11, i64 0, !7, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; 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"

%class.Vector3 = type { [3 x float] }
%"struct.geometry::types::polygon50_t" = type { i32, [50 x %class.Vector3] }

; 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 uwtable
declare dso_local void @_ZNK7Vector3miERKS_(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Vector312crossProductERKS_(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN8geometry7polygon9halfPlaneERK7Vector3S3_S3_S3_b(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8geometry5types11polygon50_tC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(604), ptr noundef nonnull align 4 dereferenceable(604)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8geometry7polygon13orderVertsCcwERNS_5types11polygon50_tE(ptr noundef nonnull align 4 dereferenceable(604)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8geometry7polygon21clipSutherlandHodgmanERKNS_5types11polygon50_tES4_RS2_(ptr noundef nonnull align 4 dereferenceable(604) %0, ptr noundef nonnull align 4 dereferenceable(604) %1, ptr noundef nonnull align 4 dereferenceable(604) %2) local_unnamed_addr #1 {
  %4 = alloca %class.Vector3, align 4
  %5 = alloca %class.Vector3, align 4
  %6 = alloca float, align 4
  %7 = alloca %class.Vector3, align 4
  %8 = alloca %class.Vector3, align 4
  %9 = alloca %class.Vector3, align 4
  %10 = alloca %"struct.geometry::types::polygon50_t", align 4
  %11 = alloca %"struct.geometry::types::polygon50_t", align 4
  %12 = alloca %class.Vector3, align 4
  %13 = alloca %class.Vector3, align 4
  %14 = alloca %class.Vector3, align 4
  %15 = load i32, ptr %0, align 4, !tbaa !5
  %16 = icmp ult i32 %15, 3
  %17 = load i32, ptr %1, align 4
  %18 = icmp ult i32 %17, 3
  %or.cond = select i1 %16, i1 true, i1 %18
  br i1 %or.cond, label %19, label %20

19:                                               ; preds = %3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %107

20:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #5
  call void @_ZN7Vector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %4)
  %21 = load i32, ptr %0, align 4, !tbaa !5
  %.not85 = icmp eq i32 %21, 0
  br i1 %.not85, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %20
  %22 = getelementptr inbounds i8, ptr %0, i64 4
  br label %28

._crit_edge:                                      ; preds = %28, %20
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #5
  %23 = getelementptr inbounds i8, ptr %0, i64 4
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %23, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #5
  %24 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %9, ptr noundef nonnull align 4 dereferenceable(12) %24, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @_ZNK7Vector312crossProductERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %9)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 604, ptr nonnull %10) #5
  call void @_ZN8geometry5types11polygon50_tC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(604) %10, ptr noundef nonnull align 4 dereferenceable(604) %1)
  %25 = load i32, ptr %0, align 4, !tbaa !5
  %.not6678.not = icmp eq i32 %25, 0
  br i1 %.not6678.not, label %.critedge71, label %.lr.ph81

.lr.ph81:                                         ; preds = %._crit_edge
  %26 = getelementptr inbounds i8, ptr %11, i64 4
  %27 = getelementptr inbounds i8, ptr %10, i64 4
  br label %36

28:                                               ; preds = %.lr.ph, %28
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %28 ]
  %29 = phi i32 [ %21, %.lr.ph ], [ %33, %28 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  %30 = getelementptr inbounds [50 x %class.Vector3], ptr %22, i64 0, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %31 = uitofp i32 %29 to float
  store float %31, ptr %6, align 4, !tbaa !10
  call void @_ZNK7Vector3dvERKf(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %5, ptr noundef nonnull align 4 dereferenceable(12) %30, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %32 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3pLERKS_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i32, ptr %0, align 4, !tbaa !5
  %34 = zext i32 %33 to i64
  %35 = icmp ult i64 %indvars.iv.next, %34
  br i1 %35, label %28, label %._crit_edge, !llvm.loop !12

36:                                               ; preds = %.lr.ph81, %._crit_edge77
  %indvars.iv90 = phi i64 [ 0, %.lr.ph81 ], [ %indvars.iv.next91, %._crit_edge77 ]
  call void @llvm.lifetime.start.p0(i64 604, ptr nonnull %11) #5
  call void @_ZN8geometry5types11polygon50_tC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(604) %11, ptr noundef nonnull align 4 dereferenceable(604) %10)
  store i32 0, ptr %10, align 4, !tbaa !14
  %37 = trunc nuw i64 %indvars.iv90 to i32
  %38 = add i32 %37, -1
  %39 = load i32, ptr %0, align 4, !tbaa !5
  %40 = add i32 %38, %39
  %41 = urem i32 %40, %39
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds [50 x %class.Vector3], ptr %23, i64 0, i64 %42
  %44 = getelementptr inbounds [50 x %class.Vector3], ptr %23, i64 0, i64 %indvars.iv90
  %45 = load i32, ptr %11, align 4, !tbaa !5
  %.not73.not = icmp eq i32 %45, 0
  br i1 %.not73.not, label %._crit_edge77, label %.lr.ph76

.lr.ph76:                                         ; preds = %36, %.critedge
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %.critedge ], [ 0, %36 ]
  %46 = phi i32 [ %74, %.critedge ], [ %45, %36 ]
  %47 = trunc nuw i64 %indvars.iv87 to i32
  %48 = add i32 %47, -1
  %49 = add i32 %48, %46
  %50 = urem i32 %49, %46
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds [50 x %class.Vector3], ptr %26, i64 0, i64 %51
  %53 = getelementptr inbounds [50 x %class.Vector3], ptr %26, i64 0, i64 %indvars.iv87
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #5
  call void @_ZN7Vector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %13) #5
  call void @_ZN7Vector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %13)
  %54 = call noundef i32 @_ZN8geometry4line19segmentIntersectionERK7Vector3S3_S3_S3_RS1_S4_(ptr noundef nonnull align 4 dereferenceable(12) %43, ptr noundef nonnull align 4 dereferenceable(12) %44, ptr noundef nonnull align 4 dereferenceable(12) %52, ptr noundef nonnull align 4 dereferenceable(12) %53, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %13)
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %56, label %64

56:                                               ; preds = %.lr.ph76
  %57 = load i32, ptr %10, align 4, !tbaa !14
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds [50 x %class.Vector3], ptr %27, i64 0, i64 %58
  %60 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %59, ptr noundef nonnull align 4 dereferenceable(12) %12)
  %61 = load i32, ptr %10, align 4, !tbaa !14
  %62 = add i32 %61, 1
  store i32 %62, ptr %10, align 4, !tbaa !14
  %63 = icmp eq i32 %62, 49
  br i1 %63, label %78, label %64

64:                                               ; preds = %56, %.lr.ph76
  %65 = call noundef zeroext i1 @_ZN8geometry7polygon9halfPlaneERK7Vector3S3_S3_S3_b(ptr noundef nonnull align 4 dereferenceable(12) %43, ptr noundef nonnull align 4 dereferenceable(12) %44, ptr noundef nonnull align 4 dereferenceable(12) %53, ptr noundef nonnull align 4 dereferenceable(12) %7, i1 noundef zeroext true)
  br i1 %65, label %66, label %.critedge

66:                                               ; preds = %64
  %67 = load i32, ptr %10, align 4, !tbaa !14
  %68 = zext i32 %67 to i64
  %69 = getelementptr inbounds [50 x %class.Vector3], ptr %27, i64 0, i64 %68
  %70 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %69, ptr noundef nonnull align 4 dereferenceable(12) %53)
  %71 = load i32, ptr %10, align 4, !tbaa !14
  %72 = add i32 %71, 1
  store i32 %72, ptr %10, align 4, !tbaa !14
  %73 = icmp eq i32 %72, 49
  br i1 %73, label %78, label %.critedge

.critedge:                                        ; preds = %66, %64
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #5
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %74 = load i32, ptr %11, align 4, !tbaa !5
  %75 = zext i32 %74 to i64
  %.not = icmp ult i64 %indvars.iv.next88, %75
  br i1 %.not, label %.lr.ph76, label %._crit_edge77.loopexit, !llvm.loop !15

._crit_edge77.loopexit:                           ; preds = %.critedge
  %.pre = load i32, ptr %0, align 4, !tbaa !5
  br label %._crit_edge77

._crit_edge77:                                    ; preds = %._crit_edge77.loopexit, %36
  %76 = phi i32 [ %.pre, %._crit_edge77.loopexit ], [ %39, %36 ]
  call void @llvm.lifetime.end.p0(i64 604, ptr nonnull %11) #5
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %77 = zext i32 %76 to i64
  %.not66 = icmp ult i64 %indvars.iv.next91, %77
  br i1 %.not66, label %36, label %.critedge71, !llvm.loop !16

78:                                               ; preds = %56, %66
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 604, ptr nonnull %11) #5
  br label %.loopexit

.critedge71:                                      ; preds = %._crit_edge77, %._crit_edge
  call void @_ZN8geometry7polygon13orderVertsCcwERNS_5types11polygon50_tE(ptr noundef nonnull align 4 dereferenceable(604) %10)
  %79 = load i32, ptr %10, align 4, !tbaa !5
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %83

81:                                               ; preds = %.critedge71
  %82 = call noundef nonnull align 4 dereferenceable(604) ptr @_ZN8geometry5types11polygon50_taSERKS1_(ptr noundef nonnull align 4 dereferenceable(604) %2, ptr noundef nonnull align 4 dereferenceable(604) %10)
  br label %.loopexit

83:                                               ; preds = %.critedge71
  store i32 1, ptr %2, align 4, !tbaa !14
  %84 = getelementptr inbounds i8, ptr %10, i64 4
  %85 = getelementptr inbounds i8, ptr %2, i64 4
  %86 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %85, ptr noundef nonnull align 4 dereferenceable(12) %84)
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = icmp ugt i32 %87, 1
  br i1 %88, label %.lr.ph84, label %.loopexit

.lr.ph84:                                         ; preds = %83, %103
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %103 ], [ 1, %83 ]
  %89 = getelementptr inbounds [50 x %class.Vector3], ptr %84, i64 0, i64 %indvars.iv93
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #5
  %90 = load i32, ptr %2, align 4, !tbaa !14
  %91 = add i32 %90, -1
  %92 = zext i32 %91 to i64
  %93 = getelementptr inbounds [50 x %class.Vector3], ptr %85, i64 0, i64 %92
  call void @_ZNK7Vector3miERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %14, ptr noundef nonnull align 4 dereferenceable(12) %93, ptr noundef nonnull align 4 dereferenceable(12) %89)
  %94 = call noundef float @_ZNK7Vector39magnitudeEv(ptr noundef nonnull align 4 dereferenceable(12) %14)
  %95 = fcmp ogt float %94, 0x3EB0C6F7A0000000
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #5
  br i1 %95, label %96, label %103

96:                                               ; preds = %.lr.ph84
  %97 = load i32, ptr %2, align 4, !tbaa !14
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds [50 x %class.Vector3], ptr %85, i64 0, i64 %98
  %100 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12) %99, ptr noundef nonnull align 4 dereferenceable(12) %89)
  %101 = load i32, ptr %2, align 4, !tbaa !14
  %102 = add i32 %101, 1
  store i32 %102, ptr %2, align 4, !tbaa !14
  br label %103

103:                                              ; preds = %96, %.lr.ph84
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = zext i32 %104 to i64
  %106 = icmp ult i64 %indvars.iv.next94, %105
  br i1 %106, label %.lr.ph84, label %.loopexit, !llvm.loop !17

.loopexit:                                        ; preds = %103, %83, %78, %81
  call void @llvm.lifetime.end.p0(i64 604, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  br label %107

107:                                              ; preds = %.loopexit, %19
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3aSERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7Vector3C2Ev(ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Vector3dvERKf(ptr dead_on_unwind noalias writable sret(%class.Vector3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector3pLERKS_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

declare noundef i32 @_ZN8geometry4line19segmentIntersectionERK7Vector3S3_S3_S3_RS1_S4_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(604) ptr @_ZN8geometry5types11polygon50_taSERKS1_(ptr noundef nonnull align 4 dereferenceable(604), ptr noundef nonnull align 4 dereferenceable(604)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef float @_ZNK7Vector39magnitudeEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

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


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