; LLVM IR from lbowes/falcon-9-simulation :: 3rd_party/imgui/imgui_draw.ll (ZN6ImFontC2Ev)

; 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.ImVec2 = type { float, float }
%struct.ImFont = type <{ %struct.ImVector.6, float, float, %struct.ImVector.0, %struct.ImVector.7, ptr, %struct.ImVec2, ptr, ptr, i16, i16, i16, i8, i8, float, float, float, i32, [2 x i8], [6 x i8] }>
%struct.ImVector.6 = type { i32, i32, ptr }
%struct.ImVector.0 = type { i32, i32, ptr }
%struct.ImVector.7 = type { i32, i32, ptr }

; 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 nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6ImFontC2Ev(ptr noundef nonnull align 8 dereferenceable(114) %0) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %struct.ImVec2, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  %7 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 0
  call void @_ZN8ImVectorIfEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %8 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 3
  invoke void @_ZN8ImVectorItEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %9 unwind label %31

9:                                                ; preds = %1
  %10 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 4
  invoke void @_ZN8ImVectorI11ImFontGlyphEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %11 unwind label %35

11:                                               ; preds = %9
  %12 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 6
  invoke void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %12)
          to label %13 unwind label %39

13:                                               ; preds = %11
  %14 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 2
  store float 0.000000e+00, ptr %14, align 4, !tbaa !9
  %15 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 1
  store float 0.000000e+00, ptr %15, align 8, !tbaa !19
  %16 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 10
  store i16 63, ptr %16, align 2, !tbaa !20
  %17 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 11
  store i16 -1, ptr %17, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  invoke void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %5, float noundef 0.000000e+00, float noundef 0.000000e+00)
          to label %18 unwind label %43

18:                                               ; preds = %13
  %19 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 4 %5, i64 8, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  %20 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 5
  store ptr null, ptr %20, align 8, !tbaa !24
  %21 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 7
  store ptr null, ptr %21, align 8, !tbaa !25
  %22 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 8
  store ptr null, ptr %22, align 8, !tbaa !26
  %23 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 9
  store i16 0, ptr %23, align 8, !tbaa !27
  %24 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 12
  store i8 0, ptr %24, align 2, !tbaa !28
  %25 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 14
  store float 1.000000e+00, ptr %25, align 8, !tbaa !29
  %26 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 16
  store float 0.000000e+00, ptr %26, align 8, !tbaa !30
  %27 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 15
  store float 0.000000e+00, ptr %27, align 4, !tbaa !31
  %28 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 17
  store i32 0, ptr %28, align 4, !tbaa !32
  %29 = getelementptr inbounds %struct.ImFont, ptr %6, i32 0, i32 18
  %30 = getelementptr inbounds [2 x i8], ptr %29, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 8 %30, i8 0, i64 2, i1 false)
  ret void

31:                                               ; preds = %1
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %3, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %4, align 4
  br label %49

35:                                               ; preds = %9
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %3, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %4, align 4
  br label %48

39:                                               ; preds = %11
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %3, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %4, align 4
  br label %47

43:                                               ; preds = %13
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %3, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %47

47:                                               ; preds = %43, %39
  call void @_ZN8ImVectorI11ImFontGlyphED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  br label %48

48:                                               ; preds = %47, %35
  call void @_ZN8ImVectorItED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  br label %49

49:                                               ; preds = %48, %31
  call void @_ZN8ImVectorIfED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  br label %50

50:                                               ; preds = %49
  %51 = load ptr, ptr %3, align 8
  %52 = load i32, ptr %4, align 4
  %53 = insertvalue { ptr, i32 } poison, ptr %51, 0
  %54 = insertvalue { ptr, i32 } %53, i32 %52, 1
  resume { ptr, i32 } %54
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorIfEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorItEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorI11ImFontGlyphEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorI11ImFontGlyphED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorItED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorIfED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = { inlinehint 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 #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, !13, i64 20}
!10 = !{!"_ZTS6ImFont", !11, i64 0, !13, i64 16, !13, i64 20, !14, i64 24, !15, i64 40, !6, i64 56, !16, i64 64, !6, i64 72, !6, i64 80, !17, i64 88, !17, i64 90, !17, i64 92, !18, i64 94, !13, i64 96, !13, i64 100, !13, i64 104, !12, i64 108, !7, i64 112}
!11 = !{!"_ZTS8ImVectorIfE", !12, i64 0, !12, i64 4, !6, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_ZTS8ImVectorItE", !12, i64 0, !12, i64 4, !6, i64 8}
!15 = !{!"_ZTS8ImVectorI11ImFontGlyphE", !12, i64 0, !12, i64 4, !6, i64 8}
!16 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!17 = !{!"short", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!10, !13, i64 16}
!20 = !{!10, !17, i64 90}
!21 = !{!10, !17, i64 92}
!22 = !{i64 0, i64 4, !23, i64 4, i64 4, !23}
!23 = !{!13, !13, i64 0}
!24 = !{!10, !6, i64 56}
!25 = !{!10, !6, i64 72}
!26 = !{!10, !6, i64 80}
!27 = !{!10, !17, i64 88}
!28 = !{!10, !18, i64 94}
!29 = !{!10, !13, i64 96}
!30 = !{!10, !13, i64 104}
!31 = !{!10, !13, i64 100}
!32 = !{!10, !12, 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"

%struct.ImVec2 = type { float, float }

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6ImFontC2Ev(ptr noundef nonnull align 8 dereferenceable(114) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %struct.ImVec2, align 8
  tail call void @_ZN8ImVectorIfEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  tail call void @_ZN8ImVectorItEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @_ZN8ImVectorI11ImFontGlyphEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 64
  tail call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  store <2 x float> zeroinitializer, ptr %6, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 90
  store i16 63, ptr %7, align 2, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %0, i64 92
  store i16 -1, ptr %8, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %2, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %9 = load i64, ptr %2, align 8
  store i64 %9, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr null, ptr %10, align 8, !tbaa !20
  %11 = getelementptr inbounds i8, ptr %0, i64 72
  %12 = getelementptr inbounds i8, ptr %0, i64 94
  store i8 0, ptr %12, align 2, !tbaa !21
  %13 = getelementptr inbounds i8, ptr %0, i64 96
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(18) %11, i8 0, i64 18, i1 false)
  store float 1.000000e+00, ptr %13, align 8, !tbaa !22
  %14 = getelementptr inbounds i8, ptr %0, i64 100
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(14) %14, i8 0, i64 14, i1 false)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorIfEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorItEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8ImVectorI11ImFontGlyphEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint 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 #4 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !17, i64 90}
!10 = !{!"_ZTS6ImFont", !11, i64 0, !6, i64 16, !6, i64 20, !14, i64 24, !15, i64 40, !13, i64 56, !16, i64 64, !13, i64 72, !13, i64 80, !17, i64 88, !17, i64 90, !17, i64 92, !18, i64 94, !6, i64 96, !6, i64 100, !6, i64 104, !12, i64 108, !7, i64 112}
!11 = !{!"_ZTS8ImVectorIfE", !12, i64 0, !12, i64 4, !13, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!"_ZTS8ImVectorItE", !12, i64 0, !12, i64 4, !13, i64 8}
!15 = !{!"_ZTS8ImVectorI11ImFontGlyphE", !12, i64 0, !12, i64 4, !13, i64 8}
!16 = !{!"_ZTS6ImVec2", !6, i64 0, !6, i64 4}
!17 = !{!"short", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!10, !17, i64 92}
!20 = !{!10, !13, i64 56}
!21 = !{!10, !18, i64 94}
!22 = !{!10, !6, i64 96}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass