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

@plus1mod3 = external dso_local global [3 x i32], align 4
@minus1mod3 = external dso_local global [3 x i32], align 4
@.str.43 = external hidden unnamed_addr constant [17 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 @printsubseg(ptr noundef, ptr noundef, ptr noundef) #2

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

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

49:                                               ; preds = %4
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.mesh, ptr %52, i32 0, i32 30
  %54 = load i32, ptr %53, align 4, !tbaa !14
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds i32, ptr %51, i64 %55
  store i32 %50, ptr %56, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %49, %4
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.mesh, ptr %59, i32 0, i32 30
  %61 = load i32, ptr %60, align 4, !tbaa !14
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i32, ptr %58, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = icmp eq i32 %64, 0
  br i1 %65, label %66, label %74

66:                                               ; preds = %57
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.mesh, ptr %69, i32 0, i32 30
  %71 = load i32, ptr %70, align 4, !tbaa !14
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds i32, ptr %68, i64 %72
  store i32 %67, ptr %73, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %66, %57
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.otri, ptr %75, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.otri, ptr %78, i32 0, i32 1
  %80 = load i32, ptr %79, align 8, !tbaa !13
  %81 = add nsw i32 6, %80
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds ptr, ptr %77, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  store ptr %84, ptr %14, align 8, !tbaa !5
  %85 = load ptr, ptr %14, align 8, !tbaa !5
  %86 = ptrtoint ptr %85 to i64
  %87 = and i64 %86, 1
  %88 = trunc i64 %87 to i32
  %89 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  store i32 %88, ptr %89, align 8, !tbaa !19
  %90 = load ptr, ptr %14, align 8, !tbaa !5
  %91 = ptrtoint ptr %90 to i64
  %92 = and i64 %91, -4
  %93 = inttoptr i64 %92 to ptr
  %94 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  store ptr %93, ptr %94, align 8, !tbaa !21
  %95 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !21
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.mesh, ptr %97, i32 0, i32 50
  %99 = load ptr, ptr %98, align 8, !tbaa !22
  %100 = icmp eq ptr %96, %99
  br i1 %100, label %101, label %238

101:                                              ; preds = %74
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  call void @makesubseg(ptr noundef %102, ptr noundef %10)
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !21
  %106 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  %107 = load i32, ptr %106, align 8, !tbaa !19
  %108 = add nsw i32 2, %107
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds ptr, ptr %105, i64 %109
  store ptr %103, ptr %110, align 8, !tbaa !5
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !21
  %114 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  %115 = load i32, ptr %114, align 8, !tbaa !19
  %116 = sub nsw i32 3, %115
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %113, i64 %117
  store ptr %111, ptr %118, align 8, !tbaa !5
  %119 = load ptr, ptr %12, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !21
  %122 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  %123 = load i32, ptr %122, align 8, !tbaa !19
  %124 = add nsw i32 4, %123
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds ptr, ptr %121, i64 %125
  store ptr %119, ptr %126, align 8, !tbaa !5
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8, !tbaa !21
  %130 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  %131 = load i32, ptr %130, align 8, !tbaa !19
  %132 = sub nsw i32 5, %131
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds ptr, ptr %129, i64 %133
  store ptr %127, ptr %134, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !21
  %137 = ptrtoint ptr %136 to i64
  %138 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  %139 = load i32, ptr %138, align 8, !tbaa !19
  %140 = sext i32 %139 to i64
  %141 = or i64 %137, %140
  %142 = inttoptr i64 %141 to ptr
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.otri, ptr %143, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !11
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.otri, ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 8, !tbaa !13
  %149 = add nsw i32 6, %148
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds ptr, ptr %145, i64 %150
  store ptr %142, ptr %151, align 8, !tbaa !5
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.otri, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !11
  %155 = ptrtoint ptr %154 to i64
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.otri, ptr %156, i32 0, i32 1
  %158 = load i32, ptr %157, align 8, !tbaa !13
  %159 = sext i32 %158 to i64
  %160 = or i64 %155, %159
  %161 = inttoptr i64 %160 to ptr
  %162 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %163 = load ptr, ptr %162, align 8, !tbaa !21
  %164 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  %165 = load i32, ptr %164, align 8, !tbaa !19
  %166 = add nsw i32 6, %165
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds ptr, ptr %163, i64 %167
  store ptr %161, ptr %168, align 8, !tbaa !5
  %169 = load ptr, ptr %7, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.otri, ptr %169, i32 0, i32 0
  %171 = load ptr, ptr %170, align 8, !tbaa !11
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.otri, ptr %172, i32 0, i32 1
  %174 = load i32, ptr %173, align 8, !tbaa !13
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds ptr, ptr %171, i64 %175
  %177 = load ptr, ptr %176, align 8, !tbaa !5
  store ptr %177, ptr %13, align 8, !tbaa !5
  %178 = load ptr, ptr %13, align 8, !tbaa !5
  %179 = ptrtoint ptr %178 to i64
  %180 = and i64 %179, 3
  %181 = trunc i64 %180 to i32
  %182 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  store i32 %181, ptr %182, align 8, !tbaa !13
  %183 = load ptr, ptr %13, align 8, !tbaa !5
  %184 = ptrtoint ptr %183 to i64
  %185 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  %186 = load i32, ptr %185, align 8, !tbaa !13
  %187 = sext i32 %186 to i64
  %188 = xor i64 %184, %187
  %189 = inttoptr i64 %188 to ptr
  %190 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  store ptr %189, ptr %190, align 8, !tbaa !11
  %191 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  %192 = load i32, ptr %191, align 8, !tbaa !19
  %193 = sub nsw i32 1, %192
  %194 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  store i32 %193, ptr %194, align 8, !tbaa !19
  %195 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %196 = load ptr, ptr %195, align 8, !tbaa !21
  %197 = ptrtoint ptr %196 to i64
  %198 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  %199 = load i32, ptr %198, align 8, !tbaa !19
  %200 = sext i32 %199 to i64
  %201 = or i64 %197, %200
  %202 = inttoptr i64 %201 to ptr
  %203 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  %204 = load ptr, ptr %203, align 8, !tbaa !11
  %205 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  %206 = load i32, ptr %205, align 8, !tbaa !13
  %207 = add nsw i32 6, %206
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds ptr, ptr %204, i64 %208
  store ptr %202, ptr %209, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 0
  %211 = load ptr, ptr %210, align 8, !tbaa !11
  %212 = ptrtoint ptr %211 to i64
  %213 = getelementptr inbounds %struct.otri, ptr %9, i32 0, i32 1
  %214 = load i32, ptr %213, align 8, !tbaa !13
  %215 = sext i32 %214 to i64
  %216 = or i64 %212, %215
  %217 = inttoptr i64 %216 to ptr
  %218 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %219 = load ptr, ptr %218, align 8, !tbaa !21
  %220 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 1
  %221 = load i32, ptr %220, align 8, !tbaa !19
  %222 = add nsw i32 6, %221
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds ptr, ptr %219, i64 %223
  store ptr %217, ptr %224, align 8, !tbaa !5
  %225 = load i32, ptr %8, align 4, !tbaa !9
  %226 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %227 = load ptr, ptr %226, align 8, !tbaa !21
  %228 = getelementptr inbounds ptr, ptr %227, i64 8
  store i32 %225, ptr %228, align 4, !tbaa !9
  %229 = load ptr, ptr %6, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.behavior, ptr %229, i32 0, i32 29
  %231 = load i32, ptr %230, align 4, !tbaa !23
  %232 = icmp sgt i32 %231, 2
  br i1 %232, label %233, label %237

233:                                              ; preds = %101
  %234 = call i32 (ptr, ...) @printf(ptr noundef @.str.43)
  %235 = load ptr, ptr %5, align 8, !tbaa !5
  %236 = load ptr, ptr %6, align 8, !tbaa !5
  call void @printsubseg(ptr noundef %235, ptr noundef %236, ptr noundef %10)
  br label %237

237:                                              ; preds = %233, %101
  br label %250

238:                                              ; preds = %74
  %239 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %240 = load ptr, ptr %239, align 8, !tbaa !21
  %241 = getelementptr inbounds ptr, ptr %240, i64 8
  %242 = load i32, ptr %241, align 4, !tbaa !9
  %243 = icmp eq i32 %242, 0
  br i1 %243, label %244, label %249

244:                                              ; preds = %238
  %245 = load i32, ptr %8, align 4, !tbaa !9
  %246 = getelementptr inbounds %struct.osub, ptr %10, i32 0, i32 0
  %247 = load ptr, ptr %246, align 8, !tbaa !21
  %248 = getelementptr inbounds ptr, ptr %247, i64 8
  store i32 %245, ptr %248, align 4, !tbaa !9
  br label %249

249:                                              ; preds = %244, %238
  br label %250

250:                                              ; preds = %249, %237
  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 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  ret void
}

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, !6, i64 0}
!12 = !{!"otri", !6, i64 0, !10, i64 8}
!13 = !{!12, !10, i64 8}
!14 = !{!15, !10, i64 82724}
!15 = !{!"mesh", !16, i64 0, !16, i64 88, !16, i64 176, !16, i64 264, !16, i64 352, !16, i64 440, !16, i64 528, !16, i64 616, !7, i64 704, !7, i64 33472, !7, i64 66240, !10, i64 82624, !6, i64 82632, !18, i64 82640, !18, i64 82644, !18, i64 82648, !18, i64 82652, !18, i64 82656, !10, i64 82660, !10, i64 82664, !10, i64 82668, !10, i64 82672, !10, i64 82676, !10, i64 82680, !17, i64 82688, !10, i64 82696, !10, i64 82700, !10, i64 82704, !17, 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, !17, i64 82760, !17, i64 82768, !17, i64 82776, !17, i64 82784, !17, i64 82792, !17, i64 82800, !17, 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}
!16 = !{!"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, !17, i64 64, !17, i64 72, !10, i64 80, !10, i64 84}
!17 = !{!"long", !7, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = !{!20, !10, i64 8}
!20 = !{!"osub", !6, i64 0, !10, i64 8}
!21 = !{!20, !6, i64 0}
!22 = !{!15, !6, i64 82856}
!23 = !{!24, !10, i64 116}
!24 = !{!"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, !18, i64 136, !18, i64 140, !18, i64 144, !18, i64 148}


; 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.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
@.str.43 = external hidden unnamed_addr constant [17 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 @printsubseg(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

28:                                               ; preds = %4
  store i32 %3, ptr %25, align 4, !tbaa !12
  %.pre = load i32, ptr %22, align 4, !tbaa !14
  %.pre39 = sext i32 %.pre to i64
  br label %29

29:                                               ; preds = %28, %4
  %.pre-phi = phi i64 [ %.pre39, %28 ], [ %24, %4 ]
  %30 = getelementptr inbounds i32, ptr %21, i64 %.pre-phi
  %31 = load i32, ptr %30, align 4, !tbaa !12
  %32 = icmp eq i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %29
  store i32 %3, ptr %30, align 4, !tbaa !12
  br label %34

34:                                               ; preds = %33, %29
  %35 = load i32, ptr %7, align 8, !tbaa !11
  %36 = sext i32 %35 to i64
  %37 = getelementptr ptr, ptr %6, i64 %36
  %38 = getelementptr i8, ptr %37, i64 48
  %39 = load ptr, ptr %38, align 8, !tbaa !13
  %40 = ptrtoint ptr %39 to i64
  %41 = trunc i64 %40 to i32
  %42 = and i32 %41, 1
  %43 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 %42, ptr %43, align 8, !tbaa !19
  %44 = and i64 %40, -4
  %45 = inttoptr i64 %44 to ptr
  store ptr %45, ptr %5, align 8, !tbaa !21
  %46 = getelementptr inbounds i8, ptr %0, i64 82856
  %47 = load ptr, ptr %46, align 8, !tbaa !22
  %48 = icmp eq ptr %47, %45
  br i1 %48, label %49, label %107

49:                                               ; preds = %34
  call void @makesubseg(ptr noundef nonnull %0, ptr noundef nonnull %5)
  %50 = load ptr, ptr %5, align 8, !tbaa !21
  %51 = load i32, ptr %43, align 8, !tbaa !19
  %52 = sext i32 %51 to i64
  %53 = getelementptr ptr, ptr %50, i64 %52
  %54 = getelementptr i8, ptr %53, i64 16
  store ptr %21, ptr %54, align 8, !tbaa !13
  %55 = load ptr, ptr %5, align 8, !tbaa !21
  %56 = sub nsw i32 3, %51
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds ptr, ptr %55, i64 %57
  store ptr %15, ptr %58, align 8, !tbaa !13
  %59 = load ptr, ptr %5, align 8, !tbaa !21
  %60 = getelementptr ptr, ptr %59, i64 %52
  %61 = getelementptr i8, ptr %60, i64 32
  store ptr %21, ptr %61, align 8, !tbaa !13
  %62 = load ptr, ptr %5, align 8, !tbaa !21
  %63 = sub nsw i32 5, %51
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %62, i64 %64
  store ptr %15, ptr %65, align 8, !tbaa !13
  %66 = load ptr, ptr %5, align 8, !tbaa !21
  %67 = ptrtoint ptr %66 to i64
  %68 = or i64 %67, %52
  %69 = inttoptr i64 %68 to ptr
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = load i32, ptr %7, align 8, !tbaa !11
  %72 = sext i32 %71 to i64
  %73 = getelementptr ptr, ptr %70, i64 %72
  %74 = getelementptr i8, ptr %73, i64 48
  store ptr %69, ptr %74, align 8, !tbaa !13
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = ptrtoint ptr %75 to i64
  %77 = or i64 %76, %72
  %78 = inttoptr i64 %77 to ptr
  %79 = load ptr, ptr %5, align 8, !tbaa !21
  %80 = getelementptr ptr, ptr %79, i64 %52
  %81 = getelementptr i8, ptr %80, i64 48
  store ptr %78, ptr %81, align 8, !tbaa !13
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds ptr, ptr %82, i64 %72
  %84 = load ptr, ptr %83, align 8, !tbaa !13
  %85 = ptrtoint ptr %84 to i64
  %86 = and i64 %85, 3
  %87 = and i64 %85, -4
  %88 = inttoptr i64 %87 to ptr
  %89 = sub nsw i32 1, %51
  store i32 %89, ptr %43, align 8, !tbaa !19
  %90 = load ptr, ptr %5, align 8, !tbaa !21
  %91 = ptrtoint ptr %90 to i64
  %92 = sext i32 %89 to i64
  %93 = or i64 %91, %92
  %94 = inttoptr i64 %93 to ptr
  %95 = getelementptr inbounds ptr, ptr %88, i64 %86
  %96 = getelementptr inbounds i8, ptr %95, i64 48
  store ptr %94, ptr %96, align 8, !tbaa !13
  %97 = load ptr, ptr %5, align 8, !tbaa !21
  %98 = getelementptr ptr, ptr %97, i64 %92
  %99 = getelementptr i8, ptr %98, i64 48
  store ptr %84, ptr %99, align 8, !tbaa !13
  %100 = load ptr, ptr %5, align 8, !tbaa !21
  %101 = getelementptr inbounds i8, ptr %100, i64 64
  store i32 %3, ptr %101, align 4, !tbaa !12
  %102 = getelementptr inbounds i8, ptr %1, i64 116
  %103 = load i32, ptr %102, align 4, !tbaa !23
  %104 = icmp sgt i32 %103, 2
  br i1 %104, label %105, label %112

105:                                              ; preds = %49
  %106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.43)
  call void @printsubseg(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %5)
  br label %112

107:                                              ; preds = %34
  %108 = getelementptr inbounds i8, ptr %45, i64 64
  %109 = load i32, ptr %108, align 4, !tbaa !12
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %111, label %112

111:                                              ; preds = %107
  store i32 %3, ptr %108, align 4, !tbaa !12
  br label %112

112:                                              ; preds = %107, %111, %49, %105
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #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 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, !10, i64 82724}
!15 = !{!"mesh", !16, i64 0, !16, i64 88, !16, i64 176, !16, i64 264, !16, i64 352, !16, i64 440, !16, i64 528, !16, i64 616, !8, i64 704, !8, i64 33472, !8, i64 66240, !10, i64 82624, !7, i64 82632, !18, i64 82640, !18, i64 82644, !18, i64 82648, !18, i64 82652, !18, i64 82656, !10, i64 82660, !10, i64 82664, !10, i64 82668, !10, i64 82672, !10, i64 82676, !10, i64 82680, !17, i64 82688, !10, i64 82696, !10, i64 82700, !10, i64 82704, !17, 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, !17, i64 82760, !17, i64 82768, !17, i64 82776, !17, i64 82784, !17, i64 82792, !17, i64 82800, !17, 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}
!16 = !{!"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, !17, i64 64, !17, i64 72, !10, i64 80, !10, i64 84}
!17 = !{!"long", !8, i64 0}
!18 = !{!"float", !8, i64 0}
!19 = !{!20, !10, i64 8}
!20 = !{!"osub", !7, i64 0, !10, i64 8}
!21 = !{!20, !7, i64 0}
!22 = !{!15, !7, i64 82856}
!23 = !{!24, !10, i64 116}
!24 = !{!"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, !18, i64 136, !18, i64 140, !18, i64 144, !18, i64 148}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass