; 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.behavior = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, float, float, float }
%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
@.str.79 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [36 x i8], align 1

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

declare i32 @printf(ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @internalerror() #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @insertsegment(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) #2 {
  %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 ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  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) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #3
  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
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.behavior, ptr %17, i32 0, i32 29
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = icmp sgt i32 %19, 1
  br i1 %20, label %21, label %39

21:                                               ; preds = %5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = getelementptr inbounds float, ptr %22, i64 0
  %24 = load float, ptr %23, align 4, !tbaa !14
  %25 = fpext float %24 to double
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds float, ptr %26, i64 1
  %28 = load float, ptr %27, align 4, !tbaa !14
  %29 = fpext float %28 to double
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = getelementptr inbounds float, ptr %30, i64 0
  %32 = load float, ptr %31, align 4, !tbaa !14
  %33 = fpext float %32 to double
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds float, ptr %34, i64 1
  %36 = load float, ptr %35, align 4, !tbaa !14
  %37 = fpext float %36 to double
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str.79, double noundef %25, double noundef %29, double noundef %33, double noundef %37)
  br label %39

39:                                               ; preds = %21, %5
  store ptr null, ptr %14, align 8, !tbaa !5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.mesh, ptr %41, i32 0, i32 31
  %43 = load i32, ptr %42, align 8, !tbaa !15
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %40, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  store ptr %46, ptr %13, align 8, !tbaa !5
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %74

49:                                               ; preds = %39
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = ptrtoint ptr %50 to i64
  %52 = and i64 %51, 3
  %53 = trunc i64 %52 to i32
  %54 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  store i32 %53, ptr %54, align 8, !tbaa !20
  %55 = load ptr, ptr %13, align 8, !tbaa !5
  %56 = ptrtoint ptr %55 to i64
  %57 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %58 = load i32, ptr %57, align 8, !tbaa !20
  %59 = sext i32 %58 to i64
  %60 = xor i64 %56, %59
  %61 = inttoptr i64 %60 to ptr
  %62 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  store ptr %61, ptr %62, align 8, !tbaa !21
  %63 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !21
  %65 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %66 = load i32, ptr %65, align 8, !tbaa !20
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = add nsw i32 %69, 3
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds ptr, ptr %64, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  store ptr %73, ptr %14, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %49, %39
  %75 = load ptr, ptr %14, align 8, !tbaa !5
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = icmp ne ptr %75, %76
  br i1 %77, label %78, label %121

78:                                               ; preds = %74
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.mesh, ptr %79, i32 0, i32 48
  %81 = load ptr, ptr %80, align 8, !tbaa !22
  %82 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  store ptr %81, ptr %82, align 8, !tbaa !21
  %83 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  store i32 0, ptr %83, align 8, !tbaa !20
  %84 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !21
  %86 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %87 = load i32, ptr %86, align 8, !tbaa !20
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds ptr, ptr %85, i64 %88
  %90 = load ptr, ptr %89, align 8, !tbaa !5
  store ptr %90, ptr %15, align 8, !tbaa !5
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  %92 = ptrtoint ptr %91 to i64
  %93 = and i64 %92, 3
  %94 = trunc i64 %93 to i32
  %95 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  store i32 %94, ptr %95, align 8, !tbaa !20
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = ptrtoint ptr %96 to i64
  %98 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %99 = load i32, ptr %98, align 8, !tbaa !20
  %100 = sext i32 %99 to i64
  %101 = xor i64 %97, %100
  %102 = inttoptr i64 %101 to ptr
  %103 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  store ptr %102, ptr %103, align 8, !tbaa !21
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = load ptr, ptr %7, align 8, !tbaa !5
  %106 = load ptr, ptr %8, align 8, !tbaa !5
  %107 = call i32 @locate(ptr noundef %104, ptr noundef %105, ptr noundef %106, ptr noundef %11)
  %108 = icmp ne i32 %107, 2
  br i1 %108, label %109, label %120

109:                                              ; preds = %78
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.80)
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds float, ptr %111, i64 0
  %113 = load float, ptr %112, align 4, !tbaa !14
  %114 = fpext float %113 to double
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = getelementptr inbounds float, ptr %115, i64 1
  %117 = load float, ptr %116, align 4, !tbaa !14
  %118 = fpext float %117 to double
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.81, double noundef %114, double noundef %118)
  call void @internalerror()
  br label %120

120:                                              ; preds = %109, %78
  br label %121

121:                                              ; preds = %120, %74
  %122 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !21
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.mesh, ptr %124, i32 0, i32 52
  %126 = getelementptr inbounds %struct.otri, ptr %125, i32 0, i32 0
  store ptr %123, ptr %126, align 8, !tbaa !23
  %127 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %128 = load i32, ptr %127, align 8, !tbaa !20
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.mesh, ptr %129, i32 0, i32 52
  %131 = getelementptr inbounds %struct.otri, ptr %130, i32 0, i32 1
  store i32 %128, ptr %131, align 8, !tbaa !24
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = load i32, ptr %10, align 4, !tbaa !9
  %136 = call i32 @scoutsegment(ptr noundef %132, ptr noundef %133, ptr noundef %11, ptr noundef %134, i32 noundef %135)
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %139

138:                                              ; preds = %121
  store i32 1, ptr %16, align 4
  br label %266

139:                                              ; preds = %121
  %140 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !21
  %142 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %143 = load i32, ptr %142, align 8, !tbaa !20
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !9
  %147 = add nsw i32 %146, 3
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds ptr, ptr %141, i64 %148
  %150 = load ptr, ptr %149, align 8, !tbaa !5
  store ptr %150, ptr %8, align 8, !tbaa !5
  store ptr null, ptr %14, align 8, !tbaa !5
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.mesh, ptr %152, i32 0, i32 31
  %154 = load i32, ptr %153, align 8, !tbaa !15
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds ptr, ptr %151, i64 %155
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  store ptr %157, ptr %13, align 8, !tbaa !5
  %158 = load ptr, ptr %13, align 8, !tbaa !5
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %185

160:                                              ; preds = %139
  %161 = load ptr, ptr %13, align 8, !tbaa !5
  %162 = ptrtoint ptr %161 to i64
  %163 = and i64 %162, 3
  %164 = trunc i64 %163 to i32
  %165 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  store i32 %164, ptr %165, align 8, !tbaa !20
  %166 = load ptr, ptr %13, align 8, !tbaa !5
  %167 = ptrtoint ptr %166 to i64
  %168 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %169 = load i32, ptr %168, align 8, !tbaa !20
  %170 = sext i32 %169 to i64
  %171 = xor i64 %167, %170
  %172 = inttoptr i64 %171 to ptr
  %173 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  store ptr %172, ptr %173, align 8, !tbaa !21
  %174 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !21
  %176 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %177 = load i32, ptr %176, align 8, !tbaa !20
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !9
  %181 = add nsw i32 %180, 3
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds ptr, ptr %175, i64 %182
  %184 = load ptr, ptr %183, align 8, !tbaa !5
  store ptr %184, ptr %14, align 8, !tbaa !5
  br label %185

185:                                              ; preds = %160, %139
  %186 = load ptr, ptr %14, align 8, !tbaa !5
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = icmp ne ptr %186, %187
  br i1 %188, label %189, label %232

189:                                              ; preds = %185
  %190 = load ptr, ptr %6, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.mesh, ptr %190, i32 0, i32 48
  %192 = load ptr, ptr %191, align 8, !tbaa !22
  %193 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  store ptr %192, ptr %193, align 8, !tbaa !21
  %194 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  store i32 0, ptr %194, align 8, !tbaa !20
  %195 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %196 = load ptr, ptr %195, align 8, !tbaa !21
  %197 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %198 = load i32, ptr %197, align 8, !tbaa !20
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds ptr, ptr %196, i64 %199
  %201 = load ptr, ptr %200, align 8, !tbaa !5
  store ptr %201, ptr %15, align 8, !tbaa !5
  %202 = load ptr, ptr %15, align 8, !tbaa !5
  %203 = ptrtoint ptr %202 to i64
  %204 = and i64 %203, 3
  %205 = trunc i64 %204 to i32
  %206 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  store i32 %205, ptr %206, align 8, !tbaa !20
  %207 = load ptr, ptr %15, align 8, !tbaa !5
  %208 = ptrtoint ptr %207 to i64
  %209 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %210 = load i32, ptr %209, align 8, !tbaa !20
  %211 = sext i32 %210 to i64
  %212 = xor i64 %208, %211
  %213 = inttoptr i64 %212 to ptr
  %214 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  store ptr %213, ptr %214, align 8, !tbaa !21
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  %216 = load ptr, ptr %7, align 8, !tbaa !5
  %217 = load ptr, ptr %9, align 8, !tbaa !5
  %218 = call i32 @locate(ptr noundef %215, ptr noundef %216, ptr noundef %217, ptr noundef %12)
  %219 = icmp ne i32 %218, 2
  br i1 %219, label %220, label %231

220:                                              ; preds = %189
  %221 = call i32 (ptr, ...) @printf(ptr noundef @.str.80)
  %222 = load ptr, ptr %9, align 8, !tbaa !5
  %223 = getelementptr inbounds float, ptr %222, i64 0
  %224 = load float, ptr %223, align 4, !tbaa !14
  %225 = fpext float %224 to double
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  %227 = getelementptr inbounds float, ptr %226, i64 1
  %228 = load float, ptr %227, align 4, !tbaa !14
  %229 = fpext float %228 to double
  %230 = call i32 (ptr, ...) @printf(ptr noundef @.str.81, double noundef %225, double noundef %229)
  call void @internalerror()
  br label %231

231:                                              ; preds = %220, %189
  br label %232

232:                                              ; preds = %231, %185
  %233 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %234 = load ptr, ptr %233, align 8, !tbaa !21
  %235 = load ptr, ptr %6, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.mesh, ptr %235, i32 0, i32 52
  %237 = getelementptr inbounds %struct.otri, ptr %236, i32 0, i32 0
  store ptr %234, ptr %237, align 8, !tbaa !23
  %238 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %239 = load i32, ptr %238, align 8, !tbaa !20
  %240 = load ptr, ptr %6, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.mesh, ptr %240, i32 0, i32 52
  %242 = getelementptr inbounds %struct.otri, ptr %241, i32 0, i32 1
  store i32 %239, ptr %242, align 8, !tbaa !24
  %243 = load ptr, ptr %6, align 8, !tbaa !5
  %244 = load ptr, ptr %7, align 8, !tbaa !5
  %245 = load ptr, ptr %8, align 8, !tbaa !5
  %246 = load i32, ptr %10, align 4, !tbaa !9
  %247 = call i32 @scoutsegment(ptr noundef %243, ptr noundef %244, ptr noundef %12, ptr noundef %245, i32 noundef %246)
  %248 = icmp ne i32 %247, 0
  br i1 %248, label %249, label %250

249:                                              ; preds = %232
  store i32 1, ptr %16, align 4
  br label %266

250:                                              ; preds = %232
  %251 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %252 = load ptr, ptr %251, align 8, !tbaa !21
  %253 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %254 = load i32, ptr %253, align 8, !tbaa !20
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %255
  %257 = load i32, ptr %256, align 4, !tbaa !9
  %258 = add nsw i32 %257, 3
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds ptr, ptr %252, i64 %259
  %261 = load ptr, ptr %260, align 8, !tbaa !5
  store ptr %261, ptr %9, align 8, !tbaa !5
  %262 = load ptr, ptr %6, align 8, !tbaa !5
  %263 = load ptr, ptr %7, align 8, !tbaa !5
  %264 = load ptr, ptr %9, align 8, !tbaa !5
  %265 = load i32, ptr %10, align 4, !tbaa !9
  call void @constrainededge(ptr noundef %262, ptr noundef %263, ptr noundef %11, ptr noundef %264, i32 noundef %265)
  store i32 0, ptr %16, align 4
  br label %266

266:                                              ; preds = %250, %249, %138
  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
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #3
  %267 = load i32, ptr %16, align 4
  switch i32 %267, label %269 [
    i32 0, label %268
    i32 1, label %268
  ]

268:                                              ; preds = %266, %266
  ret void

269:                                              ; preds = %266
  unreachable
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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, !10, i64 116}
!12 = !{!"behavior", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !13, i64 136, !13, i64 140, !13, i64 144, !13, i64 148}
!13 = !{!"float", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !10, i64 82728}
!16 = !{!"mesh", !17, i64 0, !17, i64 88, !17, i64 176, !17, i64 264, !17, i64 352, !17, i64 440, !17, i64 528, !17, i64 616, !7, i64 704, !7, i64 33472, !7, i64 66240, !10, i64 82624, !6, i64 82632, !13, i64 82640, !13, i64 82644, !13, i64 82648, !13, i64 82652, !13, i64 82656, !10, i64 82660, !10, i64 82664, !10, i64 82668, !10, i64 82672, !10, i64 82676, !10, i64 82680, !18, i64 82688, !10, i64 82696, !10, i64 82700, !10, i64 82704, !18, 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, !18, i64 82760, !18, i64 82768, !18, i64 82776, !18, i64 82784, !18, i64 82792, !18, i64 82800, !18, i64 82808, !6, i64 82816, !6, i64 82824, !6, i64 82832, !6, i64 82840, !6, i64 82848, !6, i64 82856, !6, i64 82864, !19, i64 82872}
!17 = !{!"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, !18, i64 64, !18, i64 72, !10, i64 80, !10, i64 84}
!18 = !{!"long", !7, i64 0}
!19 = !{!"otri", !6, i64 0, !10, i64 8}
!20 = !{!19, !10, i64 8}
!21 = !{!19, !6, i64 0}
!22 = !{!16, !6, i64 82840}
!23 = !{!16, !6, i64 82872}
!24 = !{!16, !10, i64 82880}


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

@plus1mod3 = external dso_local local_unnamed_addr global [3 x i32], align 4
@.str.79 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.80 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [36 x i8], align 1

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @internalerror() local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @insertsegment(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #2 {
  %6 = alloca %struct.otri, align 8
  %7 = alloca %struct.otri, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %8 = getelementptr inbounds i8, ptr %1, i64 116
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 1
  br i1 %10, label %11, label %23

11:                                               ; preds = %5
  %12 = load float, ptr %2, align 4, !tbaa !11
  %13 = fpext float %12 to double
  %14 = getelementptr inbounds i8, ptr %2, i64 4
  %15 = load float, ptr %14, align 4, !tbaa !11
  %16 = fpext float %15 to double
  %17 = load float, ptr %3, align 4, !tbaa !11
  %18 = fpext float %17 to double
  %19 = getelementptr inbounds i8, ptr %3, i64 4
  %20 = load float, ptr %19, align 4, !tbaa !11
  %21 = fpext float %20 to double
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.79, double noundef %13, double noundef %16, double noundef %18, double noundef %21)
  br label %23

23:                                               ; preds = %11, %5
  %24 = getelementptr inbounds i8, ptr %0, i64 82728
  %25 = load i32, ptr %24, align 8, !tbaa !12
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds ptr, ptr %2, i64 %26
  %28 = load ptr, ptr %27, align 8, !tbaa !18
  %.not = icmp eq ptr %28, null
  br i1 %.not, label %43, label %29

29:                                               ; preds = %23
  %30 = ptrtoint ptr %28 to i64
  %31 = trunc i64 %30 to i32
  %32 = and i32 %31, 3
  %33 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 %32, ptr %33, align 8, !tbaa !19
  %34 = and i64 %30, -4
  %35 = inttoptr i64 %34 to ptr
  store ptr %35, ptr %6, align 8, !tbaa !20
  %36 = and i64 %30, 3
  %37 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !21
  %39 = sext i32 %38 to i64
  %40 = getelementptr ptr, ptr %35, i64 %39
  %41 = getelementptr i8, ptr %40, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  br label %43

43:                                               ; preds = %29, %23
  %.0 = phi ptr [ %42, %29 ], [ null, %23 ]
  %.not54 = icmp eq ptr %.0, %2
  br i1 %.not54, label %63, label %44

44:                                               ; preds = %43
  %45 = getelementptr inbounds i8, ptr %0, i64 82840
  %46 = load ptr, ptr %45, align 8, !tbaa !22
  store ptr %46, ptr %6, align 8, !tbaa !20
  %47 = getelementptr inbounds i8, ptr %6, i64 8
  %48 = load ptr, ptr %46, align 8, !tbaa !18
  %49 = ptrtoint ptr %48 to i64
  %50 = trunc i64 %49 to i32
  %51 = and i32 %50, 3
  store i32 %51, ptr %47, align 8, !tbaa !19
  %52 = and i64 %49, -4
  %53 = inttoptr i64 %52 to ptr
  store ptr %53, ptr %6, align 8, !tbaa !20
  %54 = call i32 @locate(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %6)
  %.not55 = icmp eq i32 %54, 2
  br i1 %.not55, label %63, label %55

55:                                               ; preds = %44
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.80)
  %57 = load float, ptr %2, align 4, !tbaa !11
  %58 = fpext float %57 to double
  %59 = getelementptr inbounds i8, ptr %2, i64 4
  %60 = load float, ptr %59, align 4, !tbaa !11
  %61 = fpext float %60 to double
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.81, double noundef %58, double noundef %61)
  call void @internalerror()
  br label %63

63:                                               ; preds = %44, %55, %43
  %64 = load ptr, ptr %6, align 8, !tbaa !20
  %65 = getelementptr inbounds i8, ptr %0, i64 82872
  store ptr %64, ptr %65, align 8, !tbaa !23
  %66 = getelementptr inbounds i8, ptr %6, i64 8
  %67 = load i32, ptr %66, align 8, !tbaa !19
  %68 = getelementptr inbounds i8, ptr %0, i64 82880
  store i32 %67, ptr %68, align 8, !tbaa !24
  %69 = call i32 @scoutsegment(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %6, ptr noundef %3, i32 noundef %4)
  %.not56 = icmp eq i32 %69, 0
  br i1 %.not56, label %70, label %133

70:                                               ; preds = %63
  %71 = load ptr, ptr %6, align 8, !tbaa !20
  %72 = load i32, ptr %66, align 8, !tbaa !19
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !21
  %76 = sext i32 %75 to i64
  %77 = getelementptr ptr, ptr %71, i64 %76
  %78 = getelementptr i8, ptr %77, i64 24
  %79 = load ptr, ptr %78, align 8, !tbaa !18
  %80 = load i32, ptr %24, align 8, !tbaa !12
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds ptr, ptr %3, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !18
  %.not57 = icmp eq ptr %83, null
  br i1 %.not57, label %98, label %84

84:                                               ; preds = %70
  %85 = ptrtoint ptr %83 to i64
  %86 = trunc i64 %85 to i32
  %87 = and i32 %86, 3
  %88 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 %87, ptr %88, align 8, !tbaa !19
  %89 = and i64 %85, -4
  %90 = inttoptr i64 %89 to ptr
  store ptr %90, ptr %7, align 8, !tbaa !20
  %91 = and i64 %85, 3
  %92 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !21
  %94 = sext i32 %93 to i64
  %95 = getelementptr ptr, ptr %90, i64 %94
  %96 = getelementptr i8, ptr %95, i64 24
  %97 = load ptr, ptr %96, align 8, !tbaa !18
  br label %98

98:                                               ; preds = %84, %70
  %.1 = phi ptr [ %97, %84 ], [ null, %70 ]
  %.not58 = icmp eq ptr %.1, %3
  br i1 %.not58, label %118, label %99

99:                                               ; preds = %98
  %100 = getelementptr inbounds i8, ptr %0, i64 82840
  %101 = load ptr, ptr %100, align 8, !tbaa !22
  store ptr %101, ptr %7, align 8, !tbaa !20
  %102 = getelementptr inbounds i8, ptr %7, i64 8
  %103 = load ptr, ptr %101, align 8, !tbaa !18
  %104 = ptrtoint ptr %103 to i64
  %105 = trunc i64 %104 to i32
  %106 = and i32 %105, 3
  store i32 %106, ptr %102, align 8, !tbaa !19
  %107 = and i64 %104, -4
  %108 = inttoptr i64 %107 to ptr
  store ptr %108, ptr %7, align 8, !tbaa !20
  %109 = call i32 @locate(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %3, ptr noundef nonnull %7)
  %.not59 = icmp eq i32 %109, 2
  br i1 %.not59, label %118, label %110

110:                                              ; preds = %99
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.80)
  %112 = load float, ptr %3, align 4, !tbaa !11
  %113 = fpext float %112 to double
  %114 = getelementptr inbounds i8, ptr %3, i64 4
  %115 = load float, ptr %114, align 4, !tbaa !11
  %116 = fpext float %115 to double
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.81, double noundef %113, double noundef %116)
  call void @internalerror()
  br label %118

118:                                              ; preds = %99, %110, %98
  %119 = load ptr, ptr %7, align 8, !tbaa !20
  store ptr %119, ptr %65, align 8, !tbaa !23
  %120 = getelementptr inbounds i8, ptr %7, i64 8
  %121 = load i32, ptr %120, align 8, !tbaa !19
  store i32 %121, ptr %68, align 8, !tbaa !24
  %122 = call i32 @scoutsegment(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %7, ptr noundef %79, i32 noundef %4)
  %.not60 = icmp eq i32 %122, 0
  br i1 %.not60, label %123, label %133

123:                                              ; preds = %118
  %124 = load ptr, ptr %7, align 8, !tbaa !20
  %125 = load i32, ptr %120, align 8, !tbaa !19
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !21
  %129 = sext i32 %128 to i64
  %130 = getelementptr ptr, ptr %124, i64 %129
  %131 = getelementptr i8, ptr %130, i64 24
  %132 = load ptr, ptr %131, align 8, !tbaa !18
  call void @constrainededge(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %6, ptr noundef %132, i32 noundef %4)
  br label %133

133:                                              ; preds = %118, %63, %123
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  ret void
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 116}
!6 = !{!"behavior", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !7, i64 108, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !7, i64 82728}
!13 = !{!"mesh", !14, i64 0, !14, i64 88, !14, i64 176, !14, i64 264, !14, i64 352, !14, i64 440, !14, i64 528, !14, i64 616, !8, i64 704, !8, i64 33472, !8, i64 66240, !7, i64 82624, !15, i64 82632, !10, i64 82640, !10, i64 82644, !10, i64 82648, !10, i64 82652, !10, i64 82656, !7, i64 82660, !7, i64 82664, !7, i64 82668, !7, i64 82672, !7, i64 82676, !7, i64 82680, !16, i64 82688, !7, i64 82696, !7, i64 82700, !7, i64 82704, !16, i64 82712, !7, i64 82720, !7, i64 82724, !7, i64 82728, !7, i64 82732, !7, i64 82736, !7, i64 82740, !7, i64 82744, !7, i64 82748, !7, i64 82752, !16, i64 82760, !16, i64 82768, !16, i64 82776, !16, i64 82784, !16, i64 82792, !16, i64 82800, !16, i64 82808, !15, i64 82816, !15, i64 82824, !15, i64 82832, !15, i64 82840, !15, i64 82848, !15, i64 82856, !15, i64 82864, !17, i64 82872}
!14 = !{!"memorypool", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !16, i64 64, !16, i64 72, !7, i64 80, !7, i64 84}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!"otri", !15, i64 0, !7, i64 8}
!18 = !{!15, !15, i64 0}
!19 = !{!17, !7, i64 8}
!20 = !{!17, !15, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!13, !15, i64 82840}
!23 = !{!13, !15, i64 82872}
!24 = !{!13, !7, i64 82880}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass