; LLVM IR from sympiler/nasoq :: src/common (TreeUtils)

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

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@__PRETTY_FUNCTION__._ZN5nasoq18heightPartitioningEiPiS0_iiiiRSt6vectorIiSaIiEERS1_IS3_SaIS3_EEPdS0_b = external hidden unnamed_addr constant [145 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 speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5nasoq18heightPartitioningEiPiS0_iiiiRSt6vectorIiSaIiEERS1_IS3_SaIS3_EEPdS0_b(i32 noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef %9, ptr noundef %10, i1 noundef zeroext %11) #4 {
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i8, align 1
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca ptr, align 8
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  store i32 %0, ptr %14, align 4, !tbaa !5
  store ptr %1, ptr %15, align 8, !tbaa !9
  store ptr %2, ptr %16, align 8, !tbaa !9
  store i32 %3, ptr %17, align 4, !tbaa !5
  store i32 %4, ptr %18, align 4, !tbaa !5
  store i32 %5, ptr %19, align 4, !tbaa !5
  store i32 %6, ptr %20, align 4, !tbaa !5
  store ptr %7, ptr %21, align 8, !tbaa !9
  store ptr %8, ptr %22, align 8, !tbaa !9
  store ptr %9, ptr %23, align 8, !tbaa !9
  store ptr %10, ptr %24, align 8, !tbaa !9
  %40 = zext i1 %11 to i8
  store i8 %40, ptr %25, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 0, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store i32 3, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #6
  store i32 0, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #6
  %41 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %41, ptr %30, align 4, !tbaa !5
  %42 = load i32, ptr %14, align 4, !tbaa !5
  %43 = icmp sle i32 %42, 2
  br i1 %43, label %44, label %52

44:                                               ; preds = %12
  %45 = load ptr, ptr %24, align 8, !tbaa !9
  %46 = getelementptr inbounds i32, ptr %45, i64 0
  store i32 0, ptr %46, align 4, !tbaa !5
  %47 = load i32, ptr %14, align 4, !tbaa !5
  %48 = load ptr, ptr %24, align 8, !tbaa !9
  %49 = getelementptr inbounds i32, ptr %48, i64 1
  store i32 %47, ptr %49, align 4, !tbaa !5
  %50 = load ptr, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  store i32 1, ptr %31, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 4 dereferenceable(4) %31)
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  store i32 1, ptr %29, align 4, !tbaa !5
  %51 = load i32, ptr %29, align 4, !tbaa !5
  store i32 %51, ptr %13, align 4
  store i32 1, ptr %32, align 4
  br label %241

52:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  %53 = load i32, ptr %14, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %54, i64 4)
  %56 = extractvalue { i64, i1 } %55, 1
  %57 = extractvalue { i64, i1 } %55, 0
  %58 = select i1 %56, i64 -1, i64 %57
  %59 = call noalias noundef nonnull ptr @_Znam(i64 noundef %58) #7
  store ptr %59, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #6
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %92, %52
  %61 = load i32, ptr %34, align 4, !tbaa !5
  %62 = load i32, ptr %14, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 2, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #6
  br label %95

65:                                               ; preds = %60
  %66 = load ptr, ptr %15, align 8, !tbaa !9
  %67 = load i32, ptr %34, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr %66, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = load ptr, ptr %15, align 8, !tbaa !9
  %73 = load i32, ptr %34, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr %72, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = sub nsw i32 %71, %76
  %78 = load ptr, ptr %33, align 8, !tbaa !9
  %79 = load i32, ptr %34, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i32, ptr %78, i64 %80
  store i32 %77, ptr %81, align 4, !tbaa !5
  %82 = load ptr, ptr %33, align 8, !tbaa !9
  %83 = load i32, ptr %34, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i32, ptr %82, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = icmp sge i32 %86, 0
  br i1 %87, label %88, label %89

88:                                               ; preds = %65
  br label %91

89:                                               ; preds = %65
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 284, ptr noundef @__PRETTY_FUNCTION__._ZN5nasoq18heightPartitioningEiPiS0_iiiiRSt6vectorIiSaIiEERS1_IS3_SaIS3_EEPdS0_b) #8
  unreachable

90:                                               ; No predecessors!
  br label %91

91:                                               ; preds = %90, %88
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %34, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %34, align 4, !tbaa !5
  br label %60, !llvm.loop !13

95:                                               ; preds = %64
  %96 = load ptr, ptr %24, align 8, !tbaa !9
  %97 = getelementptr inbounds i32, ptr %96, i64 0
  store i32 0, ptr %97, align 4, !tbaa !5
  %98 = load i8, ptr %25, align 1, !tbaa !11, !range !15, !noundef !16
  %99 = trunc i8 %98 to i1
  br i1 %99, label %100, label %157

100:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #6
  %101 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %101, ptr %35, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %143, %100
  %103 = load i32, ptr %35, align 4, !tbaa !5
  %104 = load i32, ptr %14, align 4, !tbaa !5
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 5, ptr %32, align 4
  br label %147

107:                                              ; preds = %102
  %108 = load i32, ptr %29, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %29, align 4, !tbaa !5
  %110 = load i32, ptr %35, align 4, !tbaa !5
  %111 = load ptr, ptr %24, align 8, !tbaa !9
  %112 = load i32, ptr %29, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i32, ptr %111, i64 %113
  store i32 %110, ptr %114, align 4, !tbaa !5
  %115 = load ptr, ptr %33, align 8, !tbaa !9
  %116 = load i32, ptr %35, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i32, ptr %115, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = load i32, ptr %20, align 4, !tbaa !5
  %121 = load i32, ptr %30, align 4, !tbaa !5
  %122 = mul nsw i32 %120, %121
  %123 = icmp sge i32 %119, %122
  br i1 %123, label %124, label %126

124:                                              ; preds = %107
  %125 = load ptr, ptr %21, align 8, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %125, ptr noundef nonnull align 4 dereferenceable(4) %30)
  br label %142

126:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  %127 = load ptr, ptr %33, align 8, !tbaa !9
  %128 = load i32, ptr %35, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr %127, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = sdiv i32 %131, 2
  store i32 %132, ptr %36, align 4, !tbaa !5
  %133 = load i32, ptr %36, align 4, !tbaa !5
  %134 = icmp sgt i32 %133, 1
  br i1 %134, label %135, label %137

135:                                              ; preds = %126
  %136 = load ptr, ptr %21, align 8, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %136, ptr noundef nonnull align 4 dereferenceable(4) %36)
  br label %138

137:                                              ; preds = %126
  store i32 5, ptr %32, align 4
  br label %139

138:                                              ; preds = %135
  store i32 0, ptr %32, align 4
  br label %139

139:                                              ; preds = %138, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  %140 = load i32, ptr %32, align 4
  switch i32 %140, label %147 [
    i32 0, label %141
  ]

141:                                              ; preds = %139
  br label %142

142:                                              ; preds = %141, %124
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %19, align 4, !tbaa !5
  %145 = load i32, ptr %35, align 4, !tbaa !5
  %146 = add nsw i32 %145, %144
  store i32 %146, ptr %35, align 4, !tbaa !5
  br label %102, !llvm.loop !17

147:                                              ; preds = %139, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #6
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %17, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  %151 = load ptr, ptr %24, align 8, !tbaa !9
  %152 = load i32, ptr %29, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %29, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds i32, ptr %151, i64 %154
  store i32 %150, ptr %155, align 4, !tbaa !5
  %156 = load ptr, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #6
  store i32 1, ptr %37, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %156, ptr noundef nonnull align 4 dereferenceable(4) %37)
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #6
  br label %239

157:                                              ; preds = %95
  br label %158

158:                                              ; preds = %221, %157
  %159 = load i32, ptr %30, align 4, !tbaa !5
  %160 = icmp sgt i32 %159, 1
  br i1 %160, label %161, label %226

161:                                              ; preds = %158
  br label %162

162:                                              ; preds = %195, %161
  %163 = load ptr, ptr %33, align 8, !tbaa !9
  %164 = load i32, ptr %17, align 4, !tbaa !5
  %165 = load i32, ptr %26, align 4, !tbaa !5
  %166 = sub nsw i32 %164, %165
  %167 = sub nsw i32 %166, 1
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds i32, ptr %163, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = load i32, ptr %30, align 4, !tbaa !5
  %172 = icmp sle i32 %170, %171
  br i1 %172, label %173, label %177

173:                                              ; preds = %162
  %174 = load i32, ptr %26, align 4, !tbaa !5
  %175 = load i32, ptr %14, align 4, !tbaa !5
  %176 = icmp slt i32 %174, %175
  br label %177

177:                                              ; preds = %173, %162
  %178 = phi i1 [ false, %162 ], [ %176, %173 ]
  br i1 %178, label %179, label %196

179:                                              ; preds = %177
  %180 = load i32, ptr %26, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %26, align 4, !tbaa !5
  %182 = load i32, ptr %17, align 4, !tbaa !5
  %183 = load i32, ptr %26, align 4, !tbaa !5
  %184 = sub nsw i32 %182, %183
  %185 = sub nsw i32 %184, 1
  %186 = icmp slt i32 %185, 0
  br i1 %186, label %194, label %187

187:                                              ; preds = %179
  %188 = load i32, ptr %17, align 4, !tbaa !5
  %189 = load i32, ptr %26, align 4, !tbaa !5
  %190 = sub nsw i32 %188, %189
  %191 = sub nsw i32 %190, 1
  %192 = load i32, ptr %14, align 4, !tbaa !5
  %193 = icmp sge i32 %191, %192
  br i1 %193, label %194, label %195

194:                                              ; preds = %187, %179
  br label %196

195:                                              ; preds = %187
  br label %162, !llvm.loop !18

196:                                              ; preds = %194, %177
  %197 = load ptr, ptr %21, align 8, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %197, ptr noundef nonnull align 4 dereferenceable(4) %30)
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #6
  %198 = load i32, ptr %17, align 4, !tbaa !5
  %199 = load i32, ptr %26, align 4, !tbaa !5
  %200 = sub nsw i32 %198, %199
  %201 = load i32, ptr %19, align 4, !tbaa !5
  %202 = sub nsw i32 %200, %201
  store i32 %202, ptr %38, align 4, !tbaa !5
  %203 = load i32, ptr %38, align 4, !tbaa !5
  %204 = load ptr, ptr %24, align 8, !tbaa !9
  %205 = load i32, ptr %29, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds i32, ptr %204, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = icmp sgt i32 %203, %208
  br i1 %209, label %210, label %221

210:                                              ; preds = %196
  %211 = load i32, ptr %38, align 4, !tbaa !5
  %212 = load i32, ptr %14, align 4, !tbaa !5
  %213 = icmp slt i32 %211, %212
  br i1 %213, label %214, label %221

214:                                              ; preds = %210
  %215 = load i32, ptr %38, align 4, !tbaa !5
  %216 = load ptr, ptr %24, align 8, !tbaa !9
  %217 = load i32, ptr %29, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %29, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds i32, ptr %216, i64 %219
  store i32 %215, ptr %220, align 4, !tbaa !5
  br label %221

221:                                              ; preds = %214, %210, %196
  %222 = load i32, ptr %20, align 4, !tbaa !5
  %223 = load i32, ptr %30, align 4, !tbaa !5
  %224 = sdiv i32 %223, %222
  store i32 %224, ptr %30, align 4, !tbaa !5
  %225 = load i32, ptr %26, align 4, !tbaa !5
  store i32 %225, ptr %27, align 4, !tbaa !5
  store i32 0, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #6
  br label %158, !llvm.loop !19

226:                                              ; preds = %158
  %227 = load i32, ptr %17, align 4, !tbaa !5
  %228 = add nsw i32 %227, 1
  %229 = load ptr, ptr %24, align 8, !tbaa !9
  %230 = load i32, ptr %29, align 4, !tbaa !5
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %29, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds i32, ptr %229, i64 %232
  store i32 %228, ptr %233, align 4, !tbaa !5
  %234 = load ptr, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #6
  store i32 1, ptr %39, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %234, ptr noundef nonnull align 4 dereferenceable(4) %39)
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #6
  %235 = load ptr, ptr %33, align 8, !tbaa !9
  %236 = icmp eq ptr %235, null
  br i1 %236, label %238, label %237

237:                                              ; preds = %226
  call void @_ZdaPv(ptr noundef %235) #9
  br label %238

238:                                              ; preds = %237, %226
  br label %239

239:                                              ; preds = %238, %148
  %240 = load i32, ptr %29, align 4, !tbaa !5
  store i32 %240, ptr %13, align 4
  store i32 1, ptr %32, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  br label %241

241:                                              ; preds = %239, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  %242 = load i32, ptr %13, align 4
  ret i32 %242
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { nobuiltin 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 #4 = { mustprogress 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 #5 = { noreturn 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 #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { noreturn nounwind }
attributes #9 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}


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

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@__PRETTY_FUNCTION__._ZN5nasoq18heightPartitioningEiPiS0_iiiiRSt6vectorIiSaIiEERS1_IS3_SaIS3_EEPdS0_b = external hidden unnamed_addr constant [145 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) 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: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5nasoq18heightPartitioningEiPiS0_iiiiRSt6vectorIiSaIiEERS1_IS3_SaIS3_EEPdS0_b(i32 noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readnone %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, ptr noundef nonnull align 8 dereferenceable(24) %7, ptr nocapture noundef nonnull readnone align 8 dereferenceable(24) %8, ptr nocapture noundef readnone %9, ptr nocapture noundef %10, i1 noundef zeroext %11) local_unnamed_addr #3 {
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  store i32 %4, ptr %13, align 4, !tbaa !5
  %18 = icmp slt i32 %0, 3
  br i1 %18, label %19, label %21

19:                                               ; preds = %12
  store i32 0, ptr %10, align 4, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 %0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #5
  store i32 1, ptr %14, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #5
  br label %93

21:                                               ; preds = %12
  %22 = zext nneg i32 %0 to i64
  %23 = shl nuw nsw i64 %22, 2
  %24 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %23) #6
  br label %25

25:                                               ; preds = %30, %21
  %indvars.iv = phi i64 [ %indvars.iv.next, %30 ], [ 0, %21 ]
  %exitcond.not = icmp eq i64 %indvars.iv, %22
  br i1 %exitcond.not, label %26, label %30

26:                                               ; preds = %25
  store i32 0, ptr %10, align 4, !tbaa !5
  br i1 %11, label %.preheader, label %thread-pre-split

.preheader:                                       ; preds = %26
  %27 = icmp slt i32 %5, %0
  br i1 %27, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.preheader
  %28 = sext i32 %5 to i64
  %29 = zext nneg i32 %0 to i64
  br label %.lr.ph

30:                                               ; preds = %25
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = sub nsw i32 %32, %34
  %36 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv
  store i32 %35, ptr %36, align 4, !tbaa !5
  %37 = icmp sgt i32 %35, -1
  br i1 %37, label %25, label %38, !llvm.loop !9

38:                                               ; preds = %30
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 284, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN5nasoq18heightPartitioningEiPiS0_iiiiRSt6vectorIiSaIiEERS1_IS3_SaIS3_EEPdS0_b) #7
  unreachable

.lr.ph:                                           ; preds = %.lr.ph.preheader, %50
  %indvars.iv100 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next101, %50 ]
  %indvars.iv98 = phi i64 [ %28, %.lr.ph.preheader ], [ %indvars.iv.next99, %50 ]
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %39 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next101
  %40 = trunc nsw i64 %indvars.iv98 to i32
  store i32 %40, ptr %39, align 4, !tbaa !5
  %41 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv98
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = load i32, ptr %13, align 4, !tbaa !5
  %44 = mul nsw i32 %43, %6
  %.not84 = icmp slt i32 %42, %44
  br i1 %.not84, label %46, label %45

45:                                               ; preds = %.lr.ph
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(4) %13)
  br label %50

46:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #5
  %47 = sdiv i32 %42, 2
  store i32 %47, ptr %15, align 4, !tbaa !5
  %48 = icmp sgt i32 %42, 3
  br i1 %48, label %49, label %.critedge

49:                                               ; preds = %46
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(4) %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #5
  br label %50

50:                                               ; preds = %49, %45
  %indvars.iv.next99 = add nsw i64 %indvars.iv98, %28
  %51 = icmp slt i64 %indvars.iv.next99, %29
  br i1 %51, label %.lr.ph, label %.loopexit.loopexit, !llvm.loop !11

.critedge:                                        ; preds = %46
  %52 = trunc nuw nsw i64 %indvars.iv.next101 to i32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #5
  br label %.loopexit

.loopexit.loopexit:                               ; preds = %50
  %53 = trunc nuw nsw i64 %indvars.iv.next101 to i32
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.preheader, %.critedge
  %.178 = phi i32 [ %52, %.critedge ], [ 0, %.preheader ], [ %53, %.loopexit.loopexit ]
  %54 = add nsw i32 %3, 1
  %55 = add nsw i32 %.178, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i32, ptr %10, i64 %56
  store i32 %54, ptr %57, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #5
  store i32 1, ptr %16, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(4) %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #5
  br label %93

thread-pre-split:                                 ; preds = %26
  %58 = icmp sgt i32 %4, 1
  br i1 %58, label %.preheader87.lr.ph, label %._crit_edge

.preheader87.lr.ph:                               ; preds = %thread-pre-split
  %reass.sub = add i32 %3, -2
  %59 = zext nneg i32 %0 to i64
  br label %.preheader87

.preheader87:                                     ; preds = %.preheader87.lr.ph, %85
  %.27989 = phi i32 [ 0, %.preheader87.lr.ph ], [ %.3, %85 ]
  %60 = phi i32 [ %4, %.preheader87.lr.ph ], [ %87, %85 ]
  br label %61

61:                                               ; preds = %.preheader87, %72
  %indvars.iv95 = phi i64 [ 0, %.preheader87 ], [ %indvars.iv.next96, %72 ]
  %62 = trunc i64 %indvars.iv95 to i32
  %63 = xor i32 %62, -1
  %64 = add i32 %63, %3
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %24, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp sle i32 %67, %60
  %69 = icmp ult i64 %indvars.iv95, %59
  %70 = and i1 %69, %68
  %71 = trunc nuw nsw i64 %indvars.iv95 to i32
  br i1 %70, label %72, label %.split.loop.exit107

72:                                               ; preds = %61
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %73 = sub i32 %reass.sub, %71
  %or.cond = icmp ult i32 %73, %0
  br i1 %or.cond, label %61, label %.split.loop.exit, !llvm.loop !12

.split.loop.exit:                                 ; preds = %72
  %indvars.le = trunc i64 %indvars.iv.next96 to i32
  br label %.split.loop.exit107

.split.loop.exit107:                              ; preds = %61, %.split.loop.exit
  %.2 = phi i32 [ %indvars.le, %.split.loop.exit ], [ %71, %61 ]
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %74 = add i32 %.2, %5
  %75 = sub i32 %3, %74
  %76 = sext i32 %.27989 to i64
  %77 = getelementptr inbounds i32, ptr %10, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = icmp sgt i32 %75, %78
  %80 = icmp slt i32 %75, %0
  %or.cond85 = and i1 %80, %79
  br i1 %or.cond85, label %81, label %85

81:                                               ; preds = %.split.loop.exit107
  %82 = add nsw i32 %.27989, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %10, i64 %83
  store i32 %75, ptr %84, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %81, %.split.loop.exit107
  %.3 = phi i32 [ %82, %81 ], [ %.27989, %.split.loop.exit107 ]
  %86 = load i32, ptr %13, align 4, !tbaa !5
  %87 = sdiv i32 %86, %6
  store i32 %87, ptr %13, align 4, !tbaa !5
  %88 = icmp sgt i32 %87, 1
  br i1 %88, label %.preheader87, label %._crit_edge.loopexit, !llvm.loop !13

._crit_edge.loopexit:                             ; preds = %85
  %89 = add nsw i32 %.3, 1
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %thread-pre-split
  %.279.lcssa = phi i32 [ 1, %thread-pre-split ], [ %89, %._crit_edge.loopexit ]
  %90 = add nsw i32 %3, 1
  %91 = sext i32 %.279.lcssa to i64
  %92 = getelementptr inbounds i32, ptr %10, i64 %91
  store i32 %90, ptr %92, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #5
  store i32 1, ptr %17, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(4) %17)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #5
  call void @_ZdaPv(ptr noundef nonnull %24) #8
  br label %93

93:                                               ; preds = %.loopexit, %._crit_edge, %19
  %.0 = phi i32 [ 1, %19 ], [ %55, %.loopexit ], [ %.279.lcssa, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  ret i32 %.0
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nobuiltin 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 #3 = { mustprogress 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 #4 = { noreturn 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 #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { noreturn nounwind }
attributes #8 = { builtin nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass