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

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

%class.anon = type { i8 }
%class.anon.0 = type { i8 }
%class.anon.2 = type { i8 }
%class.anon.4 = type { i8 }
%class.anon.6 = type { i8 }
%class.anon.8 = type { i8 }
%class.anon.10 = type { i8 }
%"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 }
%"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 }

@_ZTVN6mujoco11GlfwAdapterE = external dso_local unnamed_addr constant { [29 x ptr] }, align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6mujoco11GlfwAdapterC2Ev(ptr noundef nonnull align 8 dereferenceable(2952) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %class.anon, align 1
  %6 = alloca %class.anon.0, align 1
  %7 = alloca %class.anon.2, align 1
  %8 = alloca %class.anon.4, align 1
  %9 = alloca %class.anon.6, align 1
  %10 = alloca %class.anon.8, align 1
  %11 = alloca %class.anon.10, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  call void @_ZN6mujoco17PlatformUIAdapterC2Ev(ptr noundef nonnull align 8 dereferenceable(2900) %12)
  store ptr getelementptr inbounds inrange(-16, 216) ({ [29 x ptr] }, ptr @_ZTVN6mujoco11GlfwAdapterE, i32 0, i32 0, i32 2), ptr %12, align 8, !tbaa !9
  %13 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 1
  %14 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 3
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %14)
          to label %15 unwind label %23

15:                                               ; preds = %1
  %16 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 4
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %17 unwind label %23

17:                                               ; preds = %15
  %18 = invoke noundef i32 @_ZN6mujoco12_GLOBAL__N_113MaybeGlfwInitEv()
          to label %19 unwind label %23

19:                                               ; preds = %17
  %20 = icmp ne i32 %18, 1
  br i1 %20, label %21, label %27

21:                                               ; preds = %19
  invoke void (ptr, ...) @mju_error(ptr noundef @.str)
          to label %22 unwind label %23

22:                                               ; preds = %21
  br label %27

23:                                               ; preds = %167, %165, %156, %147, %138, %129, %120, %111, %102, %97, %95, %86, %84, %75, %73, %71, %52, %49, %47, %43, %39, %37, %34, %32, %29, %27, %21, %17, %15, %1
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %3, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %4, align 4
  br label %201

27:                                               ; preds = %22, %19
  %28 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %29 unwind label %23

29:                                               ; preds = %27
  %30 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %28, i32 0, i32 31
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  invoke void %31(i32 noundef 135181, i32 noundef 4)
          to label %32 unwind label %23

32:                                               ; preds = %29
  %33 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %34 unwind label %23

34:                                               ; preds = %32
  %35 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %33, i32 0, i32 31
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  invoke void %36(i32 noundef 131076, i32 noundef 1)
          to label %37 unwind label %23

37:                                               ; preds = %34
  %38 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %39 unwind label %23

39:                                               ; preds = %37
  %40 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %38, i32 0, i32 9
  %41 = load ptr, ptr %40, align 8, !tbaa !13
  %42 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %43 unwind label %23

43:                                               ; preds = %39
  %44 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %42, i32 0, i32 7
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  %46 = invoke noundef ptr %45()
          to label %47 unwind label %23

47:                                               ; preds = %43
  %48 = invoke noundef ptr %41(ptr noundef %46)
          to label %49 unwind label %23

49:                                               ; preds = %47
  %50 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %50, ptr align 4 %48, i64 24, i1 false), !tbaa.struct !15
  %51 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %52 unwind label %23

52:                                               ; preds = %49
  %53 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %51, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  %55 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 1
  %56 = getelementptr inbounds %struct.GLFWvidmode, ptr %55, i32 0, i32 0
  %57 = load i32, ptr %56, align 4, !tbaa !19
  %58 = mul nsw i32 2, %57
  %59 = sdiv i32 %58, 3
  %60 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 1
  %61 = getelementptr inbounds %struct.GLFWvidmode, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !28
  %63 = mul nsw i32 2, %62
  %64 = sdiv i32 %63, 3
  %65 = invoke noundef ptr %54(i32 noundef %59, i32 noundef %64, ptr noundef @.str.1, ptr noundef null, ptr noundef null)
          to label %66 unwind label %23

66:                                               ; preds = %52
  %67 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  store ptr %65, ptr %67, align 8, !tbaa !29
  %68 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %69 = load ptr, ptr %68, align 8, !tbaa !29
  %70 = icmp ne ptr %69, null
  br i1 %70, label %73, label %71

71:                                               ; preds = %66
  invoke void (ptr, ...) @mju_error(ptr noundef @.str.2)
          to label %72 unwind label %23

72:                                               ; preds = %71
  br label %73

73:                                               ; preds = %72, %66
  %74 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %75 unwind label %23

75:                                               ; preds = %73
  %76 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %74, i32 0, i32 11
  %77 = load ptr, ptr %76, align 8, !tbaa !30
  %78 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !29
  %80 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 3
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 0
  %82 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 3
  %83 = getelementptr inbounds %"struct.std::pair", ptr %82, i32 0, i32 1
  invoke void %77(ptr noundef %79, ptr noundef %81, ptr noundef %83)
          to label %84 unwind label %23

84:                                               ; preds = %75
  %85 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %86 unwind label %23

86:                                               ; preds = %84
  %87 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %85, i32 0, i32 12
  %88 = load ptr, ptr %87, align 8, !tbaa !31
  %89 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %90 = load ptr, ptr %89, align 8, !tbaa !29
  %91 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 4
  %92 = getelementptr inbounds %"struct.std::pair", ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 4
  %94 = getelementptr inbounds %"struct.std::pair", ptr %93, i32 0, i32 1
  invoke void %88(ptr noundef %90, ptr noundef %92, ptr noundef %94)
          to label %95 unwind label %23

95:                                               ; preds = %86
  %96 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %97 unwind label %23

97:                                               ; preds = %95
  %98 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %96, i32 0, i32 27
  %99 = load ptr, ptr %98, align 8, !tbaa !32
  %100 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !29
  invoke void %99(ptr noundef %101, ptr noundef %12)
          to label %102 unwind label %23

102:                                              ; preds = %97
  %103 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %104 unwind label %23

104:                                              ; preds = %102
  %105 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %103, i32 0, i32 19
  %106 = load ptr, ptr %105, align 8, !tbaa !33
  %107 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  %109 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_0cvPFvP10GLFWwindowiPPKcEEv"(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  %110 = invoke noundef ptr %106(ptr noundef %108, ptr noundef %109)
          to label %111 unwind label %173

111:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  %112 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %113 unwind label %23

113:                                              ; preds = %111
  %114 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %112, i32 0, i32 20
  %115 = load ptr, ptr %114, align 8, !tbaa !34
  %116 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  %118 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_1cvPFvP10GLFWwindowiiiiEEv"(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  %119 = invoke noundef ptr %115(ptr noundef %117, ptr noundef %118)
          to label %120 unwind label %177

120:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  %121 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %122 unwind label %23

122:                                              ; preds = %120
  %123 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %121, i32 0, i32 21
  %124 = load ptr, ptr %123, align 8, !tbaa !35
  %125 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %126 = load ptr, ptr %125, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  %127 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_2cvPFvP10GLFWwindowiiiEEv"(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  %128 = invoke noundef ptr %124(ptr noundef %126, ptr noundef %127)
          to label %129 unwind label %181

129:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  %130 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %131 unwind label %23

131:                                              ; preds = %129
  %132 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %130, i32 0, i32 18
  %133 = load ptr, ptr %132, align 8, !tbaa !36
  %134 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %135 = load ptr, ptr %134, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  %136 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_3cvPFvP10GLFWwindowddEEv"(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  %137 = invoke noundef ptr %133(ptr noundef %135, ptr noundef %136)
          to label %138 unwind label %185

138:                                              ; preds = %131
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  %139 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %140 unwind label %23

140:                                              ; preds = %138
  %141 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %139, i32 0, i32 22
  %142 = load ptr, ptr %141, align 8, !tbaa !37
  %143 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  %145 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_4cvPFvP10GLFWwindowddEEv"(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  %146 = invoke noundef ptr %142(ptr noundef %144, ptr noundef %145)
          to label %147 unwind label %189

147:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  %148 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %149 unwind label %23

149:                                              ; preds = %147
  %150 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %148, i32 0, i32 24
  %151 = load ptr, ptr %150, align 8, !tbaa !38
  %152 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %153 = load ptr, ptr %152, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  %154 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_5cvPFvP10GLFWwindowEEv"(ptr noundef nonnull align 1 dereferenceable(1) %10) #6
  %155 = invoke noundef ptr %151(ptr noundef %153, ptr noundef %154)
          to label %156 unwind label %193

156:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  %157 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %158 unwind label %23

158:                                              ; preds = %156
  %159 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %157, i32 0, i32 25
  %160 = load ptr, ptr %159, align 8, !tbaa !39
  %161 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %162 = load ptr, ptr %161, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  %163 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_6cvPFvP10GLFWwindowiiEEv"(ptr noundef nonnull align 1 dereferenceable(1) %11) #6
  %164 = invoke noundef ptr %160(ptr noundef %162, ptr noundef %163)
          to label %165 unwind label %197

165:                                              ; preds = %158
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  %166 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %167 unwind label %23

167:                                              ; preds = %165
  %168 = getelementptr inbounds %"struct.mujoco::Glfw", ptr %166, i32 0, i32 15
  %169 = load ptr, ptr %168, align 8, !tbaa !40
  %170 = getelementptr inbounds %"class.mujoco::GlfwAdapter", ptr %12, i32 0, i32 2
  %171 = load ptr, ptr %170, align 8, !tbaa !29
  invoke void %169(ptr noundef %171)
          to label %172 unwind label %23

172:                                              ; preds = %167
  ret void

173:                                              ; preds = %104
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %3, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  br label %201

177:                                              ; preds = %113
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %3, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  br label %201

181:                                              ; preds = %122
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %3, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  br label %201

185:                                              ; preds = %131
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %3, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  br label %201

189:                                              ; preds = %140
  %190 = landingpad { ptr, i32 }
          cleanup
  %191 = extractvalue { ptr, i32 } %190, 0
  store ptr %191, ptr %3, align 8
  %192 = extractvalue { ptr, i32 } %190, 1
  store i32 %192, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  br label %201

193:                                              ; preds = %149
  %194 = landingpad { ptr, i32 }
          cleanup
  %195 = extractvalue { ptr, i32 } %194, 0
  store ptr %195, ptr %3, align 8
  %196 = extractvalue { ptr, i32 } %194, 1
  store i32 %196, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  br label %201

197:                                              ; preds = %158
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %3, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  br label %201

201:                                              ; preds = %197, %193, %189, %185, %181, %177, %173, %23
  call void @_ZN6mujoco17PlatformUIAdapterD2Ev(ptr noundef nonnull align 8 dereferenceable(2900) %12) #6
  br label %202

202:                                              ; preds = %201
  %203 = load ptr, ptr %3, align 8
  %204 = load i32, ptr %4, align 4
  %205 = insertvalue { ptr, i32 } poison, ptr %203, 0
  %206 = insertvalue { ptr, i32 } %205, i32 %204, 1
  resume { ptr, i32 } %206
}

declare void @_ZN6mujoco17PlatformUIAdapterC2Ev(ptr noundef nonnull align 8 dereferenceable(2900)) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN6mujoco12_GLOBAL__N_113MaybeGlfwInitEv() #0

declare void @mju_error(ptr noundef, ...) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_0cvPFvP10GLFWwindowiPPKcEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_1cvPFvP10GLFWwindowiiiiEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_2cvPFvP10GLFWwindowiiiEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_3cvPFvP10GLFWwindowddEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_4cvPFvP10GLFWwindowddEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_5cvPFvP10GLFWwindowEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_6cvPFvP10GLFWwindowiiEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #5 align 2

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

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


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

%class.anon = type { i8 }
%class.anon.0 = type { i8 }
%class.anon.2 = type { i8 }
%class.anon.4 = type { i8 }
%class.anon.6 = type { i8 }
%class.anon.8 = type { i8 }
%class.anon.10 = type { i8 }

@_ZTVN6mujoco11GlfwAdapterE = external dso_local unnamed_addr constant { [29 x ptr] }, align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6mujoco11GlfwAdapterC2Ev(ptr noundef nonnull align 8 dereferenceable(2952) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.anon, align 1
  %3 = alloca %class.anon.0, align 1
  %4 = alloca %class.anon.2, align 1
  %5 = alloca %class.anon.4, align 1
  %6 = alloca %class.anon.6, align 1
  %7 = alloca %class.anon.8, align 1
  %8 = alloca %class.anon.10, align 1
  tail call void @_ZN6mujoco17PlatformUIAdapterC2Ev(ptr noundef nonnull align 8 dereferenceable(2900) %0)
  store ptr getelementptr inbounds inrange(-16, 216) (i8, ptr @_ZTVN6mujoco11GlfwAdapterE, i64 16), ptr %0, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 2936
  tail call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
  %10 = getelementptr inbounds i8, ptr %0, i64 2944
  tail call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %10)
  %11 = invoke noundef i32 @_ZN6mujoco12_GLOBAL__N_113MaybeGlfwInitEv()
          to label %12 unwind label %14

12:                                               ; preds = %1
  %.not = icmp eq i32 %11, 1
  br i1 %.not, label %16, label %13

13:                                               ; preds = %12
  invoke void (ptr, ...) @mju_error(ptr noundef nonnull @.str)
          to label %16 unwind label %14

14:                                               ; preds = %132, %130, %122, %114, %106, %98, %90, %82, %74, %70, %68, %63, %61, %56, %54, %53, %41, %38, %36, %32, %28, %26, %23, %21, %18, %16, %13, %1
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %151

16:                                               ; preds = %13, %12
  %17 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %18 unwind label %14

18:                                               ; preds = %16
  %19 = getelementptr inbounds i8, ptr %17, i64 248
  %20 = load ptr, ptr %19, align 8, !tbaa !8
  invoke void %20(i32 noundef 135181, i32 noundef 4)
          to label %21 unwind label %14

21:                                               ; preds = %18
  %22 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %23 unwind label %14

23:                                               ; preds = %21
  %24 = getelementptr inbounds i8, ptr %22, i64 248
  %25 = load ptr, ptr %24, align 8, !tbaa !8
  invoke void %25(i32 noundef 131076, i32 noundef 1)
          to label %26 unwind label %14

26:                                               ; preds = %23
  %27 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %28 unwind label %14

28:                                               ; preds = %26
  %29 = getelementptr inbounds i8, ptr %27, i64 72
  %30 = load ptr, ptr %29, align 8, !tbaa !12
  %31 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %32 unwind label %14

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %31, i64 56
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %35 = invoke noundef ptr %34()
          to label %36 unwind label %14

36:                                               ; preds = %32
  %37 = invoke noundef ptr %30(ptr noundef %35)
          to label %38 unwind label %14

38:                                               ; preds = %36
  %39 = getelementptr inbounds i8, ptr %0, i64 2900
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) %39, ptr noundef nonnull align 4 dereferenceable(24) %37, i64 24, i1 false), !tbaa.struct !14
  %40 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %41 unwind label %14

41:                                               ; preds = %38
  %42 = load ptr, ptr %40, align 8, !tbaa !17
  %43 = load i32, ptr %39, align 4, !tbaa !18
  %44 = shl nsw i32 %43, 1
  %45 = sdiv i32 %44, 3
  %46 = getelementptr inbounds i8, ptr %0, i64 2904
  %47 = load i32, ptr %46, align 8, !tbaa !27
  %48 = shl nsw i32 %47, 1
  %49 = sdiv i32 %48, 3
  %50 = invoke noundef ptr %42(i32 noundef %45, i32 noundef %49, ptr noundef nonnull @.str.1, ptr noundef null, ptr noundef null)
          to label %51 unwind label %14

51:                                               ; preds = %41
  %52 = getelementptr inbounds i8, ptr %0, i64 2928
  store ptr %50, ptr %52, align 8, !tbaa !28
  %.not3 = icmp eq ptr %50, null
  br i1 %.not3, label %53, label %54

53:                                               ; preds = %51
  invoke void (ptr, ...) @mju_error(ptr noundef nonnull @.str.2)
          to label %54 unwind label %14

54:                                               ; preds = %53, %51
  %55 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %56 unwind label %14

56:                                               ; preds = %54
  %57 = getelementptr inbounds i8, ptr %55, i64 88
  %58 = load ptr, ptr %57, align 8, !tbaa !29
  %59 = load ptr, ptr %52, align 8, !tbaa !28
  %60 = getelementptr inbounds i8, ptr %0, i64 2940
  invoke void %58(ptr noundef %59, ptr noundef nonnull %9, ptr noundef nonnull %60)
          to label %61 unwind label %14

61:                                               ; preds = %56
  %62 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %63 unwind label %14

63:                                               ; preds = %61
  %64 = getelementptr inbounds i8, ptr %62, i64 96
  %65 = load ptr, ptr %64, align 8, !tbaa !30
  %66 = load ptr, ptr %52, align 8, !tbaa !28
  %67 = getelementptr inbounds i8, ptr %0, i64 2948
  invoke void %65(ptr noundef %66, ptr noundef nonnull %10, ptr noundef nonnull %67)
          to label %68 unwind label %14

68:                                               ; preds = %63
  %69 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %70 unwind label %14

70:                                               ; preds = %68
  %71 = getelementptr inbounds i8, ptr %69, i64 216
  %72 = load ptr, ptr %71, align 8, !tbaa !31
  %73 = load ptr, ptr %52, align 8, !tbaa !28
  invoke void %72(ptr noundef %73, ptr noundef nonnull %0)
          to label %74 unwind label %14

74:                                               ; preds = %70
  %75 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %76 unwind label %14

76:                                               ; preds = %74
  %77 = getelementptr inbounds i8, ptr %75, i64 152
  %78 = load ptr, ptr %77, align 8, !tbaa !32
  %79 = load ptr, ptr %52, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #6
  %80 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_0cvPFvP10GLFWwindowiPPKcEEv"(ptr noundef nonnull align 1 dereferenceable(1) %2) #6
  %81 = invoke noundef ptr %78(ptr noundef %79, ptr noundef %80)
          to label %82 unwind label %137

82:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  %83 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %84 unwind label %14

84:                                               ; preds = %82
  %85 = getelementptr inbounds i8, ptr %83, i64 160
  %86 = load ptr, ptr %85, align 8, !tbaa !33
  %87 = load ptr, ptr %52, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  %88 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_1cvPFvP10GLFWwindowiiiiEEv"(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  %89 = invoke noundef ptr %86(ptr noundef %87, ptr noundef %88)
          to label %90 unwind label %139

90:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  %91 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %92 unwind label %14

92:                                               ; preds = %90
  %93 = getelementptr inbounds i8, ptr %91, i64 168
  %94 = load ptr, ptr %93, align 8, !tbaa !34
  %95 = load ptr, ptr %52, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  %96 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_2cvPFvP10GLFWwindowiiiEEv"(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  %97 = invoke noundef ptr %94(ptr noundef %95, ptr noundef %96)
          to label %98 unwind label %141

98:                                               ; preds = %92
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  %99 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %100 unwind label %14

100:                                              ; preds = %98
  %101 = getelementptr inbounds i8, ptr %99, i64 144
  %102 = load ptr, ptr %101, align 8, !tbaa !35
  %103 = load ptr, ptr %52, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  %104 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_3cvPFvP10GLFWwindowddEEv"(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  %105 = invoke noundef ptr %102(ptr noundef %103, ptr noundef %104)
          to label %106 unwind label %143

106:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  %107 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %108 unwind label %14

108:                                              ; preds = %106
  %109 = getelementptr inbounds i8, ptr %107, i64 176
  %110 = load ptr, ptr %109, align 8, !tbaa !36
  %111 = load ptr, ptr %52, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  %112 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_4cvPFvP10GLFWwindowddEEv"(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  %113 = invoke noundef ptr %110(ptr noundef %111, ptr noundef %112)
          to label %114 unwind label %145

114:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  %115 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %116 unwind label %14

116:                                              ; preds = %114
  %117 = getelementptr inbounds i8, ptr %115, i64 192
  %118 = load ptr, ptr %117, align 8, !tbaa !37
  %119 = load ptr, ptr %52, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #6
  %120 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_5cvPFvP10GLFWwindowEEv"(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  %121 = invoke noundef ptr %118(ptr noundef %119, ptr noundef %120)
          to label %122 unwind label %147

122:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  %123 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %124 unwind label %14

124:                                              ; preds = %122
  %125 = getelementptr inbounds i8, ptr %123, i64 200
  %126 = load ptr, ptr %125, align 8, !tbaa !38
  %127 = load ptr, ptr %52, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #6
  %128 = call noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_6cvPFvP10GLFWwindowiiEEv"(ptr noundef nonnull align 1 dereferenceable(1) %8) #6
  %129 = invoke noundef ptr %126(ptr noundef %127, ptr noundef %128)
          to label %130 unwind label %149

130:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  %131 = invoke noundef nonnull align 8 dereferenceable(264) ptr @_ZN6mujoco4GlfwEPv(ptr noundef null)
          to label %132 unwind label %14

132:                                              ; preds = %130
  %133 = getelementptr inbounds i8, ptr %131, i64 120
  %134 = load ptr, ptr %133, align 8, !tbaa !39
  %135 = load ptr, ptr %52, align 8, !tbaa !28
  invoke void %134(ptr noundef %135)
          to label %136 unwind label %14

136:                                              ; preds = %132
  ret void

137:                                              ; preds = %76
  %138 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #6
  br label %151

139:                                              ; preds = %84
  %140 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  br label %151

141:                                              ; preds = %92
  %142 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %151

143:                                              ; preds = %100
  %144 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  br label %151

145:                                              ; preds = %108
  %146 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  br label %151

147:                                              ; preds = %116
  %148 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  br label %151

149:                                              ; preds = %124
  %150 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  br label %151

151:                                              ; preds = %149, %147, %145, %143, %141, %139, %137, %14
  %.pn = phi { ptr, i32 } [ %15, %14 ], [ %150, %149 ], [ %148, %147 ], [ %146, %145 ], [ %144, %143 ], [ %142, %141 ], [ %140, %139 ], [ %138, %137 ]
  call void @_ZN6mujoco17PlatformUIAdapterD2Ev(ptr noundef nonnull align 8 dereferenceable(2900) %0) #6
  resume { ptr, i32 } %.pn
}

declare void @_ZN6mujoco17PlatformUIAdapterC2Ev(ptr noundef nonnull align 8 dereferenceable(2900)) unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN6mujoco12_GLOBAL__N_113MaybeGlfwInitEv() local_unnamed_addr #0

declare void @mju_error(ptr noundef, ...) local_unnamed_addr #1

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_0cvPFvP10GLFWwindowiPPKcEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_1cvPFvP10GLFWwindowiiiiEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_2cvPFvP10GLFWwindowiiiEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_3cvPFvP10GLFWwindowddEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_4cvPFvP10GLFWwindowddEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_5cvPFvP10GLFWwindowEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZZN6mujoco11GlfwAdapterC1EvENK3$_6cvPFvP10GLFWwindowiiEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5 align 2

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

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


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