; LLVM IR from Samson-Mano/EM_Propogation_simulation :: EM_Propogation_simulation/src/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.ImFont = type <{ %struct.ImVector.6, float, float, %struct.ImVector.1, %struct.ImVector.7, ptr, ptr, ptr, i16, i16, i16, i16, float, float, i8, [3 x i8], float, float, float, i32, [2 x i8], [2 x i8] }>
%struct.ImVector.6 = type { i32, i32, ptr }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImVector.7 = type { i32, i32, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z25ImFontAtlasBuildSetupFontP11ImFontAtlasP6ImFontP12ImFontConfigff(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef %3, float noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store float %3, ptr %9, align 4, !tbaa !9
  store float %4, ptr %10, align 4, !tbaa !9
  %11 = load ptr, ptr %8, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.ImFontConfig, ptr %11, i32 0, i32 13
  %13 = load i8, ptr %12, align 8, !tbaa !11, !range !17, !noundef !18
  %14 = trunc i8 %13 to i1
  br i1 %14, label %36, label %15

15:                                               ; preds = %5
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN6ImFont15ClearOutputDataEv(ptr noundef nonnull align 8 dereferenceable(118) %16)
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ImFontConfig, ptr %17, i32 0, i32 4
  %19 = load float, ptr %18, align 4, !tbaa !19
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.ImFont, ptr %20, i32 0, i32 2
  store float %19, ptr %21, align 4, !tbaa !20
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.ImFont, ptr %23, i32 0, i32 7
  store ptr %22, ptr %24, align 8, !tbaa !25
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ImFont, ptr %25, i32 0, i32 8
  store i16 0, ptr %26, align 8, !tbaa !26
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.ImFont, ptr %28, i32 0, i32 6
  store ptr %27, ptr %29, align 8, !tbaa !27
  %30 = load float, ptr %9, align 4, !tbaa !9
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ImFont, ptr %31, i32 0, i32 17
  store float %30, ptr %32, align 8, !tbaa !28
  %33 = load float, ptr %10, align 4, !tbaa !9
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ImFont, ptr %34, i32 0, i32 18
  store float %33, ptr %35, align 4, !tbaa !29
  br label %36

36:                                               ; preds = %15, %5
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ImFont, ptr %37, i32 0, i32 8
  %39 = load i16, ptr %38, align 8, !tbaa !26
  %40 = add i16 %39, 1
  store i16 %40, ptr %38, align 8, !tbaa !26
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImFont15ClearOutputDataEv(ptr noundef nonnull align 8 dereferenceable(118)) #0 align 2

attributes #0 = { 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" }

!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 = !{!"float", !7, i64 0}
!11 = !{!12, !14, i64 72}
!12 = !{!"_ZTS12ImFontConfig", !6, i64 0, !13, i64 8, !14, i64 12, !13, i64 16, !10, i64 20, !13, i64 24, !13, i64 28, !14, i64 32, !15, i64 36, !15, i64 44, !6, i64 56, !10, i64 64, !10, i64 68, !14, i64 72, !13, i64 76, !10, i64 80, !16, i64 84, !7, i64 86, !6, i64 128}
!13 = !{!"int", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTS6ImVec2", !10, i64 0, !10, i64 4}
!16 = !{!"short", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!12, !10, i64 20}
!20 = !{!21, !10, i64 20}
!21 = !{!"_ZTS6ImFont", !22, i64 0, !10, i64 16, !10, i64 20, !23, i64 24, !24, i64 40, !6, i64 56, !6, i64 64, !6, i64 72, !16, i64 80, !16, i64 82, !16, i64 84, !16, i64 86, !10, i64 88, !10, i64 92, !14, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !13, i64 112, !7, i64 116}
!22 = !{!"_ZTS8ImVectorIfE", !13, i64 0, !13, i64 4, !6, i64 8}
!23 = !{!"_ZTS8ImVectorItE", !13, i64 0, !13, i64 4, !6, i64 8}
!24 = !{!"_ZTS8ImVectorI11ImFontGlyphE", !13, i64 0, !13, i64 4, !6, i64 8}
!25 = !{!21, !6, i64 72}
!26 = !{!21, !16, i64 80}
!27 = !{!21, !6, i64 64}
!28 = !{!21, !10, i64 104}
!29 = !{!21, !10, i64 108}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z25ImFontAtlasBuildSetupFontP11ImFontAtlasP6ImFontP12ImFontConfigff(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef %3, float noundef %4) local_unnamed_addr #0 {
  %6 = getelementptr inbounds i8, ptr %2, i64 72
  %7 = load i8, ptr %6, align 8, !tbaa !5, !range !15, !noundef !16
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %._crit_edge, label %10

._crit_edge:                                      ; preds = %5
  %.phi.trans.insert = getelementptr inbounds i8, ptr %1, i64 80
  %.pre = load i16, ptr %.phi.trans.insert, align 8, !tbaa !17
  %9 = add i16 %.pre, 1
  br label %18

10:                                               ; preds = %5
  tail call void @_ZN6ImFont15ClearOutputDataEv(ptr noundef nonnull align 8 dereferenceable(118) %1)
  %11 = getelementptr inbounds i8, ptr %2, i64 20
  %12 = load float, ptr %11, align 4, !tbaa !22
  %13 = getelementptr inbounds i8, ptr %1, i64 20
  store float %12, ptr %13, align 4, !tbaa !23
  %14 = getelementptr inbounds i8, ptr %1, i64 72
  store ptr %2, ptr %14, align 8, !tbaa !24
  %15 = getelementptr inbounds i8, ptr %1, i64 64
  store ptr %0, ptr %15, align 8, !tbaa !25
  %16 = getelementptr inbounds i8, ptr %1, i64 104
  store float %3, ptr %16, align 8, !tbaa !26
  %17 = getelementptr inbounds i8, ptr %1, i64 108
  store float %4, ptr %17, align 4, !tbaa !27
  br label %18

18:                                               ; preds = %._crit_edge, %10
  %19 = phi i16 [ %9, %._crit_edge ], [ 1, %10 ]
  %20 = getelementptr inbounds i8, ptr %1, i64 80
  store i16 %19, ptr %20, align 8, !tbaa !17
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ImFont15ClearOutputDataEv(ptr noundef nonnull align 8 dereferenceable(118)) local_unnamed_addr #0 align 2

attributes #0 = { 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" }

!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, !11, i64 72}
!6 = !{!"_ZTS12ImFontConfig", !7, i64 0, !10, i64 8, !11, i64 12, !10, i64 16, !12, i64 20, !10, i64 24, !10, i64 28, !11, i64 32, !13, i64 36, !13, i64 44, !7, i64 56, !12, i64 64, !12, i64 68, !11, i64 72, !10, i64 76, !12, i64 80, !14, i64 84, !8, i64 86, !7, i64 128}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = !{!"_ZTS6ImVec2", !12, i64 0, !12, i64 4}
!14 = !{!"short", !8, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !14, i64 80}
!18 = !{!"_ZTS6ImFont", !19, i64 0, !12, i64 16, !12, i64 20, !20, i64 24, !21, i64 40, !7, i64 56, !7, i64 64, !7, i64 72, !14, i64 80, !14, i64 82, !14, i64 84, !14, i64 86, !12, i64 88, !12, i64 92, !11, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !10, i64 112, !8, i64 116}
!19 = !{!"_ZTS8ImVectorIfE", !10, i64 0, !10, i64 4, !7, i64 8}
!20 = !{!"_ZTS8ImVectorItE", !10, i64 0, !10, i64 4, !7, i64 8}
!21 = !{!"_ZTS8ImVectorI11ImFontGlyphE", !10, i64 0, !10, i64 4, !7, i64 8}
!22 = !{!6, !12, i64 20}
!23 = !{!18, !12, i64 20}
!24 = !{!18, !7, i64 72}
!25 = !{!18, !7, i64 64}
!26 = !{!18, !12, i64 104}
!27 = !{!18, !12, i64 108}


; Effective O3 passes: DSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InstCombinePass,SROAPass,TailCallElimPass