; LLVM IR from ashishzero/karma :: src/modules/core (stb)

; 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.stbtt_fontinfo = type { ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.stbtt__buf, %struct.stbtt__buf, %struct.stbtt__buf, %struct.stbtt__buf, %struct.stbtt__buf, %struct.stbtt__buf }
%struct.stbtt__buf = type { ptr, i32, i32 }
%struct.Allocator = type { ptr, ptr }
%struct.stbtt_pack_range = type { float, i32, ptr, i32, ptr, i8, i8 }
%struct.stbtt_packedchar = type { i16, i16, i16, i16, float, float, float, float, float }
%struct.stbtt_pack_context = type { ptr, ptr, i32, i32, i32, i32, i32, i32, i32, ptr, ptr }
%struct.Thread_Context = type { %union.Handle, i64, %struct.Allocator, %struct.Temporary_Memory, ptr, ptr }
%union.Handle = type { ptr }
%struct.Temporary_Memory = type { ptr, ptr, i64 }

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z11memory_freePKv9Allocator(ptr noundef, ptr, ptr) #0

; Function Attrs: uwtable
declare hidden noundef ptr @_ZTW7context() #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_Z15memory_allocatem9Allocator(i64 noundef, ptr, ptr) #0

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_PackFontRangesGatherRects(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_PackFontRangesRenderIntoRects(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @stbtt_PackFontRangesPackRects(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local i32 @stbtt_PackFontRanges(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) #4 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.stbtt_fontinfo, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca %struct.Allocator, align 8
  %19 = alloca i32, align 4
  %20 = alloca %struct.Allocator, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 176, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 1, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %80, %5
  %22 = load i32, ptr %13, align 4, !tbaa !9
  %23 = load i32, ptr %11, align 4, !tbaa !9
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %25, label %83

25:                                               ; preds = %21
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %76, %25
  %27 = load i32, ptr %14, align 4, !tbaa !9
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = load i32, ptr %13, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds %struct.stbtt_pack_range, ptr %28, i64 %30
  %32 = getelementptr inbounds %struct.stbtt_pack_range, ptr %31, i32 0, i32 3
  %33 = load i32, ptr %32, align 8, !tbaa !11
  %34 = icmp slt i32 %27, %33
  br i1 %34, label %35, label %79

35:                                               ; preds = %26
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = load i32, ptr %13, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds %struct.stbtt_pack_range, ptr %36, i64 %38
  %40 = getelementptr inbounds %struct.stbtt_pack_range, ptr %39, i32 0, i32 4
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  %42 = load i32, ptr %14, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %struct.stbtt_packedchar, ptr %41, i64 %43
  %45 = getelementptr inbounds %struct.stbtt_packedchar, ptr %44, i32 0, i32 3
  store i16 0, ptr %45, align 2, !tbaa !15
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = load i32, ptr %13, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds %struct.stbtt_pack_range, ptr %46, i64 %48
  %50 = getelementptr inbounds %struct.stbtt_pack_range, ptr %49, i32 0, i32 4
  %51 = load ptr, ptr %50, align 8, !tbaa !14
  %52 = load i32, ptr %14, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds %struct.stbtt_packedchar, ptr %51, i64 %53
  %55 = getelementptr inbounds %struct.stbtt_packedchar, ptr %54, i32 0, i32 2
  store i16 0, ptr %55, align 4, !tbaa !18
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = load i32, ptr %13, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds %struct.stbtt_pack_range, ptr %56, i64 %58
  %60 = getelementptr inbounds %struct.stbtt_pack_range, ptr %59, i32 0, i32 4
  %61 = load ptr, ptr %60, align 8, !tbaa !14
  %62 = load i32, ptr %14, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds %struct.stbtt_packedchar, ptr %61, i64 %63
  %65 = getelementptr inbounds %struct.stbtt_packedchar, ptr %64, i32 0, i32 1
  store i16 0, ptr %65, align 2, !tbaa !19
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = load i32, ptr %13, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds %struct.stbtt_pack_range, ptr %66, i64 %68
  %70 = getelementptr inbounds %struct.stbtt_pack_range, ptr %69, i32 0, i32 4
  %71 = load ptr, ptr %70, align 8, !tbaa !14
  %72 = load i32, ptr %14, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds %struct.stbtt_packedchar, ptr %71, i64 %73
  %75 = getelementptr inbounds %struct.stbtt_packedchar, ptr %74, i32 0, i32 0
  store i16 0, ptr %75, align 4, !tbaa !20
  br label %76

76:                                               ; preds = %35
  %77 = load i32, ptr %14, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %14, align 4, !tbaa !9
  br label %26, !llvm.loop !21

79:                                               ; preds = %26
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %13, align 4, !tbaa !9
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %13, align 4, !tbaa !9
  br label %21, !llvm.loop !23

83:                                               ; preds = %21
  store i32 0, ptr %15, align 4, !tbaa !9
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %84

84:                                               ; preds = %97, %83
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = load i32, ptr %11, align 4, !tbaa !9
  %87 = icmp slt i32 %85, %86
  br i1 %87, label %88, label %100

88:                                               ; preds = %84
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds %struct.stbtt_pack_range, ptr %89, i64 %91
  %93 = getelementptr inbounds %struct.stbtt_pack_range, ptr %92, i32 0, i32 3
  %94 = load i32, ptr %93, align 8, !tbaa !11
  %95 = load i32, ptr %15, align 4, !tbaa !9
  %96 = add nsw i32 %95, %94
  store i32 %96, ptr %15, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %88
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %13, align 4, !tbaa !9
  br label %84, !llvm.loop !24

100:                                              ; preds = %84
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.stbtt_pack_context, ptr %101, i32 0, i32 0
  %103 = load i32, ptr %15, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = mul i64 16, %104
  %106 = call ptr @_ZTW7context()
  %107 = getelementptr inbounds %struct.Thread_Context, ptr %106, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %107, i64 16, i1 false), !tbaa.struct !25
  %108 = getelementptr inbounds { ptr, ptr }, ptr %18, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8
  %110 = getelementptr inbounds { ptr, ptr }, ptr %18, i32 0, i32 1
  %111 = load ptr, ptr %110, align 8
  %112 = call noundef ptr @_Z15memory_allocatem9Allocator(i64 noundef %105, ptr %109, ptr %111)
  store ptr %112, ptr %17, align 8, !tbaa !5
  %113 = load ptr, ptr %17, align 8, !tbaa !5
  %114 = icmp eq ptr %113, null
  br i1 %114, label %115, label %116

115:                                              ; preds = %100
  store i32 0, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %149

116:                                              ; preds = %100
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.stbtt_pack_context, ptr %117, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !26
  %120 = getelementptr inbounds %struct.stbtt_fontinfo, ptr %12, i32 0, i32 0
  store ptr %119, ptr %120, align 8, !tbaa !28
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = load i32, ptr %9, align 4, !tbaa !9
  %124 = call i32 @stbtt_GetFontOffsetForIndex(ptr noundef %122, i32 noundef %123)
  %125 = call i32 @stbtt_InitFont(ptr noundef %12, ptr noundef %121, i32 noundef %124)
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = load ptr, ptr %17, align 8, !tbaa !5
  %130 = call i32 @stbtt_PackFontRangesGatherRects(ptr noundef %126, ptr noundef %12, ptr noundef %127, i32 noundef %128, ptr noundef %129)
  store i32 %130, ptr %15, align 4, !tbaa !9
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = load ptr, ptr %17, align 8, !tbaa !5
  %133 = load i32, ptr %15, align 4, !tbaa !9
  call void @stbtt_PackFontRangesPackRects(ptr noundef %131, ptr noundef %132, i32 noundef %133)
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  %136 = load i32, ptr %11, align 4, !tbaa !9
  %137 = load ptr, ptr %17, align 8, !tbaa !5
  %138 = call i32 @stbtt_PackFontRangesRenderIntoRects(ptr noundef %134, ptr noundef %12, ptr noundef %135, i32 noundef %136, ptr noundef %137)
  store i32 %138, ptr %16, align 4, !tbaa !9
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.stbtt_pack_context, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %17, align 8, !tbaa !5
  %142 = call ptr @_ZTW7context()
  %143 = getelementptr inbounds %struct.Thread_Context, ptr %142, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %143, i64 16, i1 false), !tbaa.struct !25
  %144 = getelementptr inbounds { ptr, ptr }, ptr %20, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8
  %146 = getelementptr inbounds { ptr, ptr }, ptr %20, i32 0, i32 1
  %147 = load ptr, ptr %146, align 8
  call void @_Z11memory_freePKv9Allocator(ptr noundef %141, ptr %145, ptr %147)
  %148 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %148, ptr %6, align 4
  store i32 1, ptr %19, align 4
  br label %149

149:                                              ; preds = %116, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 176, ptr %12) #5
  %150 = load i32, ptr %6, align 4
  ret i32 %150
}

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_InitFont(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_GetFontOffsetForIndex(ptr noundef, i32 noundef) #4

attributes #0 = { inlinehint 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 #1 = { uwtable "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 nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !10, i64 16}
!12 = !{!"_ZTS16stbtt_pack_range", !13, i64 0, !10, i64 4, !6, i64 8, !10, i64 16, !6, i64 24, !7, i64 32, !7, i64 33}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !6, i64 24}
!15 = !{!16, !17, i64 6}
!16 = !{!"_ZTS16stbtt_packedchar", !17, i64 0, !17, i64 2, !17, i64 4, !17, i64 6, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24}
!17 = !{!"short", !7, i64 0}
!18 = !{!16, !17, i64 4}
!19 = !{!16, !17, i64 2}
!20 = !{!16, !17, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!26 = !{!27, !6, i64 0}
!27 = !{!"_ZTS18stbtt_pack_context", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !6, i64 48, !6, i64 56}
!28 = !{!29, !6, i64 0}
!29 = !{!"_ZTS14stbtt_fontinfo", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !30, i64 80, !30, i64 96, !30, i64 112, !30, i64 128, !30, i64 144, !30, i64 160}
!30 = !{!"_ZTS10stbtt__buf", !6, i64 0, !10, i64 8, !10, i64 12}


; 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.stbtt_fontinfo = type { ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.stbtt__buf, %struct.stbtt__buf, %struct.stbtt__buf, %struct.stbtt__buf, %struct.stbtt__buf, %struct.stbtt__buf }
%struct.stbtt__buf = type { ptr, i32, i32 }
%struct.stbtt_pack_range = type { float, i32, ptr, i32, ptr, i8, i8 }
%struct.stbtt_packedchar = type { i16, i16, i16, i16, float, float, float, float, float }

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z11memory_freePKv9Allocator(ptr noundef, ptr, ptr) local_unnamed_addr #0

; Function Attrs: uwtable
declare hidden noundef ptr @_ZTW7context() local_unnamed_addr #1

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_Z15memory_allocatem9Allocator(i64 noundef, ptr, ptr) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_PackFontRangesGatherRects(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_PackFontRangesRenderIntoRects(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @stbtt_PackFontRangesPackRects(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local i32 @stbtt_PackFontRanges(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #3 {
  %6 = alloca %struct.stbtt_fontinfo, align 8
  call void @llvm.lifetime.start.p0(i64 176, ptr nonnull %6) #5
  %7 = icmp sgt i32 %4, 0
  br i1 %7, label %.preheader53.preheader, label %._crit_edge59

.preheader53.preheader:                           ; preds = %5
  %wide.trip.count64 = zext nneg i32 %4 to i64
  br label %.preheader53

.preheader53:                                     ; preds = %.preheader53.preheader, %._crit_edge
  %indvars.iv61 = phi i64 [ 0, %.preheader53.preheader ], [ %indvars.iv.next62, %._crit_edge ]
  %8 = getelementptr inbounds %struct.stbtt_pack_range, ptr %3, i64 %indvars.iv61
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader53
  %12 = getelementptr inbounds i8, ptr %8, i64 24
  %13 = load ptr, ptr %12, align 8, !tbaa !12
  %wide.trip.count = zext nneg i32 %10 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %14 = icmp ult i32 %10, 4
  br i1 %14, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %50

.preheader:                                       ; preds = %._crit_edge
  br i1 %7, label %.lr.ph58.preheader, label %._crit_edge59

.lr.ph58.preheader:                               ; preds = %.preheader
  %wide.trip.count69 = zext nneg i32 %4 to i64
  %min.iters.check = icmp ult i32 %4, 8
  br i1 %min.iters.check, label %.lr.ph58.preheader72, label %vector.ph

.lr.ph58.preheader72:                             ; preds = %middle.block, %.lr.ph58.preheader
  %indvars.iv66.ph = phi i64 [ 0, %.lr.ph58.preheader ], [ %n.vec, %middle.block ]
  %.05056.ph = phi i32 [ 0, %.lr.ph58.preheader ], [ %49, %middle.block ]
  br label %.lr.ph58

vector.ph:                                        ; preds = %.lr.ph58.preheader
  %n.vec = and i64 %wide.trip.count64, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %46, %vector.body ]
  %vec.phi71 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %47, %vector.body ]
  %15 = or disjoint i64 %index, 1
  %16 = or disjoint i64 %index, 2
  %17 = or disjoint i64 %index, 3
  %18 = or disjoint i64 %index, 4
  %19 = or disjoint i64 %index, 5
  %20 = or disjoint i64 %index, 6
  %21 = or disjoint i64 %index, 7
  %22 = getelementptr inbounds %struct.stbtt_pack_range, ptr %3, i64 %index, i32 3
  %23 = getelementptr inbounds %struct.stbtt_pack_range, ptr %3, i64 %15, i32 3
  %24 = getelementptr inbounds %struct.stbtt_pack_range, ptr %3, i64 %16, i32 3
  %25 = getelementptr inbounds %struct.stbtt_pack_range, ptr %3, i64 %17, i32 3
  %26 = getelementptr inbounds %struct.stbtt_pack_range, ptr %3, i64 %18, i32 3
  %27 = getelementptr inbounds %struct.stbtt_pack_range, ptr %3, i64 %19, i32 3
  %28 = getelementptr inbounds %struct.stbtt_pack_range, ptr %3, i64 %20, i32 3
  %29 = getelementptr inbounds %struct.stbtt_pack_range, ptr %3, i64 %21, i32 3
  %30 = load i32, ptr %22, align 8, !tbaa !5
  %31 = load i32, ptr %23, align 8, !tbaa !5
  %32 = load i32, ptr %24, align 8, !tbaa !5
  %33 = load i32, ptr %25, align 8, !tbaa !5
  %34 = insertelement <4 x i32> poison, i32 %30, i64 0
  %35 = insertelement <4 x i32> %34, i32 %31, i64 1
  %36 = insertelement <4 x i32> %35, i32 %32, i64 2
  %37 = insertelement <4 x i32> %36, i32 %33, i64 3
  %38 = load i32, ptr %26, align 8, !tbaa !5
  %39 = load i32, ptr %27, align 8, !tbaa !5
  %40 = load i32, ptr %28, align 8, !tbaa !5
  %41 = load i32, ptr %29, align 8, !tbaa !5
  %42 = insertelement <4 x i32> poison, i32 %38, i64 0
  %43 = insertelement <4 x i32> %42, i32 %39, i64 1
  %44 = insertelement <4 x i32> %43, i32 %40, i64 2
  %45 = insertelement <4 x i32> %44, i32 %41, i64 3
  %46 = add <4 x i32> %37, %vec.phi
  %47 = add <4 x i32> %45, %vec.phi71
  %index.next = add nuw i64 %index, 8
  %48 = icmp eq i64 %index.next, %n.vec
  br i1 %48, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %47, %46
  %49 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count64
  br i1 %cmp.n, label %._crit_edge59.loopexit, label %.lr.ph58.preheader72

50:                                               ; preds = %50, %.lr.ph.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.new ], [ %indvars.iv.next.3, %50 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %50 ]
  %51 = getelementptr inbounds %struct.stbtt_packedchar, ptr %13, i64 %indvars.iv
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  store i64 0, ptr %51, align 4
  %52 = getelementptr inbounds %struct.stbtt_packedchar, ptr %13, i64 %indvars.iv.next
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  store i64 0, ptr %52, align 4
  %53 = getelementptr inbounds %struct.stbtt_packedchar, ptr %13, i64 %indvars.iv.next.1
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  store i64 0, ptr %53, align 4
  %54 = getelementptr inbounds %struct.stbtt_packedchar, ptr %13, i64 %indvars.iv.next.2
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  store i64 0, ptr %54, align 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %50, !llvm.loop !17

._crit_edge.loopexit.unr-lcssa:                   ; preds = %50, %.lr.ph
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next.3, %50 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %55 = getelementptr inbounds %struct.stbtt_packedchar, ptr %13, i64 %indvars.iv.epil
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  store i64 0, ptr %55, align 4
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !18

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %.preheader53
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count64
  br i1 %exitcond65.not, label %.preheader, label %.preheader53, !llvm.loop !20

.lr.ph58:                                         ; preds = %.lr.ph58.preheader72, %.lr.ph58
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph58 ], [ %indvars.iv66.ph, %.lr.ph58.preheader72 ]
  %.05056 = phi i32 [ %58, %.lr.ph58 ], [ %.05056.ph, %.lr.ph58.preheader72 ]
  %56 = getelementptr inbounds %struct.stbtt_pack_range, ptr %3, i64 %indvars.iv66, i32 3
  %57 = load i32, ptr %56, align 8, !tbaa !5
  %58 = add nsw i32 %57, %.05056
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond70.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count69
  br i1 %exitcond70.not, label %._crit_edge59.loopexit, label %.lr.ph58, !llvm.loop !21

._crit_edge59.loopexit:                           ; preds = %.lr.ph58, %middle.block
  %.lcssa = phi i32 [ %49, %middle.block ], [ %58, %.lr.ph58 ]
  %59 = sext i32 %.lcssa to i64
  %60 = shl nsw i64 %59, 4
  br label %._crit_edge59

._crit_edge59:                                    ; preds = %5, %._crit_edge59.loopexit, %.preheader
  %.050.lcssa = phi i64 [ 0, %.preheader ], [ %60, %._crit_edge59.loopexit ], [ 0, %5 ]
  %61 = tail call ptr @_ZTW7context()
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %.sroa.01.0.copyload = load ptr, ptr %62, align 8, !tbaa !22
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %61, i64 24
  %.sroa.22.0.copyload = load ptr, ptr %.sroa.22.0..sroa_idx, align 8, !tbaa !22
  %63 = tail call noundef ptr @_Z15memory_allocatem9Allocator(i64 noundef %.050.lcssa, ptr %.sroa.01.0.copyload, ptr %.sroa.22.0.copyload)
  %64 = icmp eq ptr %63, null
  br i1 %64, label %73, label %65

65:                                               ; preds = %._crit_edge59
  %66 = load ptr, ptr %0, align 8, !tbaa !23
  store ptr %66, ptr %6, align 8, !tbaa !25
  %67 = tail call i32 @stbtt_GetFontOffsetForIndex(ptr noundef %1, i32 noundef %2)
  %68 = call i32 @stbtt_InitFont(ptr noundef nonnull %6, ptr noundef %1, i32 noundef %67)
  %69 = call i32 @stbtt_PackFontRangesGatherRects(ptr noundef nonnull %0, ptr noundef nonnull %6, ptr noundef %3, i32 noundef %4, ptr noundef nonnull %63)
  call void @stbtt_PackFontRangesPackRects(ptr noundef nonnull %0, ptr noundef nonnull %63, i32 noundef %69)
  %70 = call i32 @stbtt_PackFontRangesRenderIntoRects(ptr noundef nonnull %0, ptr noundef nonnull %6, ptr noundef %3, i32 noundef %4, ptr noundef nonnull %63)
  %71 = call ptr @_ZTW7context()
  %72 = getelementptr inbounds i8, ptr %71, i64 16
  %.sroa.0.0.copyload = load ptr, ptr %72, align 8, !tbaa !22
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %71, i64 24
  %.sroa.2.0.copyload = load ptr, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !22
  call void @_Z11memory_freePKv9Allocator(ptr noundef nonnull %63, ptr %.sroa.0.0.copyload, ptr %.sroa.2.0.copyload)
  br label %73

73:                                               ; preds = %._crit_edge59, %65
  %.0 = phi i32 [ %70, %65 ], [ 0, %._crit_edge59 ]
  call void @llvm.lifetime.end.p0(i64 176, ptr nonnull %6) #5
  ret i32 %.0
}

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_InitFont(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local i32 @stbtt_GetFontOffsetForIndex(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

attributes #0 = { inlinehint 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 #1 = { uwtable "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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 16}
!6 = !{!"_ZTS16stbtt_pack_range", !7, i64 0, !10, i64 4, !11, i64 8, !10, i64 16, !11, i64 24, !8, i64 32, !8, i64 33}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !11, i64 24}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14, !16, !15}
!22 = !{!11, !11, i64 0}
!23 = !{!24, !11, i64 0}
!24 = !{!"_ZTS18stbtt_pack_context", !11, i64 0, !11, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !11, i64 48, !11, i64 56}
!25 = !{!26, !11, i64 0}
!26 = !{!"_ZTS14stbtt_fontinfo", !11, i64 0, !11, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !27, i64 80, !27, i64 96, !27, i64 112, !27, i64 128, !27, i64 144, !27, i64 160}
!27 = !{!"_ZTS10stbtt__buf", !11, i64 0, !10, i64 8, !10, i64 12}


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