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

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZL10helpstring = external hidden constant [159 x i8], align 16
@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [46 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef, ptr noundef) #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z8filetypePKc(ptr noundef) #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #4 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [1000 x i8], align 16
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1000, ptr %7) #6
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = icmp ne i32 %13, 3
  br i1 %14, label %15, label %17

15:                                               ; preds = %2
  %16 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef @_ZL10helpstring, ptr noundef null)
  store i32 %16, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %127

17:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %18, i64 1
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = call noundef i32 @_Z8filetypePKc(ptr noundef %20)
  store i32 %21, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 2
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = call noundef i32 @_Z8filetypePKc(ptr noundef %24)
  store i32 %25, ptr %10, align 4, !tbaa !5
  %26 = load i32, ptr %9, align 4, !tbaa !5
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %40, label %28

28:                                               ; preds = %17
  %29 = load i32, ptr %9, align 4, !tbaa !5
  %30 = icmp eq i32 %29, 3
  br i1 %30, label %40, label %31

31:                                               ; preds = %28
  %32 = load i32, ptr %10, align 4, !tbaa !5
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %40, label %34

34:                                               ; preds = %31
  %35 = load i32, ptr %9, align 4, !tbaa !5
  %36 = icmp eq i32 %35, 2
  br i1 %36, label %37, label %42

37:                                               ; preds = %34
  %38 = load i32, ptr %10, align 4, !tbaa !5
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %40, label %42

40:                                               ; preds = %37, %31, %28, %17
  %41 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef @.str.4, ptr noundef null)
  store i32 %41, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %126

42:                                               ; preds = %37, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %43 = load ptr, ptr %5, align 8, !tbaa !9
  %44 = getelementptr inbounds ptr, ptr %43, i64 2
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = call noalias ptr @fopen(ptr noundef %45, ptr noundef @.str.5)
  store ptr %46, ptr %11, align 8, !tbaa !9
  %47 = load ptr, ptr %11, align 8, !tbaa !9
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %67

49:                                               ; preds = %42
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %12)
  %52 = load i8, ptr %12, align 1, !tbaa !11
  %53 = sext i8 %52 to i32
  %54 = icmp ne i32 %53, 121
  br i1 %54, label %55, label %63

55:                                               ; preds = %49
  %56 = load i8, ptr %12, align 1, !tbaa !11
  %57 = sext i8 %56 to i32
  %58 = icmp ne i32 %57, 89
  br i1 %58, label %59, label %63

59:                                               ; preds = %55
  %60 = load ptr, ptr %11, align 8, !tbaa !9
  %61 = call i32 @fclose(ptr noundef %60)
  %62 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef null, ptr noundef null)
  store i32 %62, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %64

63:                                               ; preds = %55, %49
  store i32 0, ptr %8, align 4
  br label %64

64:                                               ; preds = %63, %59
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  %65 = load i32, ptr %8, align 4
  switch i32 %65, label %125 [
    i32 0, label %66
  ]

66:                                               ; preds = %64
  br label %67

67:                                               ; preds = %66, %42
  %68 = load i32, ptr %9, align 4, !tbaa !5
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %70, label %76

70:                                               ; preds = %67
  %71 = load ptr, ptr %5, align 8, !tbaa !9
  %72 = getelementptr inbounds ptr, ptr %71, i64 1
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %74 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %75 = call ptr @mj_loadXML(ptr noundef %73, ptr noundef null, ptr noundef %74, i32 noundef 1000)
  store ptr %75, ptr %6, align 8, !tbaa !9
  br label %81

76:                                               ; preds = %67
  %77 = load ptr, ptr %5, align 8, !tbaa !9
  %78 = getelementptr inbounds ptr, ptr %77, i64 1
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = call ptr @mj_loadModel(ptr noundef %79, ptr noundef null)
  store ptr %80, ptr %6, align 8, !tbaa !9
  br label %81

81:                                               ; preds = %76, %70
  %82 = load ptr, ptr %6, align 8, !tbaa !9
  %83 = icmp ne ptr %82, null
  br i1 %83, label %92, label %84

84:                                               ; preds = %81
  %85 = load i32, ptr %9, align 4, !tbaa !5
  %86 = icmp eq i32 %85, 1
  br i1 %86, label %87, label %90

87:                                               ; preds = %84
  %88 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %89 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef %88, ptr noundef null)
  store i32 %89, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %125

90:                                               ; preds = %84
  %91 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef @.str.7, ptr noundef null)
  store i32 %91, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %125

92:                                               ; preds = %81
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = icmp eq i32 %93, 1
  br i1 %94, label %95, label %108

95:                                               ; preds = %92
  %96 = load ptr, ptr %5, align 8, !tbaa !9
  %97 = getelementptr inbounds ptr, ptr %96, i64 2
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = load ptr, ptr %6, align 8, !tbaa !9
  %100 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %101 = call i32 @mj_saveLastXML(ptr noundef %98, ptr noundef %99, ptr noundef %100, i32 noundef 1000)
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %107, label %103

103:                                              ; preds = %95
  %104 = getelementptr inbounds [1000 x i8], ptr %7, i64 0, i64 0
  %105 = load ptr, ptr %6, align 8, !tbaa !9
  %106 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef %104, ptr noundef %105)
  store i32 %106, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %125

107:                                              ; preds = %95
  br label %122

108:                                              ; preds = %92
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = icmp eq i32 %109, 2
  br i1 %110, label %111, label %116

111:                                              ; preds = %108
  %112 = load ptr, ptr %6, align 8, !tbaa !9
  %113 = load ptr, ptr %5, align 8, !tbaa !9
  %114 = getelementptr inbounds ptr, ptr %113, i64 2
  %115 = load ptr, ptr %114, align 8, !tbaa !9
  call void @mj_saveModel(ptr noundef %112, ptr noundef %115, ptr noundef null, i32 noundef 0)
  br label %121

116:                                              ; preds = %108
  %117 = load ptr, ptr %6, align 8, !tbaa !9
  %118 = load ptr, ptr %5, align 8, !tbaa !9
  %119 = getelementptr inbounds ptr, ptr %118, i64 2
  %120 = load ptr, ptr %119, align 8, !tbaa !9
  call void @mj_printModel(ptr noundef %117, ptr noundef %120)
  br label %121

121:                                              ; preds = %116, %111
  br label %122

122:                                              ; preds = %121, %107
  %123 = load ptr, ptr %6, align 8, !tbaa !9
  %124 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef @.str.8, ptr noundef %123)
  store i32 %124, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %125

125:                                              ; preds = %122, %103, %90, %87, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %126

126:                                              ; preds = %125, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %127

127:                                              ; preds = %126, %15
  call void @llvm.lifetime.end.p0(i64 1000, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %128 = load i32, ptr %3, align 4
  ret i32 %128
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #5

declare i32 @fclose(ptr noundef) #5

declare ptr @mj_loadXML(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

declare ptr @mj_loadModel(ptr noundef, ptr noundef) #5

declare i32 @mj_saveLastXML(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

declare void @mj_saveModel(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #5

declare void @mj_printModel(ptr noundef, ptr noundef) #5

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


; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZL10helpstring = external hidden constant [159 x i8], align 16
@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [46 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.7 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z8filetypePKc(ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #4 {
  %3 = alloca [1000 x i8], align 16
  %4 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %3) #7
  %.not = icmp eq i32 %0, 3
  br i1 %.not, label %7, label %5

5:                                                ; preds = %2
  %6 = tail call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef nonnull @_ZL10helpstring, ptr noundef null)
  br label %53

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %1, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call noundef i32 @_Z8filetypePKc(ptr noundef %9)
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = tail call noundef i32 @_Z8filetypePKc(ptr noundef %12)
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %18, label %switch.early.test

switch.early.test:                                ; preds = %7
  switch i32 %10, label %15 [
    i32 3, label %18
    i32 0, label %18
  ]

15:                                               ; preds = %switch.early.test
  %16 = icmp eq i32 %10, 2
  %17 = icmp eq i32 %13, 1
  %or.cond5 = and i1 %16, %17
  br i1 %or.cond5, label %18, label %20

18:                                               ; preds = %switch.early.test, %switch.early.test, %7, %15
  %19 = tail call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef nonnull @.str.4, ptr noundef null)
  br label %53

20:                                               ; preds = %15
  %21 = load ptr, ptr %11, align 8, !tbaa !5
  %22 = tail call noalias ptr @fopen(ptr noundef %21, ptr noundef nonnull @.str.5)
  %.not40 = icmp eq ptr %22, null
  br i1 %.not40, label %31, label %23

23:                                               ; preds = %20
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.6)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #7
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %4)
  %26 = load i8, ptr %4, align 1
  %27 = and i8 %26, -33
  %or.cond8.not = icmp eq i8 %27, 89
  br i1 %or.cond8.not, label %.thread, label %28

.thread:                                          ; preds = %23
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  br label %31

28:                                               ; preds = %23
  %29 = call i32 @fclose(ptr noundef nonnull %22)
  %30 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef null, ptr noundef null)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #7
  br label %53

31:                                               ; preds = %.thread, %20
  %32 = icmp eq i32 %10, 1
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  br i1 %32, label %34, label %.thread44

34:                                               ; preds = %31
  %35 = call ptr @mj_loadXML(ptr noundef %33, ptr noundef null, ptr noundef nonnull %3, i32 noundef 1000)
  %.not41 = icmp eq ptr %35, null
  br i1 %.not41, label %37, label %40

.thread44:                                        ; preds = %31
  %36 = call ptr @mj_loadModel(ptr noundef %33, ptr noundef null)
  %.not4146 = icmp eq ptr %36, null
  br i1 %.not4146, label %.thread48, label %40

37:                                               ; preds = %34
  %38 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef nonnull %3, ptr noundef null)
  br label %53

.thread48:                                        ; preds = %.thread44
  %39 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef nonnull @.str.7, ptr noundef null)
  br label %53

40:                                               ; preds = %.thread44, %34
  %.03547 = phi ptr [ %36, %.thread44 ], [ %35, %34 ]
  br i1 %17, label %41, label %46

41:                                               ; preds = %40
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = call i32 @mj_saveLastXML(ptr noundef %42, ptr noundef nonnull %.03547, ptr noundef nonnull %3, i32 noundef 1000)
  %.not42 = icmp eq i32 %43, 0
  br i1 %.not42, label %44, label %51

44:                                               ; preds = %41
  %45 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef nonnull %3, ptr noundef nonnull %.03547)
  br label %53

46:                                               ; preds = %40
  %47 = icmp eq i32 %13, 2
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  br i1 %47, label %49, label %50

49:                                               ; preds = %46
  call void @mj_saveModel(ptr noundef nonnull %.03547, ptr noundef %48, ptr noundef null, i32 noundef 0)
  br label %51

50:                                               ; preds = %46
  call void @mj_printModel(ptr noundef nonnull %.03547, ptr noundef %48)
  br label %51

51:                                               ; preds = %49, %50, %41
  %52 = call noundef i32 @_Z6finishPKcP8mjModel_(ptr noundef nonnull @.str.8, ptr noundef nonnull %.03547)
  br label %53

53:                                               ; preds = %28, %18, %51, %44, %.thread48, %37, %5
  %.3 = phi i32 [ %6, %5 ], [ %19, %18 ], [ %52, %51 ], [ %45, %44 ], [ %38, %37 ], [ %39, %.thread48 ], [ %30, %28 ]
  call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %3) #7
  ret i32 %.3
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6

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

declare ptr @mj_loadXML(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

declare ptr @mj_loadModel(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @mj_saveLastXML(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

declare void @mj_saveModel(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

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

!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"}


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