; LLVM IR from unitreerobotics/kinect_teleoperate :: src/mujoco-3.1.5/simulate (platform_ui_adapter)

; 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.1" = type { double, double }
%"struct.std::pair" = type { i32, i32 }
%"class.mujoco::PlatformUIAdapter" = type <{ ptr, %struct.mjuiState_, i32, [4 x i8], ptr, ptr, %struct.mjrContext_, ptr, i32, [4 x i8] }>
%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 }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6mujoco17PlatformUIAdapter15UpdateMjuiStateEv(ptr noundef nonnull align 8 dereferenceable(2900) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair.1", align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair", align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = getelementptr inbounds ptr, ptr %11, i64 16
  %13 = load ptr, ptr %12, align 8
  %14 = call noundef zeroext i1 %13(ptr noundef nonnull align 8 dereferenceable(2900) %10)
  %15 = zext i1 %14 to i32
  %16 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %17 = getelementptr inbounds %struct.mjuiState_, ptr %16, i32 0, i32 4
  store i32 %15, ptr %17, align 4, !tbaa !11
  %18 = load ptr, ptr %10, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %18, i64 18
  %20 = load ptr, ptr %19, align 8
  %21 = call noundef zeroext i1 %20(ptr noundef nonnull align 8 dereferenceable(2900) %10)
  %22 = zext i1 %21 to i32
  %23 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %24 = getelementptr inbounds %struct.mjuiState_, ptr %23, i32 0, i32 5
  store i32 %22, ptr %24, align 8, !tbaa !18
  %25 = load ptr, ptr %10, align 8, !tbaa !9
  %26 = getelementptr inbounds ptr, ptr %25, i64 17
  %27 = load ptr, ptr %26, align 8
  %28 = call noundef zeroext i1 %27(ptr noundef nonnull align 8 dereferenceable(2900) %10)
  %29 = zext i1 %28 to i32
  %30 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %31 = getelementptr inbounds %struct.mjuiState_, ptr %30, i32 0, i32 6
  store i32 %29, ptr %31, align 4, !tbaa !19
  %32 = load ptr, ptr %10, align 8, !tbaa !9
  %33 = getelementptr inbounds ptr, ptr %32, i64 20
  %34 = load ptr, ptr %33, align 8
  %35 = call noundef zeroext i1 %34(ptr noundef nonnull align 8 dereferenceable(2900) %10)
  %36 = zext i1 %35 to i32
  %37 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %38 = getelementptr inbounds %struct.mjuiState_, ptr %37, i32 0, i32 16
  store i32 %36, ptr %38, align 8, !tbaa !20
  %39 = load ptr, ptr %10, align 8, !tbaa !9
  %40 = getelementptr inbounds ptr, ptr %39, i64 21
  %41 = load ptr, ptr %40, align 8
  %42 = call noundef zeroext i1 %41(ptr noundef nonnull align 8 dereferenceable(2900) %10)
  %43 = zext i1 %42 to i32
  %44 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %45 = getelementptr inbounds %struct.mjuiState_, ptr %44, i32 0, i32 17
  store i32 %43, ptr %45, align 4, !tbaa !21
  %46 = load ptr, ptr %10, align 8, !tbaa !9
  %47 = getelementptr inbounds ptr, ptr %46, i64 19
  %48 = load ptr, ptr %47, align 8
  %49 = call noundef zeroext i1 %48(ptr noundef nonnull align 8 dereferenceable(2900) %10)
  %50 = zext i1 %49 to i32
  %51 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %52 = getelementptr inbounds %struct.mjuiState_, ptr %51, i32 0, i32 18
  store i32 %50, ptr %52, align 8, !tbaa !22
  %53 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %54 = getelementptr inbounds %struct.mjuiState_, ptr %53, i32 0, i32 18
  %55 = load i32, ptr %54, align 8, !tbaa !22
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %69

57:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %58 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %59 = getelementptr inbounds %struct.mjuiState_, ptr %58, i32 0, i32 4
  %60 = load i32, ptr %59, align 4, !tbaa !11
  store i32 %60, ptr %3, align 4, !tbaa !23
  %61 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %62 = getelementptr inbounds %struct.mjuiState_, ptr %61, i32 0, i32 5
  %63 = load i32, ptr %62, align 8, !tbaa !18
  %64 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %65 = getelementptr inbounds %struct.mjuiState_, ptr %64, i32 0, i32 4
  store i32 %63, ptr %65, align 4, !tbaa !11
  %66 = load i32, ptr %3, align 4, !tbaa !23
  %67 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %68 = getelementptr inbounds %struct.mjuiState_, ptr %67, i32 0, i32 5
  store i32 %66, ptr %68, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %69

69:                                               ; preds = %57, %1
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #4
  %70 = load ptr, ptr %10, align 8, !tbaa !9
  %71 = getelementptr inbounds ptr, ptr %70, i64 4
  %72 = load ptr, ptr %71, align 8
  %73 = call { double, double } %72(ptr noundef nonnull align 8 dereferenceable(2900) %10)
  %74 = getelementptr inbounds { double, double }, ptr %4, i32 0, i32 0
  %75 = extractvalue { double, double } %73, 0
  store double %75, ptr %74, align 8
  %76 = getelementptr inbounds { double, double }, ptr %4, i32 0, i32 1
  %77 = extractvalue { double, double } %73, 1
  store double %77, ptr %76, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EddEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  store ptr %78, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EddEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  store ptr %79, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %80 = load ptr, ptr %10, align 8, !tbaa !9
  %81 = getelementptr inbounds ptr, ptr %80, i64 6
  %82 = load ptr, ptr %81, align 8
  %83 = call i64 %82(ptr noundef nonnull align 8 dereferenceable(2900) %10)
  store i64 %83, ptr %8, align 4
  %84 = getelementptr inbounds %"struct.std::pair", ptr %8, i32 0, i32 0
  %85 = load i32, ptr %84, align 4, !tbaa !24
  %86 = sitofp i32 %85 to double
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %87 = load ptr, ptr %10, align 8, !tbaa !9
  %88 = getelementptr inbounds ptr, ptr %87, i64 7
  %89 = load ptr, ptr %88, align 8
  %90 = call i64 %89(ptr noundef nonnull align 8 dereferenceable(2900) %10)
  store i64 %90, ptr %9, align 4
  %91 = getelementptr inbounds %"struct.std::pair", ptr %9, i32 0, i32 0
  %92 = load i32, ptr %91, align 4, !tbaa !24
  %93 = sitofp i32 %92 to double
  %94 = fdiv double %86, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  store double %94, ptr %7, align 8, !tbaa !26
  %95 = load double, ptr %7, align 8, !tbaa !26
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = load double, ptr %96, align 8, !tbaa !26
  %98 = fmul double %97, %95
  store double %98, ptr %96, align 8, !tbaa !26
  %99 = load double, ptr %7, align 8, !tbaa !26
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = load double, ptr %100, align 8, !tbaa !26
  %102 = fmul double %101, %99
  store double %102, ptr %100, align 8, !tbaa !26
  %103 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %104 = getelementptr inbounds %struct.mjuiState_, ptr %103, i32 0, i32 1
  %105 = getelementptr inbounds [25 x %struct.mjrRect_], ptr %104, i64 0, i64 0
  %106 = getelementptr inbounds %struct.mjrRect_, ptr %105, i32 0, i32 3
  %107 = load i32, ptr %106, align 4, !tbaa !27
  %108 = sitofp i32 %107 to double
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = load double, ptr %109, align 8, !tbaa !26
  %111 = fsub double %108, %110
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  store double %111, ptr %112, align 8, !tbaa !26
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = load double, ptr %113, align 8, !tbaa !26
  %115 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %116 = getelementptr inbounds %struct.mjuiState_, ptr %115, i32 0, i32 10
  %117 = load double, ptr %116, align 8, !tbaa !29
  %118 = fsub double %114, %117
  %119 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %120 = getelementptr inbounds %struct.mjuiState_, ptr %119, i32 0, i32 12
  store double %118, ptr %120, align 8, !tbaa !30
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = load double, ptr %121, align 8, !tbaa !26
  %123 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %124 = getelementptr inbounds %struct.mjuiState_, ptr %123, i32 0, i32 11
  %125 = load double, ptr %124, align 8, !tbaa !31
  %126 = fsub double %122, %125
  %127 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %128 = getelementptr inbounds %struct.mjuiState_, ptr %127, i32 0, i32 13
  store double %126, ptr %128, align 8, !tbaa !32
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = load double, ptr %129, align 8, !tbaa !26
  %131 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %132 = getelementptr inbounds %struct.mjuiState_, ptr %131, i32 0, i32 10
  store double %130, ptr %132, align 8, !tbaa !29
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = load double, ptr %133, align 8, !tbaa !26
  %135 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %136 = getelementptr inbounds %struct.mjuiState_, ptr %135, i32 0, i32 11
  store double %134, ptr %136, align 8, !tbaa !31
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = load double, ptr %137, align 8, !tbaa !26
  %139 = call i32 @mju_round(double noundef %138)
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = load double, ptr %140, align 8, !tbaa !26
  %142 = call i32 @mju_round(double noundef %141)
  %143 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %144 = getelementptr inbounds %struct.mjuiState_, ptr %143, i32 0, i32 0
  %145 = load i32, ptr %144, align 8, !tbaa !33
  %146 = sub nsw i32 %145, 1
  %147 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %148 = getelementptr inbounds %struct.mjuiState_, ptr %147, i32 0, i32 1
  %149 = getelementptr inbounds [25 x %struct.mjrRect_], ptr %148, i64 0, i64 0
  %150 = getelementptr inbounds %struct.mjrRect_, ptr %149, i64 1
  %151 = call i32 @mjr_findRect(i32 noundef %139, i32 noundef %142, i32 noundef %146, ptr noundef %150)
  %152 = add nsw i32 %151, 1
  %153 = getelementptr inbounds %"class.mujoco::PlatformUIAdapter", ptr %10, i32 0, i32 1
  %154 = getelementptr inbounds %struct.mjuiState_, ptr %153, i32 0, i32 21
  store i32 %152, ptr %154, align 8, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #4
  ret void
}

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

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

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

declare i32 @mjr_findRect(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #3

declare i32 @mju_round(double noundef) #3

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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !14, i64 428}
!12 = !{!"_ZTSN6mujoco17PlatformUIAdapterE", !13, i64 8, !14, i64 552, !6, i64 560, !6, i64 568, !16, i64 576, !6, i64 2888, !14, i64 2896}
!13 = !{!"_ZTS10mjuiState_", !14, i64 0, !7, i64 4, !6, 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, !6, i64 536}
!14 = !{!"int", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"_ZTS11mjrContext_", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !17, i64 16, !7, i64 20, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !7, i64 56, !7, i64 96, !7, 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, !7, i64 208, !7, i64 248, !7, i64 288, !7, i64 328, !14, i64 368, !7, i64 372, !7, 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, !6, i64 1224, !6, i64 1232, !6, i64 1240, !6, i64 1248, !7, i64 1256, !7, 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", !7, i64 0}
!18 = !{!12, !14, i64 432}
!19 = !{!12, !14, i64 436}
!20 = !{!12, !14, i64 504}
!21 = !{!12, !14, i64 508}
!22 = !{!12, !14, i64 512}
!23 = !{!14, !14, i64 0}
!24 = !{!25, !14, i64 0}
!25 = !{!"_ZTSSt4pairIiiE", !14, i64 0, !14, i64 4}
!26 = !{!15, !15, i64 0}
!27 = !{!28, !14, i64 12}
!28 = !{!"_ZTS8mjrRect_", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12}
!29 = !{!12, !15, i64 456}
!30 = !{!12, !15, i64 472}
!31 = !{!12, !15, i64 464}
!32 = !{!12, !15, i64 480}
!33 = !{!12, !14, i64 8}
!34 = !{!12, !14, i64 528}


; 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.1" = type { double, double }

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6mujoco17PlatformUIAdapter15UpdateMjuiStateEv(ptr noundef nonnull align 8 dereferenceable(2900) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"struct.std::pair.1", align 8
  %3 = load ptr, ptr %0, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 128
  %5 = load ptr, ptr %4, align 8
  %6 = tail call noundef zeroext i1 %5(ptr noundef nonnull align 8 dereferenceable(2900) %0)
  %7 = zext i1 %6 to i32
  %8 = getelementptr inbounds i8, ptr %0, i64 428
  store i32 %7, ptr %8, align 4, !tbaa !8
  %9 = load ptr, ptr %0, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %9, i64 144
  %11 = load ptr, ptr %10, align 8
  %12 = tail call noundef zeroext i1 %11(ptr noundef nonnull align 8 dereferenceable(2900) %0)
  %13 = zext i1 %12 to i32
  %14 = getelementptr inbounds i8, ptr %0, i64 432
  store i32 %13, ptr %14, align 8, !tbaa !17
  %15 = load ptr, ptr %0, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 136
  %17 = load ptr, ptr %16, align 8
  %18 = tail call noundef zeroext i1 %17(ptr noundef nonnull align 8 dereferenceable(2900) %0)
  %19 = zext i1 %18 to i32
  %20 = getelementptr inbounds i8, ptr %0, i64 436
  store i32 %19, ptr %20, align 4, !tbaa !18
  %21 = load ptr, ptr %0, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 160
  %23 = load ptr, ptr %22, align 8
  %24 = tail call noundef zeroext i1 %23(ptr noundef nonnull align 8 dereferenceable(2900) %0)
  %25 = zext i1 %24 to i32
  %26 = getelementptr inbounds i8, ptr %0, i64 504
  store i32 %25, ptr %26, align 8, !tbaa !19
  %27 = load ptr, ptr %0, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 168
  %29 = load ptr, ptr %28, align 8
  %30 = tail call noundef zeroext i1 %29(ptr noundef nonnull align 8 dereferenceable(2900) %0)
  %31 = zext i1 %30 to i32
  %32 = getelementptr inbounds i8, ptr %0, i64 508
  store i32 %31, ptr %32, align 4, !tbaa !20
  %33 = load ptr, ptr %0, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 152
  %35 = load ptr, ptr %34, align 8
  %36 = tail call noundef zeroext i1 %35(ptr noundef nonnull align 8 dereferenceable(2900) %0)
  %37 = zext i1 %36 to i32
  %38 = getelementptr inbounds i8, ptr %0, i64 512
  store i32 %37, ptr %38, align 8, !tbaa !21
  br i1 %36, label %39, label %42

39:                                               ; preds = %1
  %40 = load <2 x i32>, ptr %8, align 4, !tbaa !22
  %41 = shufflevector <2 x i32> %40, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i32> %41, ptr %8, align 4, !tbaa !22
  br label %42

42:                                               ; preds = %39, %1
  %43 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #4
  %44 = load ptr, ptr %0, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 32
  %46 = load ptr, ptr %45, align 8
  %47 = tail call { double, double } %46(ptr noundef nonnull align 8 dereferenceable(2900) %0)
  %48 = extractvalue { double, double } %47, 0
  store double %48, ptr %2, align 8
  %49 = getelementptr inbounds i8, ptr %2, i64 8
  %50 = extractvalue { double, double } %47, 1
  store double %50, ptr %49, align 8
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0EddEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1EddEONSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeEOS4_(ptr noundef nonnull align 8 dereferenceable(16) %2) #4
  %53 = load ptr, ptr %0, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 48
  %55 = load ptr, ptr %54, align 8
  %56 = call i64 %55(ptr noundef nonnull align 8 dereferenceable(2900) %0)
  %.sroa.01.0.extract.trunc = trunc i64 %56 to i32
  %57 = sitofp i32 %.sroa.01.0.extract.trunc to double
  %58 = load ptr, ptr %0, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 56
  %60 = load ptr, ptr %59, align 8
  %61 = call i64 %60(ptr noundef nonnull align 8 dereferenceable(2900) %0)
  %.sroa.0.0.extract.trunc = trunc i64 %61 to i32
  %62 = sitofp i32 %.sroa.0.0.extract.trunc to double
  %63 = fdiv double %57, %62
  %64 = load double, ptr %51, align 8, !tbaa !23
  %65 = fmul double %64, %63
  store double %65, ptr %51, align 8, !tbaa !23
  %66 = load double, ptr %52, align 8, !tbaa !23
  %67 = fmul double %66, %63
  %68 = getelementptr inbounds i8, ptr %0, i64 24
  %69 = load i32, ptr %68, align 8, !tbaa !24
  %70 = sitofp i32 %69 to double
  %71 = fsub double %70, %67
  store double %71, ptr %52, align 8, !tbaa !23
  %72 = load double, ptr %51, align 8, !tbaa !23
  %73 = getelementptr inbounds i8, ptr %0, i64 456
  %74 = load double, ptr %73, align 8, !tbaa !26
  %75 = fsub double %72, %74
  %76 = getelementptr inbounds i8, ptr %0, i64 472
  store double %75, ptr %76, align 8, !tbaa !27
  %77 = load double, ptr %52, align 8, !tbaa !23
  %78 = getelementptr inbounds i8, ptr %0, i64 464
  %79 = load double, ptr %78, align 8, !tbaa !28
  %80 = fsub double %77, %79
  %81 = getelementptr inbounds i8, ptr %0, i64 480
  store double %80, ptr %81, align 8, !tbaa !29
  %82 = load double, ptr %51, align 8, !tbaa !23
  store double %82, ptr %73, align 8, !tbaa !26
  %83 = load double, ptr %52, align 8, !tbaa !23
  store double %83, ptr %78, align 8, !tbaa !28
  %84 = load double, ptr %51, align 8, !tbaa !23
  %85 = call i32 @mju_round(double noundef %84)
  %86 = load double, ptr %52, align 8, !tbaa !23
  %87 = call i32 @mju_round(double noundef %86)
  %88 = load i32, ptr %43, align 8, !tbaa !30
  %89 = add nsw i32 %88, -1
  %90 = getelementptr inbounds i8, ptr %0, i64 28
  %91 = call i32 @mjr_findRect(i32 noundef %85, i32 noundef %87, i32 noundef %89, ptr noundef nonnull %90)
  %92 = add nsw i32 %91, 1
  %93 = getelementptr inbounds i8, ptr %0, i64 528
  store i32 %92, ptr %93, align 8, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #4
  ret void
}

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

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

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

declare i32 @mjr_findRect(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare i32 @mju_round(double noundef) local_unnamed_addr #3

attributes #0 = { mustprogress 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 = { 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 = { "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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !11, i64 428}
!9 = !{!"_ZTSN6mujoco17PlatformUIAdapterE", !10, i64 8, !11, i64 552, !13, i64 560, !13, i64 568, !15, i64 576, !13, i64 2888, !11, i64 2896}
!10 = !{!"_ZTS10mjuiState_", !11, i64 0, !12, i64 4, !13, i64 408, !11, i64 416, !11, i64 420, !11, i64 424, !11, i64 428, !11, i64 432, !11, i64 436, !14, i64 440, !14, i64 448, !14, i64 456, !14, i64 464, !14, i64 472, !14, i64 480, !14, i64 488, !11, i64 496, !11, i64 500, !11, i64 504, !11, i64 508, !14, i64 512, !11, i64 520, !11, i64 524, !11, i64 528, !11, i64 532, !13, i64 536}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"any pointer", !12, i64 0}
!14 = !{!"double", !12, i64 0}
!15 = !{!"_ZTS11mjrContext_", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16, !12, i64 20, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !12, i64 56, !12, i64 96, !12, i64 136, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !11, i64 192, !11, i64 196, !11, i64 200, !11, i64 204, !12, i64 208, !12, i64 248, !12, i64 288, !12, i64 328, !11, i64 368, !12, i64 372, !12, i64 772, !11, i64 1172, !11, i64 1176, !11, i64 1180, !11, i64 1184, !11, i64 1188, !11, i64 1192, !11, i64 1196, !11, i64 1200, !11, i64 1204, !11, i64 1208, !11, i64 1212, !11, i64 1216, !11, i64 1220, !13, i64 1224, !13, i64 1232, !13, i64 1240, !13, i64 1248, !12, i64 1256, !12, i64 1764, !11, i64 2272, !11, i64 2276, !11, i64 2280, !11, i64 2284, !11, i64 2288, !11, i64 2292, !11, i64 2296, !11, i64 2300, !11, i64 2304, !11, i64 2308}
!16 = !{!"float", !12, i64 0}
!17 = !{!9, !11, i64 432}
!18 = !{!9, !11, i64 436}
!19 = !{!9, !11, i64 504}
!20 = !{!9, !11, i64 508}
!21 = !{!9, !11, i64 512}
!22 = !{!11, !11, i64 0}
!23 = !{!14, !14, i64 0}
!24 = !{!25, !11, i64 12}
!25 = !{!"_ZTS8mjrRect_", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!26 = !{!9, !14, i64 456}
!27 = !{!9, !14, i64 472}
!28 = !{!9, !14, i64 464}
!29 = !{!9, !14, i64 480}
!30 = !{!9, !11, i64 8}
!31 = !{!9, !11, i64 528}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,TailCallElimPass