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

@.str.15 = external hidden unnamed_addr constant [22 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: mustprogress uwtable
define dso_local noundef ptr @_ZN11ImFontAtlas14AddFontDefaultEPK12ImFontConfig(ptr noundef nonnull align 8 dereferenceable(1180) %0, ptr noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.ImFontConfig, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 136, ptr %5) #5
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = icmp ne ptr %10, null
  br i1 %11, label %12, label %14

12:                                               ; preds = %2
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %13, i64 136, i1 false), !tbaa.struct !9
  br label %15

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

15:                                               ; preds = %14, %12
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %22, label %18

18:                                               ; preds = %15
  %19 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 6
  store i32 1, ptr %19, align 4, !tbaa !19
  %20 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 5
  store i32 1, ptr %20, align 8, !tbaa !22
  %21 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 7
  store i8 1, ptr %21, align 8, !tbaa !23
  br label %22

22:                                               ; preds = %18, %15
  %23 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 4
  %24 = load float, ptr %23, align 4, !tbaa !24
  %25 = fcmp ole float %24, 0.000000e+00
  br i1 %25, label %26, label %28

26:                                               ; preds = %22
  %27 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 4
  store float 1.300000e+01, ptr %27, align 4, !tbaa !24
  br label %28

28:                                               ; preds = %26, %22
  %29 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 17
  %30 = getelementptr inbounds [40 x i8], ptr %29, i64 0, i64 0
  %31 = load i8, ptr %30, align 2, !tbaa !18
  %32 = sext i8 %31 to i32
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %41

34:                                               ; preds = %28
  %35 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 17
  %36 = getelementptr inbounds [40 x i8], ptr %35, i64 0, i64 0
  %37 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 4
  %38 = load float, ptr %37, align 4, !tbaa !24
  %39 = fptosi float %38 to i32
  %40 = call noundef i32 (ptr, i64, ptr, ...) @_Z14ImFormatStringPcmPKcz(ptr noundef %36, i64 noundef 40, ptr noundef @.str.15, i32 noundef %39)
  br label %41

41:                                               ; preds = %34, %28
  %42 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 16
  store i16 133, ptr %42, align 4, !tbaa !25
  %43 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 4
  %44 = load float, ptr %43, align 4, !tbaa !24
  %45 = fdiv float %44, 1.300000e+01
  %46 = fptosi float %45 to i32
  %47 = sitofp i32 %46 to float
  %48 = fmul float 1.000000e+00, %47
  %49 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 9
  %50 = getelementptr inbounds %struct.ImVec2, ptr %49, i32 0, i32 1
  store float %48, ptr %50, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %51 = call noundef ptr @_ZL37GetDefaultCompressedFontDataTTFBase85v()
  store ptr %51, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %52 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 10
  %53 = load ptr, ptr %52, align 8, !tbaa !27
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %58

55:                                               ; preds = %41
  %56 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 10
  %57 = load ptr, ptr %56, align 8, !tbaa !27
  br label %60

58:                                               ; preds = %41
  %59 = call noundef ptr @_ZN11ImFontAtlas21GetGlyphRangesDefaultEv(ptr noundef nonnull align 8 dereferenceable(1180) %9)
  br label %60

60:                                               ; preds = %58, %55
  %61 = phi ptr [ %57, %55 ], [ %59, %58 ]
  store ptr %61, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.ImFontConfig, ptr %5, i32 0, i32 4
  %64 = load float, ptr %63, align 4, !tbaa !24
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = call noundef ptr @_ZN11ImFontAtlas36AddFontFromMemoryCompressedBase85TTFEPKcfPK12ImFontConfigPKt(ptr noundef nonnull align 8 dereferenceable(1180) %9, ptr noundef %62, float noundef %64, ptr noundef %5, ptr noundef %65)
  store ptr %66, ptr %8, align 8, !tbaa !5
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 136, ptr %5) #5
  ret ptr %67
}

declare noundef i32 @_Z14ImFormatStringPcmPKcz(ptr noundef, i64 noundef, ptr noundef, ...) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL37GetDefaultCompressedFontDataTTFBase85v() #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN11ImFontAtlas21GetGlyphRangesDefaultEv(ptr noundef nonnull align 8 dereferenceable(1180)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN11ImFontAtlas36AddFontFromMemoryCompressedBase85TTFEPKcfPK12ImFontConfigPKt(ptr noundef nonnull align 8 dereferenceable(1180), ptr noundef, float noundef, ptr noundef, ptr noundef) #2 align 2

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 = { 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 #3 = { "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 = { mustprogress 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 #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 = !{i64 0, i64 8, !5, i64 8, i64 4, !10, i64 12, i64 1, !12, i64 16, i64 4, !10, i64 20, i64 4, !14, i64 24, i64 4, !10, i64 28, i64 4, !10, i64 32, i64 1, !12, i64 36, i64 4, !14, i64 40, i64 4, !14, i64 44, i64 4, !14, i64 48, i64 4, !14, i64 56, i64 8, !5, i64 64, i64 4, !14, i64 68, i64 4, !14, i64 72, i64 1, !12, i64 76, i64 4, !10, i64 80, i64 4, !14, i64 84, i64 2, !16, i64 86, i64 40, !18, i64 128, i64 8, !5}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !11, i64 28}
!20 = !{!"_ZTS12ImFontConfig", !6, i64 0, !11, i64 8, !13, i64 12, !11, i64 16, !15, i64 20, !11, i64 24, !11, i64 28, !13, i64 32, !21, i64 36, !21, i64 44, !6, i64 56, !15, i64 64, !15, i64 68, !13, i64 72, !11, i64 76, !15, i64 80, !17, i64 84, !7, i64 86, !6, i64 128}
!21 = !{!"_ZTS6ImVec2", !15, i64 0, !15, i64 4}
!22 = !{!20, !11, i64 24}
!23 = !{!20, !13, i64 32}
!24 = !{!20, !15, i64 20}
!25 = !{!20, !17, i64 84}
!26 = !{!20, !15, i64 48}
!27 = !{!20, !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.15 = external hidden unnamed_addr constant [22 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: mustprogress uwtable
define dso_local noundef ptr @_ZN11ImFontAtlas14AddFontDefaultEPK12ImFontConfig(ptr noundef nonnull align 8 dereferenceable(1180) %0, ptr noundef readonly %1) local_unnamed_addr #2 align 2 {
  %3 = alloca %struct.ImFontConfig, align 8
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %3) #5
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %5, label %4

4:                                                ; preds = %2
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(136) %3, ptr noundef nonnull align 8 dereferenceable(136) %1, i64 136, i1 false), !tbaa.struct !5
  br label %9

5:                                                ; preds = %2
  call void @_ZN12ImFontConfigC1Ev(ptr noundef nonnull align 8 dereferenceable(136) %3)
  %6 = getelementptr inbounds i8, ptr %3, i64 28
  store i32 1, ptr %6, align 4, !tbaa !19
  %7 = getelementptr inbounds i8, ptr %3, i64 24
  store i32 1, ptr %7, align 8, !tbaa !22
  %8 = getelementptr inbounds i8, ptr %3, i64 32
  store i8 1, ptr %8, align 8, !tbaa !23
  br label %9

9:                                                ; preds = %4, %5
  %10 = getelementptr inbounds i8, ptr %3, i64 20
  %11 = load float, ptr %10, align 4, !tbaa !24
  %12 = fcmp ugt float %11, 0.000000e+00
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  store float 1.300000e+01, ptr %10, align 4, !tbaa !24
  br label %14

14:                                               ; preds = %13, %9
  %15 = phi float [ 1.300000e+01, %13 ], [ %11, %9 ]
  %16 = getelementptr inbounds i8, ptr %3, i64 86
  %17 = load i8, ptr %16, align 2, !tbaa !18
  %18 = icmp eq i8 %17, 0
  br i1 %18, label %19, label %22

19:                                               ; preds = %14
  %20 = fptosi float %15 to i32
  %21 = call noundef i32 (ptr, i64, ptr, ...) @_Z14ImFormatStringPcmPKcz(ptr noundef nonnull %16, i64 noundef 40, ptr noundef nonnull @.str.15, i32 noundef %20)
  %.pre = load float, ptr %10, align 4, !tbaa !24
  br label %22

22:                                               ; preds = %19, %14
  %23 = phi float [ %.pre, %19 ], [ %15, %14 ]
  %24 = getelementptr inbounds i8, ptr %3, i64 84
  store i16 133, ptr %24, align 4, !tbaa !25
  %25 = fdiv float %23, 1.300000e+01
  %26 = fptosi float %25 to i32
  %27 = sitofp i32 %26 to float
  %28 = getelementptr inbounds i8, ptr %3, i64 48
  store float %27, ptr %28, align 8, !tbaa !26
  %29 = call noundef ptr @_ZL37GetDefaultCompressedFontDataTTFBase85v()
  %30 = getelementptr inbounds i8, ptr %3, i64 56
  %31 = load ptr, ptr %30, align 8, !tbaa !27
  %.not8 = icmp eq ptr %31, null
  br i1 %.not8, label %32, label %34

32:                                               ; preds = %22
  %33 = call noundef ptr @_ZN11ImFontAtlas21GetGlyphRangesDefaultEv(ptr noundef nonnull align 8 dereferenceable(1180) %0)
  br label %34

34:                                               ; preds = %22, %32
  %35 = phi ptr [ %33, %32 ], [ %31, %22 ]
  %36 = load float, ptr %10, align 4, !tbaa !24
  %37 = call noundef ptr @_ZN11ImFontAtlas36AddFontFromMemoryCompressedBase85TTFEPKcfPK12ImFontConfigPKt(ptr noundef nonnull align 8 dereferenceable(1180) %0, ptr noundef %29, float noundef %36, ptr noundef nonnull %3, ptr noundef %35)
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %3) #5
  ret ptr %37
}

declare noundef i32 @_Z14ImFormatStringPcmPKcz(ptr noundef, i64 noundef, ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL37GetDefaultCompressedFontDataTTFBase85v() local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN11ImFontAtlas21GetGlyphRangesDefaultEv(ptr noundef nonnull align 8 dereferenceable(1180)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN11ImFontAtlas36AddFontFromMemoryCompressedBase85TTFEPKcfPK12ImFontConfigPKt(ptr noundef nonnull align 8 dereferenceable(1180), ptr noundef, float noundef, ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

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 = { 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 #3 = { "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 = { mustprogress 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 #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 = !{i64 0, i64 8, !6, i64 8, i64 4, !10, i64 12, i64 1, !12, i64 16, i64 4, !10, i64 20, i64 4, !14, i64 24, i64 4, !10, i64 28, i64 4, !10, i64 32, i64 1, !12, i64 36, i64 4, !14, i64 40, i64 4, !14, i64 44, i64 4, !14, i64 48, i64 4, !14, i64 56, i64 8, !6, i64 64, i64 4, !14, i64 68, i64 4, !14, i64 72, i64 1, !12, i64 76, i64 4, !10, i64 80, i64 4, !14, i64 84, i64 2, !16, i64 86, i64 40, !18, i64 128, i64 8, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !8, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !8, i64 0}
!18 = !{!8, !8, i64 0}
!19 = !{!20, !11, i64 28}
!20 = !{!"_ZTS12ImFontConfig", !7, i64 0, !11, i64 8, !13, i64 12, !11, i64 16, !15, i64 20, !11, i64 24, !11, i64 28, !13, i64 32, !21, i64 36, !21, i64 44, !7, i64 56, !15, i64 64, !15, i64 68, !13, i64 72, !11, i64 76, !15, i64 80, !17, i64 84, !8, i64 86, !7, i64 128}
!21 = !{!"_ZTS6ImVec2", !15, i64 0, !15, i64 4}
!22 = !{!20, !11, i64 24}
!23 = !{!20, !13, i64 32}
!24 = !{!20, !15, i64 20}
!25 = !{!20, !17, i64 84}
!26 = !{!20, !15, i64 48}
!27 = !{!20, !7, i64 56}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass