; LLVM IR from Samson-Mano/EM_Propogation_simulation :: EM_Propogation_simulation/src/ImGui/imgui.ll (ZN5ImGui13SetCursorPosXEf)

; 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.ImGuiWindow = type <{ ptr, ptr, i32, i32, ptr, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, float, float, float, float, float, float, float, i32, i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i16, i16, i16, i16, i32, i8, i8, i8, i8, i32, i8, i8, i8, i8, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVector.9, %struct.ImGuiWindowTempData, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImVec2ih, %struct.ImVec2ih, i32, float, float, [4 x i8], %struct.ImGuiStorage, %struct.ImVector.32, float, i32, ptr, %struct.ImDrawList, ptr, ptr, ptr, ptr, ptr, ptr, ptr, [2 x i32], [2 x %struct.ImRect], i32, i32, i32, i8, [3 x i8] }>
%struct.ImVec2 = type { float, float }
%struct.ImVector.9 = type { i32, i32, ptr }
%struct.ImGuiWindowTempData = type { %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, float, i8, i8, %struct.ImVec1, %struct.ImVec1, %struct.ImVec1, %struct.ImVec2, i32, i16, i16, i8, i8, i8, i8, %struct.ImVec2, %struct.ImGuiMenuColumns, i32, i32, %struct.ImVector.2, ptr, ptr, i32, i32, i32, float, float, %struct.ImVector.18, %struct.ImVector.18 }
%struct.ImVec1 = type { float }
%struct.ImGuiMenuColumns = type <{ i32, i32, i16, i16, i16, i16, i16, [4 x i16], [2 x i8] }>
%struct.ImVector.2 = type { i32, i32, ptr }
%struct.ImVector.18 = type { i32, i32, ptr }
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%struct.ImVec2ih = type { i16, i16 }
%struct.ImGuiStorage = type { %struct.ImVector.4 }
%struct.ImVector.4 = type { i32, i32, ptr }
%struct.ImVector.32 = type { i32, i32, ptr }
%struct.ImDrawList = type <{ %struct.ImVector.33, %struct.ImVector, %struct.ImVector.34, i32, i32, ptr, ptr, ptr, ptr, %struct.ImVector.35, %struct.ImVector.36, %struct.ImVector.0, %struct.ImDrawCmdHeader, %struct.ImDrawListSplitter, float, [4 x i8] }>
%struct.ImVector.33 = type { i32, i32, ptr }
%struct.ImVector = type { i32, i32, ptr }
%struct.ImVector.34 = type { i32, i32, ptr }
%struct.ImVector.35 = type { i32, i32, ptr }
%struct.ImVector.36 = type { i32, i32, ptr }
%struct.ImVector.0 = type { i32, i32, ptr }
%struct.ImDrawCmdHeader = type <{ %struct.ImVec4, ptr, i32, [4 x i8] }>
%struct.ImVec4 = type { float, float, float, float }
%struct.ImDrawListSplitter = type { i32, i32, %struct.ImVector.19 }
%struct.ImVector.19 = 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN5ImGui16GetCurrentWindowEv() #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5ImGui13SetCursorPosXEf(float noundef %0) #2 {
  %2 = alloca float, align 4
  %3 = alloca ptr, align 8
  store float %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %4 = call noundef ptr @_ZN5ImGui16GetCurrentWindowEv()
  store ptr %4, ptr %3, align 8, !tbaa !9
  %5 = load ptr, ptr %3, align 8, !tbaa !9
  %6 = getelementptr inbounds %struct.ImGuiWindow, ptr %5, i32 0, i32 5
  %7 = getelementptr inbounds %struct.ImVec2, ptr %6, i32 0, i32 0
  %8 = load float, ptr %7, align 8, !tbaa !11
  %9 = load ptr, ptr %3, align 8, !tbaa !9
  %10 = getelementptr inbounds %struct.ImGuiWindow, ptr %9, i32 0, i32 23
  %11 = getelementptr inbounds %struct.ImVec2, ptr %10, i32 0, i32 0
  %12 = load float, ptr %11, align 4, !tbaa !40
  %13 = fsub float %8, %12
  %14 = load float, ptr %2, align 4, !tbaa !5
  %15 = fadd float %13, %14
  %16 = load ptr, ptr %3, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.ImGuiWindow, ptr %16, i32 0, i32 62
  %18 = getelementptr inbounds %struct.ImGuiWindowTempData, ptr %17, i32 0, i32 0
  %19 = getelementptr inbounds %struct.ImVec2, ptr %18, i32 0, i32 0
  store float %15, ptr %19, align 8, !tbaa !41
  %20 = load ptr, ptr %3, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct.ImGuiWindow, ptr %20, i32 0, i32 62
  %22 = getelementptr inbounds %struct.ImGuiWindowTempData, ptr %21, i32 0, i32 10
  store i8 1, ptr %22, align 1, !tbaa !42
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 32}
!12 = !{!"_ZTS11ImGuiWindow", !10, i64 0, !10, i64 8, !13, i64 16, !13, i64 20, !10, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !13, i64 120, !13, i64 124, !13, i64 128, !14, i64 132, !14, i64 140, !14, i64 148, !14, i64 156, !14, i64 164, !14, i64 172, !15, i64 180, !15, i64 181, !15, i64 182, !15, i64 183, !15, i64 184, !15, i64 185, !15, i64 186, !15, i64 187, !15, i64 188, !15, i64 189, !15, i64 190, !15, i64 191, !15, i64 192, !7, i64 193, !16, i64 194, !16, i64 196, !16, i64 198, !16, i64 200, !16, i64 202, !13, i64 204, !7, i64 208, !7, i64 209, !7, i64 210, !15, i64 211, !13, i64 212, !7, i64 216, !7, i64 217, !7, i64 218, !7, i64 219, !13, i64 220, !13, i64 221, !13, i64 222, !14, i64 224, !14, i64 232, !17, i64 240, !18, i64 256, !24, i64 488, !24, i64 504, !24, i64 520, !24, i64 536, !24, i64 552, !24, i64 568, !24, i64 584, !25, i64 600, !25, i64 604, !13, i64 608, !6, i64 612, !6, i64 616, !26, i64 624, !28, i64 640, !6, i64 656, !13, i64 660, !10, i64 664, !29, i64 672, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !10, i64 920, !7, i64 928, !7, i64 936, !13, i64 968, !13, i64 972, !13, i64 976, !15, i64 980}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS6ImVec2", !6, i64 0, !6, i64 4}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!"_ZTS8ImVectorIjE", !13, i64 0, !13, i64 4, !10, i64 8}
!18 = !{!"_ZTS19ImGuiWindowTempData", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !6, i64 56, !6, i64 60, !15, i64 64, !15, i64 65, !19, i64 68, !19, i64 72, !19, i64 76, !14, i64 80, !20, i64 88, !16, i64 92, !16, i64 94, !15, i64 96, !15, i64 97, !15, i64 98, !15, i64 99, !14, i64 100, !21, i64 108, !13, i64 136, !13, i64 140, !22, i64 144, !10, i64 160, !10, i64 168, !13, i64 176, !13, i64 180, !13, i64 184, !6, i64 188, !6, i64 192, !23, i64 200, !23, i64 216}
!19 = !{!"_ZTS6ImVec1", !6, i64 0}
!20 = !{!"_ZTS13ImGuiNavLayer", !7, i64 0}
!21 = !{!"_ZTS16ImGuiMenuColumns", !13, i64 0, !13, i64 4, !16, i64 8, !16, i64 10, !16, i64 12, !16, i64 14, !16, i64 16, !7, i64 18}
!22 = !{!"_ZTS8ImVectorIP11ImGuiWindowE", !13, i64 0, !13, i64 4, !10, i64 8}
!23 = !{!"_ZTS8ImVectorIfE", !13, i64 0, !13, i64 4, !10, i64 8}
!24 = !{!"_ZTS6ImRect", !14, i64 0, !14, i64 8}
!25 = !{!"_ZTS8ImVec2ih", !16, i64 0, !16, i64 2}
!26 = !{!"_ZTS12ImGuiStorage", !27, i64 0}
!27 = !{!"_ZTS8ImVectorIN12ImGuiStorage16ImGuiStoragePairEE", !13, i64 0, !13, i64 4, !10, i64 8}
!28 = !{!"_ZTS8ImVectorI15ImGuiOldColumnsE", !13, i64 0, !13, i64 4, !10, i64 8}
!29 = !{!"_ZTS10ImDrawList", !30, i64 0, !31, i64 16, !32, i64 32, !13, i64 48, !13, i64 52, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !33, i64 88, !34, i64 104, !35, i64 120, !36, i64 136, !38, i64 168, !6, i64 192}
!30 = !{!"_ZTS8ImVectorI9ImDrawCmdE", !13, i64 0, !13, i64 4, !10, i64 8}
!31 = !{!"_ZTS8ImVectorItE", !13, i64 0, !13, i64 4, !10, i64 8}
!32 = !{!"_ZTS8ImVectorI10ImDrawVertE", !13, i64 0, !13, i64 4, !10, i64 8}
!33 = !{!"_ZTS8ImVectorI6ImVec4E", !13, i64 0, !13, i64 4, !10, i64 8}
!34 = !{!"_ZTS8ImVectorIPvE", !13, i64 0, !13, i64 4, !10, i64 8}
!35 = !{!"_ZTS8ImVectorI6ImVec2E", !13, i64 0, !13, i64 4, !10, i64 8}
!36 = !{!"_ZTS15ImDrawCmdHeader", !37, i64 0, !10, i64 16, !13, i64 24}
!37 = !{!"_ZTS6ImVec4", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!38 = !{!"_ZTS18ImDrawListSplitter", !13, i64 0, !13, i64 4, !39, i64 8}
!39 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !13, i64 0, !13, i64 4, !10, i64 8}
!40 = !{!12, !6, i64 132}
!41 = !{!12, !6, i64 256}
!42 = !{!12, !15, i64 321}


; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN5ImGui16GetCurrentWindowEv() local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN5ImGui13SetCursorPosXEf(float noundef %0) local_unnamed_addr #1 {
  %2 = tail call noundef ptr @_ZN5ImGui16GetCurrentWindowEv()
  %3 = getelementptr inbounds i8, ptr %2, i64 32
  %4 = load float, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %2, i64 132
  %6 = load float, ptr %5, align 4, !tbaa !38
  %7 = fsub float %4, %6
  %8 = fadd float %7, %0
  %9 = getelementptr inbounds i8, ptr %2, i64 256
  store float %8, ptr %9, align 8, !tbaa !39
  %10 = getelementptr inbounds i8, ptr %2, i64 321
  store i8 1, ptr %10, align 1, !tbaa !40
  ret void
}

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

!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, !12, i64 32}
!6 = !{!"_ZTS11ImGuiWindow", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !7, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !11, i64 132, !11, i64 140, !11, i64 148, !11, i64 156, !11, i64 164, !11, i64 172, !13, i64 180, !13, i64 181, !13, i64 182, !13, i64 183, !13, i64 184, !13, i64 185, !13, i64 186, !13, i64 187, !13, i64 188, !13, i64 189, !13, i64 190, !13, i64 191, !13, i64 192, !8, i64 193, !14, i64 194, !14, i64 196, !14, i64 198, !14, i64 200, !14, i64 202, !10, i64 204, !8, i64 208, !8, i64 209, !8, i64 210, !13, i64 211, !10, i64 212, !8, i64 216, !8, i64 217, !8, i64 218, !8, i64 219, !10, i64 220, !10, i64 221, !10, i64 222, !11, i64 224, !11, i64 232, !15, i64 240, !16, i64 256, !22, i64 488, !22, i64 504, !22, i64 520, !22, i64 536, !22, i64 552, !22, i64 568, !22, i64 584, !23, i64 600, !23, i64 604, !10, i64 608, !12, i64 612, !12, i64 616, !24, i64 624, !26, i64 640, !12, i64 656, !10, i64 660, !7, i64 664, !27, i64 672, !7, i64 872, !7, i64 880, !7, i64 888, !7, i64 896, !7, i64 904, !7, i64 912, !7, i64 920, !8, i64 928, !8, i64 936, !10, i64 968, !10, i64 972, !10, i64 976, !13, i64 980}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTS6ImVec2", !12, i64 0, !12, i64 4}
!12 = !{!"float", !8, i64 0}
!13 = !{!"bool", !8, i64 0}
!14 = !{!"short", !8, i64 0}
!15 = !{!"_ZTS8ImVectorIjE", !10, i64 0, !10, i64 4, !7, i64 8}
!16 = !{!"_ZTS19ImGuiWindowTempData", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !12, i64 56, !12, i64 60, !13, i64 64, !13, i64 65, !17, i64 68, !17, i64 72, !17, i64 76, !11, i64 80, !18, i64 88, !14, i64 92, !14, i64 94, !13, i64 96, !13, i64 97, !13, i64 98, !13, i64 99, !11, i64 100, !19, i64 108, !10, i64 136, !10, i64 140, !20, i64 144, !7, i64 160, !7, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !12, i64 188, !12, i64 192, !21, i64 200, !21, i64 216}
!17 = !{!"_ZTS6ImVec1", !12, i64 0}
!18 = !{!"_ZTS13ImGuiNavLayer", !8, i64 0}
!19 = !{!"_ZTS16ImGuiMenuColumns", !10, i64 0, !10, i64 4, !14, i64 8, !14, i64 10, !14, i64 12, !14, i64 14, !14, i64 16, !8, i64 18}
!20 = !{!"_ZTS8ImVectorIP11ImGuiWindowE", !10, i64 0, !10, i64 4, !7, i64 8}
!21 = !{!"_ZTS8ImVectorIfE", !10, i64 0, !10, i64 4, !7, i64 8}
!22 = !{!"_ZTS6ImRect", !11, i64 0, !11, i64 8}
!23 = !{!"_ZTS8ImVec2ih", !14, i64 0, !14, i64 2}
!24 = !{!"_ZTS12ImGuiStorage", !25, i64 0}
!25 = !{!"_ZTS8ImVectorIN12ImGuiStorage16ImGuiStoragePairEE", !10, i64 0, !10, i64 4, !7, i64 8}
!26 = !{!"_ZTS8ImVectorI15ImGuiOldColumnsE", !10, i64 0, !10, i64 4, !7, i64 8}
!27 = !{!"_ZTS10ImDrawList", !28, i64 0, !29, i64 16, !30, i64 32, !10, i64 48, !10, i64 52, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !31, i64 88, !32, i64 104, !33, i64 120, !34, i64 136, !36, i64 168, !12, i64 192}
!28 = !{!"_ZTS8ImVectorI9ImDrawCmdE", !10, i64 0, !10, i64 4, !7, i64 8}
!29 = !{!"_ZTS8ImVectorItE", !10, i64 0, !10, i64 4, !7, i64 8}
!30 = !{!"_ZTS8ImVectorI10ImDrawVertE", !10, i64 0, !10, i64 4, !7, i64 8}
!31 = !{!"_ZTS8ImVectorI6ImVec4E", !10, i64 0, !10, i64 4, !7, i64 8}
!32 = !{!"_ZTS8ImVectorIPvE", !10, i64 0, !10, i64 4, !7, i64 8}
!33 = !{!"_ZTS8ImVectorI6ImVec2E", !10, i64 0, !10, i64 4, !7, i64 8}
!34 = !{!"_ZTS15ImDrawCmdHeader", !35, i64 0, !7, i64 16, !10, i64 24}
!35 = !{!"_ZTS6ImVec4", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!36 = !{!"_ZTS18ImDrawListSplitter", !10, i64 0, !10, i64 4, !37, i64 8}
!37 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !10, i64 0, !10, i64 4, !7, i64 8}
!38 = !{!6, !12, i64 132}
!39 = !{!6, !12, i64 256}
!40 = !{!6, !13, i64 321}


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