; LLVM IR from Dragons-Lake/REI :: sources/REI_Integration/3rdParty/nanovg (nanovg)

; 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.FONStextIter = type { float, float, float, float, float, float, i32, i16, i16, ptr, i32, ptr, ptr, ptr, i32 }
%struct.FONSquad = type { float, float, float, float, float, float, float, float }
%struct.NVGcontext = type { %struct.NVGparams, ptr, i32, i32, float, float, [32 x %struct.NVGstate], i32, ptr, float, float, float, float, ptr, [4 x i32], i32, i32, i32, i32, i32 }
%struct.NVGparams = type { ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NVGstate = type { %struct.NVGcompositeOperationState, %struct.NVGpaint, %struct.NVGpaint, float, float, i32, i32, float, [6 x float], %struct.NVGscissor, float, float, float, float, i32, i32 }
%struct.NVGcompositeOperationState = type { i32, i32, i32, i32 }
%struct.NVGpaint = type { [6 x float], [2 x float], float, float, %struct.NVGcolor, %struct.NVGcolor, i32 }
%struct.NVGcolor = type { %union.anon }
%union.anon = type { [4 x float] }
%struct.NVGscissor = type { [6 x float], [2 x float] }
%struct.NVGglyphPosition = type { ptr, float, float, float }

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: nounwind uwtable
declare hidden ptr @nvg__getState(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden float @nvg__maxf(float noundef, float noundef) #2

; Function Attrs: nounwind uwtable
declare hidden float @nvg__minf(float noundef, float noundef) #2

; Function Attrs: nounwind uwtable
declare hidden float @nvg__getFontScale(ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

declare void @fonsSetSize(ptr noundef, float noundef) #4

declare void @fonsSetSpacing(ptr noundef, float noundef) #4

declare void @fonsSetBlur(ptr noundef, float noundef) #4

declare void @fonsSetAlign(ptr noundef, i32 noundef) #4

declare void @fonsSetFont(ptr noundef, i32 noundef) #4

declare i32 @fonsTextIterInit(ptr noundef, ptr noundef, float noundef, float noundef, ptr noundef, ptr noundef) #4

declare i32 @fonsTextIterNext(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @nvg__allocTextAtlas(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @nvgTextGlyphPositions(ptr noundef %0, float noundef %1, float noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6) #2 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca %struct.FONStextIter, align 8
  %20 = alloca %struct.FONStextIter, align 8
  %21 = alloca %struct.FONSquad, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store float %1, ptr %10, align 4, !tbaa !9
  store float %2, ptr %11, align 4, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store i32 %6, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = call ptr @nvg__getState(ptr noundef %24)
  store ptr %25, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %26 = load ptr, ptr %16, align 8, !tbaa !5
  %27 = call float @nvg__getFontScale(ptr noundef %26)
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.NVGcontext, ptr %28, i32 0, i32 12
  %30 = load float, ptr %29, align 4, !tbaa !13
  %31 = fmul float %27, %30
  store float %31, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %32 = load float, ptr %17, align 4, !tbaa !9
  %33 = fdiv float 1.000000e+00, %32
  store float %33, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 80, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 80, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !11
  %34 = load ptr, ptr %16, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.NVGstate, ptr %34, i32 0, i32 15
  %36 = load i32, ptr %35, align 4, !tbaa !16
  %37 = icmp eq i32 %36, -1
  br i1 %37, label %38, label %39

38:                                               ; preds = %7
  store i32 0, ptr %8, align 4
  store i32 1, ptr %23, align 4
  br label %170

39:                                               ; preds = %7
  %40 = load ptr, ptr %13, align 8, !tbaa !5
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %47

42:                                               ; preds = %39
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = call i64 @strlen(ptr noundef %44) #6
  %46 = getelementptr inbounds i8, ptr %43, i64 %45
  store ptr %46, ptr %13, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %42, %39
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = load ptr, ptr %13, align 8, !tbaa !5
  %50 = icmp eq ptr %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %47
  store i32 0, ptr %8, align 4
  store i32 1, ptr %23, align 4
  br label %170

52:                                               ; preds = %47
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.NVGcontext, ptr %53, i32 0, i32 13
  %55 = load ptr, ptr %54, align 8, !tbaa !22
  %56 = load ptr, ptr %16, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.NVGstate, ptr %56, i32 0, i32 10
  %58 = load float, ptr %57, align 4, !tbaa !23
  %59 = load float, ptr %17, align 4, !tbaa !9
  %60 = fmul float %58, %59
  call void @fonsSetSize(ptr noundef %55, float noundef %60)
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.NVGcontext, ptr %61, i32 0, i32 13
  %63 = load ptr, ptr %62, align 8, !tbaa !22
  %64 = load ptr, ptr %16, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.NVGstate, ptr %64, i32 0, i32 11
  %66 = load float, ptr %65, align 4, !tbaa !24
  %67 = load float, ptr %17, align 4, !tbaa !9
  %68 = fmul float %66, %67
  call void @fonsSetSpacing(ptr noundef %63, float noundef %68)
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.NVGcontext, ptr %69, i32 0, i32 13
  %71 = load ptr, ptr %70, align 8, !tbaa !22
  %72 = load ptr, ptr %16, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.NVGstate, ptr %72, i32 0, i32 13
  %74 = load float, ptr %73, align 4, !tbaa !25
  %75 = load float, ptr %17, align 4, !tbaa !9
  %76 = fmul float %74, %75
  call void @fonsSetBlur(ptr noundef %71, float noundef %76)
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.NVGcontext, ptr %77, i32 0, i32 13
  %79 = load ptr, ptr %78, align 8, !tbaa !22
  %80 = load ptr, ptr %16, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.NVGstate, ptr %80, i32 0, i32 14
  %82 = load i32, ptr %81, align 4, !tbaa !26
  call void @fonsSetAlign(ptr noundef %79, i32 noundef %82)
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.NVGcontext, ptr %83, i32 0, i32 13
  %85 = load ptr, ptr %84, align 8, !tbaa !22
  %86 = load ptr, ptr %16, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.NVGstate, ptr %86, i32 0, i32 15
  %88 = load i32, ptr %87, align 4, !tbaa !16
  call void @fonsSetFont(ptr noundef %85, i32 noundef %88)
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.NVGcontext, ptr %89, i32 0, i32 13
  %91 = load ptr, ptr %90, align 8, !tbaa !22
  %92 = load float, ptr %10, align 4, !tbaa !9
  %93 = load float, ptr %17, align 4, !tbaa !9
  %94 = fmul float %92, %93
  %95 = load float, ptr %11, align 4, !tbaa !9
  %96 = load float, ptr %17, align 4, !tbaa !9
  %97 = fmul float %95, %96
  %98 = load ptr, ptr %12, align 8, !tbaa !5
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = call i32 @fonsTextIterInit(ptr noundef %91, ptr noundef %19, float noundef %94, float noundef %97, ptr noundef %98, ptr noundef %99)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %19, i64 80, i1 false), !tbaa.struct !27
  br label %101

101:                                              ; preds = %167, %52
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.NVGcontext, ptr %102, i32 0, i32 13
  %104 = load ptr, ptr %103, align 8, !tbaa !22
  %105 = call i32 @fonsTextIterNext(ptr noundef %104, ptr noundef %19, ptr noundef %21)
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %168

107:                                              ; preds = %101
  %108 = getelementptr inbounds %struct.FONStextIter, ptr %19, i32 0, i32 10
  %109 = load i32, ptr %108, align 8, !tbaa !30
  %110 = icmp slt i32 %109, 0
  br i1 %110, label %111, label %120

111:                                              ; preds = %107
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = call i32 @nvg__allocTextAtlas(ptr noundef %112)
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %120

115:                                              ; preds = %111
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %20, i64 80, i1 false), !tbaa.struct !27
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.NVGcontext, ptr %116, i32 0, i32 13
  %118 = load ptr, ptr %117, align 8, !tbaa !22
  %119 = call i32 @fonsTextIterNext(ptr noundef %118, ptr noundef %19, ptr noundef %21)
  br label %120

120:                                              ; preds = %115, %111, %107
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %19, i64 80, i1 false), !tbaa.struct !27
  %121 = getelementptr inbounds %struct.FONStextIter, ptr %19, i32 0, i32 11
  %122 = load ptr, ptr %121, align 8, !tbaa !32
  %123 = load ptr, ptr %14, align 8, !tbaa !5
  %124 = load i32, ptr %22, align 4, !tbaa !11
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds %struct.NVGglyphPosition, ptr %123, i64 %125
  %127 = getelementptr inbounds %struct.NVGglyphPosition, ptr %126, i32 0, i32 0
  store ptr %122, ptr %127, align 8, !tbaa !33
  %128 = getelementptr inbounds %struct.FONStextIter, ptr %19, i32 0, i32 0
  %129 = load float, ptr %128, align 8, !tbaa !35
  %130 = load float, ptr %18, align 4, !tbaa !9
  %131 = fmul float %129, %130
  %132 = load ptr, ptr %14, align 8, !tbaa !5
  %133 = load i32, ptr %22, align 4, !tbaa !11
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %struct.NVGglyphPosition, ptr %132, i64 %134
  %136 = getelementptr inbounds %struct.NVGglyphPosition, ptr %135, i32 0, i32 1
  store float %131, ptr %136, align 8, !tbaa !36
  %137 = getelementptr inbounds %struct.FONStextIter, ptr %19, i32 0, i32 0
  %138 = load float, ptr %137, align 8, !tbaa !35
  %139 = getelementptr inbounds %struct.FONSquad, ptr %21, i32 0, i32 0
  %140 = load float, ptr %139, align 4, !tbaa !37
  %141 = call float @nvg__minf(float noundef %138, float noundef %140)
  %142 = load float, ptr %18, align 4, !tbaa !9
  %143 = fmul float %141, %142
  %144 = load ptr, ptr %14, align 8, !tbaa !5
  %145 = load i32, ptr %22, align 4, !tbaa !11
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds %struct.NVGglyphPosition, ptr %144, i64 %146
  %148 = getelementptr inbounds %struct.NVGglyphPosition, ptr %147, i32 0, i32 2
  store float %143, ptr %148, align 4, !tbaa !39
  %149 = getelementptr inbounds %struct.FONStextIter, ptr %19, i32 0, i32 2
  %150 = load float, ptr %149, align 8, !tbaa !40
  %151 = getelementptr inbounds %struct.FONSquad, ptr %21, i32 0, i32 4
  %152 = load float, ptr %151, align 4, !tbaa !41
  %153 = call float @nvg__maxf(float noundef %150, float noundef %152)
  %154 = load float, ptr %18, align 4, !tbaa !9
  %155 = fmul float %153, %154
  %156 = load ptr, ptr %14, align 8, !tbaa !5
  %157 = load i32, ptr %22, align 4, !tbaa !11
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds %struct.NVGglyphPosition, ptr %156, i64 %158
  %160 = getelementptr inbounds %struct.NVGglyphPosition, ptr %159, i32 0, i32 3
  store float %155, ptr %160, align 8, !tbaa !42
  %161 = load i32, ptr %22, align 4, !tbaa !11
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %22, align 4, !tbaa !11
  %163 = load i32, ptr %22, align 4, !tbaa !11
  %164 = load i32, ptr %15, align 4, !tbaa !11
  %165 = icmp sge i32 %163, %164
  br i1 %165, label %166, label %167

166:                                              ; preds = %120
  br label %168

167:                                              ; preds = %120
  br label %101, !llvm.loop !43

168:                                              ; preds = %166, %101
  %169 = load i32, ptr %22, align 4, !tbaa !11
  store i32 %169, ptr %8, align 4
  store i32 1, ptr %23, align 4
  br label %170

170:                                              ; preds = %168, %51, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  %171 = load i32, ptr %8, align 4
  ret i32 %171
}

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

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 8740}
!14 = !{!"NVGcontext", !15, i64 0, !6, i64 112, !12, i64 120, !12, i64 124, !10, i64 128, !10, i64 132, !7, i64 136, !12, i64 8712, !6, i64 8720, !10, i64 8728, !10, i64 8732, !10, i64 8736, !10, i64 8740, !6, i64 8744, !7, i64 8752, !12, i64 8768, !12, i64 8772, !12, i64 8776, !12, i64 8780, !12, i64 8784}
!15 = !{!"NVGparams", !6, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104}
!16 = !{!17, !12, i64 264}
!17 = !{!"NVGstate", !18, i64 0, !19, i64 16, !19, i64 92, !10, i64 168, !10, i64 172, !12, i64 176, !12, i64 180, !10, i64 184, !7, i64 188, !21, i64 212, !10, i64 244, !10, i64 248, !10, i64 252, !10, i64 256, !12, i64 260, !12, i64 264}
!18 = !{!"NVGcompositeOperationState", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!19 = !{!"NVGpaint", !7, i64 0, !7, i64 24, !10, i64 32, !10, i64 36, !20, i64 40, !20, i64 56, !12, i64 72}
!20 = !{!"NVGcolor", !7, i64 0}
!21 = !{!"NVGscissor", !7, i64 0, !7, i64 24}
!22 = !{!14, !6, i64 8744}
!23 = !{!17, !10, i64 244}
!24 = !{!17, !10, i64 248}
!25 = !{!17, !10, i64 256}
!26 = !{!17, !12, i64 260}
!27 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 4, !9, i64 20, i64 4, !9, i64 24, i64 4, !11, i64 28, i64 2, !28, i64 30, i64 2, !28, i64 32, i64 8, !5, i64 40, i64 4, !11, i64 48, i64 8, !5, i64 56, i64 8, !5, i64 64, i64 8, !5, i64 72, i64 4, !11}
!28 = !{!29, !29, i64 0}
!29 = !{!"short", !7, i64 0}
!30 = !{!31, !12, i64 40}
!31 = !{!"FONStextIter", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !12, i64 24, !29, i64 28, !29, i64 30, !6, i64 32, !12, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !12, i64 72}
!32 = !{!31, !6, i64 48}
!33 = !{!34, !6, i64 0}
!34 = !{!"NVGglyphPosition", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16}
!35 = !{!31, !10, i64 0}
!36 = !{!34, !10, i64 8}
!37 = !{!38, !10, i64 0}
!38 = !{!"FONSquad", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!39 = !{!34, !10, i64 12}
!40 = !{!31, !10, i64 8}
!41 = !{!38, !10, i64 16}
!42 = !{!34, !10, i64 16}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}


; 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.FONStextIter = type { float, float, float, float, float, float, i32, i16, i16, ptr, i32, ptr, ptr, ptr, i32 }
%struct.FONSquad = type { float, float, float, float, float, float, float, float }
%struct.NVGglyphPosition = type { ptr, float, float, float }

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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: nounwind uwtable
declare hidden ptr @nvg__getState(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden float @nvg__maxf(float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden float @nvg__minf(float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden float @nvg__getFontScale(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

declare void @fonsSetSize(ptr noundef, float noundef) local_unnamed_addr #4

declare void @fonsSetSpacing(ptr noundef, float noundef) local_unnamed_addr #4

declare void @fonsSetBlur(ptr noundef, float noundef) local_unnamed_addr #4

declare void @fonsSetAlign(ptr noundef, i32 noundef) local_unnamed_addr #4

declare void @fonsSetFont(ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @fonsTextIterInit(ptr noundef, ptr noundef, float noundef, float noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @fonsTextIterNext(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden i32 @nvg__allocTextAtlas(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @nvgTextGlyphPositions(ptr noundef %0, float noundef %1, float noundef %2, ptr noundef %3, ptr noundef %4, ptr nocapture noundef writeonly %5, i32 noundef %6) local_unnamed_addr #2 {
  %8 = alloca %struct.FONStextIter, align 8
  %9 = alloca %struct.FONStextIter, align 8
  %10 = alloca %struct.FONSquad, align 4
  %11 = tail call ptr @nvg__getState(ptr noundef %0)
  %12 = tail call float @nvg__getFontScale(ptr noundef %11)
  %13 = getelementptr inbounds i8, ptr %0, i64 8740
  %14 = load float, ptr %13, align 4, !tbaa !5
  %15 = fmul float %12, %14
  %16 = fdiv float 1.000000e+00, %15
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %9)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #6
  %17 = getelementptr inbounds i8, ptr %11, i64 264
  %18 = load i32, ptr %17, align 4, !tbaa !13
  %19 = icmp eq i32 %18, -1
  br i1 %19, label %.loopexit, label %20

20:                                               ; preds = %7
  %21 = icmp eq ptr %4, null
  br i1 %21, label %22, label %25

22:                                               ; preds = %20
  %23 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #7
  %24 = getelementptr inbounds i8, ptr %3, i64 %23
  br label %25

25:                                               ; preds = %22, %20
  %.049 = phi ptr [ %24, %22 ], [ %4, %20 ]
  %26 = icmp eq ptr %.049, %3
  br i1 %26, label %.loopexit, label %27

27:                                               ; preds = %25
  %28 = getelementptr inbounds i8, ptr %0, i64 8744
  %29 = load ptr, ptr %28, align 8, !tbaa !19
  %30 = getelementptr inbounds i8, ptr %11, i64 244
  %31 = load float, ptr %30, align 4, !tbaa !20
  %32 = fmul float %15, %31
  tail call void @fonsSetSize(ptr noundef %29, float noundef %32) #6
  %33 = load ptr, ptr %28, align 8, !tbaa !19
  %34 = getelementptr inbounds i8, ptr %11, i64 248
  %35 = load float, ptr %34, align 4, !tbaa !21
  %36 = fmul float %15, %35
  tail call void @fonsSetSpacing(ptr noundef %33, float noundef %36) #6
  %37 = load ptr, ptr %28, align 8, !tbaa !19
  %38 = getelementptr inbounds i8, ptr %11, i64 256
  %39 = load float, ptr %38, align 4, !tbaa !22
  %40 = fmul float %15, %39
  tail call void @fonsSetBlur(ptr noundef %37, float noundef %40) #6
  %41 = load ptr, ptr %28, align 8, !tbaa !19
  %42 = getelementptr inbounds i8, ptr %11, i64 260
  %43 = load i32, ptr %42, align 4, !tbaa !23
  tail call void @fonsSetAlign(ptr noundef %41, i32 noundef %43) #6
  %44 = load ptr, ptr %28, align 8, !tbaa !19
  %45 = load i32, ptr %17, align 4, !tbaa !13
  tail call void @fonsSetFont(ptr noundef %44, i32 noundef %45) #6
  %46 = load ptr, ptr %28, align 8, !tbaa !19
  %47 = fmul float %15, %1
  %48 = fmul float %15, %2
  %49 = call i32 @fonsTextIterInit(ptr noundef %46, ptr noundef nonnull %8, float noundef %47, float noundef %48, ptr noundef %3, ptr noundef %.049) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 8 dereferenceable(80) %8, i64 80, i1 false), !tbaa.struct !24
  %50 = getelementptr inbounds i8, ptr %8, i64 40
  %51 = getelementptr inbounds i8, ptr %8, i64 48
  %52 = getelementptr inbounds i8, ptr %8, i64 8
  %53 = getelementptr inbounds i8, ptr %10, i64 16
  %smax = call i32 @llvm.smax.i32(i32 %6, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  br label %54

54:                                               ; preds = %65, %27
  %indvars.iv = phi i64 [ %indvars.iv.next, %65 ], [ 0, %27 ]
  %55 = load ptr, ptr %28, align 8, !tbaa !19
  %56 = call i32 @fonsTextIterNext(ptr noundef %55, ptr noundef nonnull %8, ptr noundef nonnull %10) #6
  %.not = icmp eq i32 %56, 0
  br i1 %.not, label %.loopexit.loopexit.split.loop.exit57, label %57

57:                                               ; preds = %54
  %58 = load i32, ptr %50, align 8, !tbaa !30
  %59 = icmp slt i32 %58, 0
  br i1 %59, label %60, label %65

60:                                               ; preds = %57
  %61 = call i32 @nvg__allocTextAtlas(ptr noundef nonnull %0)
  %.not54 = icmp eq i32 %61, 0
  br i1 %.not54, label %65, label %62

62:                                               ; preds = %60
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(80) %9, i64 80, i1 false), !tbaa.struct !24
  %63 = load ptr, ptr %28, align 8, !tbaa !19
  %64 = call i32 @fonsTextIterNext(ptr noundef %63, ptr noundef nonnull %8, ptr noundef nonnull %10) #6
  br label %65

65:                                               ; preds = %62, %60, %57
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 8 dereferenceable(80) %8, i64 80, i1 false), !tbaa.struct !24
  %66 = load ptr, ptr %51, align 8, !tbaa !32
  %67 = getelementptr inbounds %struct.NVGglyphPosition, ptr %5, i64 %indvars.iv
  store ptr %66, ptr %67, align 8, !tbaa !33
  %68 = load float, ptr %8, align 8, !tbaa !35
  %69 = fmul float %16, %68
  %70 = getelementptr inbounds i8, ptr %67, i64 8
  store float %69, ptr %70, align 8, !tbaa !36
  %71 = load float, ptr %10, align 4, !tbaa !37
  %72 = call float @nvg__minf(float noundef %68, float noundef %71)
  %73 = fmul float %16, %72
  %74 = getelementptr inbounds i8, ptr %67, i64 12
  store float %73, ptr %74, align 4, !tbaa !39
  %75 = load float, ptr %52, align 8, !tbaa !40
  %76 = load float, ptr %53, align 4, !tbaa !41
  %77 = call float @nvg__maxf(float noundef %75, float noundef %76)
  %78 = fmul float %16, %77
  %79 = getelementptr inbounds i8, ptr %67, i64 16
  store float %78, ptr %79, align 8, !tbaa !42
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %54, !llvm.loop !43

.loopexit.loopexit.split.loop.exit57:             ; preds = %54
  %80 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.loopexit

.loopexit:                                        ; preds = %65, %.loopexit.loopexit.split.loop.exit57, %25, %7
  %.048 = phi i32 [ 0, %7 ], [ 0, %25 ], [ %80, %.loopexit.loopexit.split.loop.exit57 ], [ %smax, %65 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %9)
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %8) #6
  ret i32 %.048
}

; 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { "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 = { nounwind willreturn memory(read) }

!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, !12, i64 8740}
!6 = !{!"NVGcontext", !7, i64 0, !8, i64 112, !11, i64 120, !11, i64 124, !12, i64 128, !12, i64 132, !9, i64 136, !11, i64 8712, !8, i64 8720, !12, i64 8728, !12, i64 8732, !12, i64 8736, !12, i64 8740, !8, i64 8744, !9, i64 8752, !11, i64 8768, !11, i64 8772, !11, i64 8776, !11, i64 8780, !11, i64 8784}
!7 = !{!"NVGparams", !8, i64 0, !11, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !8, i64 72, !8, i64 80, !8, i64 88, !8, i64 96, !8, i64 104}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"float", !9, i64 0}
!13 = !{!14, !11, i64 264}
!14 = !{!"NVGstate", !15, i64 0, !16, i64 16, !16, i64 92, !12, i64 168, !12, i64 172, !11, i64 176, !11, i64 180, !12, i64 184, !9, i64 188, !18, i64 212, !12, i64 244, !12, i64 248, !12, i64 252, !12, i64 256, !11, i64 260, !11, i64 264}
!15 = !{!"NVGcompositeOperationState", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!16 = !{!"NVGpaint", !9, i64 0, !9, i64 24, !12, i64 32, !12, i64 36, !17, i64 40, !17, i64 56, !11, i64 72}
!17 = !{!"NVGcolor", !9, i64 0}
!18 = !{!"NVGscissor", !9, i64 0, !9, i64 24}
!19 = !{!6, !8, i64 8744}
!20 = !{!14, !12, i64 244}
!21 = !{!14, !12, i64 248}
!22 = !{!14, !12, i64 256}
!23 = !{!14, !11, i64 260}
!24 = !{i64 0, i64 4, !25, i64 4, i64 4, !25, i64 8, i64 4, !25, i64 12, i64 4, !25, i64 16, i64 4, !25, i64 20, i64 4, !25, i64 24, i64 4, !26, i64 28, i64 2, !27, i64 30, i64 2, !27, i64 32, i64 8, !29, i64 40, i64 4, !26, i64 48, i64 8, !29, i64 56, i64 8, !29, i64 64, i64 8, !29, i64 72, i64 4, !26}
!25 = !{!12, !12, i64 0}
!26 = !{!11, !11, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"short", !9, i64 0}
!29 = !{!8, !8, i64 0}
!30 = !{!31, !11, i64 40}
!31 = !{!"FONStextIter", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !11, i64 24, !28, i64 28, !28, i64 30, !8, i64 32, !11, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !11, i64 72}
!32 = !{!31, !8, i64 48}
!33 = !{!34, !8, i64 0}
!34 = !{!"NVGglyphPosition", !8, i64 0, !12, i64 8, !12, i64 12, !12, i64 16}
!35 = !{!31, !12, i64 0}
!36 = !{!34, !12, i64 8}
!37 = !{!38, !12, i64 0}
!38 = !{!"FONSquad", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!39 = !{!34, !12, i64 12}
!40 = !{!31, !12, i64 8}
!41 = !{!38, !12, i64 16}
!42 = !{!34, !12, i64 16}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}


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