; 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__._ZN5nasoq27heightPartitioning_DAG_TrngEiPiS0_iiiiRSt6vectorIiSaIiEERS1_IS3_SaIS3_EEPdS0_b = external hidden unnamed_addr constant [154 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
define dso_local noundef i32 @_ZN5nasoq27heightPartitioning_DAG_TrngEiPiS0_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 ptr, align 8
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = 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
  %38 = zext i1 %11 to i8
  store i8 %38, 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
  %39 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %39, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %40 = load i32, ptr %14, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %41, i64 4)
  %43 = extractvalue { i64, i1 } %42, 1
  %44 = extractvalue { i64, i1 } %42, 0
  %45 = select i1 %43, i64 -1, i64 %44
  %46 = call noalias noundef nonnull ptr @_Znam(i64 noundef %45) #7
  store ptr %46, ptr %31, align 8, !tbaa !9
  %47 = load i32, ptr %14, align 4, !tbaa !5
  %48 = load i32, ptr %19, align 4, !tbaa !5
  %49 = icmp sle i32 %47, %48
  br i1 %49, label %50, label %58

50:                                               ; preds = %12
  %51 = load ptr, ptr %24, align 8, !tbaa !9
  %52 = getelementptr inbounds i32, ptr %51, i64 0
  store i32 0, ptr %52, align 4, !tbaa !5
  %53 = load i32, ptr %14, align 4, !tbaa !5
  %54 = load ptr, ptr %24, align 8, !tbaa !9
  %55 = getelementptr inbounds i32, ptr %54, i64 1
  store i32 %53, ptr %55, align 4, !tbaa !5
  %56 = load ptr, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #6
  store i32 1, ptr %32, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %56, ptr noundef nonnull align 4 dereferenceable(4) %32)
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #6
  store i32 1, ptr %29, align 4, !tbaa !5
  %57 = load i32, ptr %29, align 4, !tbaa !5
  store i32 %57, ptr %13, align 4
  store i32 1, ptr %33, align 4
  br label %182

58:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #6
  store i32 0, ptr %34, align 4, !tbaa !5
  br label %59

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

63:                                               ; preds = %59
  store i32 2, ptr %33, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #6
  br label %94

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

87:                                               ; preds = %64
  br label %90

88:                                               ; preds = %64
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 224, ptr noundef @__PRETTY_FUNCTION__._ZN5nasoq27heightPartitioning_DAG_TrngEiPiS0_iiiiRSt6vectorIiSaIiEERS1_IS3_SaIS3_EEPdS0_b) #8
  unreachable

89:                                               ; No predecessors!
  br label %90

90:                                               ; preds = %89, %87
  br label %91

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

94:                                               ; preds = %63
  %95 = load ptr, ptr %24, align 8, !tbaa !9
  %96 = getelementptr inbounds i32, ptr %95, i64 0
  store i32 0, ptr %96, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #6
  store i32 0, ptr %35, align 4, !tbaa !5
  %97 = load i32, ptr %19, align 4, !tbaa !5
  store i32 %97, ptr %35, align 4, !tbaa !5
  %98 = load i32, ptr %35, align 4, !tbaa !5
  %99 = load ptr, ptr %24, align 8, !tbaa !9
  %100 = load i32, ptr %29, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr %99, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = icmp sgt i32 %98, %103
  br i1 %104, label %105, label %135

105:                                              ; preds = %94
  %106 = load i32, ptr %35, align 4, !tbaa !5
  %107 = load i32, ptr %14, align 4, !tbaa !5
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %135

109:                                              ; preds = %105
  %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 = add nsw i32 %112, 1
  store i32 %113, ptr %29, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i32, ptr %111, i64 %114
  store i32 %110, ptr %115, align 4, !tbaa !5
  %116 = load ptr, ptr %31, align 8, !tbaa !9
  %117 = load i32, ptr %35, align 4, !tbaa !5
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds i32, ptr %116, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sdiv i32 %121, 2
  %123 = icmp sgt i32 %122, 1
  br i1 %123, label %124, label %131

124:                                              ; preds = %109
  %125 = load ptr, ptr %31, align 8, !tbaa !9
  %126 = load i32, ptr %35, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i32, ptr %125, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  br label %132

131:                                              ; preds = %109
  br label %132

132:                                              ; preds = %131, %124
  %133 = phi i32 [ %130, %124 ], [ 1, %131 ]
  store i32 %133, ptr %30, align 4, !tbaa !5
  %134 = load ptr, ptr %21, align 8, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %134, ptr noundef nonnull align 4 dereferenceable(4) %30)
  br label %135

135:                                              ; preds = %132, %105, %94
  %136 = load i32, ptr %20, align 4, !tbaa !5
  %137 = load i32, ptr %35, align 4, !tbaa !5
  %138 = add nsw i32 %137, %136
  store i32 %138, ptr %35, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %157, %135
  %140 = load i32, ptr %35, align 4, !tbaa !5
  %141 = load i32, ptr %17, align 4, !tbaa !5
  %142 = sub nsw i32 %141, 1
  %143 = icmp slt i32 %140, %142
  br i1 %143, label %144, label %168

144:                                              ; preds = %139
  %145 = load ptr, ptr %31, align 8, !tbaa !9
  %146 = load i32, ptr %35, align 4, !tbaa !5
  %147 = sub nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i32, ptr %145, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  store i32 %150, ptr %30, align 4, !tbaa !5
  %151 = load ptr, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  %152 = load i32, ptr %30, align 4, !tbaa !5
  %153 = icmp sgt i32 %152, 1
  br i1 %153, label %154, label %156

154:                                              ; preds = %144
  %155 = load i32, ptr %30, align 4, !tbaa !5
  br label %157

156:                                              ; preds = %144
  br label %157

157:                                              ; preds = %156, %154
  %158 = phi i32 [ %155, %154 ], [ 1, %156 ]
  store i32 %158, ptr %36, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %151, ptr noundef nonnull align 4 dereferenceable(4) %36)
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  %159 = load i32, ptr %35, align 4, !tbaa !5
  %160 = load ptr, ptr %24, align 8, !tbaa !9
  %161 = load i32, ptr %29, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %29, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds i32, ptr %160, i64 %163
  store i32 %159, ptr %164, align 4, !tbaa !5
  %165 = load i32, ptr %20, align 4, !tbaa !5
  %166 = load i32, ptr %35, align 4, !tbaa !5
  %167 = add nsw i32 %166, %165
  store i32 %167, ptr %35, align 4, !tbaa !5
  br label %139, !llvm.loop !15

168:                                              ; preds = %139
  %169 = load i32, ptr %17, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  %171 = load ptr, ptr %24, align 8, !tbaa !9
  %172 = load i32, ptr %29, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %29, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i32, ptr %171, i64 %174
  store i32 %170, ptr %175, align 4, !tbaa !5
  %176 = 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) %176, ptr noundef nonnull align 4 dereferenceable(4) %37)
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #6
  %177 = load ptr, ptr %31, align 8, !tbaa !9
  %178 = icmp eq ptr %177, null
  br i1 %178, label %180, label %179

179:                                              ; preds = %168
  call void @_ZdaPv(ptr noundef %177) #9
  br label %180

180:                                              ; preds = %179, %168
  %181 = load i32, ptr %29, align 4, !tbaa !5
  store i32 %181, ptr %13, align 4
  store i32 1, ptr %33, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #6
  br label %182

182:                                              ; preds = %180, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  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
  %183 = load i32, ptr %13, align 4
  ret i32 %183
}

; 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

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 = distinct !{!15, !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__._ZN5nasoq27heightPartitioning_DAG_TrngEiPiS0_iiiiRSt6vectorIiSaIiEERS1_IS3_SaIS3_EEPdS0_b = external hidden unnamed_addr constant [154 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
define dso_local noundef i32 @_ZN5nasoq27heightPartitioning_DAG_TrngEiPiS0_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 writeonly %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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  store i32 %4, ptr %13, align 4, !tbaa !5
  %17 = zext nneg i32 %0 to i64
  %18 = icmp slt i32 %0, 0
  %19 = shl nuw nsw i64 %17, 2
  %20 = select i1 %18, i64 -1, i64 %19
  %21 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %20) #7
  %.not = icmp sgt i32 %0, %5
  br i1 %.not, label %.preheader.preheader, label %22

.preheader.preheader:                             ; preds = %12
  %smax = tail call i32 @llvm.smax.i32(i32 %0, i32 0)
  %wide.trip.count = zext nneg i32 %smax to i64
  br label %.preheader

22:                                               ; preds = %12
  store i32 0, ptr %10, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 %0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  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) #6
  br label %59

.preheader:                                       ; preds = %.preheader.preheader, %26
  %indvars.iv = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next, %26 ]
  %exitcond.not = icmp eq i64 %indvars.iv, %wide.trip.count
  br i1 %exitcond.not, label %24, label %26

24:                                               ; preds = %.preheader
  store i32 0, ptr %10, align 4, !tbaa !5
  %25 = icmp sgt i32 %5, 0
  br i1 %25, label %35, label %42

26:                                               ; preds = %.preheader
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = sub nsw i32 %28, %30
  %32 = getelementptr inbounds i32, ptr %21, i64 %indvars.iv
  store i32 %31, ptr %32, align 4, !tbaa !5
  %33 = icmp sgt i32 %31, -1
  br i1 %33, label %.preheader, label %34, !llvm.loop !9

34:                                               ; preds = %26
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 224, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN5nasoq27heightPartitioning_DAG_TrngEiPiS0_iiiiRSt6vectorIiSaIiEERS1_IS3_SaIS3_EEPdS0_b) #8
  unreachable

35:                                               ; preds = %24
  %36 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 %5, ptr %36, align 4, !tbaa !5
  %37 = zext nneg i32 %5 to i64
  %38 = getelementptr i32, ptr %21, i64 %37
  %39 = getelementptr i8, ptr %38, i64 -4
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = icmp sgt i32 %40, 3
  %spec.select = select i1 %41, i32 %40, i32 1
  store i32 %spec.select, ptr %13, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(4) %13)
  br label %42

42:                                               ; preds = %35, %24
  %.055 = phi i32 [ 1, %35 ], [ 0, %24 ]
  %43 = add nsw i32 %3, -1
  %invariant.gep = getelementptr i8, ptr %21, i64 -4
  %.059 = add nsw i32 %5, %6
  %44 = icmp slt i32 %.059, %43
  br i1 %44, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %42
  %45 = sext i32 %.059 to i64
  %46 = sext i32 %6 to i64
  %47 = sext i32 %43 to i64
  %48 = zext nneg i32 %.055 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv65 = phi i64 [ %48, %.lr.ph.preheader ], [ %indvars.iv.next66, %.lr.ph ]
  %indvars.iv63 = phi i64 [ %45, %.lr.ph.preheader ], [ %indvars.iv.next64, %.lr.ph ]
  %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv63
  %49 = load i32, ptr %gep, align 4, !tbaa !5
  store i32 %49, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #6
  %50 = call i32 @llvm.smax.i32(i32 %49, i32 1)
  store i32 %50, ptr %15, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(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) #6
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %51 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv.next66
  %52 = trunc nsw i64 %indvars.iv63 to i32
  store i32 %52, ptr %51, align 4, !tbaa !5
  %indvars.iv.next64 = add nsw i64 %indvars.iv63, %46
  %53 = icmp slt i64 %indvars.iv.next64, %47
  br i1 %53, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !11

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %54 = trunc nuw i64 %indvars.iv.next66 to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %42
  %.1.lcssa = phi i32 [ %.055, %42 ], [ %54, %._crit_edge.loopexit ]
  %55 = add nsw i32 %3, 1
  %56 = add nuw nsw i32 %.1.lcssa, 1
  %57 = zext nneg i32 %56 to i64
  %58 = getelementptr inbounds i32, ptr %10, i64 %57
  store i32 %55, ptr %58, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #6
  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) #6
  call void @_ZdaPv(ptr noundef nonnull %21) #9
  br label %59

59:                                               ; preds = %._crit_edge, %22
  %.054 = phi i32 [ 1, %22 ], [ %56, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  ret i32 %.054
}

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


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