; LLVM IR from ETH3D/dataset-pipeline :: thirdparty/cork/cork/isct (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, double, double, double, double, [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8] }
%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, double, double, double, double, double, 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.1015 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.1016 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.1017 = 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

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

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

; 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 @conformingedge(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 %35

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

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

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

70:                                               ; preds = %45, %35
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = icmp ne ptr %71, %72
  br i1 %73, label %74, label %115

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

105:                                              ; preds = %74
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.1016)
  %107 = load ptr, ptr %8, align 8, !tbaa !5
  %108 = getelementptr inbounds double, ptr %107, i64 0
  %109 = load double, ptr %108, align 8, !tbaa !14
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = getelementptr inbounds double, ptr %110, i64 1
  %112 = load double, ptr %111, align 8, !tbaa !14
  %113 = call i32 (ptr, ...) @printf(ptr noundef @.str.1017, double noundef %109, double noundef %112)
  call void @internalerror()
  br label %114

114:                                              ; preds = %105, %74
  br label %115

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

132:                                              ; preds = %115
  store i32 1, ptr %16, align 4
  br label %270

133:                                              ; preds = %115
  %134 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !21
  %136 = getelementptr inbounds %struct.otri, ptr %11, i32 0, i32 1
  %137 = load i32, ptr %136, align 8, !tbaa !20
  %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 = add nsw i32 %140, 3
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds ptr, ptr %135, i64 %142
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  store ptr %144, ptr %8, align 8, !tbaa !5
  store ptr null, ptr %14, align 8, !tbaa !5
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.mesh, ptr %146, i32 0, i32 31
  %148 = load i32, ptr %147, align 8, !tbaa !15
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds ptr, ptr %145, i64 %149
  %151 = load ptr, ptr %150, align 8, !tbaa !5
  store ptr %151, ptr %13, align 8, !tbaa !5
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  %153 = icmp ne ptr %152, null
  br i1 %153, label %154, label %179

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

179:                                              ; preds = %154, %133
  %180 = load ptr, ptr %14, align 8, !tbaa !5
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = icmp ne ptr %180, %181
  br i1 %182, label %183, label %224

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

214:                                              ; preds = %183
  %215 = call i32 (ptr, ...) @printf(ptr noundef @.str.1016)
  %216 = load ptr, ptr %9, align 8, !tbaa !5
  %217 = getelementptr inbounds double, ptr %216, i64 0
  %218 = load double, ptr %217, align 8, !tbaa !14
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = getelementptr inbounds double, ptr %219, i64 1
  %221 = load double, ptr %220, align 8, !tbaa !14
  %222 = call i32 (ptr, ...) @printf(ptr noundef @.str.1017, double noundef %218, double noundef %221)
  call void @internalerror()
  br label %223

223:                                              ; preds = %214, %183
  br label %224

224:                                              ; preds = %223, %179
  %225 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %226 = load ptr, ptr %225, align 8, !tbaa !21
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.mesh, ptr %227, i32 0, i32 52
  %229 = getelementptr inbounds %struct.otri, ptr %228, i32 0, i32 0
  store ptr %226, ptr %229, align 8, !tbaa !23
  %230 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %231 = load i32, ptr %230, align 8, !tbaa !20
  %232 = load ptr, ptr %6, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.mesh, ptr %232, i32 0, i32 52
  %234 = getelementptr inbounds %struct.otri, ptr %233, i32 0, i32 1
  store i32 %231, ptr %234, align 8, !tbaa !24
  %235 = load ptr, ptr %6, align 8, !tbaa !5
  %236 = load ptr, ptr %7, align 8, !tbaa !5
  %237 = load ptr, ptr %8, align 8, !tbaa !5
  %238 = load i32, ptr %10, align 4, !tbaa !9
  %239 = call i32 @scoutsegment(ptr noundef %235, ptr noundef %236, ptr noundef %12, ptr noundef %237, i32 noundef %238)
  %240 = icmp ne i32 %239, 0
  br i1 %240, label %241, label %242

241:                                              ; preds = %224
  store i32 1, ptr %16, align 4
  br label %270

242:                                              ; preds = %224
  %243 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 0
  %244 = load ptr, ptr %243, align 8, !tbaa !21
  %245 = getelementptr inbounds %struct.otri, ptr %12, i32 0, i32 1
  %246 = load i32, ptr %245, align 8, !tbaa !20
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %247
  %249 = load i32, ptr %248, align 4, !tbaa !9
  %250 = add nsw i32 %249, 3
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds ptr, ptr %244, i64 %251
  %253 = load ptr, ptr %252, align 8, !tbaa !5
  store ptr %253, ptr %9, align 8, !tbaa !5
  %254 = load ptr, ptr %7, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.behavior, ptr %254, i32 0, i32 26
  %256 = load i32, ptr %255, align 8, !tbaa !25
  %257 = icmp ne i32 %256, 0
  br i1 %257, label %258, label %264

258:                                              ; preds = %242
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  %260 = load ptr, ptr %7, align 8, !tbaa !5
  %261 = load ptr, ptr %8, align 8, !tbaa !5
  %262 = load ptr, ptr %9, align 8, !tbaa !5
  %263 = load i32, ptr %10, align 4, !tbaa !9
  call void @conformingedge(ptr noundef %259, ptr noundef %260, ptr noundef %261, ptr noundef %262, i32 noundef %263)
  br label %269

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

269:                                              ; preds = %264, %258
  store i32 0, ptr %16, align 4
  br label %270

270:                                              ; preds = %269, %241, %132
  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
  %271 = load i32, ptr %16, align 4
  switch i32 %271, label %273 [
    i32 0, label %272
    i32 1, label %272
  ]

272:                                              ; preds = %270, %270
  ret void

273:                                              ; preds = %270
  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 144, !13, i64 152, !13, i64 160, !7, i64 168, !7, i64 2216, !7, i64 4264, !7, i64 6312, !7, i64 8360, !7, i64 10408, !7, i64 12456, !7, i64 14504, !7, i64 16552, !7, i64 18600, !7, i64 20648, !7, i64 22696}
!13 = !{!"double", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !10, i64 82744}
!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 82648, !13, i64 82656, !13, i64 82664, !13, i64 82672, !10, i64 82680, !10, i64 82684, !10, i64 82688, !10, i64 82692, !10, i64 82696, !10, i64 82700, !18, i64 82704, !10, i64 82712, !10, i64 82716, !10, i64 82720, !18, i64 82728, !10, i64 82736, !10, i64 82740, !10, i64 82744, !10, i64 82748, !10, i64 82752, !10, i64 82756, !10, i64 82760, !10, i64 82764, !10, i64 82768, !18, i64 82776, !18, i64 82784, !18, i64 82792, !18, i64 82800, !18, i64 82808, !18, i64 82816, !18, i64 82824, !6, i64 82832, !6, i64 82840, !6, i64 82848, !6, i64 82856, !6, i64 82864, !6, i64 82872, !6, i64 82880, !19, i64 82888}
!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 82856}
!23 = !{!16, !6, i64 82888}
!24 = !{!16, !10, i64 82896}
!25 = !{!12, !10, i64 104}


; 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.1015 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.1016 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.1017 = 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; 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 @conformingedge(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 %19

11:                                               ; preds = %5
  %12 = load double, ptr %2, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  %14 = load double, ptr %13, align 8, !tbaa !11
  %15 = load double, ptr %3, align 8, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %3, i64 8
  %17 = load double, ptr %16, align 8, !tbaa !11
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1015, double noundef %12, double noundef %14, double noundef %15, double noundef %17)
  br label %19

19:                                               ; preds = %11, %5
  %20 = getelementptr inbounds i8, ptr %0, i64 82744
  %21 = load i32, ptr %20, align 8, !tbaa !12
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds ptr, ptr %2, i64 %22
  %24 = load ptr, ptr %23, align 8, !tbaa !18
  %.not = icmp eq ptr %24, null
  br i1 %.not, label %39, label %25

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

39:                                               ; preds = %25, %19
  %.0 = phi ptr [ %38, %25 ], [ null, %19 ]
  %.not60 = icmp eq ptr %.0, %2
  br i1 %.not60, label %57, label %40

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

51:                                               ; preds = %40
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1016)
  %53 = load double, ptr %2, align 8, !tbaa !11
  %54 = getelementptr inbounds i8, ptr %2, i64 8
  %55 = load double, ptr %54, align 8, !tbaa !11
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1017, double noundef %53, double noundef %55)
  call void @internalerror()
  br label %57

57:                                               ; preds = %40, %51, %39
  %58 = load ptr, ptr %6, align 8, !tbaa !20
  %59 = getelementptr inbounds i8, ptr %0, i64 82888
  store ptr %58, ptr %59, align 8, !tbaa !23
  %60 = getelementptr inbounds i8, ptr %6, i64 8
  %61 = load i32, ptr %60, align 8, !tbaa !19
  %62 = getelementptr inbounds i8, ptr %0, i64 82896
  store i32 %61, ptr %62, align 8, !tbaa !24
  %63 = call i32 @scoutsegment(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %6, ptr noundef %3, i32 noundef %4)
  %.not62 = icmp eq i32 %63, 0
  br i1 %.not62, label %64, label %129

64:                                               ; preds = %57
  %65 = load ptr, ptr %6, align 8, !tbaa !20
  %66 = load i32, ptr %60, align 8, !tbaa !19
  %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 !21
  %70 = sext i32 %69 to i64
  %71 = getelementptr ptr, ptr %65, i64 %70
  %72 = getelementptr i8, ptr %71, i64 24
  %73 = load ptr, ptr %72, align 8, !tbaa !18
  %74 = load i32, ptr %20, align 8, !tbaa !12
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds ptr, ptr %3, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !18
  %.not63 = icmp eq ptr %77, null
  br i1 %.not63, label %92, label %78

78:                                               ; preds = %64
  %79 = ptrtoint ptr %77 to i64
  %80 = trunc i64 %79 to i32
  %81 = and i32 %80, 3
  %82 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 %81, ptr %82, align 8, !tbaa !19
  %83 = and i64 %79, -4
  %84 = inttoptr i64 %83 to ptr
  store ptr %84, ptr %7, align 8, !tbaa !20
  %85 = and i64 %79, 3
  %86 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !21
  %88 = sext i32 %87 to i64
  %89 = getelementptr ptr, ptr %84, i64 %88
  %90 = getelementptr i8, ptr %89, i64 24
  %91 = load ptr, ptr %90, align 8, !tbaa !18
  br label %92

92:                                               ; preds = %78, %64
  %.1 = phi ptr [ %91, %78 ], [ null, %64 ]
  %.not64 = icmp eq ptr %.1, %3
  br i1 %.not64, label %110, label %93

93:                                               ; preds = %92
  %94 = getelementptr inbounds i8, ptr %0, i64 82856
  %95 = load ptr, ptr %94, align 8, !tbaa !22
  store ptr %95, ptr %7, align 8, !tbaa !20
  %96 = getelementptr inbounds i8, ptr %7, i64 8
  %97 = load ptr, ptr %95, align 8, !tbaa !18
  %98 = ptrtoint ptr %97 to i64
  %99 = trunc i64 %98 to i32
  %100 = and i32 %99, 3
  store i32 %100, ptr %96, align 8, !tbaa !19
  %101 = and i64 %98, -4
  %102 = inttoptr i64 %101 to ptr
  store ptr %102, ptr %7, align 8, !tbaa !20
  %103 = call i32 @locate(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %3, ptr noundef nonnull %7)
  %.not65 = icmp eq i32 %103, 2
  br i1 %.not65, label %110, label %104

104:                                              ; preds = %93
  %105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1016)
  %106 = load double, ptr %3, align 8, !tbaa !11
  %107 = getelementptr inbounds i8, ptr %3, i64 8
  %108 = load double, ptr %107, align 8, !tbaa !11
  %109 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1017, double noundef %106, double noundef %108)
  call void @internalerror()
  br label %110

110:                                              ; preds = %93, %104, %92
  %111 = load ptr, ptr %7, align 8, !tbaa !20
  store ptr %111, ptr %59, align 8, !tbaa !23
  %112 = getelementptr inbounds i8, ptr %7, i64 8
  %113 = load i32, ptr %112, align 8, !tbaa !19
  store i32 %113, ptr %62, align 8, !tbaa !24
  %114 = call i32 @scoutsegment(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %7, ptr noundef %73, i32 noundef %4)
  %.not66 = icmp eq i32 %114, 0
  br i1 %.not66, label %115, label %129

115:                                              ; preds = %110
  %116 = load ptr, ptr %7, align 8, !tbaa !20
  %117 = load i32, ptr %112, align 8, !tbaa !19
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [3 x i32], ptr @plus1mod3, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !21
  %121 = sext i32 %120 to i64
  %122 = getelementptr ptr, ptr %116, i64 %121
  %123 = getelementptr i8, ptr %122, i64 24
  %124 = load ptr, ptr %123, align 8, !tbaa !18
  %125 = getelementptr inbounds i8, ptr %1, i64 104
  %126 = load i32, ptr %125, align 8, !tbaa !25
  %.not67 = icmp eq i32 %126, 0
  br i1 %.not67, label %128, label %127

127:                                              ; preds = %115
  call void @conformingedge(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef %73, ptr noundef %124, i32 noundef %4)
  br label %129

128:                                              ; preds = %115
  call void @constrainededge(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %6, ptr noundef %124, i32 noundef %4)
  br label %129

129:                                              ; preds = %127, %128, %110, %57
  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 144, !10, i64 152, !10, i64 160, !8, i64 168, !8, i64 2216, !8, i64 4264, !8, i64 6312, !8, i64 8360, !8, i64 10408, !8, i64 12456, !8, i64 14504, !8, i64 16552, !8, i64 18600, !8, i64 20648, !8, i64 22696}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !7, i64 82744}
!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 82648, !10, i64 82656, !10, i64 82664, !10, i64 82672, !7, i64 82680, !7, i64 82684, !7, i64 82688, !7, i64 82692, !7, i64 82696, !7, i64 82700, !16, i64 82704, !7, i64 82712, !7, i64 82716, !7, i64 82720, !16, i64 82728, !7, i64 82736, !7, i64 82740, !7, i64 82744, !7, i64 82748, !7, i64 82752, !7, i64 82756, !7, i64 82760, !7, i64 82764, !7, i64 82768, !16, i64 82776, !16, i64 82784, !16, i64 82792, !16, i64 82800, !16, i64 82808, !16, i64 82816, !16, i64 82824, !15, i64 82832, !15, i64 82840, !15, i64 82848, !15, i64 82856, !15, i64 82864, !15, i64 82872, !15, i64 82880, !17, i64 82888}
!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 82856}
!23 = !{!13, !15, i64 82888}
!24 = !{!13, !7, i64 82896}
!25 = !{!6, !7, i64 104}


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