; LLVM IR from jrouwe/JoltPhysics :: JoltViewer/JoltViewer.ll (ZN10JoltViewer11UpdateFrameEf)

; 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.JoltViewer = type { %class.Application, %"class.JPH::DebugRendererPlayback", i32, i32, [8 x i8] }
%class.Application = type { ptr, [8 x i8], %struct.CameraState, %struct.CameraState, ptr, ptr, ptr, %"class.JPH::RefConst", ptr, ptr, ptr, ptr, %"class.std::__cxx11::basic_string", %"class.std::chrono::time_point", i8, i8, i8, i8, float, float, float, float, i32 }
%struct.CameraState = type <{ %"class.JPH::Vec3", %"class.JPH::Vec3", %"class.JPH::Vec3", float, [12 x i8] }>
%"class.JPH::Vec3" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.JPH::RefConst" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon.33 }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon.33 = type { i64, [8 x i8] }
%"class.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.JPH::DebugRendererPlayback" = type { ptr, %"class.JPH::UnorderedMap.34", %"class.JPH::UnorderedMap.38", %"class.JPH::Array.42" }
%"class.JPH::UnorderedMap.34" = type { %"class.JPH::HashTable.base.36", [4 x i8] }
%"class.JPH::HashTable.base.36" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::UnorderedMap.38" = type { %"class.JPH::HashTable.base.40", [4 x i8] }
%"class.JPH::HashTable.base.40" = type <{ ptr, ptr, i32, i32, i32 }>
%"class.JPH::Array.42" = type { i64, i64, ptr }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH21DebugRendererPlayback9DrawFrameEj(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH21DebugRendererPlayback12GetNumFramesEv(ptr noundef nonnull align 8 dereferenceable(96)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11Application5PauseEb(ptr noundef nonnull align 16 dereferenceable(272), i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10JoltViewer11UpdateFrameEf(ptr noundef nonnull align 16 dereferenceable(376) %0, float noundef %1) unnamed_addr #1 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store float %1, ptr %5, align 4, !tbaa !9
  %8 = load ptr, ptr %4, align 8
  %9 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 1
  %10 = call noundef i32 @_ZNK3JPH21DebugRendererPlayback12GetNumFramesEv(ptr noundef nonnull align 8 dereferenceable(96) %9)
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  store i1 false, ptr %3, align 1
  br label %103

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  %14 = getelementptr inbounds %class.Application, ptr %8, i32 0, i32 8
  %15 = load ptr, ptr %14, align 16, !tbaa !11
  %16 = load ptr, ptr %15, align 8, !tbaa !23
  %17 = getelementptr inbounds ptr, ptr %16, i64 5
  %18 = load ptr, ptr %17, align 8
  %19 = call noundef zeroext i1 %18(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef 42)
  br i1 %19, label %27, label %20

20:                                               ; preds = %13
  %21 = getelementptr inbounds %class.Application, ptr %8, i32 0, i32 8
  %22 = load ptr, ptr %21, align 16, !tbaa !11
  %23 = load ptr, ptr %22, align 8, !tbaa !23
  %24 = getelementptr inbounds ptr, ptr %23, i64 5
  %25 = load ptr, ptr %24, align 8
  %26 = call noundef zeroext i1 %25(ptr noundef nonnull align 8 dereferenceable(8) %22, i32 noundef 43)
  br label %27

27:                                               ; preds = %20, %13
  %28 = phi i1 [ true, %13 ], [ %26, %20 ]
  %29 = zext i1 %28 to i8
  store i8 %29, ptr %6, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %30 = getelementptr inbounds %class.Application, ptr %8, i32 0, i32 8
  %31 = load ptr, ptr %30, align 16, !tbaa !11
  %32 = load ptr, ptr %31, align 8, !tbaa !23
  %33 = getelementptr inbounds ptr, ptr %32, i64 6
  %34 = load ptr, ptr %33, align 8
  %35 = call noundef i32 %34(ptr noundef nonnull align 8 dereferenceable(8) %31)
  store i32 %35, ptr %7, align 4, !tbaa !26
  br label %36

36:                                               ; preds = %60, %27
  %37 = load i32, ptr %7, align 4, !tbaa !26
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %67

40:                                               ; preds = %36
  %41 = load i32, ptr %7, align 4, !tbaa !26
  switch i32 %41, label %59 [
    i32 19, label %42
    i32 16, label %45
    i32 39, label %47
    i32 40, label %53
  ]

42:                                               ; preds = %40
  %43 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 3
  store i32 0, ptr %43, align 4, !tbaa !28
  %44 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 2
  store i32 4, ptr %44, align 16, !tbaa !37
  call void @_ZN11Application5PauseEb(ptr noundef nonnull align 16 dereferenceable(272) %8, i1 noundef zeroext true)
  br label %59

45:                                               ; preds = %40
  %46 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 2
  store i32 4, ptr %46, align 16, !tbaa !37
  call void @_ZN11Application10SingleStepEv(ptr noundef nonnull align 16 dereferenceable(272) %8)
  br label %59

47:                                               ; preds = %40
  %48 = load i8, ptr %6, align 1, !tbaa !25, !range !38, !noundef !39
  %49 = trunc i8 %48 to i1
  %50 = zext i1 %49 to i64
  %51 = select i1 %49, i32 0, i32 1
  %52 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 2
  store i32 %51, ptr %52, align 16, !tbaa !37
  call void @_ZN11Application5PauseEb(ptr noundef nonnull align 16 dereferenceable(272) %8, i1 noundef zeroext false)
  br label %59

53:                                               ; preds = %40
  %54 = load i8, ptr %6, align 1, !tbaa !25, !range !38, !noundef !39
  %55 = trunc i8 %54 to i1
  %56 = zext i1 %55 to i64
  %57 = select i1 %55, i32 4, i32 3
  %58 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 2
  store i32 %57, ptr %58, align 16, !tbaa !37
  call void @_ZN11Application5PauseEb(ptr noundef nonnull align 16 dereferenceable(272) %8, i1 noundef zeroext false)
  br label %59

59:                                               ; preds = %53, %47, %45, %42, %40
  br label %60

60:                                               ; preds = %59
  %61 = getelementptr inbounds %class.Application, ptr %8, i32 0, i32 8
  %62 = load ptr, ptr %61, align 16, !tbaa !11
  %63 = load ptr, ptr %62, align 8, !tbaa !23
  %64 = getelementptr inbounds ptr, ptr %63, i64 7
  %65 = load ptr, ptr %64, align 8
  %66 = call noundef i32 %65(ptr noundef nonnull align 8 dereferenceable(8) %62)
  store i32 %66, ptr %7, align 4, !tbaa !26
  br label %36, !llvm.loop !40

67:                                               ; preds = %39
  %68 = load float, ptr %5, align 4, !tbaa !9
  %69 = fcmp ogt float %68, 0.000000e+00
  br i1 %69, label %70, label %102

70:                                               ; preds = %67
  %71 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 2
  %72 = load i32, ptr %71, align 16, !tbaa !37
  switch i32 %72, label %98 [
    i32 3, label %73
    i32 4, label %75
    i32 1, label %87
    i32 0, label %89
    i32 2, label %98
  ]

73:                                               ; preds = %70
  %74 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 2
  store i32 2, ptr %74, align 16, !tbaa !37
  br label %75

75:                                               ; preds = %73, %70
  %76 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 3
  %77 = load i32, ptr %76, align 4, !tbaa !28
  %78 = add i32 %77, 1
  %79 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 1
  %80 = call noundef i32 @_ZNK3JPH21DebugRendererPlayback12GetNumFramesEv(ptr noundef nonnull align 8 dereferenceable(96) %79)
  %81 = icmp ult i32 %78, %80
  br i1 %81, label %82, label %86

82:                                               ; preds = %75
  %83 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 3
  %84 = load i32, ptr %83, align 4, !tbaa !28
  %85 = add i32 %84, 1
  store i32 %85, ptr %83, align 4, !tbaa !28
  br label %86

86:                                               ; preds = %82, %75
  br label %98

87:                                               ; preds = %70
  %88 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 2
  store i32 2, ptr %88, align 16, !tbaa !37
  br label %89

89:                                               ; preds = %87, %70
  %90 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 3
  %91 = load i32, ptr %90, align 4, !tbaa !28
  %92 = icmp ugt i32 %91, 0
  br i1 %92, label %93, label %97

93:                                               ; preds = %89
  %94 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 3
  %95 = load i32, ptr %94, align 4, !tbaa !28
  %96 = add i32 %95, -1
  store i32 %96, ptr %94, align 4, !tbaa !28
  br label %97

97:                                               ; preds = %93, %89
  br label %98

98:                                               ; preds = %97, %86, %70, %70
  %99 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 1
  %100 = getelementptr inbounds %class.JoltViewer, ptr %8, i32 0, i32 3
  %101 = load i32, ptr %100, align 4, !tbaa !28
  call void @_ZNK3JPH21DebugRendererPlayback9DrawFrameEj(ptr noundef nonnull align 8 dereferenceable(96) %99, i32 noundef %101)
  br label %102

102:                                              ; preds = %98, %67
  store i1 true, ptr %3, align 1
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  br label %103

103:                                              ; preds = %102, %12
  %104 = load i1, ptr %3, align 1
  ret i1 %104
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !6, i64 176}
!12 = !{!"_ZTS11Application", !13, i64 16, !13, i64 80, !6, i64 144, !6, i64 152, !6, i64 160, !15, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !16, i64 208, !19, i64 240, !21, i64 248, !21, i64 249, !21, i64 250, !21, i64 251, !10, i64 252, !10, i64 256, !10, i64 260, !10, i64 264, !22, i64 268}
!13 = !{!"_ZTS11CameraState", !14, i64 0, !14, i64 16, !14, i64 32, !10, i64 48}
!14 = !{!"_ZTSN3JPH4Vec3E", !7, i64 0}
!15 = !{!"_ZTSN3JPH8RefConstI4FontEE", !6, i64 0}
!16 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !17, i64 0, !18, i64 8, !7, i64 16}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !6, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSNSt6chrono10time_pointINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEEEE", !20, i64 0}
!20 = !{!"_ZTSNSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEE", !18, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !8, i64 0}
!25 = !{!21, !21, i64 0}
!26 = !{!27, !27, i64 0}
!27 = !{!"_ZTS4EKey", !7, i64 0}
!28 = !{!29, !22, i64 372}
!29 = !{!"_ZTS10JoltViewer", !12, i64 0, !30, i64 272, !36, i64 368, !22, i64 372}
!30 = !{!"_ZTSN3JPH21DebugRendererPlaybackE", !6, i64 0, !31, i64 8, !33, i64 40, !35, i64 72}
!31 = !{!"_ZTSN3JPH12UnorderedMapIjNS_3RefINS_16RefTargetVirtualEEENS_4HashIjEESt8equal_toIjEEE", !32, i64 0}
!32 = !{!"_ZTSN3JPH9HashTableIjSt4pairIjNS_3RefINS_16RefTargetVirtualEEEENS_18UnorderedMapDetailIjS4_EENS_4HashIjEESt8equal_toIjEEE", !6, i64 0, !6, i64 8, !22, i64 16, !22, i64 20, !22, i64 24}
!33 = !{!"_ZTSN3JPH12UnorderedMapIjNS_3RefINS_13DebugRenderer8GeometryEEENS_4HashIjEESt8equal_toIjEEE", !34, i64 0}
!34 = !{!"_ZTSN3JPH9HashTableIjSt4pairIjNS_3RefINS_13DebugRenderer8GeometryEEEENS_18UnorderedMapDetailIjS5_EENS_4HashIjEESt8equal_toIjEEE", !6, i64 0, !6, i64 8, !22, i64 16, !22, i64 20, !22, i64 24}
!35 = !{!"_ZTSN3JPH5ArrayINS_21DebugRendererRecorder5FrameENS_12STLAllocatorIS2_EEEE", !18, i64 0, !18, i64 8, !6, i64 16}
!36 = !{!"_ZTSN10JoltViewer13EPlaybackModeE", !7, i64 0}
!37 = !{!29, !36, i64 368}
!38 = !{i8 0, i8 2}
!39 = !{}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}


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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK3JPH21DebugRendererPlayback9DrawFrameEj(ptr noundef nonnull align 8 dereferenceable(96), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK3JPH21DebugRendererPlayback12GetNumFramesEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11Application5PauseEb(ptr noundef nonnull align 16 dereferenceable(272), i1 noundef zeroext) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN10JoltViewer11UpdateFrameEf(ptr noundef nonnull align 16 dereferenceable(376) %0, float noundef %1) unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 272
  %4 = tail call noundef i32 @_ZNK3JPH21DebugRendererPlayback12GetNumFramesEv(ptr noundef nonnull align 8 dereferenceable(96) %3)
  %5 = icmp ne i32 %4, 0
  br i1 %5, label %6, label %59

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 176
  %8 = load ptr, ptr %7, align 16, !tbaa !5
  %9 = load ptr, ptr %8, align 8, !tbaa !21
  %10 = getelementptr inbounds i8, ptr %9, i64 40
  %11 = load ptr, ptr %10, align 8
  %12 = tail call noundef zeroext i1 %11(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 42)
  br i1 %12, label %19, label %13

13:                                               ; preds = %6
  %14 = load ptr, ptr %7, align 16, !tbaa !5
  %15 = load ptr, ptr %14, align 8, !tbaa !21
  %16 = getelementptr inbounds i8, ptr %15, i64 40
  %17 = load ptr, ptr %16, align 8
  %18 = tail call noundef zeroext i1 %17(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef 43)
  br label %19

19:                                               ; preds = %13, %6
  %20 = phi i1 [ true, %6 ], [ %18, %13 ]
  %21 = load ptr, ptr %7, align 16, !tbaa !5
  %22 = load ptr, ptr %21, align 8, !tbaa !21
  %23 = getelementptr inbounds i8, ptr %22, i64 48
  %24 = load ptr, ptr %23, align 8
  %25 = tail call noundef i32 %24(ptr noundef nonnull align 8 dereferenceable(8) %21)
  %spec.select = select i1 %20, i32 4, i32 3
  %26 = getelementptr inbounds i8, ptr %0, i64 368
  %not. = xor i1 %20, true
  %27 = zext i1 %not. to i32
  %28 = getelementptr inbounds i8, ptr %0, i64 372
  br label %29

29:                                               ; preds = %36, %19
  %.0 = phi i32 [ %25, %19 ], [ %41, %36 ]
  switch i32 %.0, label %36 [
    i32 0, label %30
    i32 19, label %32
    i32 16, label %33
    i32 39, label %34
    i32 40, label %35
  ]

30:                                               ; preds = %29
  %31 = fcmp ogt float %1, 0.000000e+00
  br i1 %31, label %42, label %59

32:                                               ; preds = %29
  store i32 0, ptr %28, align 4, !tbaa !23
  store i32 4, ptr %26, align 16, !tbaa !32
  tail call void @_ZN11Application5PauseEb(ptr noundef nonnull align 16 dereferenceable(272) %0, i1 noundef zeroext true)
  br label %36

33:                                               ; preds = %29
  store i32 4, ptr %26, align 16, !tbaa !32
  tail call void @_ZN11Application10SingleStepEv(ptr noundef nonnull align 16 dereferenceable(272) %0)
  br label %36

34:                                               ; preds = %29
  store i32 %27, ptr %26, align 16, !tbaa !32
  tail call void @_ZN11Application5PauseEb(ptr noundef nonnull align 16 dereferenceable(272) %0, i1 noundef zeroext false)
  br label %36

35:                                               ; preds = %29
  store i32 %spec.select, ptr %26, align 16, !tbaa !32
  tail call void @_ZN11Application5PauseEb(ptr noundef nonnull align 16 dereferenceable(272) %0, i1 noundef zeroext false)
  br label %36

36:                                               ; preds = %29, %32, %33, %34, %35
  %37 = load ptr, ptr %7, align 16, !tbaa !5
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %39 = getelementptr inbounds i8, ptr %38, i64 56
  %40 = load ptr, ptr %39, align 8
  %41 = tail call noundef i32 %40(ptr noundef nonnull align 8 dereferenceable(8) %37)
  br label %29, !llvm.loop !33

42:                                               ; preds = %30
  %43 = load i32, ptr %26, align 16, !tbaa !32
  switch i32 %43, label %._crit_edge [
    i32 3, label %44
    i32 4, label %45
    i32 1, label %52
    i32 0, label %53
  ]

._crit_edge:                                      ; preds = %42
  %.pre = load i32, ptr %28, align 4, !tbaa !23
  br label %57

44:                                               ; preds = %42
  store i32 2, ptr %26, align 16, !tbaa !32
  br label %45

45:                                               ; preds = %44, %42
  %46 = load i32, ptr %28, align 4, !tbaa !23
  %47 = add i32 %46, 1
  %48 = tail call noundef i32 @_ZNK3JPH21DebugRendererPlayback12GetNumFramesEv(ptr noundef nonnull align 8 dereferenceable(96) %3)
  %49 = icmp ult i32 %47, %48
  %.pre9 = load i32, ptr %28, align 4, !tbaa !23
  br i1 %49, label %50, label %57

50:                                               ; preds = %45
  %51 = add i32 %.pre9, 1
  store i32 %51, ptr %28, align 4, !tbaa !23
  br label %57

52:                                               ; preds = %42
  store i32 2, ptr %26, align 16, !tbaa !32
  br label %53

53:                                               ; preds = %52, %42
  %54 = load i32, ptr %28, align 4, !tbaa !23
  %.not8 = icmp eq i32 %54, 0
  br i1 %.not8, label %57, label %55

55:                                               ; preds = %53
  %56 = add i32 %54, -1
  store i32 %56, ptr %28, align 4, !tbaa !23
  br label %57

57:                                               ; preds = %._crit_edge, %53, %55, %45, %50
  %58 = phi i32 [ %.pre, %._crit_edge ], [ 0, %53 ], [ %56, %55 ], [ %.pre9, %45 ], [ %51, %50 ]
  tail call void @_ZNK3JPH21DebugRendererPlayback9DrawFrameEj(ptr noundef nonnull align 8 dereferenceable(96) %3, i32 noundef %58)
  br label %59

59:                                               ; preds = %30, %57, %2
  ret i1 %5
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN11Application10SingleStepEv(ptr noundef nonnull align 16 dereferenceable(272)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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" }

!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, !12, i64 176}
!6 = !{!"_ZTS11Application", !7, i64 16, !7, i64 80, !12, i64 144, !12, i64 152, !12, i64 160, !13, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !14, i64 208, !17, i64 240, !19, i64 248, !19, i64 249, !19, i64 250, !19, i64 251, !11, i64 252, !11, i64 256, !11, i64 260, !11, i64 264, !20, i64 268}
!7 = !{!"_ZTS11CameraState", !8, i64 0, !8, i64 16, !8, i64 32, !11, i64 48}
!8 = !{!"_ZTSN3JPH4Vec3E", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"float", !9, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"_ZTSN3JPH8RefConstI4FontEE", !12, i64 0}
!14 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !15, i64 0, !16, i64 8, !9, i64 16}
!15 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !12, i64 0}
!16 = !{!"long", !9, i64 0}
!17 = !{!"_ZTSNSt6chrono10time_pointINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEEEE", !18, i64 0}
!18 = !{!"_ZTSNSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEE", !16, i64 0}
!19 = !{!"bool", !9, i64 0}
!20 = !{!"int", !9, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"vtable pointer", !10, i64 0}
!23 = !{!24, !20, i64 372}
!24 = !{!"_ZTS10JoltViewer", !6, i64 0, !25, i64 272, !31, i64 368, !20, i64 372}
!25 = !{!"_ZTSN3JPH21DebugRendererPlaybackE", !12, i64 0, !26, i64 8, !28, i64 40, !30, i64 72}
!26 = !{!"_ZTSN3JPH12UnorderedMapIjNS_3RefINS_16RefTargetVirtualEEENS_4HashIjEESt8equal_toIjEEE", !27, i64 0}
!27 = !{!"_ZTSN3JPH9HashTableIjSt4pairIjNS_3RefINS_16RefTargetVirtualEEEENS_18UnorderedMapDetailIjS4_EENS_4HashIjEESt8equal_toIjEEE", !12, i64 0, !12, i64 8, !20, i64 16, !20, i64 20, !20, i64 24}
!28 = !{!"_ZTSN3JPH12UnorderedMapIjNS_3RefINS_13DebugRenderer8GeometryEEENS_4HashIjEESt8equal_toIjEEE", !29, i64 0}
!29 = !{!"_ZTSN3JPH9HashTableIjSt4pairIjNS_3RefINS_13DebugRenderer8GeometryEEEENS_18UnorderedMapDetailIjS5_EENS_4HashIjEESt8equal_toIjEEE", !12, i64 0, !12, i64 8, !20, i64 16, !20, i64 20, !20, i64 24}
!30 = !{!"_ZTSN3JPH5ArrayINS_21DebugRendererRecorder5FrameENS_12STLAllocatorIS2_EEEE", !16, i64 0, !16, i64 8, !12, i64 16}
!31 = !{!"_ZTSN10JoltViewer13EPlaybackModeE", !9, i64 0}
!32 = !{!24, !31, i64 368}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}


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