; LLVM IR from erwincoumans/tiny-differentiable-simulator :: third_party/dear_imgui/imgui.ll (ZN13ImGuiDockNodeC2Ej)

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16ImGuiWindowClassC2Ev(ptr noundef nonnull align 4 dereferenceable(26)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13ImGuiDockNodeC2Ej(ptr noundef nonnull align 8 dereferenceable(187) %0, i32 noundef %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %7 = load ptr, ptr %3, align 8
  %8 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 6
  call void @_ZN8ImVectorIP11ImGuiWindowEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8)
  %9 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 8
  invoke void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %10 unwind label %95

10:                                               ; preds = %2
  %11 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 9
  invoke void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %11)
          to label %12 unwind label %95

12:                                               ; preds = %10
  %13 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 10
  invoke void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %14 unwind label %95

14:                                               ; preds = %12
  %15 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 12
  invoke void @_ZN16ImGuiWindowClassC2Ev(ptr noundef nonnull align 4 dereferenceable(26) %15)
          to label %16 unwind label %95

16:                                               ; preds = %14
  %17 = load i32, ptr %4, align 4, !tbaa !9
  %18 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 0
  store i32 %17, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 2
  store i32 0, ptr %19, align 8, !tbaa !20
  %20 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 1
  store i32 0, ptr %20, align 4, !tbaa !21
  %21 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 5
  %22 = getelementptr inbounds [2 x ptr], ptr %21, i64 0, i64 1
  store ptr null, ptr %22, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 5
  %24 = getelementptr inbounds [2 x ptr], ptr %23, i64 0, i64 0
  store ptr null, ptr %24, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 4
  store ptr null, ptr %25, align 8, !tbaa !22
  %26 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 7
  store ptr null, ptr %26, align 8, !tbaa !23
  %27 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 11
  store i32 -1, ptr %27, align 8, !tbaa !24
  %28 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 13
  store i32 0, ptr %28, align 8, !tbaa !25
  %29 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 16
  store ptr null, ptr %29, align 8, !tbaa !26
  %30 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 15
  store ptr null, ptr %30, align 8, !tbaa !27
  %31 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 18
  store ptr null, ptr %31, align 8, !tbaa !28
  %32 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 17
  store ptr null, ptr %32, align 8, !tbaa !29
  %33 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 21
  store i32 -1, ptr %33, align 8, !tbaa !30
  %34 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 20
  store i32 -1, ptr %34, align 4, !tbaa !31
  %35 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 19
  store i32 -1, ptr %35, align 8, !tbaa !32
  %36 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 22
  store i32 0, ptr %36, align 4, !tbaa !33
  %37 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 23
  store i32 0, ptr %37, align 8, !tbaa !34
  %38 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 24
  store i32 0, ptr %38, align 4, !tbaa !35
  %39 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 25
  %40 = load i16, ptr %39, align 8
  %41 = and i16 %40, -57
  %42 = or i16 %41, 8
  store i16 %42, ptr %39, align 8
  %43 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 25
  %44 = load i16, ptr %43, align 8
  %45 = and i16 %44, -8
  %46 = or i16 %45, 1
  store i16 %46, ptr %43, align 8
  %47 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 25
  %48 = load i16, ptr %47, align 8
  %49 = and i16 %48, -449
  %50 = or i16 %49, 0
  store i16 %50, ptr %47, align 8
  %51 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 25
  %52 = load i16, ptr %51, align 8
  %53 = and i16 %52, -513
  %54 = or i16 %53, 512
  store i16 %54, ptr %51, align 8
  %55 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 25
  %56 = load i16, ptr %55, align 8
  %57 = and i16 %56, -8193
  %58 = or i16 %57, 0
  store i16 %58, ptr %55, align 8
  %59 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 25
  %60 = load i16, ptr %59, align 8
  %61 = and i16 %60, -4097
  %62 = or i16 %61, 0
  store i16 %62, ptr %59, align 8
  %63 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 25
  %64 = load i16, ptr %63, align 8
  %65 = and i16 %64, -2049
  %66 = or i16 %65, 0
  store i16 %66, ptr %63, align 8
  %67 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 25
  %68 = load i16, ptr %67, align 8
  %69 = and i16 %68, -1025
  %70 = or i16 %69, 0
  store i16 %70, ptr %67, align 8
  %71 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 26
  %72 = load i8, ptr %71, align 2
  %73 = and i8 %72, -5
  %74 = or i8 %73, 0
  store i8 %74, ptr %71, align 2
  %75 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 26
  %76 = load i8, ptr %75, align 2
  %77 = and i8 %76, -3
  %78 = or i8 %77, 0
  store i8 %78, ptr %75, align 2
  %79 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 26
  %80 = load i8, ptr %79, align 2
  %81 = and i8 %80, -2
  %82 = or i8 %81, 0
  store i8 %82, ptr %79, align 2
  %83 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 25
  %84 = load i16, ptr %83, align 8
  %85 = and i16 %84, 32767
  %86 = or i16 %85, 0
  store i16 %86, ptr %83, align 8
  %87 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 25
  %88 = load i16, ptr %87, align 8
  %89 = and i16 %88, -16385
  %90 = or i16 %89, 0
  store i16 %90, ptr %87, align 8
  %91 = getelementptr inbounds %struct.ImGuiDockNode, ptr %7, i32 0, i32 26
  %92 = load i8, ptr %91, align 2
  %93 = and i8 %92, -9
  %94 = or i8 %93, 0
  store i8 %94, ptr %91, align 2
  ret void

95:                                               ; preds = %14, %12, %10, %2
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %5, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %6, align 4
  call void @_ZN8ImVectorIP11ImGuiWindowED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #3
  br label %99

99:                                               ; preds = %95
  %100 = load ptr, ptr %5, align 8
  %101 = load i32, ptr %6, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103
}

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

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

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 = { 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 = { 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 0}
!12 = !{!"_ZTS13ImGuiDockNode", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !7, i64 24, !13, i64 40, !6, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !16, i64 88, !17, i64 92, !19, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !10, i64 160, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 184, !10, i64 184, !18, i64 185, !18, i64 185, !18, i64 185, !18, i64 185, !18, i64 185, !18, i64 185, !18, i64 185, !18, i64 186, !18, i64 186, !18, i64 186, !18, i64 186}
!13 = !{!"_ZTS8ImVectorIP11ImGuiWindowE", !10, i64 0, !10, i64 4, !6, i64 8}
!14 = !{!"_ZTS6ImVec2", !15, i64 0, !15, i64 4}
!15 = !{!"float", !7, i64 0}
!16 = !{!"_ZTS9ImGuiAxis", !7, i64 0}
!17 = !{!"_ZTS16ImGuiWindowClass", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !18, i64 24, !18, i64 25}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTS18ImGuiDockNodeState", !7, i64 0}
!20 = !{!12, !10, i64 8}
!21 = !{!12, !10, i64 4}
!22 = !{!12, !6, i64 16}
!23 = !{!12, !6, i64 56}
!24 = !{!12, !16, i64 88}
!25 = !{!12, !19, i64 120}
!26 = !{!12, !6, i64 136}
!27 = !{!12, !6, i64 128}
!28 = !{!12, !6, i64 152}
!29 = !{!12, !6, i64 144}
!30 = !{!12, !10, i64 168}
!31 = !{!12, !10, i64 164}
!32 = !{!12, !10, i64 160}
!33 = !{!12, !10, i64 172}
!34 = !{!12, !10, i64 176}
!35 = !{!12, !10, i64 180}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16ImGuiWindowClassC2Ev(ptr noundef nonnull align 4 dereferenceable(26)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN13ImGuiDockNodeC2Ej(ptr noundef nonnull align 8 dereferenceable(187) %0, i32 noundef %1) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @_ZN8ImVectorIP11ImGuiWindowEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 64
  tail call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %4)
  %5 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %5)
  %6 = getelementptr inbounds i8, ptr %0, i64 80
  tail call void @_ZN6ImVec2C2Ev(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %7 = getelementptr inbounds i8, ptr %0, i64 92
  tail call void @_ZN16ImGuiWindowClassC2Ev(ptr noundef nonnull align 4 dereferenceable(26) %7)
  store i32 %1, ptr %0, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 0, ptr %8, align 8, !tbaa !18
  %9 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 0, ptr %9, align 4, !tbaa !19
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = getelementptr inbounds i8, ptr %0, i64 56
  store ptr null, ptr %11, align 8, !tbaa !20
  %12 = getelementptr inbounds i8, ptr %0, i64 88
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %10, i8 0, i64 24, i1 false)
  store i32 -1, ptr %12, align 8, !tbaa !21
  %13 = getelementptr inbounds i8, ptr %0, i64 120
  store i32 0, ptr %13, align 8, !tbaa !22
  %14 = getelementptr inbounds i8, ptr %0, i64 128
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %14, i8 0, i64 32, i1 false)
  %15 = getelementptr inbounds i8, ptr %0, i64 160
  store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 0>, ptr %15, align 8, !tbaa !23
  %16 = getelementptr inbounds i8, ptr %0, i64 176
  store i32 0, ptr %16, align 8, !tbaa !24
  %17 = getelementptr inbounds i8, ptr %0, i64 180
  store i32 0, ptr %17, align 4, !tbaa !25
  %18 = getelementptr inbounds i8, ptr %0, i64 184
  %19 = getelementptr inbounds i8, ptr %0, i64 186
  %20 = load i8, ptr %19, align 2
  store i16 521, ptr %18, align 8
  %21 = and i8 %20, -16
  store i8 %21, ptr %19, align 2
  ret void
}

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !7, i64 0}
!6 = !{!"_ZTS13ImGuiDockNode", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !8, i64 24, !11, i64 40, !10, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !14, i64 88, !15, i64 92, !17, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !7, i64 160, !7, i64 164, !7, i64 168, !7, i64 172, !7, i64 176, !7, i64 180, !7, i64 184, !7, i64 184, !7, i64 184, !16, i64 185, !16, i64 185, !16, i64 185, !16, i64 185, !16, i64 185, !16, i64 185, !16, i64 185, !16, i64 186, !16, i64 186, !16, i64 186, !16, i64 186}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTS8ImVectorIP11ImGuiWindowE", !7, i64 0, !7, i64 4, !10, i64 8}
!12 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!13 = !{!"float", !8, i64 0}
!14 = !{!"_ZTS9ImGuiAxis", !8, i64 0}
!15 = !{!"_ZTS16ImGuiWindowClass", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !16, i64 24, !16, i64 25}
!16 = !{!"bool", !8, i64 0}
!17 = !{!"_ZTS18ImGuiDockNodeState", !8, i64 0}
!18 = !{!6, !7, i64 8}
!19 = !{!6, !7, i64 4}
!20 = !{!6, !10, i64 56}
!21 = !{!6, !14, i64 88}
!22 = !{!6, !17, i64 120}
!23 = !{!7, !7, i64 0}
!24 = !{!6, !7, i64 176}
!25 = !{!6, !7, i64 180}


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