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

; 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.ImGuiContext = type { i8, i8, %struct.ImGuiIO, %struct.ImGuiStyle, ptr, float, float, %struct.ImDrawListSharedData, double, i32, i32, i32, i8, i8, i8, i8, i8, ptr, %struct.ImVector.1, %struct.ImVector.1, i32, i32, %struct.ImVector.2, %struct.ImVector.2, %struct.ImVector.2, %struct.ImVector.3, %struct.ImGuiStorage, i32, %struct.ImVec2, ptr, ptr, ptr, ptr, ptr, %struct.ImVec2, i32, float, %struct.ImVec2, %struct.ImVec2, i32, i32, i32, i8, i8, float, float, i32, i32, float, i8, i8, i8, i8, i8, i8, %struct.ImVec2, ptr, i32, i32, i32, i8, i8, ptr, i32, float, [140 x %struct.ImGuiKeyOwnerData], %struct.ImGuiKeyRoutingTable, i32, i8, i32, i32, i32, i32, %struct.ImGuiNextItemData, %struct.ImGuiLastItemData, %struct.ImGuiNextWindowData, %struct.ImVector.6, %struct.ImVector.7, %struct.ImVector.8, %struct.ImVector.9, %struct.ImVector.10, %struct.ImVector.11, %struct.ImVector.12, %struct.ImVector.12, i32, %struct.ImVector.13, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i32, %struct.ImRect, i8, i8, i8, i32, i32, i32, i32, i32, i32, %struct.ImRect, %struct.ImRect, i32, i32, i32, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, %struct.ImGuiNavItemData, i32, i32, ptr, ptr, ptr, float, float, i8, %struct.ImVec2, %struct.ImVec2, float, i32, i8, i8, i8, i32, i32, i32, [4 x i8], %struct.ImGuiPayload, %struct.ImRect, i32, i32, float, i32, i32, i32, i32, %struct.ImVector.14, [16 x i8], i32, %struct.ImVector.15, ptr, i32, %struct.ImVector.16, %struct.ImPool, %struct.ImVector.18, %struct.ImVector.19, ptr, %struct.ImPool.20, %struct.ImVector.22, %struct.ImVector.23, i32, i32, float, float, %struct.ImVec2, %struct.ImGuiInputTextState, %struct.ImGuiInputTextDeactivatedState, %struct.ImFont, i32, i32, i32, i32, float, float, i32, %struct.ImVec4, %struct.ImGuiComboPreviewData, float, float, i8, i8, float, float, float, float, i16, i16, %struct.ImVector.24, %struct.ImVector.9, %struct.ImGuiPlatformImeData, %struct.ImGuiPlatformImeData, i8, i8, float, %struct.ImGuiTextBuffer, %struct.ImVector.26, %struct.ImChunkStream, %struct.ImChunkStream.27, %struct.ImVector.28, i32, [7 x ptr], i8, i32, ptr, %struct.ImGuiTextBuffer, ptr, ptr, float, i8, i32, i32, i32, i32, %struct.ImGuiTextBuffer, %struct.ImGuiTextIndex, i8, i8, i8, i8, i8, i32, %struct.ImGuiMetricsConfig, %struct.ImGuiStackTool, [60 x float], i32, i32, float, i32, i32, i32, %struct.ImVector.24 }
%struct.ImGuiIO = type { i32, i32, %struct.ImVec2, float, float, ptr, ptr, float, float, float, float, float, float, float, ptr, ptr, float, i8, ptr, %struct.ImVec2, i8, i8, i8, i8, i8, i8, i8, i8, float, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, float, i32, i32, i32, i32, i32, %struct.ImVec2, [652 x i32], [652 x i8], [16 x float], ptr, %struct.ImVec2, [5 x i8], float, float, i32, i8, i8, i8, i8, i32, [652 x %struct.ImGuiKeyData], i8, %struct.ImVec2, [5 x %struct.ImVec2], [5 x double], [5 x i8], [5 x i8], [5 x i16], [5 x i16], [5 x i8], [5 x i8], [5 x i8], i8, [5 x float], [5 x float], [5 x float], float, i8, i8, i8, i8, i16, %struct.ImVector }
%struct.ImGuiKeyData = type { i8, float, float, float }
%struct.ImVector = type { i32, i32, ptr }
%struct.ImGuiStyle = type { float, float, %struct.ImVec2, float, float, %struct.ImVec2, %struct.ImVec2, i32, float, float, float, float, %struct.ImVec2, float, float, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, float, float, float, float, float, float, float, float, float, i32, %struct.ImVec2, %struct.ImVec2, float, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, i8, i8, i8, float, float, [53 x %struct.ImVec4] }
%struct.ImDrawListSharedData = type { %struct.ImVec2, ptr, float, float, float, %struct.ImVec4, i32, %struct.ImVector.0, [48 x %struct.ImVec2], float, [64 x i8], ptr }
%struct.ImVector.0 = type { i32, i32, ptr }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImVector.2 = type { i32, i32, ptr }
%struct.ImVector.3 = type { i32, i32, ptr }
%struct.ImGuiStorage = type { %struct.ImVector.4 }
%struct.ImVector.4 = type { i32, i32, ptr }
%struct.ImGuiKeyOwnerData = type <{ i32, i32, i8, i8, [2 x i8] }>
%struct.ImGuiKeyRoutingTable = type { [140 x i16], %struct.ImVector.5, %struct.ImVector.5 }
%struct.ImVector.5 = type { i32, i32, ptr }
%struct.ImGuiNextItemData = type <{ i32, float, i32, i32, i8, [3 x i8] }>
%struct.ImGuiLastItemData = type { i32, i32, i32, %struct.ImRect, %struct.ImRect, %struct.ImRect }
%struct.ImGuiNextWindowData = type <{ i32, i32, i32, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, i8, [3 x i8], %struct.ImRect, [4 x i8], ptr, ptr, float, %struct.ImVec2, [4 x i8] }>
%struct.ImVector.6 = type { i32, i32, ptr }
%struct.ImVector.7 = type { i32, i32, ptr }
%struct.ImVector.8 = type { i32, i32, ptr }
%struct.ImVector.10 = type { i32, i32, ptr }
%struct.ImVector.11 = type { i32, i32, ptr }
%struct.ImVector.12 = type { i32, i32, ptr }
%struct.ImVector.13 = type { i32, i32, ptr }
%struct.ImGuiNavItemData = type { ptr, i32, i32, %struct.ImRect, i32, float, float, float }
%struct.ImGuiPayload = type <{ ptr, i32, i32, i32, i32, [33 x i8], i8, i8, [5 x i8] }>
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%struct.ImVector.14 = type { i32, i32, ptr }
%struct.ImVector.15 = type { i32, i32, ptr }
%struct.ImVector.16 = type { i32, i32, ptr }
%struct.ImPool = type { %struct.ImVector.17, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.17 = type { i32, i32, ptr }
%struct.ImVector.18 = type { i32, i32, ptr }
%struct.ImVector.19 = type { i32, i32, ptr }
%struct.ImPool.20 = type { %struct.ImVector.21, %struct.ImGuiStorage, i32, i32 }
%struct.ImVector.21 = type { i32, i32, ptr }
%struct.ImVector.22 = type { i32, i32, ptr }
%struct.ImVector.23 = type { i32, i32, ptr }
%struct.ImVec2 = type { float, float }
%struct.ImGuiInputTextState = type <{ ptr, i32, i32, i32, [4 x i8], %struct.ImVector, %struct.ImVector.24, %struct.ImVector.24, i8, [3 x i8], i32, float, %"struct.ImStb::STB_TexteditState", float, i8, i8, i8, i8, i32, [4 x i8] }>
%"struct.ImStb::STB_TexteditState" = type { i32, i32, i32, i8, i32, i8, i8, i8, i8, i8, i8, i8, float, %"struct.ImStb::StbUndoState" }
%"struct.ImStb::StbUndoState" = type { [99 x %"struct.ImStb::StbUndoRecord"], [999 x i16], i16, i16, i32, i32 }
%"struct.ImStb::StbUndoRecord" = type { i32, i32, i32, i32 }
%struct.ImGuiInputTextDeactivatedState = type { i32, %struct.ImVector.24 }
%struct.ImFont = type <{ %struct.ImVector.18, float, float, %struct.ImVector, %struct.ImVector.25, ptr, ptr, ptr, i16, i16, i16, i16, float, float, i8, [3 x i8], float, float, float, i32, [2 x i8], [2 x i8] }>
%struct.ImVector.25 = type { i32, i32, ptr }
%struct.ImVec4 = type { float, float, float, float }
%struct.ImGuiComboPreviewData = type { %struct.ImRect, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, i32 }
%struct.ImVector.9 = type { i32, i32, ptr }
%struct.ImGuiPlatformImeData = type { i8, %struct.ImVec2, float }
%struct.ImVector.26 = type { i32, i32, ptr }
%struct.ImChunkStream = type { %struct.ImVector.24 }
%struct.ImChunkStream.27 = type { %struct.ImVector.24 }
%struct.ImVector.28 = type { i32, i32, ptr }
%struct.ImGuiTextBuffer = type { %struct.ImVector.24 }
%struct.ImGuiTextIndex = type <{ %struct.ImVector.10, i32, [4 x i8] }>
%struct.ImGuiMetricsConfig = type { i8, i8, i8, i8, i8, i8, i8, i8, i32, i32 }
%struct.ImGuiStackTool = type { i32, i32, i32, %struct.ImVector.29, i8, float }
%struct.ImVector.29 = type { i32, i32, ptr }
%struct.ImVector.24 = type { i32, i32, ptr }
%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.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.ImVec2ih = type { i16, i16 }
%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.34 = type { i32, i32, ptr }
%struct.ImVector.35 = type { i32, i32, ptr }
%struct.ImVector.36 = type { i32, i32, ptr }
%struct.ImDrawCmdHeader = type <{ %struct.ImVec4, ptr, i32, [4 x i8] }>
%struct.ImDrawListSplitter = type { i32, i32, %struct.ImVector.19 }

@GImGui = external dso_local global ptr, align 8

; 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: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5ImGui26IsWindowWithinBeginStackOfEP11ImGuiWindowS1_(ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP11ImGuiWindowEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5ImGui43FindBottomMostVisibleWindowWithinBeginStackEP11ImGuiWindow(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %8 = load ptr, ptr @GImGui, align 8, !tbaa !5
  store ptr %8, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %9, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = call noundef i32 @_ZN5ImGui22FindWindowDisplayIndexEP11ImGuiWindow(ptr noundef %10)
  store i32 %11, ptr %5, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %48, %1
  %13 = load i32, ptr %5, align 4, !tbaa !9
  %14 = icmp sge i32 %13, 0
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  store i32 2, ptr %6, align 4
  br label %51

16:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ImGuiContext, ptr %17, i32 0, i32 22
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP11ImGuiWindowEixEi(ptr noundef nonnull align 8 dereferenceable(16) %18, i32 noundef %19)
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %21, ptr %7, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ImGuiWindow, ptr %22, i32 0, i32 3
  %24 = load i32, ptr %23, align 4, !tbaa !11
  %25 = and i32 %24, 16777216
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %16
  store i32 4, ptr %6, align 4
  br label %45

28:                                               ; preds = %16
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = call noundef zeroext i1 @_ZN5ImGui26IsWindowWithinBeginStackOfEP11ImGuiWindowS1_(ptr noundef %29, ptr noundef %30)
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 2, ptr %6, align 4
  br label %45

33:                                               ; preds = %28
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call noundef zeroext i1 @_ZL24IsWindowActiveAndVisibleP11ImGuiWindow(ptr noundef %34)
  br i1 %35, label %36, label %44

36:                                               ; preds = %33
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = call noundef i32 @_ZL21GetWindowDisplayLayerP11ImGuiWindow(ptr noundef %37)
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = call noundef i32 @_ZL21GetWindowDisplayLayerP11ImGuiWindow(ptr noundef %39)
  %41 = icmp sle i32 %38, %40
  br i1 %41, label %42, label %44

42:                                               ; preds = %36
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %43, ptr %4, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %42, %36, %33
  store i32 0, ptr %6, align 4
  br label %45

45:                                               ; preds = %44, %32, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %46 = load i32, ptr %6, align 4
  switch i32 %46, label %51 [
    i32 0, label %47
    i32 4, label %48
  ]

47:                                               ; preds = %45
  br label %48

48:                                               ; preds = %47, %45
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr %5, align 4, !tbaa !9
  br label %12, !llvm.loop !40

51:                                               ; preds = %45, %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret ptr %53
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5ImGui22FindWindowDisplayIndexEP11ImGuiWindow(ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL24IsWindowActiveAndVisibleP11ImGuiWindow(ptr noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL21GetWindowDisplayLayerP11ImGuiWindow(ptr noundef) #2

attributes #0 = { 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 = { 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 #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 = { 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, !10, i64 20}
!12 = !{!"_ZTS11ImGuiWindow", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !6, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !14, i64 88, !14, i64 92, !14, i64 96, !14, i64 100, !14, i64 104, !14, i64 108, !14, i64 112, !14, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !13, i64 132, !13, i64 140, !13, i64 148, !13, i64 156, !13, i64 164, !13, 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, !10, i64 204, !7, i64 208, !7, i64 209, !7, i64 210, !15, i64 211, !10, i64 212, !7, i64 216, !7, i64 217, !7, i64 218, !7, i64 219, !10, i64 220, !10, i64 221, !10, i64 222, !13, i64 224, !13, 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, !10, i64 608, !14, i64 612, !14, i64 616, !26, i64 624, !28, i64 640, !14, i64 656, !10, i64 660, !6, i64 664, !29, i64 672, !6, i64 872, !6, i64 880, !6, i64 888, !6, i64 896, !6, i64 904, !6, i64 912, !6, i64 920, !7, i64 928, !7, i64 936, !10, i64 968, !10, i64 972, !10, i64 976, !15, i64 980}
!13 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"short", !7, i64 0}
!17 = !{!"_ZTS8ImVectorIjE", !10, i64 0, !10, i64 4, !6, i64 8}
!18 = !{!"_ZTS19ImGuiWindowTempData", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !14, i64 56, !14, i64 60, !15, i64 64, !15, i64 65, !19, i64 68, !19, i64 72, !19, i64 76, !13, i64 80, !20, i64 88, !16, i64 92, !16, i64 94, !15, i64 96, !15, i64 97, !15, i64 98, !15, i64 99, !13, i64 100, !21, i64 108, !10, i64 136, !10, i64 140, !22, i64 144, !6, i64 160, !6, i64 168, !10, i64 176, !10, i64 180, !10, i64 184, !14, i64 188, !14, i64 192, !23, i64 200, !23, i64 216}
!19 = !{!"_ZTS6ImVec1", !14, i64 0}
!20 = !{!"_ZTS13ImGuiNavLayer", !7, i64 0}
!21 = !{!"_ZTS16ImGuiMenuColumns", !10, i64 0, !10, i64 4, !16, i64 8, !16, i64 10, !16, i64 12, !16, i64 14, !16, i64 16, !7, i64 18}
!22 = !{!"_ZTS8ImVectorIP11ImGuiWindowE", !10, i64 0, !10, i64 4, !6, i64 8}
!23 = !{!"_ZTS8ImVectorIfE", !10, i64 0, !10, i64 4, !6, i64 8}
!24 = !{!"_ZTS6ImRect", !13, i64 0, !13, i64 8}
!25 = !{!"_ZTS8ImVec2ih", !16, i64 0, !16, i64 2}
!26 = !{!"_ZTS12ImGuiStorage", !27, i64 0}
!27 = !{!"_ZTS8ImVectorIN12ImGuiStorage16ImGuiStoragePairEE", !10, i64 0, !10, i64 4, !6, i64 8}
!28 = !{!"_ZTS8ImVectorI15ImGuiOldColumnsE", !10, i64 0, !10, i64 4, !6, i64 8}
!29 = !{!"_ZTS10ImDrawList", !30, i64 0, !31, i64 16, !32, i64 32, !10, i64 48, !10, i64 52, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !33, i64 88, !34, i64 104, !35, i64 120, !36, i64 136, !38, i64 168, !14, i64 192}
!30 = !{!"_ZTS8ImVectorI9ImDrawCmdE", !10, i64 0, !10, i64 4, !6, i64 8}
!31 = !{!"_ZTS8ImVectorItE", !10, i64 0, !10, i64 4, !6, i64 8}
!32 = !{!"_ZTS8ImVectorI10ImDrawVertE", !10, i64 0, !10, i64 4, !6, i64 8}
!33 = !{!"_ZTS8ImVectorI6ImVec4E", !10, i64 0, !10, i64 4, !6, i64 8}
!34 = !{!"_ZTS8ImVectorIPvE", !10, i64 0, !10, i64 4, !6, i64 8}
!35 = !{!"_ZTS8ImVectorI6ImVec2E", !10, i64 0, !10, i64 4, !6, i64 8}
!36 = !{!"_ZTS15ImDrawCmdHeader", !37, i64 0, !6, i64 16, !10, i64 24}
!37 = !{!"_ZTS6ImVec4", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!38 = !{!"_ZTS18ImDrawListSplitter", !10, i64 0, !10, i64 4, !39, i64 8}
!39 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !10, i64 0, !10, i64 4, !6, i64 8}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}


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

@GImGui = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5ImGui26IsWindowWithinBeginStackOfEP11ImGuiWindowS1_(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP11ImGuiWindowEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN5ImGui43FindBottomMostVisibleWindowWithinBeginStackEP11ImGuiWindow(ptr noundef %0) local_unnamed_addr #2 {
  %2 = load ptr, ptr @GImGui, align 8, !tbaa !5
  %3 = tail call noundef i32 @_ZN5ImGui22FindWindowDisplayIndexEP11ImGuiWindow(ptr noundef %0)
  %4 = icmp sgt i32 %3, -1
  br i1 %4, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %5 = getelementptr inbounds i8, ptr %2, i64 15984
  br label %6

6:                                                ; preds = %.lr.ph, %19
  %.021 = phi ptr [ %0, %.lr.ph ], [ %.2.ph, %19 ]
  %.01520 = phi i32 [ %3, %.lr.ph ], [ %20, %19 ]
  %7 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP11ImGuiWindowEixEi(ptr noundef nonnull align 8 dereferenceable(16) %5, i32 noundef %.01520)
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 20
  %10 = load i32, ptr %9, align 4, !tbaa !9
  %11 = and i32 %10, 16777216
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %12, label %19

12:                                               ; preds = %6
  %13 = tail call noundef zeroext i1 @_ZN5ImGui26IsWindowWithinBeginStackOfEP11ImGuiWindowS1_(ptr noundef nonnull %8, ptr noundef %0)
  br i1 %13, label %14, label %._crit_edge

14:                                               ; preds = %12
  %15 = tail call noundef zeroext i1 @_ZL24IsWindowActiveAndVisibleP11ImGuiWindow(ptr noundef nonnull %8)
  br i1 %15, label %16, label %19

16:                                               ; preds = %14
  %17 = tail call noundef i32 @_ZL21GetWindowDisplayLayerP11ImGuiWindow(ptr noundef nonnull %8)
  %18 = tail call noundef i32 @_ZL21GetWindowDisplayLayerP11ImGuiWindow(ptr noundef %0)
  %.not16 = icmp sgt i32 %17, %18
  %spec.select = select i1 %.not16, ptr %.021, ptr %8
  br label %19

19:                                               ; preds = %6, %16, %14
  %.2.ph = phi ptr [ %spec.select, %16 ], [ %.021, %14 ], [ %.021, %6 ]
  %20 = add nsw i32 %.01520, -1
  %21 = icmp sgt i32 %.01520, 0
  br i1 %21, label %6, label %._crit_edge, !llvm.loop !39

._crit_edge:                                      ; preds = %19, %12, %1
  %.0.lcssa = phi ptr [ %0, %1 ], [ %.021, %12 ], [ %.2.ph, %19 ]
  ret ptr %.0.lcssa
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5ImGui22FindWindowDisplayIndexEP11ImGuiWindow(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL24IsWindowActiveAndVisibleP11ImGuiWindow(ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL21GetWindowDisplayLayerP11ImGuiWindow(ptr noundef) local_unnamed_addr #1

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass