; 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.ImFontAtlasCustomRect = type { i16, i16, i16, i16, i32, float, %struct.ImVec2, 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.20 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@__PRETTY_FUNCTION__._ZN11ImFontAtlas22AddCustomRectFontGlyphEP6ImFonttiifRK6ImVec2 = external hidden unnamed_addr constant [92 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 void @_ZN21ImFontAtlasCustomRectC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI21ImFontAtlasCustomRectE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN11ImFontAtlas22AddCustomRectFontGlyphEP6ImFonttiifRK6ImVec2(ptr noundef nonnull align 8 dereferenceable(1180) %0, ptr noundef %1, i16 noundef zeroext %2, i32 noundef %3, i32 noundef %4, float noundef %5, ptr noundef nonnull align 4 dereferenceable(8) %6) #3 align 2 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i16, align 2
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %struct.ImFontAtlasCustomRect, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i16 %2, ptr %10, align 2, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !11
  store i32 %4, ptr %12, align 4, !tbaa !11
  store float %5, ptr %13, align 4, !tbaa !13
  store ptr %6, ptr %14, align 8, !tbaa !5
  %16 = load ptr, ptr %8, align 8
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %7
  br label %22

20:                                               ; preds = %7
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.1, i32 noundef 2210, ptr noundef @__PRETTY_FUNCTION__._ZN11ImFontAtlas22AddCustomRectFontGlyphEP6ImFonttiifRK6ImVec2) #5
  unreachable

21:                                               ; No predecessors!
  br label %22

22:                                               ; preds = %21, %19
  %23 = load i32, ptr %11, align 4, !tbaa !11
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %25, label %28

25:                                               ; preds = %22
  %26 = load i32, ptr %11, align 4, !tbaa !11
  %27 = icmp sle i32 %26, 65535
  br label %28

28:                                               ; preds = %25, %22
  %29 = phi i1 [ false, %22 ], [ %27, %25 ]
  br i1 %29, label %30, label %31

30:                                               ; preds = %28
  br label %33

31:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str.1, i32 noundef 2211, ptr noundef @__PRETTY_FUNCTION__._ZN11ImFontAtlas22AddCustomRectFontGlyphEP6ImFonttiifRK6ImVec2) #5
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %30
  %34 = load i32, ptr %12, align 4, !tbaa !11
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %36, label %39

36:                                               ; preds = %33
  %37 = load i32, ptr %12, align 4, !tbaa !11
  %38 = icmp sle i32 %37, 65535
  br label %39

39:                                               ; preds = %36, %33
  %40 = phi i1 [ false, %33 ], [ %38, %36 ]
  br i1 %40, label %41, label %42

41:                                               ; preds = %39
  br label %44

42:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.21, ptr noundef @.str.1, i32 noundef 2212, ptr noundef @__PRETTY_FUNCTION__._ZN11ImFontAtlas22AddCustomRectFontGlyphEP6ImFonttiifRK6ImVec2) #5
  unreachable

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %41
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #6
  call void @_ZN21ImFontAtlasCustomRectC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15)
  %45 = load i32, ptr %11, align 4, !tbaa !11
  %46 = trunc i32 %45 to i16
  %47 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %15, i32 0, i32 0
  store i16 %46, ptr %47, align 8, !tbaa !15
  %48 = load i32, ptr %12, align 4, !tbaa !11
  %49 = trunc i32 %48 to i16
  %50 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %15, i32 0, i32 1
  store i16 %49, ptr %50, align 2, !tbaa !18
  %51 = load i16, ptr %10, align 2, !tbaa !9
  %52 = zext i16 %51 to i32
  %53 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %15, i32 0, i32 4
  store i32 %52, ptr %53, align 8, !tbaa !19
  %54 = load float, ptr %13, align 4, !tbaa !13
  %55 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %15, i32 0, i32 5
  store float %54, ptr %55, align 4, !tbaa !20
  %56 = load ptr, ptr %14, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %15, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %57, ptr align 4 %56, i64 8, i1 false), !tbaa.struct !21
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ImFontAtlasCustomRect, ptr %15, i32 0, i32 7
  store ptr %58, ptr %59, align 8, !tbaa !22
  %60 = getelementptr inbounds %struct.ImFontAtlas, ptr %16, i32 0, i32 18
  call void @_ZN8ImVectorI21ImFontAtlasCustomRectE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull align 8 dereferenceable(32) %15)
  %61 = getelementptr inbounds %struct.ImFontAtlas, ptr %16, i32 0, i32 18
  %62 = getelementptr inbounds %struct.ImVector.9, ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 8, !tbaa !23
  %64 = sub nsw i32 %63, 1
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  ret i32 %64
}

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 = { inlinehint 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 #5 = { noreturn nounwind }
attributes #6 = { 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 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTS21ImFontAtlasCustomRect", !10, i64 0, !10, i64 2, !10, i64 4, !10, i64 6, !12, i64 8, !14, i64 12, !17, i64 16, !6, i64 24}
!17 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!18 = !{!16, !10, i64 2}
!19 = !{!16, !12, i64 8}
!20 = !{!16, !14, i64 12}
!21 = !{i64 0, i64 4, !13, i64 4, i64 4, !13}
!22 = !{!16, !6, i64 24}
!23 = !{!24, !12, i64 104}
!24 = !{!"_ZTS11ImFontAtlas", !12, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !25, i64 24, !6, i64 32, !25, i64 40, !25, i64 41, !6, i64 48, !6, i64 56, !12, i64 64, !12, i64 68, !17, i64 72, !17, i64 80, !26, i64 88, !27, i64 104, !28, i64 120, !7, i64 136, !6, i64 1160, !12, i64 1168, !12, i64 1172, !12, i64 1176}
!25 = !{!"bool", !7, i64 0}
!26 = !{!"_ZTS8ImVectorIP6ImFontE", !12, i64 0, !12, i64 4, !6, i64 8}
!27 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !12, i64 0, !12, i64 4, !6, i64 8}
!28 = !{!"_ZTS8ImVectorI12ImFontConfigE", !12, i64 0, !12, i64 4, !6, i64 8}


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

@.str.1 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [15 x i8], align 1
@__PRETTY_FUNCTION__._ZN11ImFontAtlas22AddCustomRectFontGlyphEP6ImFonttiifRK6ImVec2 = external hidden unnamed_addr constant [92 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 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 #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN21ImFontAtlasCustomRectC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI21ImFontAtlasCustomRectE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -2147483648, 2147483647) i32 @_ZN11ImFontAtlas22AddCustomRectFontGlyphEP6ImFonttiifRK6ImVec2(ptr noundef nonnull align 8 dereferenceable(1180) %0, ptr noundef %1, i16 noundef zeroext %2, i32 noundef %3, i32 noundef %4, float noundef %5, ptr nocapture noundef nonnull readonly align 4 dereferenceable(8) %6) local_unnamed_addr #2 align 2 {
  %8 = alloca %struct.ImFontAtlasCustomRect, align 8
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %9, label %10

9:                                                ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.1, i32 noundef 2210, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN11ImFontAtlas22AddCustomRectFontGlyphEP6ImFonttiifRK6ImVec2) #4
  unreachable

10:                                               ; preds = %7
  %11 = add i32 %3, -1
  %12 = icmp ult i32 %11, 65535
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str.1, i32 noundef 2211, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN11ImFontAtlas22AddCustomRectFontGlyphEP6ImFonttiifRK6ImVec2) #4
  unreachable

14:                                               ; preds = %10
  %15 = add i32 %4, -1
  %16 = icmp ult i32 %15, 65535
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  call void @_ZN21ImFontAtlasCustomRectC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %19 = trunc nuw i32 %3 to i16
  store i16 %19, ptr %8, align 8, !tbaa !5
  %20 = trunc nuw i32 %4 to i16
  %21 = getelementptr inbounds i8, ptr %8, i64 2
  store i16 %20, ptr %21, align 2, !tbaa !14
  %22 = zext i16 %2 to i32
  %23 = getelementptr inbounds i8, ptr %8, i64 8
  store i32 %22, ptr %23, align 8, !tbaa !15
  %24 = getelementptr inbounds i8, ptr %8, i64 12
  store float %5, ptr %24, align 4, !tbaa !16
  %25 = getelementptr inbounds i8, ptr %8, i64 16
  %26 = load i64, ptr %6, align 4
  store i64 %26, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr %8, i64 24
  store ptr %1, ptr %27, align 8, !tbaa !17
  %28 = getelementptr inbounds i8, ptr %0, i64 104
  call void @_ZN8ImVectorI21ImFontAtlasCustomRectE9push_backERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(32) %8)
  %29 = load i32, ptr %28, align 8, !tbaa !18
  %30 = add nsw i32 %29, -1
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  ret i32 %30
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { inlinehint 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 = !{!"_ZTS21ImFontAtlasCustomRect", !7, i64 0, !7, i64 2, !7, i64 4, !7, i64 6, !10, i64 8, !11, i64 12, !12, i64 16, !13, i64 24}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!"_ZTS6ImVec2", !11, i64 0, !11, i64 4}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!6, !7, i64 2}
!15 = !{!6, !10, i64 8}
!16 = !{!6, !11, i64 12}
!17 = !{!6, !13, i64 24}
!18 = !{!19, !10, i64 104}
!19 = !{!"_ZTS11ImFontAtlas", !10, i64 0, !13, i64 8, !10, i64 16, !10, i64 20, !20, i64 24, !13, i64 32, !20, i64 40, !20, i64 41, !13, i64 48, !13, i64 56, !10, i64 64, !10, i64 68, !12, i64 72, !12, i64 80, !21, i64 88, !22, i64 104, !23, i64 120, !8, i64 136, !13, i64 1160, !10, i64 1168, !10, i64 1172, !10, i64 1176}
!20 = !{!"bool", !8, i64 0}
!21 = !{!"_ZTS8ImVectorIP6ImFontE", !10, i64 0, !10, i64 4, !13, i64 8}
!22 = !{!"_ZTS8ImVectorI21ImFontAtlasCustomRectE", !10, i64 0, !10, i64 4, !13, i64 8}
!23 = !{!"_ZTS8ImVectorI12ImFontConfigE", !10, i64 0, !10, i64 4, !13, i64 8}


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