; LLVM IR from unitreerobotics/kinect_teleoperate :: src/mujoco-3.1.5/simulate/glfw_adapter.ll (ZNK6mujoco11GlfwAdapter13GetWindowSizeEv)

; 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.std::pair" = type { i32, i32 }
%"struct.mujoco::Glfw" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.mujoco::GlfwAdapter" = type { %"class.mujoco::PlatformUIAdapter.base", %struct.GLFWvidmode, ptr, %"struct.std::pair", %"struct.std::pair" }
%"class.mujoco::PlatformUIAdapter.base" = type <{ ptr, %struct.mjuiState_, i32, [4 x i8], ptr, ptr, %struct.mjrContext_, ptr, i32 }>
%struct.mjuiState_ = type { i32, [25 x %struct.mjrRect_], ptr, i32, i32, i32, i32, i32, i32, double, double, double, double, double, double, double, i32, i32, i32, i32, double, i32, i32, i32, i32, ptr }
%struct.mjrRect_ = type { i32, i32, i32, i32 }
%struct.mjrContext_ = type { float, float, float, float, float, [4 x float], i32, i32, i32, i32, i32, [10 x i32], [10 x i32], [10 x i32], i32, i32, i32, i32, i32, i32, i32, i32, [10 x i32], [10 x i32], [10 x i32], [10 x i32], i32, [100 x i32], [100 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, [127 x i32], [127 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.GLFWvidmode = type { i32, i32, i32, i32, i32, i32 }

declare noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef) #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local i64 @_ZNK6mujoco11GlfwAdapter13GetWindowSizeEv(ptr noundef nonnull align 8 dereferenceable(2952) %0) unnamed_addr #3 align 2 {
  %2 = alloca %"struct.std::pair", align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %7 = call noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
  %8 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %7, i32 0, i32 12
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %6, i32 0, i32 2
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  call void %9(ptr noundef %11, ptr noundef %4, ptr noundef %5)
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %12 = load i64, ptr %2, align 4
  ret i64 %12
}

attributes #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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, !6, i64 96}
!10 = !{!"_ZTSN6mujoco4GlfwE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256}
!11 = !{!12, !6, i64 2928}
!12 = !{!"_ZTSN6mujoco11GlfwAdapterE", !13, i64 0, !19, i64 2900, !6, i64 2928, !20, i64 2936, !20, i64 2944}
!13 = !{!"_ZTSN6mujoco17PlatformUIAdapterE", !14, i64 8, !15, i64 552, !6, i64 560, !6, i64 568, !17, i64 576, !6, i64 2888, !15, i64 2896}
!14 = !{!"_ZTS10mjuiState_", !15, i64 0, !7, i64 4, !6, i64 408, !15, i64 416, !15, i64 420, !15, i64 424, !15, i64 428, !15, i64 432, !15, i64 436, !16, i64 440, !16, i64 448, !16, i64 456, !16, i64 464, !16, i64 472, !16, i64 480, !16, i64 488, !15, i64 496, !15, i64 500, !15, i64 504, !15, i64 508, !16, i64 512, !15, i64 520, !15, i64 524, !15, i64 528, !15, i64 532, !6, i64 536}
!15 = !{!"int", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"_ZTS11mjrContext_", !18, i64 0, !18, i64 4, !18, i64 8, !18, i64 12, !18, i64 16, !7, i64 20, !15, i64 36, !15, i64 40, !15, i64 44, !15, i64 48, !15, i64 52, !7, i64 56, !7, i64 96, !7, i64 136, !15, i64 176, !15, i64 180, !15, i64 184, !15, i64 188, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !7, i64 208, !7, i64 248, !7, i64 288, !7, i64 328, !15, i64 368, !7, i64 372, !7, i64 772, !15, i64 1172, !15, i64 1176, !15, i64 1180, !15, i64 1184, !15, i64 1188, !15, i64 1192, !15, i64 1196, !15, i64 1200, !15, i64 1204, !15, i64 1208, !15, i64 1212, !15, i64 1216, !15, i64 1220, !6, i64 1224, !6, i64 1232, !6, i64 1240, !6, i64 1248, !7, i64 1256, !7, i64 1764, !15, i64 2272, !15, i64 2276, !15, i64 2280, !15, i64 2284, !15, i64 2288, !15, i64 2292, !15, i64 2296, !15, i64 2300, !15, i64 2304, !15, i64 2308}
!18 = !{!"float", !7, i64 0}
!19 = !{!"_ZTS11GLFWvidmode", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!20 = !{!"_ZTSSt4pairIiiE", !15, i64 0, !15, i64 4}


; 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.std::pair" = type { i32, i32 }

declare noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local i64 @_ZNK6mujoco11GlfwAdapter13GetWindowSizeEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(2952) %0) unnamed_addr #3 align 2 {
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %5 = tail call noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
  %6 = getelementptr inbounds i8, ptr %5, i64 96
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 2928
  %9 = load ptr, ptr %8, align 8, !tbaa !10
  call void %7(ptr noundef %9, ptr noundef nonnull %3, ptr noundef nonnull %4)
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %10 = load i64, ptr %2, align 8
  ret i64 %10
}

attributes #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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, !7, i64 96}
!6 = !{!"_ZTSN6mujoco4GlfwE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 2928}
!11 = !{!"_ZTSN6mujoco11GlfwAdapterE", !12, i64 0, !18, i64 2900, !7, i64 2928, !19, i64 2936, !19, i64 2944}
!12 = !{!"_ZTSN6mujoco17PlatformUIAdapterE", !13, i64 8, !14, i64 552, !7, i64 560, !7, i64 568, !16, i64 576, !7, i64 2888, !14, i64 2896}
!13 = !{!"_ZTS10mjuiState_", !14, i64 0, !8, i64 4, !7, i64 408, !14, i64 416, !14, i64 420, !14, i64 424, !14, i64 428, !14, i64 432, !14, i64 436, !15, i64 440, !15, i64 448, !15, i64 456, !15, i64 464, !15, i64 472, !15, i64 480, !15, i64 488, !14, i64 496, !14, i64 500, !14, i64 504, !14, i64 508, !15, i64 512, !14, i64 520, !14, i64 524, !14, i64 528, !14, i64 532, !7, i64 536}
!14 = !{!"int", !8, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = !{!"_ZTS11mjrContext_", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !17, i64 16, !8, i64 20, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !8, i64 56, !8, i64 96, !8, i64 136, !14, i64 176, !14, i64 180, !14, i64 184, !14, i64 188, !14, i64 192, !14, i64 196, !14, i64 200, !14, i64 204, !8, i64 208, !8, i64 248, !8, i64 288, !8, i64 328, !14, i64 368, !8, i64 372, !8, i64 772, !14, i64 1172, !14, i64 1176, !14, i64 1180, !14, i64 1184, !14, i64 1188, !14, i64 1192, !14, i64 1196, !14, i64 1200, !14, i64 1204, !14, i64 1208, !14, i64 1212, !14, i64 1216, !14, i64 1220, !7, i64 1224, !7, i64 1232, !7, i64 1240, !7, i64 1248, !8, i64 1256, !8, i64 1764, !14, i64 2272, !14, i64 2276, !14, i64 2280, !14, i64 2284, !14, i64 2288, !14, i64 2292, !14, i64 2296, !14, i64 2300, !14, i64 2304, !14, i64 2308}
!17 = !{!"float", !8, i64 0}
!18 = !{!"_ZTS11GLFWvidmode", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20}
!19 = !{!"_ZTSSt4pairIiiE", !14, i64 0, !14, i64 4}


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