; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder (basisu_enc)

; 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.__va_list_tag = type { i32, i32, ptr, ptr }
%"class.basisu::image" = type { i32, i32, i32, %"class.basisu::vector" }
%"class.basisu::vector" = type { ptr, i32, i32 }

@_ZN6basisu21g_debug_font8x8_basicE = external dso_local constant [96 x [8 x i8]], align 16

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #1

; Function Attrs: nounwind
declare i32 @vsnprintf(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #1

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

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

41:                                               ; preds = %157, %9
  %42 = load ptr, ptr %21, align 8, !tbaa !5
  %43 = load i8, ptr %42, align 1, !tbaa !13
  %44 = icmp ne i8 %43, 0
  br i1 %44, label %45, label %158

45:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #4
  %46 = load ptr, ptr %21, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i32 1
  store ptr %47, ptr %21, align 8, !tbaa !5
  %48 = load i8, ptr %46, align 1, !tbaa !13
  store i8 %48, ptr %23, align 1, !tbaa !13
  %49 = load i8, ptr %23, align 1, !tbaa !13
  %50 = zext i8 %49 to i32
  %51 = icmp slt i32 %50, 32
  br i1 %51, label %56, label %52

52:                                               ; preds = %45
  %53 = load i8, ptr %23, align 1, !tbaa !13
  %54 = zext i8 %53 to i32
  %55 = icmp sgt i32 %54, 127
  br i1 %55, label %56, label %57

56:                                               ; preds = %52, %45
  store i8 46, ptr %23, align 1, !tbaa !13
  br label %57

57:                                               ; preds = %56, %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %58 = load i8, ptr %23, align 1, !tbaa !13
  %59 = zext i8 %58 to i32
  %60 = sub nsw i32 %59, 32
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [96 x [8 x i8]], ptr @_ZN6basisu21g_debug_font8x8_basicE, i64 0, i64 %61
  %63 = getelementptr inbounds [8 x i8], ptr %62, i64 0, i64 0
  store ptr %63, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  store i32 0, ptr %25, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %136, %57
  %65 = load i32, ptr %25, align 4, !tbaa !9
  %66 = icmp ult i32 %65, 8
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  store i32 4, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  br label %139

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  %69 = load ptr, ptr %24, align 8, !tbaa !5
  %70 = load i32, ptr %25, align 4, !tbaa !9
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %69, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !13
  %74 = zext i8 %73 to i32
  store i32 %74, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  store i32 0, ptr %28, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %132, %68
  %76 = load i32, ptr %28, align 4, !tbaa !9
  %77 = icmp ult i32 %76, 8
  br i1 %77, label %79, label %78

78:                                               ; preds = %75
  store i32 7, ptr %26, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  br label %135

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  %80 = load i32, ptr %27, align 4, !tbaa !9
  %81 = load i32, ptr %28, align 4, !tbaa !9
  %82 = shl i32 1, %81
  %83 = and i32 %80, %82
  store i32 %83, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %84 = load i32, ptr %29, align 4, !tbaa !9
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %88

86:                                               ; preds = %79
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  br label %90

88:                                               ; preds = %79
  %89 = load ptr, ptr %16, align 8, !tbaa !5
  br label %90

90:                                               ; preds = %88, %86
  %91 = phi ptr [ %87, %86 ], [ %89, %88 ]
  store ptr %91, ptr %30, align 8, !tbaa !5
  %92 = load ptr, ptr %30, align 8, !tbaa !5
  %93 = icmp ne ptr %92, null
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 9, ptr %26, align 4
  br label %129

95:                                               ; preds = %90
  %96 = load i8, ptr %17, align 1, !tbaa !11, !range !14, !noundef !15
  %97 = trunc i8 %96 to i1
  br i1 %97, label %98, label %113

98:                                               ; preds = %95
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = load i32, ptr %28, align 4, !tbaa !9
  %101 = load i32, ptr %13, align 4, !tbaa !9
  %102 = mul i32 %100, %101
  %103 = add i32 %99, %102
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = load i32, ptr %25, align 4, !tbaa !9
  %106 = load i32, ptr %14, align 4, !tbaa !9
  %107 = mul i32 %105, %106
  %108 = add i32 %104, %107
  %109 = load i32, ptr %13, align 4, !tbaa !9
  %110 = load i32, ptr %14, align 4, !tbaa !9
  %111 = load ptr, ptr %30, align 8, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %32, i32 noundef %103, i32 noundef %108, i32 noundef %109, i32 noundef %110, ptr noundef nonnull align 1 dereferenceable(4) %111)
  br label %128

113:                                              ; preds = %95
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = load i32, ptr %28, align 4, !tbaa !9
  %116 = load i32, ptr %13, align 4, !tbaa !9
  %117 = mul i32 %115, %116
  %118 = add i32 %114, %117
  %119 = load i32, ptr %12, align 4, !tbaa !9
  %120 = load i32, ptr %25, align 4, !tbaa !9
  %121 = load i32, ptr %14, align 4, !tbaa !9
  %122 = mul i32 %120, %121
  %123 = add i32 %119, %122
  %124 = load i32, ptr %13, align 4, !tbaa !9
  %125 = load i32, ptr %14, align 4, !tbaa !9
  %126 = load ptr, ptr %30, align 8, !tbaa !5
  %127 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %32, i32 noundef %118, i32 noundef %123, i32 noundef %124, i32 noundef %125, ptr noundef nonnull align 1 dereferenceable(4) %126)
  br label %128

128:                                              ; preds = %113, %98
  store i32 0, ptr %26, align 4
  br label %129

129:                                              ; preds = %128, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  %130 = load i32, ptr %26, align 4
  switch i32 %130, label %159 [
    i32 0, label %131
    i32 9, label %132
  ]

131:                                              ; preds = %129
  br label %132

132:                                              ; preds = %131, %129
  %133 = load i32, ptr %28, align 4, !tbaa !9
  %134 = add i32 %133, 1
  store i32 %134, ptr %28, align 4, !tbaa !9
  br label %75, !llvm.loop !16

135:                                              ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  br label %136

136:                                              ; preds = %135
  %137 = load i32, ptr %25, align 4, !tbaa !9
  %138 = add i32 %137, 1
  store i32 %138, ptr %25, align 4, !tbaa !9
  br label %64, !llvm.loop !18

139:                                              ; preds = %67
  %140 = load i32, ptr %13, align 4, !tbaa !9
  %141 = mul i32 8, %140
  %142 = load i32, ptr %11, align 4, !tbaa !9
  %143 = add i32 %142, %141
  store i32 %143, ptr %11, align 4, !tbaa !9
  %144 = load i32, ptr %11, align 4, !tbaa !9
  %145 = load i32, ptr %13, align 4, !tbaa !9
  %146 = mul i32 8, %145
  %147 = add i32 %144, %146
  %148 = getelementptr inbounds %"class.basisu::image", ptr %32, i32 0, i32 0
  %149 = load i32, ptr %148, align 8, !tbaa !19
  %150 = icmp ugt i32 %147, %149
  br i1 %150, label %151, label %157

151:                                              ; preds = %139
  %152 = load i32, ptr %22, align 4, !tbaa !9
  store i32 %152, ptr %11, align 4, !tbaa !9
  %153 = load i32, ptr %14, align 4, !tbaa !9
  %154 = mul i32 8, %153
  %155 = load i32, ptr %12, align 4, !tbaa !9
  %156 = add i32 %155, %154
  store i32 %156, ptr %12, align 4, !tbaa !9
  br label %157

157:                                              ; preds = %151, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #4
  br label %41, !llvm.loop !22

158:                                              ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 2048, ptr %19) #4
  ret void

159:                                              ; preds = %129
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(4)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn }
attributes #2 = { 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 = { 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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!20, !10, i64 0}
!20 = !{!"_ZTSN6basisu5imageE", !10, i64 0, !10, i64 4, !10, i64 8, !21, i64 16}
!21 = !{!"_ZTSN6basisu6vectorINS_10color_rgbaEEE", !6, i64 0, !10, i64 8, !10, i64 12}
!22 = distinct !{!22, !17}


; 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.__va_list_tag = type { i32, i32, ptr, ptr }

@_ZN6basisu21g_debug_font8x8_basicE = external dso_local local_unnamed_addr constant [96 x [8 x i8]], align 16

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #1

; Function Attrs: nofree nounwind
declare noundef i32 @vsnprintf(ptr nocapture noundef, i64 noundef, ptr nocapture noundef readonly, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #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: mustprogress uwtable
define dso_local void @_ZN6basisu5image10debug_textEjjjjRKNS_10color_rgbaEPS2_bPKcz(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %5, ptr noundef %6, i1 noundef zeroext %7, ptr nocapture noundef readonly %8, ...) local_unnamed_addr #3 align 2 {
  %10 = alloca [2048 x i8], align 16
  %11 = alloca [1 x %struct.__va_list_tag], align 16
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #4
  call void @llvm.va_start.p0(ptr nonnull %11)
  %12 = call i32 @vsnprintf(ptr noundef nonnull %10, i64 noundef 2048, ptr noundef %8, ptr noundef nonnull %11) #4
  call void @llvm.va_end.p0(ptr nonnull %11)
  %13 = load i8, ptr %10, align 16, !tbaa !5
  %.not63 = icmp eq i8 %13, 0
  br i1 %.not63, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %9
  %14 = shl i32 %3, 3
  %15 = shl i32 %4, 3
  %16 = shl i32 %3, 1
  %17 = mul i32 %3, 3
  %18 = shl i32 %3, 2
  %19 = mul i32 %3, 5
  %20 = mul i32 %3, 6
  %21 = mul i32 %3, 7
  br i1 %7, label %.split60.us.us, label %.split60

.split60.us.us:                                   ; preds = %.lr.ph, %.split62.us.us
  %22 = phi i8 [ %83, %.split62.us.us ], [ %13, %.lr.ph ]
  %.066.us = phi i32 [ %.1.us, %.split62.us.us ], [ %1, %.lr.ph ]
  %.04765.us = phi i32 [ %.148.us, %.split62.us.us ], [ %2, %.lr.ph ]
  %.05064.us = phi ptr [ %77, %.split62.us.us ], [ %10, %.lr.ph ]
  %or.cond.us = icmp slt i8 %22, 32
  %spec.store.select.us = select i1 %or.cond.us, i8 46, i8 %22
  %23 = zext i8 %spec.store.select.us to i64
  %24 = add nsw i64 %23, -32
  %25 = getelementptr inbounds [96 x [8 x i8]], ptr @_ZN6basisu21g_debug_font8x8_basicE, i64 0, i64 %24
  %26 = add i32 %.066.us, %3
  %27 = add i32 %16, %.066.us
  %28 = add i32 %17, %.066.us
  %29 = add i32 %18, %.066.us
  %30 = add i32 %19, %.066.us
  %31 = add i32 %20, %.066.us
  %32 = add i32 %21, %.066.us
  br label %.split.us.us.us

.split.us.us.us:                                  ; preds = %.split58.us.us.us, %.split60.us.us
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %.split58.us.us.us ], [ 0, %.split60.us.us ]
  %33 = getelementptr inbounds i8, ptr %25, i64 %indvars.iv70
  %34 = load i8, ptr %33, align 1, !tbaa !5
  %35 = zext i8 %34 to i32
  %36 = trunc nuw nsw i64 %indvars.iv70 to i32
  %37 = mul i32 %36, %4
  %38 = add i32 %37, %.04765.us
  %39 = and i32 %35, 1
  %.not54.us.us.us = icmp eq i32 %39, 0
  %40 = select i1 %.not54.us.us.us, ptr %6, ptr %5
  %.not55.us.us.us = icmp eq ptr %40, null
  br i1 %.not55.us.us.us, label %43, label %41

41:                                               ; preds = %.split.us.us.us
  %42 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.066.us, i32 noundef %38, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %40)
  br label %43

43:                                               ; preds = %41, %.split.us.us.us
  %44 = and i32 %35, 2
  %.not54.us.us.us.1 = icmp eq i32 %44, 0
  %45 = select i1 %.not54.us.us.us.1, ptr %6, ptr %5
  %.not55.us.us.us.1 = icmp eq ptr %45, null
  br i1 %.not55.us.us.us.1, label %48, label %46

46:                                               ; preds = %43
  %47 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %26, i32 noundef %38, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %45)
  br label %48

48:                                               ; preds = %46, %43
  %49 = and i32 %35, 4
  %.not54.us.us.us.2 = icmp eq i32 %49, 0
  %50 = select i1 %.not54.us.us.us.2, ptr %6, ptr %5
  %.not55.us.us.us.2 = icmp eq ptr %50, null
  br i1 %.not55.us.us.us.2, label %53, label %51

51:                                               ; preds = %48
  %52 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %27, i32 noundef %38, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %50)
  br label %53

53:                                               ; preds = %51, %48
  %54 = and i32 %35, 8
  %.not54.us.us.us.3 = icmp eq i32 %54, 0
  %55 = select i1 %.not54.us.us.us.3, ptr %6, ptr %5
  %.not55.us.us.us.3 = icmp eq ptr %55, null
  br i1 %.not55.us.us.us.3, label %58, label %56

56:                                               ; preds = %53
  %57 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %28, i32 noundef %38, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %55)
  br label %58

58:                                               ; preds = %56, %53
  %59 = and i32 %35, 16
  %.not54.us.us.us.4 = icmp eq i32 %59, 0
  %60 = select i1 %.not54.us.us.us.4, ptr %6, ptr %5
  %.not55.us.us.us.4 = icmp eq ptr %60, null
  br i1 %.not55.us.us.us.4, label %63, label %61

61:                                               ; preds = %58
  %62 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %29, i32 noundef %38, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %60)
  br label %63

63:                                               ; preds = %61, %58
  %64 = and i32 %35, 32
  %.not54.us.us.us.5 = icmp eq i32 %64, 0
  %65 = select i1 %.not54.us.us.us.5, ptr %6, ptr %5
  %.not55.us.us.us.5 = icmp eq ptr %65, null
  br i1 %.not55.us.us.us.5, label %68, label %66

66:                                               ; preds = %63
  %67 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %30, i32 noundef %38, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %65)
  br label %68

68:                                               ; preds = %66, %63
  %69 = and i32 %35, 64
  %.not54.us.us.us.6 = icmp eq i32 %69, 0
  %70 = select i1 %.not54.us.us.us.6, ptr %6, ptr %5
  %.not55.us.us.us.6 = icmp eq ptr %70, null
  br i1 %.not55.us.us.us.6, label %73, label %71

71:                                               ; preds = %68
  %72 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %31, i32 noundef %38, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %70)
  br label %73

73:                                               ; preds = %71, %68
  %.not54.us.us.us.775 = icmp slt i8 %34, 0
  %74 = select i1 %.not54.us.us.us.775, ptr %5, ptr %6
  %.not55.us.us.us.7 = icmp eq ptr %74, null
  br i1 %.not55.us.us.us.7, label %.split58.us.us.us, label %75

75:                                               ; preds = %73
  %76 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %32, i32 noundef %38, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %74)
  br label %.split58.us.us.us

.split58.us.us.us:                                ; preds = %75, %73
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next71, 8
  br i1 %exitcond73.not, label %.split62.us.us, label %.split.us.us.us, !llvm.loop !8

.split62.us.us:                                   ; preds = %.split58.us.us.us
  %77 = getelementptr inbounds i8, ptr %.05064.us, i64 1
  %78 = add i32 %.066.us, %14
  %79 = add i32 %78, %14
  %80 = load i32, ptr %0, align 8, !tbaa !10
  %81 = icmp ugt i32 %79, %80
  %82 = select i1 %81, i32 %15, i32 0
  %.148.us = add i32 %82, %.04765.us
  %.1.us = select i1 %81, i32 %1, i32 %78
  %83 = load i8, ptr %77, align 1, !tbaa !5
  %.not.us = icmp eq i8 %83, 0
  br i1 %.not.us, label %._crit_edge, label %.split60.us.us, !llvm.loop !15

.split60:                                         ; preds = %.lr.ph, %.split62
  %84 = phi i8 [ %101, %.split62 ], [ %13, %.lr.ph ]
  %.066 = phi i32 [ %.1, %.split62 ], [ %1, %.lr.ph ]
  %.04765 = phi i32 [ %.148, %.split62 ], [ %2, %.lr.ph ]
  %.05064 = phi ptr [ %95, %.split62 ], [ %10, %.lr.ph ]
  %or.cond = icmp slt i8 %84, 32
  %spec.store.select = select i1 %or.cond, i8 46, i8 %84
  %85 = zext i8 %spec.store.select to i64
  %86 = add nsw i64 %85, -32
  %87 = getelementptr inbounds [96 x [8 x i8]], ptr @_ZN6basisu21g_debug_font8x8_basicE, i64 0, i64 %86
  %88 = add i32 %.066, %3
  %89 = add i32 %16, %.066
  %90 = add i32 %17, %.066
  %91 = add i32 %18, %.066
  %92 = add i32 %19, %.066
  %93 = add i32 %20, %.066
  %94 = add i32 %21, %.066
  br label %.split

.split62:                                         ; preds = %.split58
  %95 = getelementptr inbounds i8, ptr %.05064, i64 1
  %96 = add i32 %.066, %14
  %97 = add i32 %96, %14
  %98 = load i32, ptr %0, align 8, !tbaa !10
  %99 = icmp ugt i32 %97, %98
  %100 = select i1 %99, i32 %15, i32 0
  %.148 = add i32 %100, %.04765
  %.1 = select i1 %99, i32 %1, i32 %96
  %101 = load i8, ptr %95, align 1, !tbaa !5
  %.not = icmp eq i8 %101, 0
  br i1 %.not, label %._crit_edge, label %.split60, !llvm.loop !15

.split:                                           ; preds = %.split60, %.split58
  %indvars.iv = phi i64 [ 0, %.split60 ], [ %indvars.iv.next, %.split58 ]
  %102 = getelementptr inbounds i8, ptr %87, i64 %indvars.iv
  %103 = load i8, ptr %102, align 1, !tbaa !5
  %104 = zext i8 %103 to i32
  %105 = trunc nuw nsw i64 %indvars.iv to i32
  %106 = mul i32 %105, %4
  %107 = add i32 %106, %.04765
  %108 = and i32 %104, 1
  %.not54 = icmp eq i32 %108, 0
  %109 = select i1 %.not54, ptr %6, ptr %5
  %.not55 = icmp eq ptr %109, null
  br i1 %.not55, label %112, label %110

110:                                              ; preds = %.split
  %111 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.066, i32 noundef %107, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %109)
  br label %112

112:                                              ; preds = %110, %.split
  %113 = and i32 %104, 2
  %.not54.1 = icmp eq i32 %113, 0
  %114 = select i1 %.not54.1, ptr %6, ptr %5
  %.not55.1 = icmp eq ptr %114, null
  br i1 %.not55.1, label %117, label %115

115:                                              ; preds = %112
  %116 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %88, i32 noundef %107, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %114)
  br label %117

117:                                              ; preds = %115, %112
  %118 = and i32 %104, 4
  %.not54.2 = icmp eq i32 %118, 0
  %119 = select i1 %.not54.2, ptr %6, ptr %5
  %.not55.2 = icmp eq ptr %119, null
  br i1 %.not55.2, label %122, label %120

120:                                              ; preds = %117
  %121 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %89, i32 noundef %107, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %119)
  br label %122

122:                                              ; preds = %120, %117
  %123 = and i32 %104, 8
  %.not54.3 = icmp eq i32 %123, 0
  %124 = select i1 %.not54.3, ptr %6, ptr %5
  %.not55.3 = icmp eq ptr %124, null
  br i1 %.not55.3, label %127, label %125

125:                                              ; preds = %122
  %126 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %90, i32 noundef %107, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %124)
  br label %127

127:                                              ; preds = %125, %122
  %128 = and i32 %104, 16
  %.not54.4 = icmp eq i32 %128, 0
  %129 = select i1 %.not54.4, ptr %6, ptr %5
  %.not55.4 = icmp eq ptr %129, null
  br i1 %.not55.4, label %132, label %130

130:                                              ; preds = %127
  %131 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %91, i32 noundef %107, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %129)
  br label %132

132:                                              ; preds = %130, %127
  %133 = and i32 %104, 32
  %.not54.5 = icmp eq i32 %133, 0
  %134 = select i1 %.not54.5, ptr %6, ptr %5
  %.not55.5 = icmp eq ptr %134, null
  br i1 %.not55.5, label %137, label %135

135:                                              ; preds = %132
  %136 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %92, i32 noundef %107, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %134)
  br label %137

137:                                              ; preds = %135, %132
  %138 = and i32 %104, 64
  %.not54.6 = icmp eq i32 %138, 0
  %139 = select i1 %.not54.6, ptr %6, ptr %5
  %.not55.6 = icmp eq ptr %139, null
  br i1 %.not55.6, label %142, label %140

140:                                              ; preds = %137
  %141 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %93, i32 noundef %107, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %139)
  br label %142

142:                                              ; preds = %140, %137
  %.not54.774 = icmp slt i8 %103, 0
  %143 = select i1 %.not54.774, ptr %5, ptr %6
  %.not55.7 = icmp eq ptr %143, null
  br i1 %.not55.7, label %.split58, label %144

144:                                              ; preds = %142
  %145 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %94, i32 noundef %107, i32 noundef %3, i32 noundef %4, ptr noundef nonnull align 1 dereferenceable(4) %143)
  br label %.split58

.split58:                                         ; preds = %144, %142
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 8
  br i1 %exitcond.not, label %.split62, label %.split, !llvm.loop !8

._crit_edge:                                      ; preds = %.split62, %.split62.us.us, %9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %10) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image14fill_box_alphaEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN6basisu5image8fill_boxEjjjjRKNS_10color_rgbaE(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 1 dereferenceable(4)) local_unnamed_addr #3 align 2

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass