; LLVM IR from DarrenSweeney/3D-Physics-Engine :: Physics Engine/Imgui/imgui.ll (ZN5ImGui8ShutdownEv)

; 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.ImGuiState = type { i8, [7 x i8], %struct.ImGuiIO, %struct.ImGuiStyle, ptr, float, %struct.ImVec2, float, i32, i32, %class.ImVector.1, ptr, %class.ImVector.1, ptr, ptr, ptr, i32, i32, i32, i8, i8, ptr, float, %class.ImVector.2, %class.ImVector.3, %class.ImVector.4, %class.ImVector, %struct.ImVec2, i32, %struct.ImVec2, i32, i8, i32, i8, i8, i32, %class.ImVector.5, %class.ImVector.1, %struct.ImGuiTextEditState, i32, %struct.ImGuiStorage, i32, [1024 x i8], ptr, i8, ptr, ptr, i32, i32, [120 x float], i32, float }
%struct.ImGuiIO = type <{ %struct.ImVec2, float, float, ptr, ptr, float, float, [17 x i32], [4 x i8], ptr, ptr, float, i8, [3 x i8], %struct.ImVec2, %struct.ImVec2, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.ImVec2, [5 x i8], [3 x i8], float, i8, i8, i8, [512 x i8], i8, [17 x i16], i8, i8, float, %struct.ImVec2, %struct.ImVec2, [5 x i8], [3 x i8], [5 x %struct.ImVec2], [5 x float], [5 x i8], [5 x i8], [2 x i8], [5 x float], [512 x float], [4 x i8] }>
%struct.ImGuiStyle = type { float, %struct.ImVec2, %struct.ImVec2, float, float, %struct.ImVec2, float, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, float, float, float, [39 x %struct.ImVec4] }
%struct.ImVec4 = type { float, float, float, float }
%class.ImVector.2 = type { i64, i64, ptr }
%class.ImVector.3 = type { i64, i64, ptr }
%class.ImVector.4 = type { i64, i64, ptr }
%class.ImVector = type { i64, i64, ptr }
%struct.ImVec2 = type { float, float }
%class.ImVector.5 = type { i64, i64, ptr }
%class.ImVector.1 = type { i64, i64, ptr }
%struct.ImGuiTextEditState = type <{ i32, [1024 x i16], [3073 x i8], [3 x i8], i64, float, float, %struct.STB_TexteditState, float, %struct.ImVec2, i8, [7 x i8], ptr, float, [4 x i8] }>
%struct.STB_TexteditState = type { i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, float, %struct.StbUndoState }
%struct.StbUndoState = type { [99 x %struct.StbUndoRecord], [999 x i16], i16, i16, i16, i16 }
%struct.StbUndoRecord = type { i32, i16, i16, i16 }
%struct.ImGuiStorage = type { %class.ImVector.6 }
%class.ImVector.6 = type { i64, i64, ptr }

@_ZL6GImGui = external hidden global ptr, align 8
@stdout = external 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 uwtable
declare dso_local void @_ZN12ImGuiStorage5ClearEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5ImGui7MemFreeEPv(ptr noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK8ImVectorIP11ImGuiWindowE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP11ImGuiWindowEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL12SaveSettingsv() #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5ImGui8ShutdownEv() #1 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  %5 = load ptr, ptr @_ZL6GImGui, align 8, !tbaa !5
  store ptr %5, ptr %1, align 8, !tbaa !5
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.ImGuiState, ptr %6, i32 0, i32 0
  %8 = load i8, ptr %7, align 8, !tbaa !9, !range !30, !noundef !31
  %9 = trunc i8 %8 to i1
  br i1 %9, label %11, label %10

10:                                               ; preds = %0
  store i32 1, ptr %2, align 4
  br label %125

11:                                               ; preds = %0
  call void @_ZL12SaveSettingsv()
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !32
  br label %12

12:                                               ; preds = %30, %11
  %13 = load i64, ptr %3, align 8, !tbaa !32
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.ImGuiState, ptr %14, i32 0, i32 10
  %16 = call noundef i64 @_ZNK8ImVectorIP11ImGuiWindowE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15)
  %17 = icmp ult i64 %13, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %12
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %33

19:                                               ; preds = %12
  %20 = load ptr, ptr %1, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.ImGuiState, ptr %20, i32 0, i32 10
  %22 = load i64, ptr %3, align 8, !tbaa !32
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP11ImGuiWindowEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %22)
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  call void @_ZN11ImGuiWindowD1Ev(ptr noundef nonnull align 8 dereferenceable(480) %24) #6
  %25 = load ptr, ptr %1, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ImGuiState, ptr %25, i32 0, i32 10
  %27 = load i64, ptr %3, align 8, !tbaa !32
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP11ImGuiWindowEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %27)
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  call void @_ZN5ImGui7MemFreeEPv(ptr noundef %29)
  br label %30

30:                                               ; preds = %19
  %31 = load i64, ptr %3, align 8, !tbaa !32
  %32 = add i64 %31, 1
  store i64 %32, ptr %3, align 8, !tbaa !32
  br label %12, !llvm.loop !33

33:                                               ; preds = %18
  %34 = load ptr, ptr %1, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ImGuiState, ptr %34, i32 0, i32 10
  call void @_ZN8ImVectorIP11ImGuiWindowE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %35)
  %36 = load ptr, ptr %1, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ImGuiState, ptr %36, i32 0, i32 12
  call void @_ZN8ImVectorIP11ImGuiWindowE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %37)
  %38 = load ptr, ptr %1, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.ImGuiState, ptr %38, i32 0, i32 36
  call void @_ZN8ImVectorIP10ImDrawListE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %39)
  %40 = load ptr, ptr %1, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.ImGuiState, ptr %40, i32 0, i32 13
  store ptr null, ptr %41, align 8, !tbaa !35
  %42 = load ptr, ptr %1, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ImGuiState, ptr %42, i32 0, i32 14
  store ptr null, ptr %43, align 8, !tbaa !36
  %44 = load ptr, ptr %1, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ImGuiState, ptr %44, i32 0, i32 15
  store ptr null, ptr %45, align 8, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !32
  br label %46

46:                                               ; preds = %64, %33
  %47 = load i64, ptr %4, align 8, !tbaa !32
  %48 = load ptr, ptr %1, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.ImGuiState, ptr %48, i32 0, i32 23
  %50 = call noundef i64 @_ZNK8ImVectorIP12ImGuiIniDataE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %49)
  %51 = icmp ult i64 %47, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %46
  store i32 5, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %67

53:                                               ; preds = %46
  %54 = load ptr, ptr %1, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ImGuiState, ptr %54, i32 0, i32 23
  %56 = load i64, ptr %4, align 8, !tbaa !32
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP12ImGuiIniDataEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %56)
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  call void @_ZN12ImGuiIniDataD2Ev(ptr noundef nonnull align 8 dereferenceable(25) %58) #6
  %59 = load ptr, ptr %1, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ImGuiState, ptr %59, i32 0, i32 23
  %61 = load i64, ptr %4, align 8, !tbaa !32
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP12ImGuiIniDataEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %61)
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  call void @_ZN5ImGui7MemFreeEPv(ptr noundef %63)
  br label %64

64:                                               ; preds = %53
  %65 = load i64, ptr %4, align 8, !tbaa !32
  %66 = add i64 %65, 1
  store i64 %66, ptr %4, align 8, !tbaa !32
  br label %46, !llvm.loop !38

67:                                               ; preds = %52
  %68 = load ptr, ptr %1, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.ImGuiState, ptr %68, i32 0, i32 23
  call void @_ZN8ImVectorIP12ImGuiIniDataE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %69)
  %70 = load ptr, ptr %1, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ImGuiState, ptr %70, i32 0, i32 24
  call void @_ZN8ImVectorI11ImGuiColModE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %71)
  %72 = load ptr, ptr %1, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ImGuiState, ptr %72, i32 0, i32 25
  call void @_ZN8ImVectorI13ImGuiStyleModE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %73)
  %74 = load ptr, ptr %1, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.ImGuiState, ptr %74, i32 0, i32 26
  call void @_ZN8ImVectorIP6ImFontE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %75)
  %76 = load ptr, ptr %1, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ImGuiState, ptr %76, i32 0, i32 40
  call void @_ZN12ImGuiStorage5ClearEv(ptr noundef nonnull align 8 dereferenceable(24) %77)
  %78 = load ptr, ptr %1, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ImGuiState, ptr %78, i32 0, i32 45
  %80 = load ptr, ptr %79, align 8, !tbaa !39
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %95

82:                                               ; preds = %67
  %83 = load ptr, ptr %1, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ImGuiState, ptr %83, i32 0, i32 45
  %85 = load ptr, ptr %84, align 8, !tbaa !39
  %86 = load ptr, ptr @stdout, align 8, !tbaa !5
  %87 = icmp ne ptr %85, %86
  br i1 %87, label %88, label %95

88:                                               ; preds = %82
  %89 = load ptr, ptr %1, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.ImGuiState, ptr %89, i32 0, i32 45
  %91 = load ptr, ptr %90, align 8, !tbaa !39
  %92 = call i32 @fclose(ptr noundef %91)
  %93 = load ptr, ptr %1, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ImGuiState, ptr %93, i32 0, i32 45
  store ptr null, ptr %94, align 8, !tbaa !39
  br label %95

95:                                               ; preds = %88, %82, %67
  %96 = load ptr, ptr %1, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ImGuiState, ptr %96, i32 0, i32 2
  %98 = getelementptr inbounds %struct.ImGuiIO, ptr %97, i32 0, i32 10
  %99 = load ptr, ptr %98, align 8, !tbaa !40
  call void @_ZN11ImFontAtlas5ClearEv(ptr noundef nonnull align 8 dereferenceable(96) %99)
  %100 = load ptr, ptr %1, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ImGuiState, ptr %100, i32 0, i32 43
  %102 = load ptr, ptr %101, align 8, !tbaa !41
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %110

104:                                              ; preds = %95
  %105 = load ptr, ptr %1, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.ImGuiState, ptr %105, i32 0, i32 43
  %107 = load ptr, ptr %106, align 8, !tbaa !41
  call void @_ZN5ImGui7MemFreeEPv(ptr noundef %107)
  %108 = load ptr, ptr %1, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.ImGuiState, ptr %108, i32 0, i32 43
  store ptr null, ptr %109, align 8, !tbaa !41
  br label %110

110:                                              ; preds = %104, %95
  %111 = load ptr, ptr %1, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.ImGuiState, ptr %111, i32 0, i32 46
  %113 = load ptr, ptr %112, align 8, !tbaa !42
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %122

115:                                              ; preds = %110
  %116 = load ptr, ptr %1, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ImGuiState, ptr %116, i32 0, i32 46
  %118 = load ptr, ptr %117, align 8, !tbaa !42
  call void @_ZN15ImGuiTextBufferD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %118) #6
  %119 = load ptr, ptr %1, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ImGuiState, ptr %119, i32 0, i32 46
  %121 = load ptr, ptr %120, align 8, !tbaa !42
  call void @_ZN5ImGui7MemFreeEPv(ptr noundef %121)
  br label %122

122:                                              ; preds = %115, %110
  %123 = load ptr, ptr %1, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.ImGuiState, ptr %123, i32 0, i32 0
  store i8 0, ptr %124, align 8, !tbaa !9
  store i32 0, ptr %2, align 4
  br label %125

125:                                              ; preds = %122, %10
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  %126 = load i32, ptr %2, align 4
  switch i32 %126, label %128 [
    i32 0, label %127
    i32 1, label %127
  ]

127:                                              ; preds = %125, %125
  ret void

128:                                              ; preds = %125
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorIP11ImGuiWindowE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorIP10ImDrawListE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK8ImVectorIP12ImGuiIniDataE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP12ImGuiIniDataEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorIP12ImGuiIniDataE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI11ImGuiColModE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI13ImGuiStyleModE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorIP6ImFontE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

declare i32 @fclose(ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11ImFontAtlas5ClearEv(ptr noundef nonnull align 8 dereferenceable(96)) #1 align 2

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

declare void @_ZN11ImGuiWindowD1Ev(ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { 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 = { "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, !11, i64 0}
!10 = !{!"_ZTS10ImGuiState", !11, i64 0, !12, i64 8, !15, i64 2960, !6, i64 3672, !14, i64 3680, !13, i64 3684, !14, i64 3692, !16, i64 3696, !16, i64 3700, !17, i64 3704, !6, i64 3728, !17, i64 3736, !6, i64 3760, !6, i64 3768, !6, i64 3776, !16, i64 3784, !16, i64 3788, !16, i64 3792, !11, i64 3796, !11, i64 3797, !6, i64 3800, !14, i64 3808, !19, i64 3816, !20, i64 3840, !21, i64 3864, !22, i64 3888, !13, i64 3912, !16, i64 3920, !13, i64 3924, !16, i64 3932, !11, i64 3936, !16, i64 3940, !11, i64 3944, !11, i64 3945, !16, i64 3948, !23, i64 3952, !17, i64 3976, !24, i64 4000, !16, i64 12400, !28, i64 12408, !16, i64 12432, !7, i64 12436, !6, i64 13464, !11, i64 13472, !6, i64 13480, !6, i64 13488, !16, i64 13496, !16, i64 13500, !7, i64 13504, !16, i64 13984, !14, i64 13988}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTS7ImGuiIO", !13, i64 0, !14, i64 8, !14, i64 12, !6, i64 16, !6, i64 24, !14, i64 32, !14, i64 36, !7, i64 40, !6, i64 112, !6, i64 120, !14, i64 128, !11, i64 132, !13, i64 136, !13, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !13, i64 208, !7, i64 216, !14, i64 224, !11, i64 228, !11, i64 229, !11, i64 230, !7, i64 231, !7, i64 744, !11, i64 778, !11, i64 779, !14, i64 780, !13, i64 784, !13, i64 792, !7, i64 800, !7, i64 808, !7, i64 848, !7, i64 868, !7, i64 873, !7, i64 880, !7, i64 900}
!13 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTS10ImGuiStyle", !14, i64 0, !13, i64 4, !13, i64 12, !14, i64 20, !14, i64 24, !13, i64 28, !14, i64 36, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !14, i64 72, !14, i64 76, !14, i64 80, !14, i64 84, !7, i64 88}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTS8ImVectorIP11ImGuiWindowE", !18, i64 0, !18, i64 8, !6, i64 16}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTS8ImVectorIP12ImGuiIniDataE", !18, i64 0, !18, i64 8, !6, i64 16}
!20 = !{!"_ZTS8ImVectorI11ImGuiColModE", !18, i64 0, !18, i64 8, !6, i64 16}
!21 = !{!"_ZTS8ImVectorI13ImGuiStyleModE", !18, i64 0, !18, i64 8, !6, i64 16}
!22 = !{!"_ZTS8ImVectorIP6ImFontE", !18, i64 0, !18, i64 8, !6, i64 16}
!23 = !{!"_ZTS8ImVectorIP10ImDrawListE", !18, i64 0, !18, i64 8, !6, i64 16}
!24 = !{!"_ZTS18ImGuiTextEditState", !16, i64 0, !7, i64 4, !7, i64 2052, !18, i64 5128, !14, i64 5136, !14, i64 5140, !25, i64 5144, !14, i64 8364, !13, i64 8368, !11, i64 8376, !6, i64 8384, !14, i64 8392}
!25 = !{!"_ZTS17STB_TexteditState", !16, i64 0, !16, i64 4, !16, i64 8, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19, !14, i64 20, !26, i64 24}
!26 = !{!"_ZTS12StbUndoState", !7, i64 0, !7, i64 1188, !27, i64 3186, !27, i64 3188, !27, i64 3190, !27, i64 3192}
!27 = !{!"short", !7, i64 0}
!28 = !{!"_ZTS12ImGuiStorage", !29, i64 0}
!29 = !{!"_ZTS8ImVectorIN12ImGuiStorage4PairEE", !18, i64 0, !18, i64 8, !6, i64 16}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = !{!18, !18, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!10, !6, i64 3760}
!36 = !{!10, !6, i64 3768}
!37 = !{!10, !6, i64 3776}
!38 = distinct !{!38, !34}
!39 = !{!10, !6, i64 13480}
!40 = !{!10, !6, i64 128}
!41 = !{!10, !6, i64 13464}
!42 = !{!10, !6, i64 13488}


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

@_ZL6GImGui = external hidden local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12ImGuiStorage5ClearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5ImGui7MemFreeEPv(ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK8ImVectorIP11ImGuiWindowE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL12SaveSettingsv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5ImGui8ShutdownEv() local_unnamed_addr #0 {
  %1 = load ptr, ptr @_ZL6GImGui, align 8, !tbaa !5
  %2 = load i8, ptr %1, align 8, !tbaa !9, !range !30, !noundef !31
  %3 = trunc nuw i8 %2 to i1
  br i1 %3, label %4, label %47

4:                                                ; preds = %0
  tail call void @_ZL12SaveSettingsv()
  %5 = getelementptr inbounds i8, ptr %1, i64 3704
  %6 = tail call noundef i64 @_ZNK8ImVectorIP11ImGuiWindowE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %.not51 = icmp eq i64 %6, 0
  br i1 %.not51, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %4
  tail call void @_ZN8ImVectorIP11ImGuiWindowE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %7 = getelementptr inbounds i8, ptr %1, i64 3736
  tail call void @_ZN8ImVectorIP11ImGuiWindowE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  %8 = getelementptr inbounds i8, ptr %1, i64 3952
  tail call void @_ZN8ImVectorIP10ImDrawListE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %9 = getelementptr inbounds i8, ptr %1, i64 3760
  %10 = getelementptr inbounds i8, ptr %1, i64 3816
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, i8 0, i64 24, i1 false)
  %11 = tail call noundef i64 @_ZNK8ImVectorIP12ImGuiIniDataE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %.not52 = icmp eq i64 %11, 0
  br i1 %.not52, label %._crit_edge49, label %.lr.ph48

.lr.ph:                                           ; preds = %4, %.lr.ph
  %.03745 = phi i64 [ %16, %.lr.ph ], [ 0, %4 ]
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP11ImGuiWindowEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.03745)
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  tail call void @_ZN11ImGuiWindowD1Ev(ptr noundef nonnull align 8 dereferenceable(480) %13) #6
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP11ImGuiWindowEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %.03745)
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  tail call void @_ZN5ImGui7MemFreeEPv(ptr noundef %15)
  %16 = add nuw i64 %.03745, 1
  %17 = tail call noundef i64 @_ZNK8ImVectorIP11ImGuiWindowE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %18 = icmp ult i64 %16, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !32

._crit_edge49:                                    ; preds = %.lr.ph48, %._crit_edge
  tail call void @_ZN8ImVectorIP12ImGuiIniDataE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %19 = getelementptr inbounds i8, ptr %1, i64 3840
  tail call void @_ZN8ImVectorI11ImGuiColModE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %19)
  %20 = getelementptr inbounds i8, ptr %1, i64 3864
  tail call void @_ZN8ImVectorI13ImGuiStyleModE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %21 = getelementptr inbounds i8, ptr %1, i64 3888
  tail call void @_ZN8ImVectorIP6ImFontE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  %22 = getelementptr inbounds i8, ptr %1, i64 12408
  tail call void @_ZN12ImGuiStorage5ClearEv(ptr noundef nonnull align 8 dereferenceable(24) %22)
  %23 = getelementptr inbounds i8, ptr %1, i64 13480
  %24 = load ptr, ptr %23, align 8, !tbaa !34
  %.not = icmp eq ptr %24, null
  %25 = load ptr, ptr @stdout, align 8
  %.not41 = icmp eq ptr %24, %25
  %or.cond = select i1 %.not, i1 true, i1 %.not41
  br i1 %or.cond, label %35, label %33

.lr.ph48:                                         ; preds = %._crit_edge, %.lr.ph48
  %.046 = phi i64 [ %30, %.lr.ph48 ], [ 0, %._crit_edge ]
  %26 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP12ImGuiIniDataEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.046)
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  tail call void @_ZN12ImGuiIniDataD2Ev(ptr noundef nonnull align 8 dereferenceable(25) %27) #6
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8ImVectorIP12ImGuiIniDataEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.046)
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  tail call void @_ZN5ImGui7MemFreeEPv(ptr noundef %29)
  %30 = add nuw i64 %.046, 1
  %31 = tail call noundef i64 @_ZNK8ImVectorIP12ImGuiIniDataE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %32 = icmp ult i64 %30, %31
  br i1 %32, label %.lr.ph48, label %._crit_edge49, !llvm.loop !35

33:                                               ; preds = %._crit_edge49
  %34 = tail call i32 @fclose(ptr noundef nonnull %24)
  store ptr null, ptr %23, align 8, !tbaa !34
  br label %35

35:                                               ; preds = %33, %._crit_edge49
  %36 = getelementptr inbounds i8, ptr %1, i64 128
  %37 = load ptr, ptr %36, align 8, !tbaa !36
  tail call void @_ZN11ImFontAtlas5ClearEv(ptr noundef nonnull align 8 dereferenceable(96) %37)
  %38 = getelementptr inbounds i8, ptr %1, i64 13464
  %39 = load ptr, ptr %38, align 8, !tbaa !37
  %.not42 = icmp eq ptr %39, null
  br i1 %.not42, label %41, label %40

40:                                               ; preds = %35
  tail call void @_ZN5ImGui7MemFreeEPv(ptr noundef nonnull %39)
  store ptr null, ptr %38, align 8, !tbaa !37
  br label %41

41:                                               ; preds = %40, %35
  %42 = getelementptr inbounds i8, ptr %1, i64 13488
  %43 = load ptr, ptr %42, align 8, !tbaa !38
  %.not43 = icmp eq ptr %43, null
  br i1 %.not43, label %46, label %44

44:                                               ; preds = %41
  tail call void @_ZN15ImGuiTextBufferD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %43) #6
  %45 = load ptr, ptr %42, align 8, !tbaa !38
  tail call void @_ZN5ImGui7MemFreeEPv(ptr noundef %45)
  br label %46

46:                                               ; preds = %44, %41
  store i8 0, ptr %1, align 8, !tbaa !9
  br label %47

47:                                               ; preds = %0, %46
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorIP11ImGuiWindowE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorIP10ImDrawListE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK8ImVectorIP12ImGuiIniDataE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorIP12ImGuiIniDataE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI11ImGuiColModE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI13ImGuiStyleModE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorIP6ImFontE5clearEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11ImFontAtlas5ClearEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #0 align 2

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

declare void @_ZN11ImGuiWindowD1Ev(ptr) local_unnamed_addr

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

attributes #0 = { 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 #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 = { 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 #3 = { 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 = { nofree 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11, i64 0}
!10 = !{!"_ZTS10ImGuiState", !11, i64 0, !12, i64 8, !15, i64 2960, !6, i64 3672, !14, i64 3680, !13, i64 3684, !14, i64 3692, !16, i64 3696, !16, i64 3700, !17, i64 3704, !6, i64 3728, !17, i64 3736, !6, i64 3760, !6, i64 3768, !6, i64 3776, !16, i64 3784, !16, i64 3788, !16, i64 3792, !11, i64 3796, !11, i64 3797, !6, i64 3800, !14, i64 3808, !19, i64 3816, !20, i64 3840, !21, i64 3864, !22, i64 3888, !13, i64 3912, !16, i64 3920, !13, i64 3924, !16, i64 3932, !11, i64 3936, !16, i64 3940, !11, i64 3944, !11, i64 3945, !16, i64 3948, !23, i64 3952, !17, i64 3976, !24, i64 4000, !16, i64 12400, !28, i64 12408, !16, i64 12432, !7, i64 12436, !6, i64 13464, !11, i64 13472, !6, i64 13480, !6, i64 13488, !16, i64 13496, !16, i64 13500, !7, i64 13504, !16, i64 13984, !14, i64 13988}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTS7ImGuiIO", !13, i64 0, !14, i64 8, !14, i64 12, !6, i64 16, !6, i64 24, !14, i64 32, !14, i64 36, !7, i64 40, !6, i64 112, !6, i64 120, !14, i64 128, !11, i64 132, !13, i64 136, !13, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !13, i64 208, !7, i64 216, !14, i64 224, !11, i64 228, !11, i64 229, !11, i64 230, !7, i64 231, !7, i64 744, !11, i64 778, !11, i64 779, !14, i64 780, !13, i64 784, !13, i64 792, !7, i64 800, !7, i64 808, !7, i64 848, !7, i64 868, !7, i64 873, !7, i64 880, !7, i64 900}
!13 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTS10ImGuiStyle", !14, i64 0, !13, i64 4, !13, i64 12, !14, i64 20, !14, i64 24, !13, i64 28, !14, i64 36, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !14, i64 72, !14, i64 76, !14, i64 80, !14, i64 84, !7, i64 88}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTS8ImVectorIP11ImGuiWindowE", !18, i64 0, !18, i64 8, !6, i64 16}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTS8ImVectorIP12ImGuiIniDataE", !18, i64 0, !18, i64 8, !6, i64 16}
!20 = !{!"_ZTS8ImVectorI11ImGuiColModE", !18, i64 0, !18, i64 8, !6, i64 16}
!21 = !{!"_ZTS8ImVectorI13ImGuiStyleModE", !18, i64 0, !18, i64 8, !6, i64 16}
!22 = !{!"_ZTS8ImVectorIP6ImFontE", !18, i64 0, !18, i64 8, !6, i64 16}
!23 = !{!"_ZTS8ImVectorIP10ImDrawListE", !18, i64 0, !18, i64 8, !6, i64 16}
!24 = !{!"_ZTS18ImGuiTextEditState", !16, i64 0, !7, i64 4, !7, i64 2052, !18, i64 5128, !14, i64 5136, !14, i64 5140, !25, i64 5144, !14, i64 8364, !13, i64 8368, !11, i64 8376, !6, i64 8384, !14, i64 8392}
!25 = !{!"_ZTS17STB_TexteditState", !16, i64 0, !16, i64 4, !16, i64 8, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19, !14, i64 20, !26, i64 24}
!26 = !{!"_ZTS12StbUndoState", !7, i64 0, !7, i64 1188, !27, i64 3186, !27, i64 3188, !27, i64 3190, !27, i64 3192}
!27 = !{!"short", !7, i64 0}
!28 = !{!"_ZTS12ImGuiStorage", !29, i64 0}
!29 = !{!"_ZTS8ImVectorIN12ImGuiStorage4PairEE", !18, i64 0, !18, i64 8, !6, i64 16}
!30 = !{i8 0, i8 2}
!31 = !{}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!10, !6, i64 13480}
!35 = distinct !{!35, !33}
!36 = !{!10, !6, i64 128}
!37 = !{!10, !6, i64 13464}
!38 = !{!10, !6, i64 13488}


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