; LLVM IR from erwincoumans/tiny-differentiable-simulator :: third_party/dear_imgui (imnodes)

; 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.anon = type <{ ptr, ptr, ptr, %struct.ImGuiStorage, %struct.ImVector.0, %struct.ImVector.0, %struct.ImVec2, %struct.ImRect, i32, [4 x i8], %"struct.imnodes::IO", %"struct.imnodes::Style", %struct.ImVector.1, %struct.ImVector.2, %struct.ImGuiTextBuffer, i32, [4 x i8], %struct.ImVector.0, i32, i32, i32, %"struct.imnodes::(anonymous namespace)::OptionalIndex", %"struct.imnodes::(anonymous namespace)::OptionalIndex", %"struct.imnodes::(anonymous namespace)::OptionalIndex", i32, %"struct.imnodes::(anonymous namespace)::OptionalIndex", %"struct.imnodes::(anonymous namespace)::OptionalIndex", i32, i32, i8, [3 x i8], %struct.ImVec2, i8, i8, i8, i8, i8, [3 x i8] }>
%struct.ImGuiStorage = type { %struct.ImVector }
%struct.ImVector = type { i32, i32, ptr }
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%"struct.imnodes::IO" = type { %"struct.imnodes::IO::EmulateThreeButtonMouse", %"struct.imnodes::IO::LinkDetachWithModifierClick" }
%"struct.imnodes::IO::EmulateThreeButtonMouse" = type { i8, ptr }
%"struct.imnodes::IO::LinkDetachWithModifierClick" = type { ptr }
%"struct.imnodes::Style" = type { float, float, float, float, float, float, float, float, float, float, float, float, float, i32, [16 x i32] }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImVector.2 = type { i32, i32, ptr }
%struct.ImGuiTextBuffer = type { %struct.ImVector.3 }
%struct.ImVector.3 = type { i32, i32, ptr }
%struct.ImVector.0 = type { i32, i32, ptr }
%"struct.imnodes::(anonymous namespace)::OptionalIndex" = type { i32 }
%struct.ImVec2 = type { float, float }
%"struct.imnodes::EditorContext" = type { %"struct.imnodes::(anonymous namespace)::ObjectPool", %"struct.imnodes::(anonymous namespace)::ObjectPool.6", %"struct.imnodes::(anonymous namespace)::ObjectPool.8", %struct.ImVector.0, %struct.ImVec2, %struct.ImVector.0, %struct.ImVector.0, i32, %"struct.imnodes::(anonymous namespace)::ClickInteractionState" }
%"struct.imnodes::(anonymous namespace)::ObjectPool" = type { %struct.ImVector.4, %struct.ImVector.5, %struct.ImVector.0, %struct.ImGuiStorage }
%struct.ImVector.4 = type { i32, i32, ptr }
%struct.ImVector.5 = type { i32, i32, ptr }
%"struct.imnodes::(anonymous namespace)::ObjectPool.6" = type { %struct.ImVector.7, %struct.ImVector.5, %struct.ImVector.0, %struct.ImGuiStorage }
%struct.ImVector.7 = type { i32, i32, ptr }
%"struct.imnodes::(anonymous namespace)::ObjectPool.8" = type { %struct.ImVector.9, %struct.ImVector.5, %struct.ImVector.0, %struct.ImGuiStorage }
%struct.ImVector.9 = type { i32, i32, ptr }
%"struct.imnodes::(anonymous namespace)::ClickInteractionState" = type { %struct.anon.10, %struct.anon.11 }
%struct.anon.10 = type { i32, %"struct.imnodes::(anonymous namespace)::OptionalIndex", i32 }
%struct.anon.11 = type { %struct.ImRect }
%"struct.imnodes::(anonymous namespace)::NodeData" = type <{ i32, %struct.ImVec2, %struct.ImRect, %struct.ImRect, %struct.anon.12, %struct.anon.13, [4 x i8], %struct.ImVector.0, i8, [7 x i8] }>
%struct.anon.12 = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.anon.13 = type { float, %struct.ImVec2 }

@_ZN7imnodes12_GLOBAL__N_11gE = external hidden global %struct.anon, align 8
@.str.1 = external hidden unnamed_addr constant [111 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN7imnodes26SaveEditorStateToIniStringEPKNS_13EditorContextEPm = external hidden unnamed_addr constant [91 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN7imnodes26SaveEditorStateToIniStringEPKNS_13EditorContextEPm(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = icmp ne ptr %8, null
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  br label %13

11:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.24, ptr noundef @.str.1, i32 noundef 2631, ptr noundef @__PRETTY_FUNCTION__._ZN7imnodes26SaveEditorStateToIniStringEPKNS_13EditorContextEPm) #6
  unreachable

12:                                               ; No predecessors!
  br label %13

13:                                               ; preds = %12, %10
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %14, ptr %5, align 8, !tbaa !5
  call void @_ZN15ImGuiTextBuffer5clearEv(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%struct.anon, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i32 0, i32 14))
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.imnodes::EditorContext", ptr %15, i32 0, i32 0
  %17 = getelementptr inbounds %"struct.imnodes::(anonymous namespace)::ObjectPool", ptr %16, i32 0, i32 0
  %18 = call noundef i32 @_ZNK8ImVectorIN7imnodes12_GLOBAL__N_18NodeDataEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %17)
  %19 = mul nsw i32 64, %18
  call void @_ZN15ImGuiTextBuffer7reserveEi(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%struct.anon, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i32 0, i32 14), i32 noundef %19)
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.imnodes::EditorContext", ptr %20, i32 0, i32 4
  %22 = getelementptr inbounds %struct.ImVec2, ptr %21, i32 0, i32 0
  %23 = load float, ptr %22, align 8, !tbaa !9
  %24 = fptosi float %23 to i32
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.imnodes::EditorContext", ptr %25, i32 0, i32 4
  %27 = getelementptr inbounds %struct.ImVec2, ptr %26, i32 0, i32 1
  %28 = load float, ptr %27, align 4, !tbaa !29
  %29 = fptosi float %28 to i32
  call void (ptr, ptr, ...) @_ZN15ImGuiTextBuffer7appendfEPKcz(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%struct.anon, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i32 0, i32 14), ptr noundef @.str.25, i32 noundef %24, i32 noundef %29)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !30
  br label %30

30:                                               ; preds = %57, %13
  %31 = load i32, ptr %6, align 4, !tbaa !30
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %"struct.imnodes::EditorContext", ptr %32, i32 0, i32 0
  %34 = getelementptr inbounds %"struct.imnodes::(anonymous namespace)::ObjectPool", ptr %33, i32 0, i32 0
  %35 = call noundef i32 @_ZNK8ImVectorIN7imnodes12_GLOBAL__N_18NodeDataEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %34)
  %36 = icmp slt i32 %31, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %60

38:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %"struct.imnodes::EditorContext", ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds %"struct.imnodes::(anonymous namespace)::ObjectPool", ptr %40, i32 0, i32 0
  %42 = load i32, ptr %6, align 4, !tbaa !30
  %43 = call noundef nonnull align 8 dereferenceable(105) ptr @_ZNK8ImVectorIN7imnodes12_GLOBAL__N_18NodeDataEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %41, i32 noundef %42)
  store ptr %43, ptr %7, align 8, !tbaa !5
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.imnodes::(anonymous namespace)::NodeData", ptr %44, i32 0, i32 0
  %46 = load i32, ptr %45, align 8, !tbaa !31
  call void (ptr, ptr, ...) @_ZN15ImGuiTextBuffer7appendfEPKcz(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%struct.anon, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i32 0, i32 14), ptr noundef @.str.26, i32 noundef %46)
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.imnodes::(anonymous namespace)::NodeData", ptr %47, i32 0, i32 1
  %49 = getelementptr inbounds %struct.ImVec2, ptr %48, i32 0, i32 0
  %50 = load float, ptr %49, align 4, !tbaa !36
  %51 = fptosi float %50 to i32
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %"struct.imnodes::(anonymous namespace)::NodeData", ptr %52, i32 0, i32 1
  %54 = getelementptr inbounds %struct.ImVec2, ptr %53, i32 0, i32 1
  %55 = load float, ptr %54, align 4, !tbaa !37
  %56 = fptosi float %55 to i32
  call void (ptr, ptr, ...) @_ZN15ImGuiTextBuffer7appendfEPKcz(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%struct.anon, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i32 0, i32 14), ptr noundef @.str.27, i32 noundef %51, i32 noundef %56)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %57

57:                                               ; preds = %38
  %58 = load i32, ptr %6, align 4, !tbaa !30
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %6, align 4, !tbaa !30
  br label %30, !llvm.loop !38

60:                                               ; preds = %37
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %67

63:                                               ; preds = %60
  %64 = call noundef i32 @_ZNK15ImGuiTextBuffer4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%struct.anon, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i32 0, i32 14))
  %65 = sext i32 %64 to i64
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  store i64 %65, ptr %66, align 8, !tbaa !40
  br label %67

67:                                               ; preds = %63, %60
  %68 = call noundef ptr @_ZNK15ImGuiTextBuffer5c_strEv(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (%struct.anon, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i32 0, i32 14))
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  ret ptr %68
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN15ImGuiTextBuffer7reserveEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #3 align 2

declare void @_ZN15ImGuiTextBuffer7appendfEPKcz(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ...) #4

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 = { 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 = { noreturn nounwind }
attributes #7 = { 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, !23, i64 208}
!10 = !{!"_ZTSN7imnodes13EditorContextE", !11, i64 0, !18, i64 64, !20, i64 128, !15, i64 192, !22, i64 208, !15, i64 216, !15, i64 232, !7, i64 248, !24, i64 252}
!11 = !{!"_ZTSN7imnodes12_GLOBAL__N_110ObjectPoolINS0_8NodeDataEEE", !12, i64 0, !14, i64 16, !15, i64 32, !16, i64 48}
!12 = !{!"_ZTS8ImVectorIN7imnodes12_GLOBAL__N_18NodeDataEE", !13, i64 0, !13, i64 4, !6, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTS8ImVectorIbE", !13, i64 0, !13, i64 4, !6, i64 8}
!15 = !{!"_ZTS8ImVectorIiE", !13, i64 0, !13, i64 4, !6, i64 8}
!16 = !{!"_ZTS12ImGuiStorage", !17, i64 0}
!17 = !{!"_ZTS8ImVectorIN12ImGuiStorage16ImGuiStoragePairEE", !13, i64 0, !13, i64 4, !6, i64 8}
!18 = !{!"_ZTSN7imnodes12_GLOBAL__N_110ObjectPoolINS0_7PinDataEEE", !19, i64 0, !14, i64 16, !15, i64 32, !16, i64 48}
!19 = !{!"_ZTS8ImVectorIN7imnodes12_GLOBAL__N_17PinDataEE", !13, i64 0, !13, i64 4, !6, i64 8}
!20 = !{!"_ZTSN7imnodes12_GLOBAL__N_110ObjectPoolINS0_8LinkDataEEE", !21, i64 0, !14, i64 16, !15, i64 32, !16, i64 48}
!21 = !{!"_ZTS8ImVectorIN7imnodes12_GLOBAL__N_18LinkDataEE", !13, i64 0, !13, i64 4, !6, i64 8}
!22 = !{!"_ZTS6ImVec2", !23, i64 0, !23, i64 4}
!23 = !{!"float", !7, i64 0}
!24 = !{!"_ZTSN7imnodes12_GLOBAL__N_121ClickInteractionStateE", !25, i64 0, !27, i64 12}
!25 = !{!"_ZTSN7imnodes12_GLOBAL__N_121ClickInteractionState3$_1E", !13, i64 0, !26, i64 4, !7, i64 8}
!26 = !{!"_ZTSN7imnodes12_GLOBAL__N_113OptionalIndexE", !13, i64 0}
!27 = !{!"_ZTSN7imnodes12_GLOBAL__N_121ClickInteractionState3$_2E", !28, i64 0}
!28 = !{!"_ZTS6ImRect", !22, i64 0, !22, i64 8}
!29 = !{!10, !23, i64 212}
!30 = !{!13, !13, i64 0}
!31 = !{!32, !13, i64 0}
!32 = !{!"_ZTSN7imnodes12_GLOBAL__N_18NodeDataE", !13, i64 0, !22, i64 4, !28, i64 12, !28, i64 28, !33, i64 44, !34, i64 72, !15, i64 88, !35, i64 104}
!33 = !{!"_ZTSN7imnodes12_GLOBAL__N_18NodeData3$_3E", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24}
!34 = !{!"_ZTSN7imnodes12_GLOBAL__N_18NodeData3$_4E", !23, i64 0, !22, i64 4}
!35 = !{!"bool", !7, i64 0}
!36 = !{!32, !23, i64 4}
!37 = !{!32, !23, i64 8}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = !{!41, !41, i64 0}
!41 = !{!"long", !7, i64 0}


; 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.anon = type <{ ptr, ptr, ptr, %struct.ImGuiStorage, %struct.ImVector.0, %struct.ImVector.0, %struct.ImVec2, %struct.ImRect, i32, [4 x i8], %"struct.imnodes::IO", %"struct.imnodes::Style", %struct.ImVector.1, %struct.ImVector.2, %struct.ImGuiTextBuffer, i32, [4 x i8], %struct.ImVector.0, i32, i32, i32, %"struct.imnodes::(anonymous namespace)::OptionalIndex", %"struct.imnodes::(anonymous namespace)::OptionalIndex", %"struct.imnodes::(anonymous namespace)::OptionalIndex", i32, %"struct.imnodes::(anonymous namespace)::OptionalIndex", %"struct.imnodes::(anonymous namespace)::OptionalIndex", i32, i32, i8, [3 x i8], %struct.ImVec2, i8, i8, i8, i8, i8, [3 x i8] }>
%struct.ImGuiStorage = type { %struct.ImVector }
%struct.ImVector = type { i32, i32, ptr }
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%"struct.imnodes::IO" = type { %"struct.imnodes::IO::EmulateThreeButtonMouse", %"struct.imnodes::IO::LinkDetachWithModifierClick" }
%"struct.imnodes::IO::EmulateThreeButtonMouse" = type { i8, ptr }
%"struct.imnodes::IO::LinkDetachWithModifierClick" = type { ptr }
%"struct.imnodes::Style" = type { float, float, float, float, float, float, float, float, float, float, float, float, float, i32, [16 x i32] }
%struct.ImVector.1 = type { i32, i32, ptr }
%struct.ImVector.2 = type { i32, i32, ptr }
%struct.ImGuiTextBuffer = type { %struct.ImVector.3 }
%struct.ImVector.3 = type { i32, i32, ptr }
%struct.ImVector.0 = type { i32, i32, ptr }
%"struct.imnodes::(anonymous namespace)::OptionalIndex" = type { i32 }
%struct.ImVec2 = type { float, float }

@_ZN7imnodes12_GLOBAL__N_11gE = external hidden global %struct.anon, align 8
@.str.1 = external hidden unnamed_addr constant [111 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [19 x i8], align 1
@__PRETTY_FUNCTION__._ZN7imnodes26SaveEditorStateToIniStringEPKNS_13EditorContextEPm = external hidden unnamed_addr constant [91 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN7imnodes26SaveEditorStateToIniStringEPKNS_13EditorContextEPm(ptr noundef %0, ptr noundef writeonly %1) local_unnamed_addr #2 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.1, i32 noundef 2631, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN7imnodes26SaveEditorStateToIniStringEPKNS_13EditorContextEPm) #5
  unreachable

4:                                                ; preds = %2
  tail call void @_ZN15ImGuiTextBuffer5clearEv(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i64 280))
  %5 = tail call noundef i32 @_ZNK8ImVectorIN7imnodes12_GLOBAL__N_18NodeDataEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %6 = shl nsw i32 %5, 6
  tail call void @_ZN15ImGuiTextBuffer7reserveEi(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i64 280), i32 noundef %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 208
  %8 = load float, ptr %7, align 8, !tbaa !5
  %9 = fptosi float %8 to i32
  %10 = getelementptr inbounds i8, ptr %0, i64 212
  %11 = load float, ptr %10, align 4, !tbaa !28
  %12 = fptosi float %11 to i32
  tail call void (ptr, ptr, ...) @_ZN15ImGuiTextBuffer7appendfEPKcz(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i64 280), ptr noundef nonnull @.str.25, i32 noundef %9, i32 noundef %12)
  %13 = tail call noundef i32 @_ZNK8ImVectorIN7imnodes12_GLOBAL__N_18NodeDataEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %4
  %.not16 = icmp eq ptr %1, null
  br i1 %.not16, label %29, label %26

.lr.ph:                                           ; preds = %4, %.lr.ph
  %.017 = phi i32 [ %23, %.lr.ph ], [ 0, %4 ]
  %15 = tail call noundef nonnull align 8 dereferenceable(105) ptr @_ZNK8ImVectorIN7imnodes12_GLOBAL__N_18NodeDataEEixEi(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.017)
  %16 = load i32, ptr %15, align 8, !tbaa !29
  tail call void (ptr, ptr, ...) @_ZN15ImGuiTextBuffer7appendfEPKcz(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i64 280), ptr noundef nonnull @.str.26, i32 noundef %16)
  %17 = getelementptr inbounds i8, ptr %15, i64 4
  %18 = load float, ptr %17, align 4, !tbaa !34
  %19 = fptosi float %18 to i32
  %20 = getelementptr inbounds i8, ptr %15, i64 8
  %21 = load float, ptr %20, align 8, !tbaa !35
  %22 = fptosi float %21 to i32
  tail call void (ptr, ptr, ...) @_ZN15ImGuiTextBuffer7appendfEPKcz(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i64 280), ptr noundef nonnull @.str.27, i32 noundef %19, i32 noundef %22)
  %23 = add nuw nsw i32 %.017, 1
  %24 = tail call noundef i32 @_ZNK8ImVectorIN7imnodes12_GLOBAL__N_18NodeDataEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !36

26:                                               ; preds = %._crit_edge
  %27 = tail call noundef i32 @_ZNK15ImGuiTextBuffer4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i64 280))
  %28 = sext i32 %27 to i64
  store i64 %28, ptr %1, align 8, !tbaa !38
  br label %29

29:                                               ; preds = %26, %._crit_edge
  %30 = tail call noundef ptr @_ZNK15ImGuiTextBuffer5c_strEv(ptr noundef nonnull align 8 dereferenceable(16) getelementptr inbounds (i8, ptr @_ZN7imnodes12_GLOBAL__N_11gE, i64 280))
  ret ptr %30
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN15ImGuiTextBuffer7reserveEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #2 align 2

declare void @_ZN15ImGuiTextBuffer7appendfEPKcz(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK15ImGuiTextBuffer4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK15ImGuiTextBuffer5c_strEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

attributes #0 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { "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 = { noreturn 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, !22, i64 208}
!6 = !{!"_ZTSN7imnodes13EditorContextE", !7, i64 0, !17, i64 64, !19, i64 128, !14, i64 192, !21, i64 208, !14, i64 216, !14, i64 232, !10, i64 248, !23, i64 252}
!7 = !{!"_ZTSN7imnodes12_GLOBAL__N_110ObjectPoolINS0_8NodeDataEEE", !8, i64 0, !13, i64 16, !14, i64 32, !15, i64 48}
!8 = !{!"_ZTS8ImVectorIN7imnodes12_GLOBAL__N_18NodeDataEE", !9, i64 0, !9, i64 4, !12, i64 8}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"any pointer", !10, i64 0}
!13 = !{!"_ZTS8ImVectorIbE", !9, i64 0, !9, i64 4, !12, i64 8}
!14 = !{!"_ZTS8ImVectorIiE", !9, i64 0, !9, i64 4, !12, i64 8}
!15 = !{!"_ZTS12ImGuiStorage", !16, i64 0}
!16 = !{!"_ZTS8ImVectorIN12ImGuiStorage16ImGuiStoragePairEE", !9, i64 0, !9, i64 4, !12, i64 8}
!17 = !{!"_ZTSN7imnodes12_GLOBAL__N_110ObjectPoolINS0_7PinDataEEE", !18, i64 0, !13, i64 16, !14, i64 32, !15, i64 48}
!18 = !{!"_ZTS8ImVectorIN7imnodes12_GLOBAL__N_17PinDataEE", !9, i64 0, !9, i64 4, !12, i64 8}
!19 = !{!"_ZTSN7imnodes12_GLOBAL__N_110ObjectPoolINS0_8LinkDataEEE", !20, i64 0, !13, i64 16, !14, i64 32, !15, i64 48}
!20 = !{!"_ZTS8ImVectorIN7imnodes12_GLOBAL__N_18LinkDataEE", !9, i64 0, !9, i64 4, !12, i64 8}
!21 = !{!"_ZTS6ImVec2", !22, i64 0, !22, i64 4}
!22 = !{!"float", !10, i64 0}
!23 = !{!"_ZTSN7imnodes12_GLOBAL__N_121ClickInteractionStateE", !24, i64 0, !26, i64 12}
!24 = !{!"_ZTSN7imnodes12_GLOBAL__N_121ClickInteractionState3$_1E", !9, i64 0, !25, i64 4, !10, i64 8}
!25 = !{!"_ZTSN7imnodes12_GLOBAL__N_113OptionalIndexE", !9, i64 0}
!26 = !{!"_ZTSN7imnodes12_GLOBAL__N_121ClickInteractionState3$_2E", !27, i64 0}
!27 = !{!"_ZTS6ImRect", !21, i64 0, !21, i64 8}
!28 = !{!6, !22, i64 212}
!29 = !{!30, !9, i64 0}
!30 = !{!"_ZTSN7imnodes12_GLOBAL__N_18NodeDataE", !9, i64 0, !21, i64 4, !27, i64 12, !27, i64 28, !31, i64 44, !32, i64 72, !14, i64 88, !33, i64 104}
!31 = !{!"_ZTSN7imnodes12_GLOBAL__N_18NodeData3$_3E", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !9, i64 20, !9, i64 24}
!32 = !{!"_ZTSN7imnodes12_GLOBAL__N_18NodeData3$_4E", !22, i64 0, !21, i64 4}
!33 = !{!"bool", !10, i64 0}
!34 = !{!30, !22, i64 4}
!35 = !{!30, !22, i64 8}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!39, !39, i64 0}
!39 = !{!"long", !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass