; LLVM IR from Zhuagenborn/Tiny-x86-OS :: src/kernel/util/bitmap.ll (ZN6Bitmap5AllocEj)

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

%"class.stl::source_location" = type { ptr, ptr, i32, i32 }
%"class.stl::string_view" = type <{ ptr, i32, [4 x i8] }>
%class.Bitmap = type { i32, ptr }

@.str = external hidden unnamed_addr constant [84 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind
declare void @_ZN3dbg6AssertEbN3stl11string_viewERKNS0_15source_locationE(i1 noundef zeroext, ptr, i32, ptr noundef nonnull align 8 dereferenceable(24)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3stl11string_viewC2EPKc(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3stl15source_location7currentEPKcS2_jj(ptr dead_on_unwind noalias writable sret(%"class.stl::source_location") align 8, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6Bitmap7IsAllocEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN6Bitmap3SetEjj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN6Bitmap5AllocEj(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %1) #1 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.stl::string_view", align 8
  %7 = alloca %"class.stl::source_location", align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.stl::string_view", align 8
  %12 = alloca %"class.stl::source_location", align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %16 = load ptr, ptr %4, align 8
  %17 = getelementptr inbounds %class.Bitmap, ptr %16, i32 0, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %23

20:                                               ; preds = %2
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = icmp ugt i32 %21, 0
  br label %23

23:                                               ; preds = %20, %2
  %24 = phi i1 [ false, %2 ], [ %22, %20 ]
  call void @_ZN3stl11string_viewC2EPKc(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef null) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #3
  call void @_ZN3stl15source_location7currentEPKcS2_jj(ptr dead_on_unwind writable sret(%"class.stl::source_location") align 8 %7, ptr noundef @.str, ptr noundef @.str.6, i32 noundef 110, i32 noundef 0) #3
  %25 = getelementptr inbounds { ptr, i32 }, ptr %6, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8
  %27 = getelementptr inbounds { ptr, i32 }, ptr %6, i32 0, i32 1
  %28 = load i32, ptr %27, align 8
  call void @_ZN3dbg6AssertEbN3stl11string_viewERKNS0_15source_locationE(i1 noundef zeroext %24, ptr %26, i32 %28, ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %45, %23
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = getelementptr inbounds %class.Bitmap, ptr %16, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !13
  %33 = icmp ne i32 %30, %32
  br i1 %33, label %34, label %43

34:                                               ; preds = %29
  %35 = getelementptr inbounds %class.Bitmap, ptr %16, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds i8, ptr %36, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !14
  %41 = zext i8 %40 to i32
  %42 = icmp eq i32 %41, 255
  br label %43

43:                                               ; preds = %34, %29
  %44 = phi i1 [ false, %29 ], [ %42, %34 ]
  br i1 %44, label %45, label %48

45:                                               ; preds = %43
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = add i32 %46, 1
  store i32 %47, ptr %8, align 4, !tbaa !9
  br label %29, !llvm.loop !15

48:                                               ; preds = %43
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = getelementptr inbounds %class.Bitmap, ptr %16, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !13
  %52 = icmp eq i32 %49, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %48
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %118

54:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %69, %54
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = icmp ne i32 %56, 8
  br i1 %57, label %58, label %67

58:                                               ; preds = %55
  %59 = getelementptr inbounds %class.Bitmap, ptr %16, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  %61 = load i32, ptr %8, align 4, !tbaa !9
  %62 = zext i32 %61 to i64
  %63 = getelementptr inbounds i8, ptr %60, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !14
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = call noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext %64, i32 noundef %65) #3
  br label %67

67:                                               ; preds = %58, %55
  %68 = phi i1 [ false, %55 ], [ %66, %58 ]
  br i1 %68, label %69, label %72

69:                                               ; preds = %67
  %70 = load i32, ptr %10, align 4, !tbaa !9
  %71 = add i32 %70, 1
  store i32 %71, ptr %10, align 4, !tbaa !9
  br label %55, !llvm.loop !17

72:                                               ; preds = %67
  %73 = load i32, ptr %10, align 4, !tbaa !9
  %74 = icmp ult i32 %73, 8
  call void @_ZN3stl11string_viewC2EPKc(ptr noundef nonnull align 8 dereferenceable(12) %11, ptr noundef null) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #3
  call void @_ZN3stl15source_location7currentEPKcS2_jj(ptr dead_on_unwind writable sret(%"class.stl::source_location") align 8 %12, ptr noundef @.str, ptr noundef @.str.6, i32 noundef 125, i32 noundef 0) #3
  %75 = getelementptr inbounds { ptr, i32 }, ptr %11, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8
  %77 = getelementptr inbounds { ptr, i32 }, ptr %11, i32 0, i32 1
  %78 = load i32, ptr %77, align 8
  call void @_ZN3dbg6AssertEbN3stl11string_viewERKNS0_15source_locationE(i1 noundef zeroext %74, ptr %76, i32 %78, ptr noundef nonnull align 8 dereferenceable(24) %12) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #3
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = mul i32 %79, 8
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = add i32 %81, %80
  store i32 %82, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %83 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %83, ptr %14, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %111, %72
  %85 = load i32, ptr %14, align 4, !tbaa !9
  %86 = getelementptr inbounds %class.Bitmap, ptr %16, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !13
  %88 = mul i32 %87, 8
  %89 = icmp ne i32 %85, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %84
  store i32 6, ptr %9, align 4
  br label %114

91:                                               ; preds = %84
  %92 = load i32, ptr %14, align 4, !tbaa !9
  %93 = call noundef zeroext i1 @_ZNK6Bitmap7IsAllocEj(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef %92) #3
  br i1 %93, label %109, label %94

94:                                               ; preds = %91
  %95 = load i32, ptr %13, align 4, !tbaa !9
  %96 = add i32 %95, 1
  store i32 %96, ptr %13, align 4, !tbaa !9
  %97 = load i32, ptr %5, align 4, !tbaa !9
  %98 = icmp eq i32 %96, %97
  br i1 %98, label %99, label %108

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  %100 = load i32, ptr %14, align 4, !tbaa !9
  %101 = load i32, ptr %5, align 4, !tbaa !9
  %102 = sub i32 %100, %101
  %103 = add i32 %102, 1
  store i32 %103, ptr %15, align 4, !tbaa !9
  %104 = load i32, ptr %15, align 4, !tbaa !9
  %105 = load i32, ptr %5, align 4, !tbaa !9
  %106 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6Bitmap3SetEjj(ptr noundef nonnull align 8 dereferenceable(16) %16, i32 noundef %104, i32 noundef %105) #3
  %107 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %107, ptr %3, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %114

108:                                              ; preds = %94
  br label %110

109:                                              ; preds = %91
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %110

110:                                              ; preds = %109, %108
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %14, align 4, !tbaa !9
  %113 = add i32 %112, 1
  store i32 %113, ptr %14, align 4, !tbaa !9
  br label %84, !llvm.loop !18

114:                                              ; preds = %99, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  %115 = load i32, ptr %9, align 4
  switch i32 %115, label %117 [
    i32 6, label %116
  ]

116:                                              ; preds = %114
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %117

117:                                              ; preds = %116, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %118

118:                                              ; preds = %117, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %119 = load i32, ptr %3, align 4
  ret i32 %119
}

attributes #0 = { 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 #1 = { mustprogress 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTS6Bitmap", !10, i64 0, !6, i64 8}
!13 = !{!12, !10, i64 0}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}


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

%"class.stl::source_location" = type { ptr, ptr, i32, i32 }
%"class.stl::string_view" = type <{ ptr, i32, [4 x i8] }>

@.str = external hidden unnamed_addr constant [84 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind
declare void @_ZN3dbg6AssertEbN3stl11string_viewERKNS0_15source_locationE(i1 noundef zeroext, ptr, i32, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3stl11string_viewC2EPKc(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3stl15source_location7currentEPKcS2_jj(ptr dead_on_unwind noalias writable sret(%"class.stl::source_location") align 8, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6Bitmap7IsAllocEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZN6Bitmap3SetEjj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN6Bitmap5AllocEj(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %"class.stl::string_view", align 8
  %4 = alloca %"class.stl::source_location", align 8
  %5 = alloca %"class.stl::string_view", align 8
  %6 = alloca %"class.stl::source_location", align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = icmp ne ptr %8, null
  %10 = icmp ne i32 %1, 0
  %11 = and i1 %10, %9
  call void @_ZN3stl11string_viewC2EPKc(ptr noundef nonnull align 8 dereferenceable(12) %3, ptr noundef null) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  call void @_ZN3stl15source_location7currentEPKcS2_jj(ptr dead_on_unwind nonnull writable sret(%"class.stl::source_location") align 8 %4, ptr noundef nonnull @.str, ptr noundef nonnull @.str.6, i32 noundef 110, i32 noundef 0) #3
  %12 = load ptr, ptr %3, align 8
  %13 = getelementptr inbounds i8, ptr %3, i64 8
  %14 = load i32, ptr %13, align 8
  call void @_ZN3dbg6AssertEbN3stl11string_viewERKNS0_15source_locationE(i1 noundef zeroext %11, ptr %12, i32 %14, ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  %15 = load i32, ptr %0, align 8, !tbaa !11
  %.not40 = icmp eq i32 %15, 0
  br i1 %.not40, label %.critedge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %.lr.ph, %23
  %.03241 = phi i32 [ 0, %.lr.ph ], [ %24, %23 ]
  %18 = zext i32 %.03241 to i64
  %19 = getelementptr inbounds i8, ptr %16, i64 %18
  %20 = load i8, ptr %19, align 1, !tbaa !12
  %21 = icmp eq i8 %20, -1
  br i1 %21, label %23, label %.critedge.preheader

.critedge.preheader:                              ; preds = %17
  %22 = call noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext %20, i32 noundef 0) #3
  br i1 %22, label %.critedge, label %.critedge2

23:                                               ; preds = %17
  %24 = add nuw i32 %.03241, 1
  %.not = icmp eq i32 %24, %15
  br i1 %.not, label %.critedge.thread, label %17, !llvm.loop !13

.critedge:                                        ; preds = %.critedge.preheader
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %25, i64 %18
  %27 = load i8, ptr %26, align 1, !tbaa !12
  %28 = call noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext %27, i32 noundef 1) #3
  br i1 %28, label %.critedge.1, label %.critedge2

.critedge.1:                                      ; preds = %.critedge
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i64 %18
  %31 = load i8, ptr %30, align 1, !tbaa !12
  %32 = call noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext %31, i32 noundef 2) #3
  br i1 %32, label %.critedge.2, label %.critedge2

.critedge.2:                                      ; preds = %.critedge.1
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 %18
  %35 = load i8, ptr %34, align 1, !tbaa !12
  %36 = call noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext %35, i32 noundef 3) #3
  br i1 %36, label %.critedge.3, label %.critedge2

.critedge.3:                                      ; preds = %.critedge.2
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %37, i64 %18
  %39 = load i8, ptr %38, align 1, !tbaa !12
  %40 = call noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext %39, i32 noundef 4) #3
  br i1 %40, label %.critedge.4, label %.critedge2

.critedge.4:                                      ; preds = %.critedge.3
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 %18
  %43 = load i8, ptr %42, align 1, !tbaa !12
  %44 = call noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext %43, i32 noundef 5) #3
  br i1 %44, label %.critedge.5, label %.critedge2

.critedge.5:                                      ; preds = %.critedge.4
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 %18
  %47 = load i8, ptr %46, align 1, !tbaa !12
  %48 = call noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext %47, i32 noundef 6) #3
  br i1 %48, label %.critedge.6, label %.critedge2

.critedge.6:                                      ; preds = %.critedge.5
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 %18
  %51 = load i8, ptr %50, align 1, !tbaa !12
  %52 = call noundef zeroext i1 @_ZN3bit8IsBitSetIhEEbT_j(i8 noundef zeroext %51, i32 noundef 7) #3
  %not. = xor i1 %52, true
  %spec.select56 = select i1 %52, i32 8, i32 7
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge.6, %.critedge.5, %.critedge.4, %.critedge.3, %.critedge.2, %.critedge.1, %.critedge, %.critedge.preheader
  %53 = phi i1 [ true, %.critedge.preheader ], [ true, %.critedge ], [ true, %.critedge.1 ], [ true, %.critedge.2 ], [ true, %.critedge.3 ], [ true, %.critedge.4 ], [ true, %.critedge.5 ], [ %not., %.critedge.6 ]
  %.030.lcssa = phi i32 [ 0, %.critedge.preheader ], [ 1, %.critedge ], [ 2, %.critedge.1 ], [ 3, %.critedge.2 ], [ 4, %.critedge.3 ], [ 5, %.critedge.4 ], [ 6, %.critedge.5 ], [ %spec.select56, %.critedge.6 ]
  call void @_ZN3stl11string_viewC2EPKc(ptr noundef nonnull align 8 dereferenceable(12) %5, ptr noundef null) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #3
  call void @_ZN3stl15source_location7currentEPKcS2_jj(ptr dead_on_unwind nonnull writable sret(%"class.stl::source_location") align 8 %6, ptr noundef nonnull @.str, ptr noundef nonnull @.str.6, i32 noundef 125, i32 noundef 0) #3
  %54 = load ptr, ptr %5, align 8
  %55 = getelementptr inbounds i8, ptr %5, i64 8
  %56 = load i32, ptr %55, align 8
  call void @_ZN3dbg6AssertEbN3stl11string_viewERKNS0_15source_locationE(i1 noundef zeroext %53, ptr %54, i32 %56, ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  %57 = shl i32 %.03241, 3
  %58 = add i32 %.030.lcssa, %57
  %59 = load i32, ptr %0, align 8, !tbaa !11
  %60 = shl i32 %59, 3
  %.not3643 = icmp eq i32 %58, %60
  br i1 %.not3643, label %.critedge.thread, label %.lr.ph46

.lr.ph46:                                         ; preds = %.critedge2, %69
  %.02745 = phi i32 [ %70, %69 ], [ %58, %.critedge2 ]
  %.02844 = phi i32 [ %.129, %69 ], [ 0, %.critedge2 ]
  %61 = call noundef zeroext i1 @_ZNK6Bitmap7IsAllocEj(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.02745) #3
  br i1 %61, label %69, label %62

62:                                               ; preds = %.lr.ph46
  %63 = add i32 %.02844, 1
  %64 = icmp eq i32 %63, %1
  br i1 %64, label %65, label %69

65:                                               ; preds = %62
  %66 = sub i32 %.02745, %1
  %67 = add i32 %66, 1
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZN6Bitmap3SetEjj(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %67, i32 noundef %1) #3
  br label %.critedge.thread

69:                                               ; preds = %.lr.ph46, %62
  %.129 = phi i32 [ %63, %62 ], [ 0, %.lr.ph46 ]
  %70 = add i32 %.02745, 1
  %71 = load i32, ptr %0, align 8, !tbaa !11
  %72 = shl i32 %71, 3
  %.not36 = icmp eq i32 %70, %72
  br i1 %.not36, label %.critedge.thread, label %.lr.ph46, !llvm.loop !15

.critedge.thread:                                 ; preds = %23, %69, %2, %.critedge2, %65
  %.2 = phi i32 [ %67, %65 ], [ -1, %.critedge2 ], [ -1, %2 ], [ -1, %69 ], [ -1, %23 ]
  ret i32 %.2
}

attributes #0 = { 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 #1 = { mustprogress 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 8}
!6 = !{!"_ZTS6Bitmap", !7, i64 0, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!8, !8, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


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