; 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.ImFontAtlas = type <{ i32, [4 x i8], ptr, i32, i32, i8, [7 x i8], ptr, i8, i8, [6 x i8], ptr, ptr, i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVector.8, %struct.ImVector.9, %struct.ImVector.10, [64 x %struct.ImVec4], ptr, i32, i32, i32, [4 x i8] }>
%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 [122 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__._ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt = external hidden unnamed_addr constant [101 x i8], align 1
@.str.19 = 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(1180), ptr noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt(ptr noundef nonnull align 8 dereferenceable(1180) %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 5
  %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.10, ptr noundef @.str.1, i32 noundef 2161, 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.19, ptr noundef @.str.1, i32 noundef 2163, 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 = fcmp ogt float %42, 0.000000e+00
  br i1 %43, label %44, label %46

44:                                               ; preds = %37
  %45 = load float, ptr %10, align 4, !tbaa !11
  br label %49

46:                                               ; preds = %37
  %47 = getelementptr inbounds %struct.ImFontConfig, ptr %13, i32 0, i32 4
  %48 = load float, ptr %47, align 4, !tbaa !30
  br label %49

49:                                               ; preds = %46, %44
  %50 = phi float [ %45, %44 ], [ %48, %46 ]
  %51 = getelementptr inbounds %struct.ImFontConfig, ptr %13, i32 0, i32 4
  store float %50, ptr %51, align 4, !tbaa !30
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %57

54:                                               ; preds = %49
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.ImFontConfig, ptr %13, i32 0, i32 10
  store ptr %55, ptr %56, align 8, !tbaa !31
  br label %57

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

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 24}
!14 = !{!"_ZTS11ImFontAtlas", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !15, i64 24, !6, i64 32, !15, i64 40, !15, i64 41, !6, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !16, i64 72, !16, i64 80, !17, i64 88, !18, i64 104, !19, i64 120, !7, i64 136, !6, i64 1160, !10, i64 1168, !10, i64 1172, !10, i64 1176}
!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 [122 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__._ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt = external hidden unnamed_addr constant [101 x i8], align 1
@.str.19 = 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(1180), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt(ptr noundef nonnull align 8 dereferenceable(1180) %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 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = load i8, ptr %8, align 8, !tbaa !5, !range !17, !noundef !18
  %10 = trunc nuw i8 %9 to i1
  br i1 %10, label %11, label %12

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

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

13:                                               ; preds = %12
  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 %15

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

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

18:                                               ; preds = %15
  call void @__assert_fail(ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, i32 noundef 2163, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN11ImFontAtlas20AddFontFromMemoryTTFEPvifPK12ImFontConfigPKt) #4
  unreachable

19:                                               ; preds = %15
  store ptr %1, ptr %7, align 8, !tbaa !27
  %20 = getelementptr inbounds i8, ptr %7, i64 8
  store i32 %2, ptr %20, align 8, !tbaa !29
  %21 = fcmp ogt float %3, 0.000000e+00
  %22 = getelementptr inbounds i8, ptr %7, i64 20
  %23 = load float, ptr %22, align 4
  %24 = select i1 %21, float %3, float %23
  store float %24, ptr %22, align 4, !tbaa !30
  %.not9 = icmp eq ptr %5, null
  br i1 %.not9, label %27, label %25

25:                                               ; preds = %19
  %26 = getelementptr inbounds i8, ptr %7, i64 56
  store ptr %5, ptr %26, align 8, !tbaa !31
  br label %27

27:                                               ; preds = %25, %19
  %28 = call noundef ptr @_ZN11ImFontAtlas7AddFontEPK12ImFontConfig(ptr noundef nonnull align 8 dereferenceable(1180) %0, ptr noundef nonnull %7)
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %7) #5
  ret ptr %28
}

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, !11, i64 24}
!6 = !{!"_ZTS11ImFontAtlas", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 20, !11, i64 24, !10, i64 32, !11, i64 40, !11, i64 41, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 68, !12, i64 72, !12, i64 80, !14, i64 88, !15, i64 104, !16, i64 120, !8, i64 136, !10, i64 1160, !7, i64 1168, !7, i64 1172, !7, i64 1176}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !8, i64 0}
!14 = !{!"_ZTS8ImVectorIP6ImFontE", !7, i64 0, !7, i64 4, !10, i64 8}
!15 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !7, i64 0, !7, i64 4, !10, i64 8}
!16 = !{!"_ZTS8ImVectorI12ImFontConfigE", !7, i64 0, !7, i64 4, !10, 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 = !{!10, !10, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!11, !11, i64 0}
!23 = !{!13, !13, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"short", !8, i64 0}
!26 = !{!8, !8, i64 0}
!27 = !{!28, !10, i64 0}
!28 = !{!"_ZTS12ImFontConfig", !10, i64 0, !7, i64 8, !11, i64 12, !7, i64 16, !13, i64 20, !7, i64 24, !7, i64 28, !11, i64 32, !12, i64 36, !12, i64 44, !10, i64 56, !13, i64 64, !13, i64 68, !11, i64 72, !7, i64 76, !13, i64 80, !25, i64 84, !8, i64 86, !10, i64 128}
!29 = !{!28, !7, i64 8}
!30 = !{!28, !13, i64 20}
!31 = !{!28, !10, i64 56}


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