; LLVM IR from simbody/simbody :: SimTKcommon/tests (SFMTTest)

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

@_ZTISt9exception = external constant ptr
@__const.main.expected = external hidden unnamed_addr constant [5 x i32], align 16
@.str = external hidden unnamed_addr constant [33 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca [5 x i32], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #12
  %11 = invoke noundef ptr @_ZN10SimTK_SFMT14createSFMTDataEv()
          to label %12 unwind label %19

12:                                               ; preds = %0
  store ptr %11, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  invoke void @_ZN10SimTK_SFMT13init_gen_randEjRNS_8SFMTDataE(i32 noundef 1234, ptr noundef nonnull align 1 %13)
          to label %14 unwind label %19

14:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 20, ptr %5) #12
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 @__const.main.expected, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #12
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %40, %14
  %16 = load i32, ptr %6, align 4, !tbaa !9
  %17 = icmp slt i32 %16, 5
  br i1 %17, label %23, label %18

18:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #12
  br label %43

19:                                               ; preds = %12, %0
  %20 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %21 = extractvalue { ptr, i32 } %20, 0
  store ptr %21, ptr %3, align 8
  %22 = extractvalue { ptr, i32 } %20, 1
  store i32 %22, ptr %4, align 4
  br label %103

23:                                               ; preds = %15
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = invoke noundef i32 @_ZN10SimTK_SFMT10gen_rand32ERNS_8SFMTDataE(ptr noundef nonnull align 1 %24)
          to label %26 unwind label %34

26:                                               ; preds = %23
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !9
  %31 = icmp eq i32 %25, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %26
  br label %39

33:                                               ; preds = %26
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 41, ptr noundef @__PRETTY_FUNCTION__.main) #13
  unreachable

34:                                               ; preds = %23
  %35 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %3, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #12
  br label %102

38:                                               ; No predecessors!
  br label %39

39:                                               ; preds = %38, %32
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %6, align 4, !tbaa !9
  br label %15, !llvm.loop !11

43:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #12
  %44 = invoke noundef i32 @_ZN10SimTK_SFMT20get_min_array_size32Ev()
          to label %45 unwind label %49

45:                                               ; preds = %43
  store i32 %44, ptr %7, align 4, !tbaa !9
  %46 = load i32, ptr %7, align 4, !tbaa !9
  %47 = icmp slt i32 %46, 5
  br i1 %47, label %48, label %53

48:                                               ; preds = %45
  store i32 5, ptr %7, align 4, !tbaa !9
  br label %53

49:                                               ; preds = %43
  %50 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %3, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %4, align 4
  br label %101

53:                                               ; preds = %48, %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #12
  %54 = load i32, ptr %7, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %55, i64 4)
  %57 = extractvalue { i64, i1 } %56, 1
  %58 = extractvalue { i64, i1 } %56, 0
  %59 = select i1 %57, i64 -1, i64 %58
  %60 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %59) #14
          to label %61 unwind label %72

61:                                               ; preds = %53
  store ptr %60, ptr %8, align 8, !tbaa !5
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  invoke void @_ZN10SimTK_SFMT13init_gen_randEjRNS_8SFMTDataE(i32 noundef 1234, ptr noundef nonnull align 1 %62)
          to label %63 unwind label %72

63:                                               ; preds = %61
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  invoke void @_ZN10SimTK_SFMT12fill_array32EPjiRNS_8SFMTDataE(ptr noundef %64, i32 noundef %65, ptr noundef nonnull align 1 %66)
          to label %67 unwind label %72

67:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #12
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %91, %67
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = icmp slt i32 %69, 5
  br i1 %70, label %76, label %71

71:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #12
  br label %94

72:                                               ; preds = %94, %63, %61, %53
  %73 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %3, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #12
  br label %101

76:                                               ; preds = %68
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i32, ptr %77, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = load i32, ptr %9, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = icmp eq i32 %81, %85
  br i1 %86, label %87, label %88

87:                                               ; preds = %76
  br label %90

88:                                               ; preds = %76
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 52, ptr noundef @__PRETTY_FUNCTION__.main) #13
  unreachable

89:                                               ; No predecessors!
  br label %90

90:                                               ; preds = %89, %87
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %9, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %9, align 4, !tbaa !9
  br label %68, !llvm.loop !13

94:                                               ; preds = %71
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  invoke void @_ZN10SimTK_SFMT14deleteSFMTDataEPNS_8SFMTDataE(ptr noundef %95)
          to label %96 unwind label %72

96:                                               ; preds = %94
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = icmp eq ptr %97, null
  br i1 %98, label %100, label %99

99:                                               ; preds = %96
  call void @_ZdaPv(ptr noundef %97) #15
  br label %100

100:                                              ; preds = %99, %96
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #12
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #12
  call void @llvm.lifetime.end.p0(i64 20, ptr %5) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #12
  br label %127

101:                                              ; preds = %72, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #12
  br label %102

102:                                              ; preds = %101, %34
  call void @llvm.lifetime.end.p0(i64 20, ptr %5) #12
  br label %103

103:                                              ; preds = %102, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #12
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %4, align 4
  %106 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9exception) #12
  %107 = icmp eq i32 %105, %106
  br i1 %107, label %108, label %130

108:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #12
  %109 = load ptr, ptr %3, align 8
  %110 = call ptr @__cxa_begin_catch(ptr %109) #12
  store ptr %110, ptr %10, align 8
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
          to label %112 unwind label %122

112:                                              ; preds = %108
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = load ptr, ptr %113, align 8, !tbaa !14
  %115 = getelementptr inbounds ptr, ptr %114, i64 2
  %116 = load ptr, ptr %115, align 8
  %117 = call noundef ptr %116(ptr noundef nonnull align 8 dereferenceable(8) %113) #12
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef %117)
          to label %119 unwind label %122

119:                                              ; preds = %112
  %120 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %121 unwind label %122

121:                                              ; preds = %119
  store i32 1, ptr %1, align 4
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #12
  br label %128

122:                                              ; preds = %119, %112, %108
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %3, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %4, align 4
  invoke void @__cxa_end_catch()
          to label %126 unwind label %135

126:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #12
  br label %130

127:                                              ; preds = %100
  store i32 0, ptr %1, align 4
  br label %128

128:                                              ; preds = %127, %121
  %129 = load i32, ptr %1, align 4
  ret i32 %129

130:                                              ; preds = %126, %104
  %131 = load ptr, ptr %3, align 8
  %132 = load i32, ptr %4, align 4
  %133 = insertvalue { ptr, i32 } poison, ptr %131, 0
  %134 = insertvalue { ptr, i32 } %133, i32 %132, 1
  resume { ptr, i32 } %134

135:                                              ; preds = %122
  %136 = landingpad { ptr, i32 }
          catch ptr null
  %137 = extractvalue { ptr, i32 } %136, 0
  call void @__clang_call_terminate(ptr %137) #13
  unreachable
}

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

declare noundef ptr @_ZN10SimTK_SFMT14createSFMTDataEv() #2

declare i32 @__gxx_personality_v0(...)

declare void @_ZN10SimTK_SFMT13init_gen_randEjRNS_8SFMTDataE(i32 noundef, ptr noundef nonnull align 1) #2

; 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

declare noundef i32 @_ZN10SimTK_SFMT10gen_rand32ERNS_8SFMTDataE(ptr noundef nonnull align 1) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

declare noundef i32 @_ZN10SimTK_SFMT20get_min_array_size32Ev() #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #5

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #6

declare void @_ZN10SimTK_SFMT12fill_array32EPjiRNS_8SFMTDataE(ptr noundef, i32 noundef, ptr noundef nonnull align 1) #2

declare void @_ZN10SimTK_SFMT14deleteSFMTDataEPNS_8SFMTDataE(ptr noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #7

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #8

declare ptr @__cxa_begin_catch(ptr)

; 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) #9

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #10 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #9

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #11

attributes #0 = { 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 #1 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { noreturn 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nobuiltin 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 #7 = { nobuiltin 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 #8 = { nounwind memory(none) }
attributes #9 = { 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 #10 = { 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 #11 = { noinline noreturn nounwind uwtable "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 #12 = { nounwind }
attributes #13 = { noreturn nounwind }
attributes #14 = { builtin allocsize(0) }
attributes #15 = { builtin 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 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !8, 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 }

@_ZTISt9exception = external constant ptr
@__const.main.expected = external hidden unnamed_addr constant [5 x i32], align 16
@.str = external hidden unnamed_addr constant [33 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [80 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 0, 2) i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = invoke noundef ptr @_ZN10SimTK_SFMT14createSFMTDataEv()
          to label %2 unwind label %22

2:                                                ; preds = %0
  invoke void @_ZN10SimTK_SFMT13init_gen_randEjRNS_8SFMTDataE(i32 noundef 1234, ptr noundef nonnull align 1 %1)
          to label %.preheader34.preheader unwind label %22

.preheader34.preheader:                           ; preds = %2
  %3 = invoke noundef i32 @_ZN10SimTK_SFMT10gen_rand32ERNS_8SFMTDataE(ptr noundef nonnull align 1 %1)
          to label %24 unwind label %28

.preheader34.1:                                   ; preds = %24
  %4 = invoke noundef i32 @_ZN10SimTK_SFMT10gen_rand32ERNS_8SFMTDataE(ptr noundef nonnull align 1 %1)
          to label %5 unwind label %28

5:                                                ; preds = %.preheader34.1
  %6 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.expected, i64 4), align 4, !tbaa !5
  %7 = icmp eq i32 %4, %6
  br i1 %7, label %.preheader34.2, label %27

.preheader34.2:                                   ; preds = %5
  %8 = invoke noundef i32 @_ZN10SimTK_SFMT10gen_rand32ERNS_8SFMTDataE(ptr noundef nonnull align 1 %1)
          to label %9 unwind label %28

9:                                                ; preds = %.preheader34.2
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.expected, i64 8), align 8, !tbaa !5
  %11 = icmp eq i32 %8, %10
  br i1 %11, label %.preheader34.3, label %27

.preheader34.3:                                   ; preds = %9
  %12 = invoke noundef i32 @_ZN10SimTK_SFMT10gen_rand32ERNS_8SFMTDataE(ptr noundef nonnull align 1 %1)
          to label %13 unwind label %28

13:                                               ; preds = %.preheader34.3
  %14 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.expected, i64 12), align 4, !tbaa !5
  %15 = icmp eq i32 %12, %14
  br i1 %15, label %.preheader34.4, label %27

.preheader34.4:                                   ; preds = %13
  %16 = invoke noundef i32 @_ZN10SimTK_SFMT10gen_rand32ERNS_8SFMTDataE(ptr noundef nonnull align 1 %1)
          to label %17 unwind label %28

17:                                               ; preds = %.preheader34.4
  %18 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.expected, i64 16), align 16, !tbaa !5
  %19 = icmp eq i32 %16, %18
  br i1 %19, label %20, label %27

20:                                               ; preds = %17
  %21 = invoke noundef i32 @_ZN10SimTK_SFMT20get_min_array_size32Ev()
          to label %30 unwind label %34

22:                                               ; preds = %2, %0
  %23 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %57

24:                                               ; preds = %.preheader34.preheader
  %25 = load i32, ptr @__const.main.expected, align 16, !tbaa !5
  %26 = icmp eq i32 %3, %25
  br i1 %26, label %.preheader34.1, label %27

27:                                               ; preds = %17, %13, %9, %5, %24
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 41, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #10
  unreachable

28:                                               ; preds = %.preheader34.4, %.preheader34.3, %.preheader34.2, %.preheader34.1, %.preheader34.preheader
  %29 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %57

30:                                               ; preds = %20
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %21, i32 5)
  %31 = zext nneg i32 %spec.store.select to i64
  %32 = shl nuw nsw i64 %31, 2
  %33 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %32) #11
          to label %36 unwind label %53

34:                                               ; preds = %20
  %35 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %57

36:                                               ; preds = %30
  invoke void @_ZN10SimTK_SFMT13init_gen_randEjRNS_8SFMTDataE(i32 noundef 1234, ptr noundef nonnull align 1 %1)
          to label %37 unwind label %53

37:                                               ; preds = %36
  invoke void @_ZN10SimTK_SFMT12fill_array32EPjiRNS_8SFMTDataE(ptr noundef nonnull %33, i32 noundef %spec.store.select, ptr noundef nonnull align 1 %1)
          to label %.preheader.preheader unwind label %53

.preheader.preheader:                             ; preds = %37
  %38 = load i32, ptr %33, align 4, !tbaa !5
  %39 = icmp eq i32 %38, %3
  br i1 %39, label %.preheader.1, label %55

.preheader.1:                                     ; preds = %.preheader.preheader
  %40 = getelementptr inbounds i8, ptr %33, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = icmp eq i32 %41, %4
  br i1 %42, label %.preheader.2, label %55

.preheader.2:                                     ; preds = %.preheader.1
  %43 = getelementptr inbounds i8, ptr %33, i64 8
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = icmp eq i32 %44, %8
  br i1 %45, label %.preheader.3, label %55

.preheader.3:                                     ; preds = %.preheader.2
  %46 = getelementptr inbounds i8, ptr %33, i64 12
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = icmp eq i32 %47, %12
  br i1 %48, label %.preheader.4, label %55

.preheader.4:                                     ; preds = %.preheader.3
  %49 = getelementptr inbounds i8, ptr %33, i64 16
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp eq i32 %50, %16
  br i1 %51, label %52, label %55

52:                                               ; preds = %.preheader.4
  invoke void @_ZN10SimTK_SFMT14deleteSFMTDataEPNS_8SFMTDataE(ptr noundef nonnull %1)
          to label %56 unwind label %53

53:                                               ; preds = %52, %37, %36, %30
  %54 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9exception
  br label %57

55:                                               ; preds = %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 52, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #10
  unreachable

56:                                               ; preds = %52
  tail call void @_ZdaPv(ptr noundef nonnull %33) #12
  br label %74

57:                                               ; preds = %28, %53, %34, %22
  %.pn31.pn = phi { ptr, i32 } [ %23, %22 ], [ %29, %28 ], [ %54, %53 ], [ %35, %34 ]
  %.228 = extractvalue { ptr, i32 } %.pn31.pn, 1
  %58 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9exception) #13
  %59 = icmp eq i32 %.228, %58
  br i1 %59, label %60, label %75

60:                                               ; preds = %57
  %.2 = extractvalue { ptr, i32 } %.pn31.pn, 0
  %61 = tail call ptr @__cxa_begin_catch(ptr %.2) #13
  %62 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
          to label %63 unwind label %72

63:                                               ; preds = %60
  %64 = load ptr, ptr %61, align 8, !tbaa !9
  %65 = getelementptr inbounds i8, ptr %64, i64 16
  %66 = load ptr, ptr %65, align 8
  %67 = tail call noundef ptr %66(ptr noundef nonnull align 8 dereferenceable(8) %61) #13
  %68 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef %67)
          to label %69 unwind label %72

69:                                               ; preds = %63
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %71 unwind label %72

71:                                               ; preds = %69
  tail call void @__cxa_end_catch()
  br label %74

72:                                               ; preds = %69, %63, %60
  %73 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %75 unwind label %76

74:                                               ; preds = %56, %71
  %.0 = phi i32 [ 1, %71 ], [ 0, %56 ]
  ret i32 %.0

75:                                               ; preds = %72, %57
  %.merged = phi { ptr, i32 } [ %.pn31.pn, %57 ], [ %73, %72 ]
  resume { ptr, i32 } %.merged

76:                                               ; preds = %72
  %77 = landingpad { ptr, i32 }
          catch ptr null
  %78 = extractvalue { ptr, i32 } %77, 0
  tail call void @__clang_call_terminate(ptr %78) #10
  unreachable
}

declare noundef ptr @_ZN10SimTK_SFMT14createSFMTDataEv() local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

declare void @_ZN10SimTK_SFMT13init_gen_randEjRNS_8SFMTDataE(i32 noundef, ptr noundef nonnull align 1) local_unnamed_addr #1

declare noundef i32 @_ZN10SimTK_SFMT10gen_rand32ERNS_8SFMTDataE(ptr noundef nonnull align 1) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare noundef i32 @_ZN10SimTK_SFMT20get_min_array_size32Ev() local_unnamed_addr #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

declare void @_ZN10SimTK_SFMT12fill_array32EPjiRNS_8SFMTDataE(ptr noundef, i32 noundef, ptr noundef nonnull align 1) local_unnamed_addr #1

declare void @_ZN10SimTK_SFMT14deleteSFMTDataEPNS_8SFMTDataE(ptr noundef) local_unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #5

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

; 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 #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #7 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #6

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #9

attributes #0 = { 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 #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 = { noreturn 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 #3 = { nobuiltin 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 #4 = { nobuiltin 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 #5 = { nofree nosync nounwind memory(none) }
attributes #6 = { 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 #7 = { 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 #8 = { noinline noreturn nounwind uwtable "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { noreturn nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { builtin nounwind }
attributes #13 = { 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 = !{!"vtable pointer", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopSimplifyPass,SROAPass,SimplifyCFGPass,TailCallElimPass