; LLVM IR from MIT-SPARK/Kimera-VIO :: third_party/triangle/src (triangle)

; 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.otri = type { ptr, i32 }
%struct.osub = type { ptr, i32 }
%struct.mesh = type { %struct.memorypool, %struct.memorypool, %struct.memorypool, %struct.memorypool, %struct.memorypool, %struct.memorypool, %struct.memorypool, %struct.memorypool, [4096 x ptr], [4096 x ptr], [4096 x i32], i32, ptr, float, float, float, float, float, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.otri }
%struct.memorypool = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i64, i64, i32, i32 }

@plus1mod3 = external dso_local global [3 x i32], align 4
@minus1mod3 = external dso_local global [3 x i32], align 4

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

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

; Function Attrs: nounwind uwtable
declare dso_local float @counterclockwise(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @insertsubseg(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @flip(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @segmentintersection(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @scoutsegment(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @delaunayfixup(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @constrainededge(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.otri, align 8
  %12 = alloca %struct.otri, align 8
  %13 = alloca %struct.osub, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca float, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store i32 %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #2
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #2
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #2
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.otri, ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.otri, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 8, !tbaa !13
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = add nsw i32 %29, 3
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds ptr, ptr %23, i64 %31
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  store ptr %33, ptr %14, align 8, !tbaa !5
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.otri, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  store ptr %36, ptr %37, align 8, !tbaa !11
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.otri, ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 8, !tbaa !13
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  store i32 %43, ptr %44, align 8, !tbaa !13
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  call void @flip(ptr noundef %45, ptr noundef %46, ptr noundef %11)
  store i32 0, ptr %17, align 4, !tbaa !9
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %249, %5
  %48 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !11
  %50 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %51 = load i32, ptr %50, align 8, !tbaa !13
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = add nsw i32 %54, 3
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds ptr, ptr %49, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  store ptr %58, ptr %15, align 8, !tbaa !5
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  %60 = getelementptr inbounds float, ptr %59, i64 0
  %61 = load float, ptr %60, align 4, !tbaa !14
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds float, ptr %62, i64 0
  %64 = load float, ptr %63, align 4, !tbaa !14
  %65 = fcmp oeq float %61, %64
  br i1 %65, label %66, label %105

66:                                               ; preds = %47
  %67 = load ptr, ptr %15, align 8, !tbaa !5
  %68 = getelementptr inbounds float, ptr %67, i64 1
  %69 = load float, ptr %68, align 4, !tbaa !14
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = getelementptr inbounds float, ptr %70, i64 1
  %72 = load float, ptr %71, align 4, !tbaa !14
  %73 = fcmp oeq float %69, %72
  br i1 %73, label %74, label %105

74:                                               ; preds = %66
  %75 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !13
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds ptr, ptr %76, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  store ptr %81, ptr %19, align 8, !tbaa !5
  %82 = load ptr, ptr %19, align 8, !tbaa !5
  %83 = ptrtoint ptr %82 to i64
  %84 = and i64 %83, 3
  %85 = trunc i64 %84 to i32
  %86 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  store i32 %85, ptr %86, align 8, !tbaa !13
  %87 = load ptr, ptr %19, align 8, !tbaa !5
  %88 = ptrtoint ptr %87 to i64
  %89 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %90 = load i32, ptr %89, align 8, !tbaa !13
  %91 = sext i32 %90 to i64
  %92 = xor i64 %88, %91
  %93 = inttoptr i64 %92 to ptr
  %94 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  store ptr %93, ptr %94, align 8, !tbaa !11
  %95 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %96 = load i32, ptr %95, align 8, !tbaa !13
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !9
  %100 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  store i32 %99, ptr %100, align 8, !tbaa !13
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  call void @delaunayfixup(ptr noundef %101, ptr noundef %102, ptr noundef %11, i32 noundef 0)
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  call void @delaunayfixup(ptr noundef %103, ptr noundef %104, ptr noundef %12, i32 noundef 1)
  store i32 1, ptr %18, align 4, !tbaa !9
  br label %248

105:                                              ; preds = %66, %47
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = load ptr, ptr %14, align 8, !tbaa !5
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = load ptr, ptr %15, align 8, !tbaa !5
  %111 = call float @counterclockwise(ptr noundef %106, ptr noundef %107, ptr noundef %108, ptr noundef %109, ptr noundef %110)
  store float %111, ptr %16, align 4, !tbaa !14
  %112 = load float, ptr %16, align 4, !tbaa !14
  %113 = fpext float %112 to double
  %114 = fcmp oeq double %113, 0.000000e+00
  br i1 %114, label %115, label %146

115:                                              ; preds = %105
  store i32 1, ptr %17, align 4, !tbaa !9
  %116 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !11
  %118 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %119 = load i32, ptr %118, align 8, !tbaa !13
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds ptr, ptr %117, i64 %120
  %122 = load ptr, ptr %121, align 8, !tbaa !5
  store ptr %122, ptr %19, align 8, !tbaa !5
  %123 = load ptr, ptr %19, align 8, !tbaa !5
  %124 = ptrtoint ptr %123 to i64
  %125 = and i64 %124, 3
  %126 = trunc i64 %125 to i32
  %127 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  store i32 %126, ptr %127, align 8, !tbaa !13
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = ptrtoint ptr %128 to i64
  %130 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %131 = load i32, ptr %130, align 8, !tbaa !13
  %132 = sext i32 %131 to i64
  %133 = xor i64 %129, %132
  %134 = inttoptr i64 %133 to ptr
  %135 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  store ptr %134, ptr %135, align 8, !tbaa !11
  %136 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %137 = load i32, ptr %136, align 8, !tbaa !13
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !9
  %141 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  store i32 %140, ptr %141, align 8, !tbaa !13
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  call void @delaunayfixup(ptr noundef %142, ptr noundef %143, ptr noundef %11, i32 noundef 0)
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = load ptr, ptr %7, align 8, !tbaa !5
  call void @delaunayfixup(ptr noundef %144, ptr noundef %145, ptr noundef %12, i32 noundef 1)
  store i32 1, ptr %18, align 4, !tbaa !9
  br label %247

146:                                              ; preds = %105
  %147 = load float, ptr %16, align 4, !tbaa !14
  %148 = fpext float %147 to double
  %149 = fcmp ogt double %148, 0.000000e+00
  br i1 %149, label %150, label %185

150:                                              ; preds = %146
  %151 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !11
  %153 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %154 = load i32, ptr %153, align 8, !tbaa !13
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds ptr, ptr %152, i64 %155
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  store ptr %157, ptr %19, align 8, !tbaa !5
  %158 = load ptr, ptr %19, align 8, !tbaa !5
  %159 = ptrtoint ptr %158 to i64
  %160 = and i64 %159, 3
  %161 = trunc i64 %160 to i32
  %162 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  store i32 %161, ptr %162, align 8, !tbaa !13
  %163 = load ptr, ptr %19, align 8, !tbaa !5
  %164 = ptrtoint ptr %163 to i64
  %165 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %166 = load i32, ptr %165, align 8, !tbaa !13
  %167 = sext i32 %166 to i64
  %168 = xor i64 %164, %167
  %169 = inttoptr i64 %168 to ptr
  %170 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  store ptr %169, ptr %170, align 8, !tbaa !11
  %171 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %172 = load i32, ptr %171, align 8, !tbaa !13
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !9
  %176 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  store i32 %175, ptr %176, align 8, !tbaa !13
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  call void @delaunayfixup(ptr noundef %177, ptr noundef %178, ptr noundef %12, i32 noundef 1)
  %179 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %180 = load i32, ptr %179, align 8, !tbaa !13
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [3 x i32], ptr @minus1mod3, i64 0, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !9
  %184 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  store i32 %183, ptr %184, align 8, !tbaa !13
  br label %214

185:                                              ; preds = %146
  %186 = load ptr, ptr %6, align 8, !tbaa !5
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  call void @delaunayfixup(ptr noundef %186, ptr noundef %187, ptr noundef %11, i32 noundef 0)
  %188 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %189 = load ptr, ptr %188, align 8, !tbaa !11
  %190 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %191 = load i32, ptr %190, align 8, !tbaa !13
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds ptr, ptr %189, i64 %192
  %194 = load ptr, ptr %193, align 8, !tbaa !5
  store ptr %194, ptr %19, align 8, !tbaa !5
  %195 = load ptr, ptr %19, align 8, !tbaa !5
  %196 = ptrtoint ptr %195 to i64
  %197 = and i64 %196, 3
  %198 = trunc i64 %197 to i32
  %199 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  store i32 %198, ptr %199, align 8, !tbaa !13
  %200 = load ptr, ptr %19, align 8, !tbaa !5
  %201 = ptrtoint ptr %200 to i64
  %202 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %203 = load i32, ptr %202, align 8, !tbaa !13
  %204 = sext i32 %203 to i64
  %205 = xor i64 %201, %204
  %206 = inttoptr i64 %205 to ptr
  %207 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  store ptr %206, ptr %207, align 8, !tbaa !11
  %208 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %209 = load i32, ptr %208, align 8, !tbaa !13
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !9
  %213 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  store i32 %212, ptr %213, align 8, !tbaa !13
  br label %214

214:                                              ; preds = %185, %150
  %215 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !11
  %217 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %218 = load i32, ptr %217, align 8, !tbaa !13
  %219 = add nsw i32 6, %218
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds ptr, ptr %216, i64 %220
  %222 = load ptr, ptr %221, align 8, !tbaa !5
  store ptr %222, ptr %20, align 8, !tbaa !5
  %223 = load ptr, ptr %20, align 8, !tbaa !5
  %224 = ptrtoint ptr %223 to i64
  %225 = and i64 %224, 1
  %226 = trunc i64 %225 to i32
  %227 = getelementptr inbounds %struct.osub, ptr %13, i32 0, i32 1
  store i32 %226, ptr %227, align 8, !tbaa !16
  %228 = load ptr, ptr %20, align 8, !tbaa !5
  %229 = ptrtoint ptr %228 to i64
  %230 = and i64 %229, -4
  %231 = inttoptr i64 %230 to ptr
  %232 = getelementptr inbounds %struct.osub, ptr %13, i32 0, i32 0
  store ptr %231, ptr %232, align 8, !tbaa !18
  %233 = getelementptr inbounds %struct.osub, ptr %13, i32 0, i32 0
  %234 = load ptr, ptr %233, align 8, !tbaa !18
  %235 = load ptr, ptr %6, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.mesh, ptr %235, i32 0, i32 50
  %237 = load ptr, ptr %236, align 8, !tbaa !19
  %238 = icmp eq ptr %234, %237
  br i1 %238, label %239, label %242

239:                                              ; preds = %214
  %240 = load ptr, ptr %6, align 8, !tbaa !5
  %241 = load ptr, ptr %7, align 8, !tbaa !5
  call void @flip(ptr noundef %240, ptr noundef %241, ptr noundef %11)
  br label %246

242:                                              ; preds = %214
  store i32 1, ptr %17, align 4, !tbaa !9
  %243 = load ptr, ptr %6, align 8, !tbaa !5
  %244 = load ptr, ptr %7, align 8, !tbaa !5
  %245 = load ptr, ptr %9, align 8, !tbaa !5
  call void @segmentintersection(ptr noundef %243, ptr noundef %244, ptr noundef %11, ptr noundef %13, ptr noundef %245)
  store i32 1, ptr %18, align 4, !tbaa !9
  br label %246

246:                                              ; preds = %242, %239
  br label %247

247:                                              ; preds = %246, %115
  br label %248

248:                                              ; preds = %247, %74
  br label %249

249:                                              ; preds = %248
  %250 = load i32, ptr %18, align 4, !tbaa !9
  %251 = icmp ne i32 %250, 0
  %252 = xor i1 %251, true
  br i1 %252, label %47, label %253, !llvm.loop !23

253:                                              ; preds = %249
  %254 = load ptr, ptr %6, align 8, !tbaa !5
  %255 = load ptr, ptr %7, align 8, !tbaa !5
  %256 = load i32, ptr %10, align 4, !tbaa !9
  call void @insertsubseg(ptr noundef %254, ptr noundef %255, ptr noundef %11, i32 noundef %256)
  %257 = load i32, ptr %17, align 4, !tbaa !9
  %258 = icmp ne i32 %257, 0
  br i1 %258, label %259, label %272

259:                                              ; preds = %253
  %260 = load ptr, ptr %6, align 8, !tbaa !5
  %261 = load ptr, ptr %7, align 8, !tbaa !5
  %262 = load ptr, ptr %9, align 8, !tbaa !5
  %263 = load i32, ptr %10, align 4, !tbaa !9
  %264 = call i32 @scoutsegment(ptr noundef %260, ptr noundef %261, ptr noundef %11, ptr noundef %262, i32 noundef %263)
  %265 = icmp ne i32 %264, 0
  br i1 %265, label %271, label %266

266:                                              ; preds = %259
  %267 = load ptr, ptr %6, align 8, !tbaa !5
  %268 = load ptr, ptr %7, align 8, !tbaa !5
  %269 = load ptr, ptr %9, align 8, !tbaa !5
  %270 = load i32, ptr %10, align 4, !tbaa !9
  call void @constrainededge(ptr noundef %267, ptr noundef %268, ptr noundef %11, ptr noundef %269, i32 noundef %270)
  br label %271

271:                                              ; preds = %266, %259
  br label %272

272:                                              ; preds = %271, %253
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #2
  ret void
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"otri", !6, i64 0, !10, i64 8}
!13 = !{!12, !10, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!17, !10, i64 8}
!17 = !{!"osub", !6, i64 0, !10, i64 8}
!18 = !{!17, !6, i64 0}
!19 = !{!20, !6, i64 82856}
!20 = !{!"mesh", !21, i64 0, !21, i64 88, !21, i64 176, !21, i64 264, !21, i64 352, !21, i64 440, !21, i64 528, !21, i64 616, !7, i64 704, !7, i64 33472, !7, i64 66240, !10, i64 82624, !6, i64 82632, !15, i64 82640, !15, i64 82644, !15, i64 82648, !15, i64 82652, !15, i64 82656, !10, i64 82660, !10, i64 82664, !10, i64 82668, !10, i64 82672, !10, i64 82676, !10, i64 82680, !22, i64 82688, !10, i64 82696, !10, i64 82700, !10, i64 82704, !22, i64 82712, !10, i64 82720, !10, i64 82724, !10, i64 82728, !10, i64 82732, !10, i64 82736, !10, i64 82740, !10, i64 82744, !10, i64 82748, !10, i64 82752, !22, i64 82760, !22, i64 82768, !22, i64 82776, !22, i64 82784, !22, i64 82792, !22, i64 82800, !22, i64 82808, !6, i64 82816, !6, i64 82824, !6, i64 82832, !6, i64 82840, !6, i64 82848, !6, i64 82856, !6, i64 82864, !12, i64 82872}
!21 = !{!"memorypool", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !22, i64 64, !22, i64 72, !10, i64 80, !10, i64 84}
!22 = !{!"long", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"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.otri = type { ptr, i32 }
%struct.osub = type { ptr, i32 }

@plus1mod3 = external dso_local local_unnamed_addr global [3 x i32], align 4
@minus1mod3 = external dso_local local_unnamed_addr global [3 x i32], align 4

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local float @counterclockwise(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @insertsubseg(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @flip(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @segmentintersection(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @scoutsegment(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @delaunayfixup(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @constrainededge(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #1 {
  %6 = alloca %struct.otri, align 8
  %7 = alloca %struct.otri, align 8
  %8 = alloca %struct.osub, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #2
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %2, i64 8
  %11 = load i32, ptr %10, align 8, !tbaa !11
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !12
  %15 = sext i32 %14 to i64
  %16 = getelementptr ptr, ptr %9, i64 %15
  %17 = getelementptr i8, ptr %16, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  store ptr %9, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 %14, ptr %19, align 8, !tbaa !11
  call void @flip(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6)
  %20 = getelementptr inbounds i8, ptr %3, i64 4
  %21 = getelementptr inbounds i8, ptr %7, i64 8
  %22 = getelementptr inbounds i8, ptr %8, i64 8
  %23 = getelementptr inbounds i8, ptr %0, i64 82856
  br label %24

24:                                               ; preds = %99, %5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = load i32, ptr %19, align 8, !tbaa !11
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !12
  %30 = sext i32 %29 to i64
  %31 = getelementptr ptr, ptr %25, i64 %30
  %32 = getelementptr i8, ptr %31, i64 24
  %33 = load ptr, ptr %32, align 8, !tbaa !13
  %34 = load float, ptr %33, align 4, !tbaa !14
  %35 = load float, ptr %3, align 4, !tbaa !14
  %36 = fcmp oeq float %34, %35
  br i1 %36, label %37, label %42

37:                                               ; preds = %24
  %38 = getelementptr inbounds i8, ptr %33, i64 4
  %39 = load float, ptr %38, align 4, !tbaa !14
  %40 = load float, ptr %20, align 4, !tbaa !14
  %41 = fcmp oeq float %39, %40
  br i1 %41, label %101, label %42

42:                                               ; preds = %37, %24
  %43 = call float @counterclockwise(ptr noundef %0, ptr noundef %1, ptr noundef %18, ptr noundef nonnull %3, ptr noundef nonnull %33)
  %44 = fcmp oeq float %43, 0.000000e+00
  br i1 %44, label %45, label %57

45:                                               ; preds = %42
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = load i32, ptr %19, align 8, !tbaa !11
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds ptr, ptr %46, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !13
  %51 = ptrtoint ptr %50 to i64
  %52 = and i64 %51, -4
  %53 = inttoptr i64 %52 to ptr
  store ptr %53, ptr %7, align 8, !tbaa !5
  %54 = and i64 %51, 3
  %55 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !12
  store i32 %56, ptr %21, align 8, !tbaa !11
  call void @delaunayfixup(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6, i32 noundef 0)
  call void @delaunayfixup(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %7, i32 noundef 1)
  br label %.thread67

57:                                               ; preds = %42
  %58 = fcmp ogt float %43, 0.000000e+00
  br i1 %58, label %59, label %74

59:                                               ; preds = %57
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load i32, ptr %19, align 8, !tbaa !11
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds ptr, ptr %60, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !13
  %65 = ptrtoint ptr %64 to i64
  %66 = and i64 %65, -4
  %67 = inttoptr i64 %66 to ptr
  store ptr %67, ptr %7, align 8, !tbaa !5
  %68 = and i64 %65, 3
  %69 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !12
  store i32 %70, ptr %21, align 8, !tbaa !11
  call void @delaunayfixup(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %7, i32 noundef 1)
  %71 = load i32, ptr %19, align 8, !tbaa !11
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [3 x i32], ptr @minus1mod3, i64 0, i64 %72
  %.pre = load ptr, ptr %6, align 8, !tbaa !5
  br label %85

74:                                               ; preds = %57
  call void @delaunayfixup(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6, i32 noundef 0)
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = load i32, ptr %19, align 8, !tbaa !11
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds ptr, ptr %75, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !13
  %80 = ptrtoint ptr %79 to i64
  %81 = and i64 %80, -4
  %82 = inttoptr i64 %81 to ptr
  store ptr %82, ptr %6, align 8, !tbaa !5
  %83 = and i64 %80, 3
  %84 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %83
  br label %85

85:                                               ; preds = %74, %59
  %86 = phi ptr [ %82, %74 ], [ %.pre, %59 ]
  %storemerge.in = phi ptr [ %84, %74 ], [ %73, %59 ]
  %storemerge = load i32, ptr %storemerge.in, align 4, !tbaa !12
  store i32 %storemerge, ptr %19, align 8, !tbaa !11
  %87 = sext i32 %storemerge to i64
  %88 = getelementptr ptr, ptr %86, i64 %87
  %89 = getelementptr i8, ptr %88, i64 48
  %90 = load ptr, ptr %89, align 8, !tbaa !13
  %91 = ptrtoint ptr %90 to i64
  %92 = trunc i64 %91 to i32
  %93 = and i32 %92, 1
  store i32 %93, ptr %22, align 8, !tbaa !16
  %94 = and i64 %91, -4
  %95 = inttoptr i64 %94 to ptr
  store ptr %95, ptr %8, align 8, !tbaa !18
  %96 = load ptr, ptr %23, align 8, !tbaa !19
  %97 = icmp eq ptr %96, %95
  br i1 %97, label %99, label %98

98:                                               ; preds = %85
  call void @segmentintersection(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef nonnull %3)
  br label %.thread67

99:                                               ; preds = %85
  call void @flip(ptr noundef nonnull %0, ptr noundef %1, ptr noundef nonnull %6)
  br label %24, !llvm.loop !23

.thread67:                                        ; preds = %98, %45
  call void @insertsubseg(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6, i32 noundef %4)
  %100 = call i32 @scoutsegment(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6, ptr noundef nonnull %3, i32 noundef %4)
  %.not61 = icmp eq i32 %100, 0
  br i1 %.not61, label %110, label %111

101:                                              ; preds = %37
  %102 = getelementptr inbounds ptr, ptr %25, i64 %27
  %103 = load ptr, ptr %102, align 8, !tbaa !13
  %104 = ptrtoint ptr %103 to i64
  %105 = and i64 %104, -4
  %106 = inttoptr i64 %105 to ptr
  store ptr %106, ptr %7, align 8, !tbaa !5
  %107 = and i64 %104, 3
  %108 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !12
  store i32 %109, ptr %21, align 8, !tbaa !11
  call void @delaunayfixup(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6, i32 noundef 0)
  call void @delaunayfixup(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %7, i32 noundef 1)
  call void @insertsubseg(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6, i32 noundef %4)
  br label %111

110:                                              ; preds = %.thread67
  call void @constrainededge(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %6, ptr noundef nonnull %3, i32 noundef %4)
  br label %111

111:                                              ; preds = %101, %.thread67, %110
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #2
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = !{!"otri", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!10, !10, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !8, i64 0}
!16 = !{!17, !10, i64 8}
!17 = !{!"osub", !7, i64 0, !10, i64 8}
!18 = !{!17, !7, i64 0}
!19 = !{!20, !7, i64 82856}
!20 = !{!"mesh", !21, i64 0, !21, i64 88, !21, i64 176, !21, i64 264, !21, i64 352, !21, i64 440, !21, i64 528, !21, i64 616, !8, i64 704, !8, i64 33472, !8, i64 66240, !10, i64 82624, !7, i64 82632, !15, i64 82640, !15, i64 82644, !15, i64 82648, !15, i64 82652, !15, i64 82656, !10, i64 82660, !10, i64 82664, !10, i64 82668, !10, i64 82672, !10, i64 82676, !10, i64 82680, !22, i64 82688, !10, i64 82696, !10, i64 82700, !10, i64 82704, !22, i64 82712, !10, i64 82720, !10, i64 82724, !10, i64 82728, !10, i64 82732, !10, i64 82736, !10, i64 82740, !10, i64 82744, !10, i64 82748, !10, i64 82752, !22, i64 82760, !22, i64 82768, !22, i64 82776, !22, i64 82784, !22, i64 82792, !22, i64 82800, !22, i64 82808, !7, i64 82816, !7, i64 82824, !7, i64 82832, !7, i64 82840, !7, i64 82848, !7, i64 82856, !7, i64 82864, !6, i64 82872}
!21 = !{!"memorypool", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !22, i64 64, !22, i64 72, !10, i64 80, !10, i64 84}
!22 = !{!"long", !8, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass