; LLVM IR from Devaniti/BoolkaEngine :: ThirdParty/imgui (imgui_draw)

; 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.ImFontConfig = type { ptr, i32, i8, i32, float, i32, i32, i8, %struct.ImVec2, %struct.ImVec2, ptr, float, float, i8, i32, float, i16, [40 x i8], ptr }
%struct.ImVec2 = type { float, float }
%struct.ImFontAtlas = type { i8, i32, ptr, i32, i32, ptr, ptr, i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVector.8, %struct.ImVector.9, %struct.ImVector.10, [64 x %struct.ImVec4], i32, i32 }
%struct.ImVector.8 = type { i32, i32, ptr }
%struct.ImVector.9 = type { i32, i32, ptr }
%struct.ImVector.10 = type { i32, i32, ptr }
%struct.ImVec4 = type { float, float, float, float }

@.str.1 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__._ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt = external hidden unnamed_addr constant [101 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [28 x i8], align 1

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

; Function Attrs: nocallback nofree 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN11ImFontAtlas7AddFontEPK12ImFontConfig(ptr noundef nonnull align 8 dereferenceable(1144), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt(ptr noundef nonnull align 8 dereferenceable(1144) %0, ptr noundef %1, i32 noundef %2, float noundef %3, ptr noundef %4, ptr noundef %5) #3 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %struct.ImFontConfig, 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 float %3, ptr %10, align 4, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  %14 = load ptr, ptr %7, align 8
  %15 = getelementptr inbounds %struct.ImFontAtlas, ptr %14, i32 0, i32 0
  %16 = load i8, ptr %15, align 8, !tbaa !13, !range !20, !noundef !21
  %17 = trunc i8 %16 to i1
  br i1 %17, label %19, label %18

18:                                               ; preds = %6
  br label %19

19:                                               ; preds = %18, %6
  %20 = phi i1 [ false, %6 ], [ true, %18 ]
  br i1 %20, label %21, label %22

21:                                               ; preds = %19
  br label %24

22:                                               ; preds = %19
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 1989, ptr noundef @__PRETTY_FUNCTION__._ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt) #4
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  call void @llvm.lifetime.start.p0(i64 136, ptr %13) #5
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %29

27:                                               ; preds = %24
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %28, i64 136, i1 false), !tbaa.struct !22
  br label %30

29:                                               ; preds = %24
  call void @_ZN12ImFontConfigC1Ev(ptr noundef nonnull align 8 dereferenceable(136) %13)
  br label %30

30:                                               ; preds = %29, %27
  %31 = getelementptr inbounds %struct.ImFontConfig, ptr %13, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !27
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %35

34:                                               ; preds = %30
  br label %37

35:                                               ; preds = %30
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 1991, ptr noundef @__PRETTY_FUNCTION__._ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt) #4
  unreachable

36:                                               ; No predecessors!
  br label %37

37:                                               ; preds = %36, %34
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.ImFontConfig, ptr %13, i32 0, i32 0
  store ptr %38, ptr %39, align 8, !tbaa !27
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = getelementptr inbounds %struct.ImFontConfig, ptr %13, i32 0, i32 1
  store i32 %40, ptr %41, align 8, !tbaa !29
  %42 = load float, ptr %10, align 4, !tbaa !11
  %43 = getelementptr inbounds %struct.ImFontConfig, ptr %13, i32 0, i32 4
  store float %42, ptr %43, align 4, !tbaa !30
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %49

46:                                               ; preds = %37
  %47 = load ptr, ptr %12, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ImFontConfig, ptr %13, i32 0, i32 10
  store ptr %47, ptr %48, align 8, !tbaa !31
  br label %49

49:                                               ; preds = %46, %37
  %50 = call noundef ptr @_ZN11ImFontAtlas7AddFontEPK12ImFontConfig(ptr noundef nonnull align 8 dereferenceable(1144) %14, ptr noundef %13)
  call void @llvm.lifetime.end.p0(i64 136, ptr %13) #5
  ret ptr %50
}

declare void @_ZN12ImFontConfigC1Ev(ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind }
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, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS11ImFontAtlas", !15, i64 0, !10, i64 4, !6, i64 8, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !16, i64 48, !16, i64 56, !17, i64 64, !18, i64 80, !19, i64 96, !7, i64 112, !10, i64 1136, !10, i64 1140}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTS6ImVec2", !12, i64 0, !12, i64 4}
!17 = !{!"_ZTS8ImVectorIP6ImFontE", !10, i64 0, !10, i64 4, !6, i64 8}
!18 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !10, i64 0, !10, i64 4, !6, i64 8}
!19 = !{!"_ZTS8ImVectorI12ImFontConfigE", !10, i64 0, !10, i64 4, !6, i64 8}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{i64 0, i64 8, !5, i64 8, i64 4, !9, i64 12, i64 1, !23, i64 16, i64 4, !9, i64 20, i64 4, !11, i64 24, i64 4, !9, i64 28, i64 4, !9, i64 32, i64 1, !23, i64 36, i64 4, !11, i64 40, i64 4, !11, i64 44, i64 4, !11, i64 48, i64 4, !11, i64 56, i64 8, !5, i64 64, i64 4, !11, i64 68, i64 4, !11, i64 72, i64 1, !23, i64 76, i64 4, !9, i64 80, i64 4, !11, i64 84, i64 2, !24, i64 86, i64 40, !26, i64 128, i64 8, !5}
!23 = !{!15, !15, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"short", !7, i64 0}
!26 = !{!7, !7, i64 0}
!27 = !{!28, !6, i64 0}
!28 = !{!"_ZTS12ImFontConfig", !6, i64 0, !10, i64 8, !15, i64 12, !10, i64 16, !12, i64 20, !10, i64 24, !10, i64 28, !15, i64 32, !16, i64 36, !16, i64 44, !6, i64 56, !12, i64 64, !12, i64 68, !15, i64 72, !10, i64 76, !12, i64 80, !25, i64 84, !7, i64 86, !6, i64 128}
!29 = !{!28, !10, i64 8}
!30 = !{!28, !12, i64 20}
!31 = !{!28, !6, i64 56}


; 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.ImFontConfig = type { ptr, i32, i8, i32, float, i32, i32, i8, %struct.ImVec2, %struct.ImVec2, ptr, float, float, i8, i32, float, i16, [40 x i8], ptr }
%struct.ImVec2 = type { float, float }

@.str.1 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__._ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt = external hidden unnamed_addr constant [101 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [28 x i8], align 1

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

; Function Attrs: 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN11ImFontAtlas7AddFontEPK12ImFontConfig(ptr noundef nonnull align 8 dereferenceable(1144), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt(ptr noundef nonnull align 8 dereferenceable(1144) %0, ptr noundef %1, i32 noundef %2, float noundef %3, ptr noundef readonly %4, ptr noundef %5) local_unnamed_addr #3 align 2 {
  %7 = alloca %struct.ImFontConfig, align 8
  %8 = load i8, ptr %0, align 8, !tbaa !5, !range !17, !noundef !18
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %10, label %11

10:                                               ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 1989, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt) #4
  unreachable

11:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %7) #5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %13, label %12

12:                                               ; preds = %11
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(136) %7, ptr noundef nonnull align 8 dereferenceable(136) %4, i64 136, i1 false), !tbaa.struct !19
  br label %14

13:                                               ; preds = %11
  call void @_ZN12ImFontConfigC1Ev(ptr noundef nonnull align 8 dereferenceable(136) %7)
  br label %14

14:                                               ; preds = %13, %12
  %15 = load ptr, ptr %7, align 8, !tbaa !27
  %16 = icmp eq ptr %15, null
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 1991, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt) #4
  unreachable

18:                                               ; preds = %14
  store ptr %1, ptr %7, align 8, !tbaa !27
  %19 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 %2, ptr %19, align 8, !tbaa !29
  %20 = getelementptr inbounds i8, ptr %7, i64 20
  store float %3, ptr %20, align 4, !tbaa !30
  %.not8 = icmp eq ptr %5, null
  br i1 %.not8, label %23, label %21

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %7, i64 56
  store ptr %5, ptr %22, align 8, !tbaa !31
  br label %23

23:                                               ; preds = %21, %18
  %24 = call noundef ptr @_ZN11ImFontAtlas7AddFontEPK12ImFontConfig(ptr noundef nonnull align 8 dereferenceable(1144) %0, ptr noundef nonnull %7)
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %7) #5
  ret ptr %24
}

declare void @_ZN12ImFontConfigC1Ev(ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind }
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, !7, i64 0}
!6 = !{!"_ZTS11ImFontAtlas", !7, i64 0, !10, i64 4, !11, i64 8, !10, i64 16, !10, i64 20, !11, i64 24, !11, i64 32, !10, i64 40, !10, i64 44, !12, i64 48, !12, i64 56, !14, i64 64, !15, i64 80, !16, i64 96, !8, i64 112, !10, i64 1136, !10, i64 1140}
!7 = !{!"bool", !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 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !8, i64 0}
!14 = !{!"_ZTS8ImVectorIP6ImFontE", !10, i64 0, !10, i64 4, !11, i64 8}
!15 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !10, i64 0, !10, i64 4, !11, i64 8}
!16 = !{!"_ZTS8ImVectorI12ImFontConfigE", !10, i64 0, !10, i64 4, !11, i64 8}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{i64 0, i64 8, !20, i64 8, i64 4, !21, i64 12, i64 1, !22, i64 16, i64 4, !21, i64 20, i64 4, !23, i64 24, i64 4, !21, i64 28, i64 4, !21, i64 32, i64 1, !22, i64 36, i64 4, !23, i64 40, i64 4, !23, i64 44, i64 4, !23, i64 48, i64 4, !23, i64 56, i64 8, !20, i64 64, i64 4, !23, i64 68, i64 4, !23, i64 72, i64 1, !22, i64 76, i64 4, !21, i64 80, i64 4, !23, i64 84, i64 2, !24, i64 86, i64 40, !26, i64 128, i64 8, !20}
!20 = !{!11, !11, i64 0}
!21 = !{!10, !10, i64 0}
!22 = !{!7, !7, i64 0}
!23 = !{!13, !13, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"short", !8, i64 0}
!26 = !{!8, !8, i64 0}
!27 = !{!28, !11, i64 0}
!28 = !{!"_ZTS12ImFontConfig", !11, i64 0, !10, i64 8, !7, i64 12, !10, i64 16, !13, i64 20, !10, i64 24, !10, i64 28, !7, i64 32, !12, i64 36, !12, i64 44, !11, i64 56, !13, i64 64, !13, i64 68, !7, i64 72, !10, i64 76, !13, i64 80, !25, i64 84, !8, i64 86, !11, i64 128}
!29 = !{!28, !10, i64 8}
!30 = !{!28, !13, i64 20}
!31 = !{!28, !11, i64 56}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass