; LLVM IR from NishkarshRaj/Computer-Graphics :: Logistics/Clipping Algorithms/Sutherland Hodgeman (Sutherland_Net)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float>, <2 x float>, <2 x float>) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_Z12intersection7point2DS_S_S_(<2 x float>, <2 x float>, <2 x float>, <2 x float>) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z17SutherlandHodgmanP7point2DRiS0_S1_RA99_S_S1_(ptr noundef %0, ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(792) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %struct.point2D, align 4
  %14 = alloca %struct.point2D, align 4
  %15 = alloca %struct.point2D, align 4
  %16 = alloca %struct.point2D, align 4
  %17 = alloca [99 x %struct.point2D], align 16
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %struct.point2D, align 4
  %25 = alloca %struct.point2D, align 4
  %26 = alloca %struct.point2D, align 4
  %27 = alloca %struct.point2D, align 4
  %28 = alloca %struct.point2D, align 4
  %29 = alloca %struct.point2D, align 4
  %30 = alloca %struct.point2D, align 4
  %31 = alloca %struct.point2D, align 4
  %32 = alloca %struct.point2D, align 4
  %33 = alloca %struct.point2D, align 4
  %34 = alloca %struct.point2D, align 4
  %35 = alloca %struct.point2D, align 4
  %36 = alloca %struct.point2D, align 4
  %37 = alloca %struct.point2D, align 4
  %38 = alloca %struct.point2D, align 4
  %39 = alloca %struct.point2D, align 4
  %40 = alloca %struct.point2D, align 4
  %41 = alloca %struct.point2D, align 4
  %42 = alloca %struct.point2D, align 4
  %43 = alloca %struct.point2D, align 4
  %44 = alloca %struct.point2D, align 4
  %45 = alloca %struct.point2D, align 4
  %46 = alloca %struct.point2D, align 4
  %47 = alloca %struct.point2D, align 4
  %48 = alloca %struct.point2D, align 4
  %49 = alloca %struct.point2D, align 4
  %50 = alloca %struct.point2D, align 4
  %51 = alloca %struct.point2D, align 4
  %52 = alloca %struct.point2D, align 4
  %53 = alloca %struct.point2D, align 4
  %54 = alloca %struct.point2D, align 4
  %55 = alloca %struct.point2D, align 4
  %56 = alloca %struct.point2D, align 4
  %57 = alloca %struct.point2D, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 792, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %73, %6
  %59 = load i32, ptr %18, align 4, !tbaa !9
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = icmp slt i32 %59, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %76

64:                                               ; preds = %58
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = load i32, ptr %18, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds %struct.point2D, ptr %65, i64 %67
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = load i32, ptr %18, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [99 x %struct.point2D], ptr %69, i64 0, i64 %71
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %72, ptr align 4 %68, i64 8, i1 false), !tbaa.struct !11
  br label %73

73:                                               ; preds = %64
  %74 = load i32, ptr %18, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %18, align 4, !tbaa !9
  br label %58, !llvm.loop !14

76:                                               ; preds = %63
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 %78, ptr %79, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %217, %76
  %81 = load i32, ptr %19, align 4, !tbaa !9
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = icmp slt i32 %81, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %80
  store i32 5, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  br label %220

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %101, %86
  %88 = load i32, ptr %21, align 4, !tbaa !9
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = icmp slt i32 %88, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %87
  store i32 8, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  br label %104

93:                                               ; preds = %87
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = load i32, ptr %21, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [99 x %struct.point2D], ptr %94, i64 0, i64 %96
  %98 = load i32, ptr %21, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [99 x %struct.point2D], ptr %17, i64 0, i64 %99
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %100, ptr align 4 %97, i64 8, i1 false), !tbaa.struct !11
  br label %101

101:                                              ; preds = %93
  %102 = load i32, ptr %21, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %21, align 4, !tbaa !9
  br label %87, !llvm.loop !16

104:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  store i32 0, ptr %22, align 4, !tbaa !9
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = load i32, ptr %19, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %struct.point2D, ptr %105, i64 %107
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %108, i64 8, i1 false), !tbaa.struct !11
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = load i32, ptr %19, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = srem i32 %111, %113
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds %struct.point2D, ptr %109, i64 %115
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %116, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %211, %104
  %118 = load i32, ptr %23, align 4, !tbaa !9
  %119 = load ptr, ptr %12, align 8, !tbaa !5
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = icmp slt i32 %118, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %117
  store i32 11, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  br label %214

123:                                              ; preds = %117
  %124 = load i32, ptr %23, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [99 x %struct.point2D], ptr %17, i64 0, i64 %125
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 8 %126, i64 8, i1 false), !tbaa.struct !11
  %127 = load i32, ptr %23, align 4, !tbaa !9
  %128 = add nsw i32 %127, 1
  %129 = load ptr, ptr %12, align 8, !tbaa !5
  %130 = load i32, ptr %129, align 4, !tbaa !9
  %131 = srem i32 %128, %130
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [99 x %struct.point2D], ptr %17, i64 0, i64 %132
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 8 %133, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  %134 = load <2 x float>, ptr %24, align 4
  %135 = load <2 x float>, ptr %25, align 4
  %136 = load <2 x float>, ptr %26, align 4
  %137 = call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %134, <2 x float> %135, <2 x float> %136)
  br i1 %137, label %138, label %149

138:                                              ; preds = %123
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  %139 = load <2 x float>, ptr %27, align 4
  %140 = load <2 x float>, ptr %28, align 4
  %141 = load <2 x float>, ptr %29, align 4
  %142 = call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %139, <2 x float> %140, <2 x float> %141)
  br i1 %142, label %143, label %149

143:                                              ; preds = %138
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = load i32, ptr %22, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %22, align 4, !tbaa !9
  %147 = sext i32 %145 to i64
  %148 = getelementptr inbounds [99 x %struct.point2D], ptr %144, i64 0, i64 %147
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %148, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !11
  br label %210

149:                                              ; preds = %138, %123
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  %150 = load <2 x float>, ptr %30, align 4
  %151 = load <2 x float>, ptr %31, align 4
  %152 = load <2 x float>, ptr %32, align 4
  %153 = call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %150, <2 x float> %151, <2 x float> %152)
  br i1 %153, label %175, label %154

154:                                              ; preds = %149
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  %155 = load <2 x float>, ptr %33, align 4
  %156 = load <2 x float>, ptr %34, align 4
  %157 = load <2 x float>, ptr %35, align 4
  %158 = call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %155, <2 x float> %156, <2 x float> %157)
  br i1 %158, label %159, label %175

159:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %39, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %40, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !11
  %160 = load <2 x float>, ptr %37, align 4
  %161 = load <2 x float>, ptr %38, align 4
  %162 = load <2 x float>, ptr %39, align 4
  %163 = load <2 x float>, ptr %40, align 4
  %164 = call <2 x float> @_Z12intersection7point2DS_S_S_(<2 x float> %160, <2 x float> %161, <2 x float> %162, <2 x float> %163)
  store <2 x float> %164, ptr %36, align 4
  %165 = load ptr, ptr %11, align 8, !tbaa !5
  %166 = load i32, ptr %22, align 4, !tbaa !9
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %22, align 4, !tbaa !9
  %168 = sext i32 %166 to i64
  %169 = getelementptr inbounds [99 x %struct.point2D], ptr %165, i64 0, i64 %168
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %169, ptr align 4 %36, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #3
  %170 = load ptr, ptr %11, align 8, !tbaa !5
  %171 = load i32, ptr %22, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %22, align 4, !tbaa !9
  %173 = sext i32 %171 to i64
  %174 = getelementptr inbounds [99 x %struct.point2D], ptr %170, i64 0, i64 %173
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %174, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !11
  br label %209

175:                                              ; preds = %154, %149
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %41, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %42, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %43, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  %176 = load <2 x float>, ptr %41, align 4
  %177 = load <2 x float>, ptr %42, align 4
  %178 = load <2 x float>, ptr %43, align 4
  %179 = call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %176, <2 x float> %177, <2 x float> %178)
  br i1 %179, label %180, label %196

180:                                              ; preds = %175
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %44, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %45, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %46, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  %181 = load <2 x float>, ptr %44, align 4
  %182 = load <2 x float>, ptr %45, align 4
  %183 = load <2 x float>, ptr %46, align 4
  %184 = call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %181, <2 x float> %182, <2 x float> %183)
  br i1 %184, label %196, label %185

185:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %48, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %49, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %50, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %51, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !11
  %186 = load <2 x float>, ptr %48, align 4
  %187 = load <2 x float>, ptr %49, align 4
  %188 = load <2 x float>, ptr %50, align 4
  %189 = load <2 x float>, ptr %51, align 4
  %190 = call <2 x float> @_Z12intersection7point2DS_S_S_(<2 x float> %186, <2 x float> %187, <2 x float> %188, <2 x float> %189)
  store <2 x float> %190, ptr %47, align 4
  %191 = load ptr, ptr %11, align 8, !tbaa !5
  %192 = load i32, ptr %22, align 4, !tbaa !9
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr %22, align 4, !tbaa !9
  %194 = sext i32 %192 to i64
  %195 = getelementptr inbounds [99 x %struct.point2D], ptr %191, i64 0, i64 %194
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %195, ptr align 4 %47, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #3
  br label %208

196:                                              ; preds = %180, %175
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %52, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %53, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %54, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  %197 = load <2 x float>, ptr %52, align 4
  %198 = load <2 x float>, ptr %53, align 4
  %199 = load <2 x float>, ptr %54, align 4
  %200 = call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %197, <2 x float> %198, <2 x float> %199)
  br i1 %200, label %207, label %201

201:                                              ; preds = %196
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %55, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %56, ptr align 4 %13, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %57, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !11
  %202 = load <2 x float>, ptr %55, align 4
  %203 = load <2 x float>, ptr %56, align 4
  %204 = load <2 x float>, ptr %57, align 4
  %205 = call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %202, <2 x float> %203, <2 x float> %204)
  br i1 %205, label %207, label %206

206:                                              ; preds = %201
  br label %207

207:                                              ; preds = %206, %201, %196
  br label %208

208:                                              ; preds = %207, %185
  br label %209

209:                                              ; preds = %208, %159
  br label %210

210:                                              ; preds = %209, %143
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %23, align 4, !tbaa !9
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %23, align 4, !tbaa !9
  br label %117, !llvm.loop !17

214:                                              ; preds = %122
  %215 = load i32, ptr %22, align 4, !tbaa !9
  %216 = load ptr, ptr %12, align 8, !tbaa !5
  store i32 %215, ptr %216, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  br label %217

217:                                              ; preds = %214
  %218 = load i32, ptr %19, align 4, !tbaa !9
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %19, align 4, !tbaa !9
  br label %80, !llvm.loop !18

220:                                              ; preds = %85
  call void @llvm.lifetime.end.p0(i64 792, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  ret void
}

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

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


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float>, <2 x float>, <2 x float>) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @_Z12intersection7point2DS_S_S_(<2 x float>, <2 x float>, <2 x float>, <2 x float>) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z17SutherlandHodgmanP7point2DRiS0_S1_RA99_S_S1_(ptr nocapture noundef readonly %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(4) %1, ptr nocapture noundef readonly %2, ptr nocapture noundef nonnull readonly align 4 dereferenceable(4) %3, ptr nocapture noundef nonnull align 4 dereferenceable(792) %4, ptr nocapture noundef nonnull align 4 dereferenceable(4) %5) local_unnamed_addr #0 {
  %7 = alloca [99 x %struct.point2D], align 16
  call void @llvm.lifetime.start.p0(i64 792, ptr nonnull %7) #3
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.preheader111

.preheader111:                                    ; preds = %.lr.ph, %6
  %.lcssa = phi i32 [ %8, %6 ], [ %15, %.lr.ph ]
  store i32 %.lcssa, ptr %5, align 4, !tbaa !5
  %10 = load i32, ptr %3, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.preheader, label %._crit_edge122

.lr.ph:                                           ; preds = %6, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %6 ]
  %12 = getelementptr inbounds %struct.point2D, ptr %0, i64 %indvars.iv
  %13 = getelementptr inbounds [99 x %struct.point2D], ptr %4, i64 0, i64 %indvars.iv
  %14 = load i64, ptr %12, align 4
  store i64 %14, ptr %13, align 4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = icmp slt i64 %indvars.iv.next, %16
  br i1 %17, label %.lr.ph, label %.preheader111, !llvm.loop !9

.loopexit:                                        ; preds = %69, %._crit_edge
  %indvars.iv.next132138 = phi i64 [ %indvars.iv.next132, %._crit_edge ], [ %indvars.iv.next132135, %69 ]
  %.0107.lcssa = phi i32 [ 0, %._crit_edge ], [ %.1, %69 ]
  store i32 %.0107.lcssa, ptr %5, align 4, !tbaa !5
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next132138, %19
  br i1 %20, label %.preheader, label %._crit_edge122, !llvm.loop !11

.preheader:                                       ; preds = %.preheader111, %.loopexit
  %indvars.iv131 = phi i64 [ %indvars.iv.next132138, %.loopexit ], [ 0, %.preheader111 ]
  %21 = phi i32 [ %18, %.loopexit ], [ %10, %.preheader111 ]
  %22 = phi i32 [ %.0107.lcssa, %.loopexit ], [ %.lcssa, %.preheader111 ]
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph118.preheader, label %._crit_edge

._crit_edge122:                                   ; preds = %.loopexit, %.preheader111
  call void @llvm.lifetime.end.p0(i64 792, ptr nonnull %7) #3
  ret void

._crit_edge:                                      ; preds = %.preheader
  %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1
  br label %.loopexit

.lr.ph118.preheader:                              ; preds = %.preheader
  %24 = zext nneg i32 %22 to i64
  %25 = shl nuw nsw i64 %24, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %7, ptr nonnull align 4 %4, i64 %25, i1 false)
  %26 = getelementptr inbounds %struct.point2D, ptr %2, i64 %indvars.iv131
  %.sroa.078.0.copyload134 = load <2 x float>, ptr %26, align 4
  %indvars.iv.next132135 = add nuw nsw i64 %indvars.iv131, 1
  %27 = trunc nuw nsw i64 %indvars.iv.next132135 to i32
  %28 = srem i32 %27, %21
  %29 = zext nneg i32 %28 to i64
  %30 = getelementptr inbounds %struct.point2D, ptr %2, i64 %29
  %.sroa.068.0.copyload136 = load <2 x float>, ptr %30, align 4
  br label %.lr.ph118

.lr.ph118:                                        ; preds = %.lr.ph118.preheader, %69
  %indvars.iv128 = phi i64 [ 0, %.lr.ph118.preheader ], [ %indvars.iv.next129, %69 ]
  %31 = phi i32 [ %22, %.lr.ph118.preheader ], [ %70, %69 ]
  %.0107116 = phi i32 [ 0, %.lr.ph118.preheader ], [ %.1, %69 ]
  %32 = getelementptr inbounds [99 x %struct.point2D], ptr %7, i64 0, i64 %indvars.iv128
  %.sroa.062.0.copyload = load <2 x float>, ptr %32, align 8
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %33 = trunc nuw nsw i64 %indvars.iv.next129 to i32
  %34 = srem i32 %33, %31
  %35 = zext nneg i32 %34 to i64
  %36 = getelementptr inbounds [99 x %struct.point2D], ptr %7, i64 0, i64 %35
  %.sroa.054.0.copyload = load <2 x float>, ptr %36, align 8
  %37 = tail call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %.sroa.062.0.copyload, <2 x float> %.sroa.078.0.copyload134, <2 x float> %.sroa.068.0.copyload136)
  br i1 %37, label %38, label %44

38:                                               ; preds = %.lr.ph118
  %39 = tail call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %.sroa.054.0.copyload, <2 x float> %.sroa.078.0.copyload134, <2 x float> %.sroa.068.0.copyload136)
  br i1 %39, label %40, label %44

40:                                               ; preds = %38
  %41 = add nsw i32 %.0107116, 1
  %42 = sext i32 %.0107116 to i64
  %43 = getelementptr inbounds [99 x %struct.point2D], ptr %4, i64 0, i64 %42
  store <2 x float> %.sroa.054.0.copyload, ptr %43, align 4
  br label %69

44:                                               ; preds = %38, %.lr.ph118
  %45 = tail call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %.sroa.062.0.copyload, <2 x float> %.sroa.078.0.copyload134, <2 x float> %.sroa.068.0.copyload136)
  br i1 %45, label %56, label %46

46:                                               ; preds = %44
  %47 = tail call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %.sroa.054.0.copyload, <2 x float> %.sroa.078.0.copyload134, <2 x float> %.sroa.068.0.copyload136)
  br i1 %47, label %48, label %56

48:                                               ; preds = %46
  %49 = tail call <2 x float> @_Z12intersection7point2DS_S_S_(<2 x float> %.sroa.078.0.copyload134, <2 x float> %.sroa.068.0.copyload136, <2 x float> %.sroa.062.0.copyload, <2 x float> %.sroa.054.0.copyload)
  %50 = add nsw i32 %.0107116, 1
  %51 = sext i32 %.0107116 to i64
  %52 = getelementptr inbounds [99 x %struct.point2D], ptr %4, i64 0, i64 %51
  store <2 x float> %49, ptr %52, align 4
  %53 = add nsw i32 %.0107116, 2
  %54 = sext i32 %50 to i64
  %55 = getelementptr inbounds [99 x %struct.point2D], ptr %4, i64 0, i64 %54
  store <2 x float> %.sroa.054.0.copyload, ptr %55, align 4
  br label %69

56:                                               ; preds = %46, %44
  %57 = tail call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %.sroa.062.0.copyload, <2 x float> %.sroa.078.0.copyload134, <2 x float> %.sroa.068.0.copyload136)
  br i1 %57, label %58, label %65

58:                                               ; preds = %56
  %59 = tail call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %.sroa.054.0.copyload, <2 x float> %.sroa.078.0.copyload134, <2 x float> %.sroa.068.0.copyload136)
  br i1 %59, label %65, label %60

60:                                               ; preds = %58
  %61 = tail call <2 x float> @_Z12intersection7point2DS_S_S_(<2 x float> %.sroa.078.0.copyload134, <2 x float> %.sroa.068.0.copyload136, <2 x float> %.sroa.062.0.copyload, <2 x float> %.sroa.054.0.copyload)
  %62 = add nsw i32 %.0107116, 1
  %63 = sext i32 %.0107116 to i64
  %64 = getelementptr inbounds [99 x %struct.point2D], ptr %4, i64 0, i64 %63
  store <2 x float> %61, ptr %64, align 4
  br label %69

65:                                               ; preds = %58, %56
  %66 = tail call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %.sroa.062.0.copyload, <2 x float> %.sroa.078.0.copyload134, <2 x float> %.sroa.068.0.copyload136)
  br i1 %66, label %69, label %67

67:                                               ; preds = %65
  %68 = tail call noundef zeroext i1 @_Z6inside7point2DS_S_(<2 x float> %.sroa.054.0.copyload, <2 x float> %.sroa.078.0.copyload134, <2 x float> %.sroa.068.0.copyload136)
  br label %69

69:                                               ; preds = %67, %40, %60, %65, %48
  %.1 = phi i32 [ %41, %40 ], [ %.0107116, %65 ], [ %.0107116, %67 ], [ %62, %60 ], [ %53, %48 ]
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = icmp slt i64 %indvars.iv.next129, %71
  br i1 %72, label %.lr.ph118, label %.loopexit, !llvm.loop !12
}

; Function Attrs: mustprogress 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) #2

attributes #0 = { mustprogress 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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