; LLVM IR from unitreerobotics/kinect_teleoperate :: src/mujoco-3.1.5/sample (record)

; 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.mjvScene_ = type { i32, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i32, ptr, ptr, ptr, ptr, ptr, i32, [100 x %struct.mjvLight_], [2 x %struct.mjvGLCamera_], i8, [3 x float], [4 x float], float, i32, [10 x i8], i32, [3 x float] }
%struct.mjvLight_ = type { [3 x float], [3 x float], [3 x float], float, float, [3 x float], [3 x float], [3 x float], i8, i8, i8, float }
%struct.mjvGLCamera_ = type { [3 x float], [3 x float], [3 x float], float, float, float, float, float, float }
%struct.mjvCamera_ = type { i32, i32, i32, [3 x double], double, double, double }
%struct.mjvOption_ = type { i32, i32, [6 x i8], [6 x i8], [6 x i8], [6 x i8], [6 x i8], [6 x i8], [6 x i8], [32 x i8], 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.mjrRect_ = type { i32, i32, i32, i32 }
%struct.mjData_ = type { i64, i64, i32, i64, i64, i64, i64, [128 x i64], i64, i32, i32, [8 x %struct.mjWarningStat_], [15 x %struct.mjTimerStat_], [4000 x %struct.mjSolverStat_], i32, [20 x i32], [20 x i32], [2 x double], i32, i32, i32, i32, i32, i32, i32, double, [2 x double], 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, 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, 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, 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, ptr, i64 }
%struct.mjWarningStat_ = type { i32, i32 }
%struct.mjTimerStat_ = type { double, i32 }
%struct.mjSolverStat_ = type { double, double, double, i32, i32, i32, i32 }

@m = external dso_local global ptr, align 8
@d = external dso_local global ptr, align 8
@scn = external dso_local global %struct.mjvScene_, align 8
@cam = external dso_local global %struct.mjvCamera_, align 8
@opt = external dso_local global %struct.mjvOption_, align 4
@con = external dso_local global %struct.mjrContext_, align 8
@.str.5 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10initMuJoCoPKc(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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11closeMuJoCov() #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10initOpenGLv() #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11closeOpenGLv() #4

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #5 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca %struct.mjrRect_, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca %struct.mjrRect_, align 4
  %18 = alloca [50 x i8], align 16
  %19 = alloca %struct.mjrRect_, align 4
  %20 = alloca %struct.mjrRect_, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 5
  br i1 %27, label %31, label %28

28:                                               ; preds = %2
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 6
  br i1 %30, label %31, label %33

31:                                               ; preds = %28, %2
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  store i32 0, ptr %3, align 4
  br label %229

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  store double 1.000000e+01, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  store double 3.000000e+01, ptr %7, align 8, !tbaa !11
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = getelementptr inbounds ptr, ptr %34, i64 2
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %36, ptr noundef @.str.6, ptr noundef %6) #9
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = getelementptr inbounds ptr, ptr %38, i64 3
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %40, ptr noundef @.str.6, ptr noundef %7) #9
  call void @_Z10initOpenGLv()
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = getelementptr inbounds ptr, ptr %42, i64 1
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  call void @_Z10initMuJoCoPKc(ptr noundef %44)
  call void @mjr_setBuffer(i32 noundef 1, ptr noundef @con)
  %45 = load i32, ptr getelementptr inbounds (%struct.mjrContext_, ptr @con, i32 0, i32 55), align 4, !tbaa !13
  %46 = icmp ne i32 %45, 1
  br i1 %46, label %47, label %49

47:                                               ; preds = %33
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %49

49:                                               ; preds = %47, %33
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #9
  %50 = call { i64, i64 } @mjr_maxViewport(ptr noundef @con)
  %51 = getelementptr inbounds { i64, i64 }, ptr %8, i32 0, i32 0
  %52 = extractvalue { i64, i64 } %50, 0
  store i64 %52, ptr %51, align 4
  %53 = getelementptr inbounds { i64, i64 }, ptr %8, i32 0, i32 1
  %54 = extractvalue { i64, i64 } %50, 1
  store i64 %54, ptr %53, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  %55 = getelementptr inbounds %struct.mjrRect_, ptr %8, i32 0, i32 2
  %56 = load i32, ptr %55, align 4, !tbaa !16
  store i32 %56, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  %57 = getelementptr inbounds %struct.mjrRect_, ptr %8, i32 0, i32 3
  %58 = load i32, ptr %57, align 4, !tbaa !18
  store i32 %58, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %59 = load i32, ptr %9, align 4, !tbaa !5
  %60 = mul nsw i32 3, %59
  %61 = load i32, ptr %10, align 4, !tbaa !5
  %62 = mul nsw i32 %60, %61
  %63 = sext i32 %62 to i64
  %64 = call noalias ptr @malloc(i64 noundef %63) #10
  store ptr %64, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = mul i64 4, %66
  %68 = load i32, ptr %10, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = mul i64 %67, %69
  %71 = call noalias ptr @malloc(i64 noundef %70) #10
  store ptr %71, ptr %12, align 8, !tbaa !9
  %72 = load ptr, ptr %11, align 8, !tbaa !9
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %77

74:                                               ; preds = %49
  %75 = load ptr, ptr %12, align 8, !tbaa !9
  %76 = icmp ne ptr %75, null
  br i1 %76, label %78, label %77

77:                                               ; preds = %74, %49
  call void (ptr, ...) @mju_error(ptr noundef @.str.8)
  br label %78

78:                                               ; preds = %77, %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %79 = load ptr, ptr %5, align 8, !tbaa !9
  %80 = getelementptr inbounds ptr, ptr %79, i64 4
  %81 = load ptr, ptr %80, align 8, !tbaa !9
  %82 = call noalias ptr @fopen(ptr noundef %81, ptr noundef @.str.9)
  store ptr %82, ptr %13, align 8, !tbaa !9
  %83 = load ptr, ptr %13, align 8, !tbaa !9
  %84 = icmp ne ptr %83, null
  br i1 %84, label %86, label %85

85:                                               ; preds = %78
  call void (ptr, ...) @mju_error(ptr noundef @.str.10)
  br label %86

86:                                               ; preds = %85, %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 1, ptr %14, align 4, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = icmp sgt i32 %87, 5
  br i1 %88, label %89, label %96

89:                                               ; preds = %86
  %90 = load ptr, ptr %5, align 8, !tbaa !9
  %91 = getelementptr inbounds ptr, ptr %90, i64 5
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %92, ptr noundef @.str.11, ptr noundef %14) #9
  %94 = icmp ne i32 %93, 1
  br i1 %94, label %95, label %96

95:                                               ; preds = %89
  call void (ptr, ...) @mju_error(ptr noundef @.str.12)
  br label %96

96:                                               ; preds = %95, %89, %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  store double 0.000000e+00, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %220, %96
  %98 = load ptr, ptr @d, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.mjData_, ptr %98, i32 0, i32 25
  %100 = load double, ptr %99, align 8, !tbaa !19
  %101 = load double, ptr %6, align 8, !tbaa !11
  %102 = fcmp olt double %100, %101
  br i1 %102, label %103, label %223

103:                                              ; preds = %97
  %104 = load ptr, ptr @d, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.mjData_, ptr %104, i32 0, i32 25
  %106 = load double, ptr %105, align 8, !tbaa !19
  %107 = load double, ptr %15, align 8, !tbaa !11
  %108 = fsub double %106, %107
  %109 = load double, ptr %7, align 8, !tbaa !11
  %110 = fdiv double 1.000000e+00, %109
  %111 = fcmp ogt double %108, %110
  br i1 %111, label %115, label %112

112:                                              ; preds = %103
  %113 = load double, ptr %15, align 8, !tbaa !11
  %114 = fcmp oeq double %113, 0.000000e+00
  br i1 %114, label %115, label %220

115:                                              ; preds = %112, %103
  %116 = load ptr, ptr @m, align 8, !tbaa !9
  %117 = load ptr, ptr @d, align 8, !tbaa !9
  call void @mjv_updateScene(ptr noundef %116, ptr noundef %117, ptr noundef @opt, ptr noundef null, ptr noundef @cam, i32 noundef 7, ptr noundef @scn)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !22
  %118 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 0
  %119 = load i64, ptr %118, align 4
  %120 = getelementptr inbounds { i64, i64 }, ptr %17, i32 0, i32 1
  %121 = load i64, ptr %120, align 4
  call void @mjr_render(i64 %119, i64 %121, ptr noundef @scn, ptr noundef @con)
  call void @llvm.lifetime.start.p0(i64 50, ptr %18) #9
  %122 = load ptr, ptr @d, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.mjData_, ptr %122, i32 0, i32 25
  %124 = load double, ptr %123, align 8, !tbaa !19
  %125 = call noundef i32 (ptr, ptr, ...) @_ZN6mujoco11sample_utilL11sprintf_arrILm50EEEiRAT__cPKcz(ptr noundef nonnull align 1 dereferenceable(50) %18, ptr noundef @.str.13, double noundef %124)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !22
  %126 = getelementptr inbounds [50 x i8], ptr %18, i64 0, i64 0
  %127 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 0
  %128 = load i64, ptr %127, align 4
  %129 = getelementptr inbounds { i64, i64 }, ptr %19, i32 0, i32 1
  %130 = load i64, ptr %129, align 4
  call void @mjr_overlay(i32 noundef 0, i32 noundef 0, i64 %128, i64 %130, ptr noundef %126, ptr noundef null, ptr noundef @con)
  %131 = load ptr, ptr %11, align 8, !tbaa !9
  %132 = load ptr, ptr %12, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !22
  %133 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 0
  %134 = load i64, ptr %133, align 4
  %135 = getelementptr inbounds { i64, i64 }, ptr %20, i32 0, i32 1
  %136 = load i64, ptr %135, align 4
  call void @mjr_readPixels(ptr noundef %131, ptr noundef %132, i64 %134, i64 %136, ptr noundef @con)
  %137 = load i32, ptr %14, align 4, !tbaa !5
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %196

139:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  store i32 3, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %192, %139
  %141 = load i32, ptr %22, align 4, !tbaa !5
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 4, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %195

145:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %188, %145
  %147 = load i32, ptr %24, align 4, !tbaa !5
  %148 = load i32, ptr %9, align 4, !tbaa !5
  %149 = icmp slt i32 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %146
  store i32 7, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %191

151:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  %152 = load i32, ptr %22, align 4, !tbaa !5
  %153 = sdiv i32 %152, 3
  %154 = load i32, ptr %9, align 4, !tbaa !5
  %155 = mul nsw i32 %153, %154
  %156 = load i32, ptr %24, align 4, !tbaa !5
  %157 = sdiv i32 %156, 3
  %158 = add nsw i32 %155, %157
  store i32 %158, ptr %25, align 4, !tbaa !5
  %159 = load ptr, ptr %12, align 8, !tbaa !9
  %160 = load i32, ptr %22, align 4, !tbaa !5
  %161 = load i32, ptr %9, align 4, !tbaa !5
  %162 = mul nsw i32 %160, %161
  %163 = load i32, ptr %24, align 4, !tbaa !5
  %164 = add nsw i32 %162, %163
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds float, ptr %159, i64 %165
  %167 = load float, ptr %166, align 4, !tbaa !23
  %168 = fsub float 1.000000e+00, %167
  %169 = fmul float %168, 2.550000e+02
  %170 = fptoui float %169 to i8
  %171 = load ptr, ptr %11, align 8, !tbaa !9
  %172 = load i32, ptr %25, align 4, !tbaa !5
  %173 = mul nsw i32 3, %172
  %174 = add nsw i32 %173, 2
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds i8, ptr %171, i64 %175
  store i8 %170, ptr %176, align 1, !tbaa !24
  %177 = load ptr, ptr %11, align 8, !tbaa !9
  %178 = load i32, ptr %25, align 4, !tbaa !5
  %179 = mul nsw i32 3, %178
  %180 = add nsw i32 %179, 1
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i8, ptr %177, i64 %181
  store i8 %170, ptr %182, align 1, !tbaa !24
  %183 = load ptr, ptr %11, align 8, !tbaa !9
  %184 = load i32, ptr %25, align 4, !tbaa !5
  %185 = mul nsw i32 3, %184
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds i8, ptr %183, i64 %186
  store i8 %170, ptr %187, align 1, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  br label %188

188:                                              ; preds = %151
  %189 = load i32, ptr %24, align 4, !tbaa !5
  %190 = add nsw i32 %189, 3
  store i32 %190, ptr %24, align 4, !tbaa !5
  br label %146, !llvm.loop !25

191:                                              ; preds = %150
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %22, align 4, !tbaa !5
  %194 = add nsw i32 %193, 3
  store i32 %194, ptr %22, align 4, !tbaa !5
  br label %140, !llvm.loop !27

195:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  br label %196

196:                                              ; preds = %195, %115
  %197 = load ptr, ptr %11, align 8, !tbaa !9
  %198 = load i32, ptr %9, align 4, !tbaa !5
  %199 = load i32, ptr %10, align 4, !tbaa !5
  %200 = mul nsw i32 %198, %199
  %201 = sext i32 %200 to i64
  %202 = load ptr, ptr %13, align 8, !tbaa !9
  %203 = call i64 @fwrite(ptr noundef %197, i64 noundef 3, i64 noundef %201, ptr noundef %202)
  %204 = load i32, ptr %16, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %16, align 4, !tbaa !5
  %206 = srem i32 %204, 10
  %207 = icmp eq i32 %206, 0
  br i1 %207, label %208, label %216

208:                                              ; preds = %196
  %209 = call i32 @mjr_getError()
  %210 = icmp ne i32 %209, 0
  br i1 %210, label %211, label %213

211:                                              ; preds = %208
  %212 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  br label %215

213:                                              ; preds = %208
  %214 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  br label %215

215:                                              ; preds = %213, %211
  br label %216

216:                                              ; preds = %215, %196
  %217 = load ptr, ptr @d, align 8, !tbaa !9
  %218 = getelementptr inbounds %struct.mjData_, ptr %217, i32 0, i32 25
  %219 = load double, ptr %218, align 8, !tbaa !19
  store double %219, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 50, ptr %18) #9
  br label %220

220:                                              ; preds = %216, %112
  %221 = load ptr, ptr @m, align 8, !tbaa !9
  %222 = load ptr, ptr @d, align 8, !tbaa !9
  call void @mj_step(ptr noundef %221, ptr noundef %222)
  br label %97, !llvm.loop !28

223:                                              ; preds = %97
  %224 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  %225 = load ptr, ptr %13, align 8, !tbaa !9
  %226 = call i32 @fclose(ptr noundef %225)
  %227 = load ptr, ptr %11, align 8, !tbaa !9
  call void @free(ptr noundef %227) #9
  %228 = load ptr, ptr %12, align 8, !tbaa !9
  call void @free(ptr noundef %228) #9
  call void @_Z11closeMuJoCov()
  call void @_Z11closeOpenGLv()
  store i32 1, ptr %3, align 4
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  br label %229

229:                                              ; preds = %223, %31
  %230 = load i32, ptr %3, align 4
  ret i32 %230
}

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #6

declare void @mjr_setBuffer(i32 noundef, ptr noundef) #3

declare { i64, i64 } @mjr_maxViewport(ptr noundef) #3

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #7

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

declare void @mjv_updateScene(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare void @mjr_render(i64, i64, ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN6mujoco11sample_utilL11sprintf_arrILm50EEEiRAT__cPKcz(ptr noundef nonnull align 1 dereferenceable(50), ptr noundef, ...) #8

declare void @mjr_overlay(i32 noundef, i32 noundef, i64, i64, ptr noundef, ptr noundef, ptr noundef) #3

declare void @mjr_readPixels(ptr noundef, ptr noundef, i64, i64, ptr noundef) #3

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

declare i32 @mjr_getError() #3

declare void @mj_step(ptr noundef, ptr noundef) #3

declare i32 @fclose(ptr noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #6

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress norecurse 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 "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 #7 = { nounwind allocsize(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 #8 = { 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 #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !6, i64 2300}
!14 = !{!"_ZTS11mjrContext_", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !7, i64 20, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !7, i64 56, !7, i64 96, !7, i64 136, !6, i64 176, !6, i64 180, !6, i64 184, !6, i64 188, !6, i64 192, !6, i64 196, !6, i64 200, !6, i64 204, !7, i64 208, !7, i64 248, !7, i64 288, !7, i64 328, !6, i64 368, !7, i64 372, !7, i64 772, !6, i64 1172, !6, i64 1176, !6, i64 1180, !6, i64 1184, !6, i64 1188, !6, i64 1192, !6, i64 1196, !6, i64 1200, !6, i64 1204, !6, i64 1208, !6, i64 1212, !6, i64 1216, !6, i64 1220, !10, i64 1224, !10, i64 1232, !10, i64 1240, !10, i64 1248, !7, i64 1256, !7, i64 1764, !6, i64 2272, !6, i64 2276, !6, i64 2280, !6, i64 2284, !6, i64 2288, !6, i64 2292, !6, i64 2296, !6, i64 2300, !6, i64 2304, !6, i64 2308}
!15 = !{!"float", !7, i64 0}
!16 = !{!17, !6, i64 8}
!17 = !{!"_ZTS8mjrRect_", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!18 = !{!17, !6, i64 12}
!19 = !{!20, !12, i64 161616}
!20 = !{!"_ZTS7mjData_", !21, i64 0, !21, i64 8, !6, i64 16, !21, i64 24, !21, i64 32, !21, i64 40, !21, i64 48, !7, i64 56, !21, i64 1080, !6, i64 1088, !6, i64 1092, !7, i64 1096, !7, i64 1160, !7, i64 1400, !6, i64 161400, !7, i64 161404, !7, i64 161484, !7, i64 161568, !6, i64 161584, !6, i64 161588, !6, i64 161592, !6, i64 161596, !6, i64 161600, !6, i64 161604, !6, i64 161608, !12, i64 161616, !7, i64 161624, !10, i64 161640, !10, i64 161648, !10, i64 161656, !10, i64 161664, !10, i64 161672, !10, i64 161680, !10, i64 161688, !10, i64 161696, !10, i64 161704, !10, i64 161712, !10, i64 161720, !10, i64 161728, !10, i64 161736, !10, i64 161744, !10, i64 161752, !10, i64 161760, !10, i64 161768, !10, i64 161776, !10, i64 161784, !10, i64 161792, !10, i64 161800, !10, i64 161808, !10, i64 161816, !10, i64 161824, !10, i64 161832, !10, i64 161840, !10, i64 161848, !10, i64 161856, !10, i64 161864, !10, i64 161872, !10, i64 161880, !10, i64 161888, !10, i64 161896, !10, i64 161904, !10, i64 161912, !10, i64 161920, !10, i64 161928, !10, i64 161936, !10, i64 161944, !10, i64 161952, !10, i64 161960, !10, i64 161968, !10, i64 161976, !10, i64 161984, !10, i64 161992, !10, i64 162000, !10, i64 162008, !10, i64 162016, !10, i64 162024, !10, i64 162032, !10, i64 162040, !10, i64 162048, !10, i64 162056, !10, i64 162064, !10, i64 162072, !10, i64 162080, !10, i64 162088, !10, i64 162096, !10, i64 162104, !10, i64 162112, !10, i64 162120, !10, i64 162128, !10, i64 162136, !10, i64 162144, !10, i64 162152, !10, i64 162160, !10, i64 162168, !10, i64 162176, !10, i64 162184, !10, i64 162192, !10, i64 162200, !10, i64 162208, !10, i64 162216, !10, i64 162224, !10, i64 162232, !10, i64 162240, !10, i64 162248, !10, i64 162256, !10, i64 162264, !10, i64 162272, !10, i64 162280, !10, i64 162288, !10, i64 162296, !10, i64 162304, !10, i64 162312, !10, i64 162320, !10, i64 162328, !10, i64 162336, !10, i64 162344, !10, i64 162352, !10, i64 162360, !10, i64 162368, !10, i64 162376, !10, i64 162384, !10, i64 162392, !10, i64 162400, !10, i64 162408, !10, i64 162416, !10, i64 162424, !10, i64 162432, !10, i64 162440, !10, i64 162448, !10, i64 162456, !10, i64 162464, !10, i64 162472, !10, i64 162480, !10, i64 162488, !10, i64 162496, !10, i64 162504, !10, i64 162512, !10, i64 162520, !10, i64 162528, !10, i64 162536, !10, i64 162544, !10, i64 162552, !10, i64 162560, !10, i64 162568, !10, i64 162576, !10, i64 162584, !10, i64 162592, !10, i64 162600, !10, i64 162608, !10, i64 162616, !10, i64 162624, !10, i64 162632, !10, i64 162640, !10, i64 162648, !10, i64 162656, !10, i64 162664, !10, i64 162672, !10, i64 162680, !10, i64 162688, !10, i64 162696, !21, i64 162704}
!21 = !{!"long", !7, i64 0}
!22 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5}
!23 = !{!15, !15, i64 0}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}
!28 = distinct !{!28, !26}


; 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.mjvScene_ = type { i32, i32, ptr, ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i32, ptr, ptr, ptr, ptr, ptr, i32, [100 x %struct.mjvLight_], [2 x %struct.mjvGLCamera_], i8, [3 x float], [4 x float], float, i32, [10 x i8], i32, [3 x float] }
%struct.mjvLight_ = type { [3 x float], [3 x float], [3 x float], float, float, [3 x float], [3 x float], [3 x float], i8, i8, i8, float }
%struct.mjvGLCamera_ = type { [3 x float], [3 x float], [3 x float], float, float, float, float, float, float }
%struct.mjvCamera_ = type { i32, i32, i32, [3 x double], double, double, double }
%struct.mjvOption_ = type { i32, i32, [6 x i8], [6 x i8], [6 x i8], [6 x i8], [6 x i8], [6 x i8], [6 x i8], [32 x i8], 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 }

@m = external dso_local local_unnamed_addr global ptr, align 8
@d = external dso_local local_unnamed_addr global ptr, align 8
@scn = external dso_local global %struct.mjvScene_, align 8
@cam = external dso_local global %struct.mjvCamera_, align 8
@opt = external dso_local global %struct.mjvOption_, align 4
@con = external dso_local global %struct.mjrContext_, align 8
@.str.5 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10initMuJoCoPKc(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

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

; 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 uwtable
declare dso_local void @_Z11closeMuJoCov() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z10initOpenGLv() local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11closeOpenGLv() local_unnamed_addr #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #4 {
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca [50 x i8], align 16
  %7 = add i32 %0, -7
  %or.cond = icmp ult i32 %7, -2
  br i1 %or.cond, label %8, label %10

8:                                                ; preds = %2
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %111

10:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  store double 1.000000e+01, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  store double 3.000000e+01, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %12, ptr noundef nonnull @.str.6, ptr noundef nonnull %3) #9
  %14 = getelementptr inbounds i8, ptr %1, i64 24
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %15, ptr noundef nonnull @.str.6, ptr noundef nonnull %4) #9
  call void @_Z10initOpenGLv()
  %17 = getelementptr inbounds i8, ptr %1, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  call void @_Z10initMuJoCoPKc(ptr noundef %18)
  call void @mjr_setBuffer(i32 noundef 1, ptr noundef nonnull @con)
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @con, i64 2300), align 4, !tbaa !11
  %.not = icmp eq i32 %19, 1
  br i1 %.not, label %22, label %20

20:                                               ; preds = %10
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  br label %22

22:                                               ; preds = %20, %10
  %23 = call { i64, i64 } @mjr_maxViewport(ptr noundef nonnull @con)
  %24 = extractvalue { i64, i64 } %23, 0
  %25 = extractvalue { i64, i64 } %23, 1
  %.sroa.6.8.extract.trunc = trunc i64 %25 to i32
  %.sroa.6.12.extract.shift = lshr i64 %25, 32
  %.sroa.6.12.extract.trunc = trunc nuw i64 %.sroa.6.12.extract.shift to i32
  %26 = mul i64 %.sroa.6.12.extract.shift, %25
  %sext = mul i64 %26, 12884901888
  %27 = ashr exact i64 %sext, 32
  %28 = call noalias ptr @malloc(i64 noundef %27) #10
  %sext68 = shl i64 %25, 32
  %29 = ashr exact i64 %sext68, 30
  %30 = ashr i64 %25, 32
  %31 = mul i64 %29, %30
  %32 = call noalias ptr @malloc(i64 noundef %31) #10
  %33 = icmp ne ptr %28, null
  %34 = icmp ne ptr %32, null
  %or.cond3 = and i1 %33, %34
  br i1 %or.cond3, label %36, label %35

35:                                               ; preds = %22
  call void (ptr, ...) @mju_error(ptr noundef nonnull @.str.8)
  br label %36

36:                                               ; preds = %22, %35
  %37 = getelementptr inbounds i8, ptr %1, i64 32
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = call noalias ptr @fopen(ptr noundef %38, ptr noundef nonnull @.str.9)
  %.not70 = icmp eq ptr %39, null
  br i1 %.not70, label %40, label %41

40:                                               ; preds = %36
  call void (ptr, ...) @mju_error(ptr noundef nonnull @.str.10)
  br label %41

41:                                               ; preds = %40, %36
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  store i32 1, ptr %5, align 4, !tbaa !15
  %42 = icmp ugt i32 %0, 5
  br i1 %42, label %43, label %48

43:                                               ; preds = %41
  %44 = getelementptr inbounds i8, ptr %1, i64 40
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %45, ptr noundef nonnull @.str.11, ptr noundef nonnull %5) #9
  %.not71 = icmp eq i32 %46, 1
  br i1 %.not71, label %48, label %47

47:                                               ; preds = %43
  call void (ptr, ...) @mju_error(ptr noundef nonnull @.str.12)
  br label %48

48:                                               ; preds = %47, %43, %41
  %49 = load ptr, ptr @d, align 8, !tbaa !9
  %50 = getelementptr inbounds i8, ptr %49, i64 161616
  %51 = load double, ptr %50, align 8, !tbaa !16
  %52 = load double, ptr %3, align 8, !tbaa !5
  %53 = fcmp olt double %51, %52
  br i1 %53, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %48
  %factor.op.mul = and i64 %25, -4294967296
  %54 = icmp slt i32 %.sroa.6.12.extract.trunc, 1
  %55 = icmp slt i32 %.sroa.6.8.extract.trunc, 1
  %.reass = mul i64 %factor.op.mul, %25
  %56 = ashr exact i64 %.reass, 32
  %sext86 = shl i64 %25, 32
  %57 = ashr exact i64 %sext86, 32
  %58 = ashr i64 %25, 32
  br label %59

59:                                               ; preds = %.lr.ph, %101
  %60 = phi double [ %51, %.lr.ph ], [ %106, %101 ]
  %61 = phi ptr [ %49, %.lr.ph ], [ %104, %101 ]
  %.06379 = phi double [ 0.000000e+00, %.lr.ph ], [ %.1, %101 ]
  %.06478 = phi i32 [ 0, %.lr.ph ], [ %.165, %101 ]
  %62 = fsub double %60, %.06379
  %63 = load double, ptr %4, align 8, !tbaa !5
  %64 = fdiv double 1.000000e+00, %63
  %65 = fcmp ogt double %62, %64
  %66 = fcmp oeq double %.06379, 0.000000e+00
  %or.cond5 = or i1 %66, %65
  br i1 %or.cond5, label %67, label %101

67:                                               ; preds = %59
  %68 = load ptr, ptr @m, align 8, !tbaa !9
  call void @mjv_updateScene(ptr noundef %68, ptr noundef nonnull %61, ptr noundef nonnull @opt, ptr noundef null, ptr noundef nonnull @cam, i32 noundef 7, ptr noundef nonnull @scn)
  call void @mjr_render(i64 %24, i64 %25, ptr noundef nonnull @scn, ptr noundef nonnull @con)
  call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %6) #9
  %69 = load ptr, ptr @d, align 8, !tbaa !9
  %70 = getelementptr inbounds i8, ptr %69, i64 161616
  %71 = load double, ptr %70, align 8, !tbaa !16
  %72 = call noundef i32 (ptr, ptr, ...) @_ZN6mujoco11sample_utilL11sprintf_arrILm50EEEiRAT__cPKcz(ptr noundef nonnull align 1 dereferenceable(50) %6, ptr noundef nonnull @.str.13, double noundef %71)
  call void @mjr_overlay(i32 noundef 0, i32 noundef 0, i64 %24, i64 %25, ptr noundef nonnull %6, ptr noundef null, ptr noundef nonnull @con)
  call void @mjr_readPixels(ptr noundef %28, ptr noundef %32, i64 %24, i64 %25, ptr noundef nonnull @con)
  %73 = load i32, ptr %5, align 4, !tbaa !15
  %.not72 = icmp eq i32 %73, 0
  %brmerge = select i1 %.not72, i1 true, i1 %54
  %brmerge89 = or i1 %brmerge, %55
  br i1 %brmerge89, label %.loopexit, label %.preheader.us

.preheader.us:                                    ; preds = %67, %._crit_edge.us
  %indvars.iv83 = phi i64 [ %indvars.iv.next84, %._crit_edge.us ], [ 0, %67 ]
  %74 = udiv i64 %indvars.iv83, 3
  %75 = mul nuw nsw i64 %74, %57
  %76 = mul i64 %indvars.iv83, %25
  %77 = and i64 %76, 4294967295
  %invariant.gep = getelementptr inbounds float, ptr %32, i64 %77
  br label %78

78:                                               ; preds = %.preheader.us, %78
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %78 ]
  %79 = udiv i64 %indvars.iv, 3
  %80 = add nuw nsw i64 %79, %75
  %gep = getelementptr inbounds float, ptr %invariant.gep, i64 %indvars.iv
  %81 = load float, ptr %gep, align 4, !tbaa !19
  %82 = fsub float 1.000000e+00, %81
  %83 = fmul float %82, 2.550000e+02
  %84 = fptoui float %83 to i8
  %85 = mul nuw nsw i64 %80, 3
  %86 = getelementptr i8, ptr %28, i64 %85
  %87 = getelementptr i8, ptr %86, i64 2
  store i8 %84, ptr %87, align 1, !tbaa !20
  %88 = getelementptr i8, ptr %86, i64 1
  store i8 %84, ptr %88, align 1, !tbaa !20
  store i8 %84, ptr %86, align 1, !tbaa !20
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 3
  %89 = icmp slt i64 %indvars.iv.next, %57
  br i1 %89, label %78, label %._crit_edge.us, !llvm.loop !21

._crit_edge.us:                                   ; preds = %78
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 3
  %90 = icmp slt i64 %indvars.iv.next84, %58
  br i1 %90, label %.preheader.us, label %.loopexit, !llvm.loop !23

.loopexit:                                        ; preds = %._crit_edge.us, %67
  %91 = call i64 @fwrite(ptr noundef %28, i64 noundef 3, i64 noundef %56, ptr noundef %39)
  %92 = add nsw i32 %.06478, 1
  %93 = srem i32 %.06478, 10
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %.sink.split, label %97

.sink.split:                                      ; preds = %.loopexit
  %95 = call i32 @mjr_getError()
  %.not74 = icmp eq i32 %95, 0
  %.str.15..str.14 = select i1 %.not74, ptr @.str.15, ptr @.str.14
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.15..str.14)
  br label %97

97:                                               ; preds = %.sink.split, %.loopexit
  %98 = load ptr, ptr @d, align 8, !tbaa !9
  %99 = getelementptr inbounds i8, ptr %98, i64 161616
  %100 = load double, ptr %99, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %6) #9
  br label %101

101:                                              ; preds = %59, %97
  %102 = phi ptr [ %98, %97 ], [ %61, %59 ]
  %.165 = phi i32 [ %92, %97 ], [ %.06478, %59 ]
  %.1 = phi double [ %100, %97 ], [ %.06379, %59 ]
  %103 = load ptr, ptr @m, align 8, !tbaa !9
  call void @mj_step(ptr noundef %103, ptr noundef nonnull %102)
  %104 = load ptr, ptr @d, align 8, !tbaa !9
  %105 = getelementptr inbounds i8, ptr %104, i64 161616
  %106 = load double, ptr %105, align 8, !tbaa !16
  %107 = load double, ptr %3, align 8, !tbaa !5
  %108 = fcmp olt double %106, %107
  br i1 %108, label %59, label %._crit_edge, !llvm.loop !24

._crit_edge:                                      ; preds = %101, %48
  %109 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  %110 = call i32 @fclose(ptr noundef %39)
  call void @free(ptr noundef %28) #9
  call void @free(ptr noundef %32) #9
  call void @_Z11closeMuJoCov()
  call void @_Z11closeOpenGLv()
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  br label %111

111:                                              ; preds = %._crit_edge, %8
  %.0 = phi i32 [ 0, %8 ], [ 1, %._crit_edge ]
  ret i32 %.0
}

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #5

declare void @mjr_setBuffer(i32 noundef, ptr noundef) local_unnamed_addr #2

declare { i64, i64 } @mjr_maxViewport(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #5

declare void @mjv_updateScene(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @mjr_render(i64, i64, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN6mujoco11sample_utilL11sprintf_arrILm50EEEiRAT__cPKcz(ptr noundef nonnull align 1 dereferenceable(50), ptr noundef, ...) local_unnamed_addr #7

declare void @mjr_overlay(i32 noundef, i32 noundef, i64, i64, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @mjr_readPixels(ptr noundef, ptr noundef, i64, i64, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5

declare i32 @mjr_getError() local_unnamed_addr #2

declare void @mj_step(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 #4 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { 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 #8 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }

!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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !14, i64 2300}
!12 = !{!"_ZTS11mjrContext_", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, 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, !10, i64 1224, !10, i64 1232, !10, i64 1240, !10, 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}
!13 = !{!"float", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!14, !14, i64 0}
!16 = !{!17, !6, i64 161616}
!17 = !{!"_ZTS7mjData_", !18, i64 0, !18, i64 8, !14, i64 16, !18, i64 24, !18, i64 32, !18, i64 40, !18, i64 48, !7, i64 56, !18, i64 1080, !14, i64 1088, !14, i64 1092, !7, i64 1096, !7, i64 1160, !7, i64 1400, !14, i64 161400, !7, i64 161404, !7, i64 161484, !7, i64 161568, !14, i64 161584, !14, i64 161588, !14, i64 161592, !14, i64 161596, !14, i64 161600, !14, i64 161604, !14, i64 161608, !6, i64 161616, !7, i64 161624, !10, i64 161640, !10, i64 161648, !10, i64 161656, !10, i64 161664, !10, i64 161672, !10, i64 161680, !10, i64 161688, !10, i64 161696, !10, i64 161704, !10, i64 161712, !10, i64 161720, !10, i64 161728, !10, i64 161736, !10, i64 161744, !10, i64 161752, !10, i64 161760, !10, i64 161768, !10, i64 161776, !10, i64 161784, !10, i64 161792, !10, i64 161800, !10, i64 161808, !10, i64 161816, !10, i64 161824, !10, i64 161832, !10, i64 161840, !10, i64 161848, !10, i64 161856, !10, i64 161864, !10, i64 161872, !10, i64 161880, !10, i64 161888, !10, i64 161896, !10, i64 161904, !10, i64 161912, !10, i64 161920, !10, i64 161928, !10, i64 161936, !10, i64 161944, !10, i64 161952, !10, i64 161960, !10, i64 161968, !10, i64 161976, !10, i64 161984, !10, i64 161992, !10, i64 162000, !10, i64 162008, !10, i64 162016, !10, i64 162024, !10, i64 162032, !10, i64 162040, !10, i64 162048, !10, i64 162056, !10, i64 162064, !10, i64 162072, !10, i64 162080, !10, i64 162088, !10, i64 162096, !10, i64 162104, !10, i64 162112, !10, i64 162120, !10, i64 162128, !10, i64 162136, !10, i64 162144, !10, i64 162152, !10, i64 162160, !10, i64 162168, !10, i64 162176, !10, i64 162184, !10, i64 162192, !10, i64 162200, !10, i64 162208, !10, i64 162216, !10, i64 162224, !10, i64 162232, !10, i64 162240, !10, i64 162248, !10, i64 162256, !10, i64 162264, !10, i64 162272, !10, i64 162280, !10, i64 162288, !10, i64 162296, !10, i64 162304, !10, i64 162312, !10, i64 162320, !10, i64 162328, !10, i64 162336, !10, i64 162344, !10, i64 162352, !10, i64 162360, !10, i64 162368, !10, i64 162376, !10, i64 162384, !10, i64 162392, !10, i64 162400, !10, i64 162408, !10, i64 162416, !10, i64 162424, !10, i64 162432, !10, i64 162440, !10, i64 162448, !10, i64 162456, !10, i64 162464, !10, i64 162472, !10, i64 162480, !10, i64 162488, !10, i64 162496, !10, i64 162504, !10, i64 162512, !10, i64 162520, !10, i64 162528, !10, i64 162536, !10, i64 162544, !10, i64 162552, !10, i64 162560, !10, i64 162568, !10, i64 162576, !10, i64 162584, !10, i64 162592, !10, i64 162600, !10, i64 162608, !10, i64 162616, !10, i64 162624, !10, i64 162632, !10, i64 162640, !10, i64 162648, !10, i64 162656, !10, i64 162664, !10, i64 162672, !10, i64 162680, !10, i64 162688, !10, i64 162696, !18, i64 162704}
!18 = !{!"long", !7, i64 0}
!19 = !{!13, !13, i64 0}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass