; LLVM IR from thuhcsi/Crystal.TTVS :: Xface/XFace/src/XFaceApp/ApplicationBase.ll (ZNK8XFaceApp15ApplicationBase11synchronizeEb)

; 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.XFaceApp::ApplicationBase" = type { %"class.XFaceApp::TaskHandlerBase", i8, i8, ptr, ptr, ptr, ptr, ptr, ptr }
%"class.XFaceApp::TaskHandlerBase" = type { ptr, %"class.std::queue", ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<XFaceApp::Task, std::allocator<XFaceApp::Task>>::_Deque_impl" }
%"struct.std::_Deque_base<XFaceApp::Task, std::allocator<XFaceApp::Task>>::_Deque_impl" = type { %"struct.std::_Deque_base<XFaceApp::Task, std::allocator<XFaceApp::Task>>::_Deque_impl_data" }
%"struct.std::_Deque_base<XFaceApp::Task, std::allocator<XFaceApp::Task>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count = external hidden global i32, align 4
@_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE13missed_frames = external hidden global i32, align 4
@_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time = external hidden global i32, align 4
@_ZGVZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time = external hidden global i64, align 8
@.str.21 = external hidden unnamed_addr constant [16 x i8], align 1

; 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
define dso_local void @_ZNK8XFaceApp15ApplicationBase11synchronizeEb(ptr noundef nonnull align 8 dereferenceable(152) %0, i1 noundef zeroext %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = zext i1 %1 to i8
  store i8 %8, ptr %4, align 1, !tbaa !9
  %9 = load ptr, ptr %3, align 8
  %10 = load atomic i8, ptr @_ZGVZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time acquire, align 8
  %11 = icmp eq i8 %10, 0
  br i1 %11, label %12, label %22, !prof !11

12:                                               ; preds = %2
  %13 = call i32 @__cxa_guard_acquire(ptr @_ZGVZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time) #3
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %15, label %22

15:                                               ; preds = %12
  %16 = getelementptr inbounds %"class.XFaceApp::ApplicationBase", ptr %9, i32 0, i32 7
  %17 = load ptr, ptr %16, align 8, !tbaa !12
  %18 = invoke noundef signext i16 @_ZNK5XFace10IFapStream6getFPSEv(ptr noundef nonnull align 8 dereferenceable(40) %17)
          to label %19 unwind label %37

19:                                               ; preds = %15
  %20 = sext i16 %18 to i32
  %21 = sdiv i32 1000, %20
  store i32 %21, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time, align 4, !tbaa !22
  call void @__cxa_guard_release(ptr @_ZGVZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time) #3
  br label %22

22:                                               ; preds = %19, %12, %2
  %23 = load i8, ptr %4, align 1, !tbaa !9, !range !24, !noundef !25
  %24 = trunc i8 %23 to i1
  br i1 %24, label %25, label %41

25:                                               ; preds = %22
  %26 = getelementptr inbounds %"class.XFaceApp::ApplicationBase", ptr %9, i32 0, i32 5
  %27 = load ptr, ptr %26, align 8, !tbaa !26
  %28 = load ptr, ptr %27, align 8, !tbaa !27
  %29 = getelementptr inbounds ptr, ptr %28, i64 0
  %30 = load ptr, ptr %29, align 8
  %31 = call noundef i64 %30(ptr noundef nonnull align 8 dereferenceable(8) %27)
  store i32 0, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE13missed_frames, align 4, !tbaa !22
  store i32 0, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !22
  %32 = getelementptr inbounds %"class.XFaceApp::ApplicationBase", ptr %9, i32 0, i32 7
  %33 = load ptr, ptr %32, align 8, !tbaa !12
  %34 = call noundef signext i16 @_ZNK5XFace10IFapStream6getFPSEv(ptr noundef nonnull align 8 dereferenceable(40) %33)
  %35 = sext i16 %34 to i32
  %36 = sdiv i32 1000, %35
  store i32 %36, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time, align 4, !tbaa !22
  br label %41

37:                                               ; preds = %15
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %5, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %6, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time) #3
  br label %99

41:                                               ; preds = %25, %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %42 = getelementptr inbounds %"class.XFaceApp::ApplicationBase", ptr %9, i32 0, i32 5
  %43 = load ptr, ptr %42, align 8, !tbaa !26
  %44 = load ptr, ptr %43, align 8, !tbaa !27
  %45 = getelementptr inbounds ptr, ptr %44, i64 3
  %46 = load ptr, ptr %45, align 8
  %47 = call noundef i64 %46(ptr noundef nonnull align 8 dereferenceable(8) %43, i1 noundef zeroext false)
  %48 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time, align 4, !tbaa !22
  %49 = zext i32 %48 to i64
  %50 = udiv i64 %47, %49
  %51 = trunc i64 %50 to i32
  store i32 %51, ptr %7, align 4, !tbaa !22
  br label %52

52:                                               ; preds = %56, %41
  %53 = load i32, ptr %7, align 4, !tbaa !22
  %54 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !22
  %55 = icmp ugt i32 %53, %54
  br i1 %55, label %56, label %65

56:                                               ; preds = %52
  %57 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !22
  %58 = add i32 %57, 1
  store i32 %58, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !22
  %59 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE13missed_frames, align 4, !tbaa !22
  %60 = add i32 %59, 1
  store i32 %60, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE13missed_frames, align 4, !tbaa !22
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.21)
  %62 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE13missed_frames, align 4, !tbaa !22
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %61, i32 noundef %62)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %52, !llvm.loop !29

65:                                               ; preds = %52
  %66 = getelementptr inbounds %"class.XFaceApp::ApplicationBase", ptr %9, i32 0, i32 5
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  %68 = load ptr, ptr %67, align 8, !tbaa !27
  %69 = getelementptr inbounds ptr, ptr %68, i64 2
  %70 = load ptr, ptr %69, align 8
  %71 = call noundef i64 %70(ptr noundef nonnull align 8 dereferenceable(8) %67, i1 noundef zeroext false)
  %72 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time, align 4, !tbaa !22
  %73 = zext i32 %72 to i64
  %74 = icmp ult i64 %71, %73
  br i1 %74, label %75, label %90

75:                                               ; preds = %65
  %76 = getelementptr inbounds %"class.XFaceApp::ApplicationBase", ptr %9, i32 0, i32 5
  %77 = load ptr, ptr %76, align 8, !tbaa !26
  %78 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time, align 4, !tbaa !22
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds %"class.XFaceApp::ApplicationBase", ptr %9, i32 0, i32 5
  %81 = load ptr, ptr %80, align 8, !tbaa !26
  %82 = load ptr, ptr %81, align 8, !tbaa !27
  %83 = getelementptr inbounds ptr, ptr %82, i64 2
  %84 = load ptr, ptr %83, align 8
  %85 = call noundef i64 %84(ptr noundef nonnull align 8 dereferenceable(8) %81, i1 noundef zeroext false)
  %86 = sub i64 %79, %85
  %87 = load ptr, ptr %77, align 8, !tbaa !27
  %88 = getelementptr inbounds ptr, ptr %87, i64 1
  %89 = load ptr, ptr %88, align 8
  call void %89(ptr noundef nonnull align 8 dereferenceable(8) %77, i64 noundef %86)
  br label %90

90:                                               ; preds = %75, %65
  %91 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !22
  %92 = add i32 %91, 1
  store i32 %92, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !22
  %93 = getelementptr inbounds %"class.XFaceApp::ApplicationBase", ptr %9, i32 0, i32 5
  %94 = load ptr, ptr %93, align 8, !tbaa !26
  %95 = load ptr, ptr %94, align 8, !tbaa !27
  %96 = getelementptr inbounds ptr, ptr %95, i64 2
  %97 = load ptr, ptr %96, align 8
  %98 = call noundef i64 %97(ptr noundef nonnull align 8 dereferenceable(8) %94, i1 noundef zeroext true)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret void

99:                                               ; preds = %37
  %100 = load ptr, ptr %5, align 8
  %101 = load i32, ptr %6, align 4
  %102 = insertvalue { ptr, i32 } poison, ptr %100, 0
  %103 = insertvalue { ptr, i32 } %102, i32 %101, 1
  resume { ptr, i32 } %103
}

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i16 @_ZNK5XFace10IFapStream6getFPSEv(ptr noundef nonnull align 8 dereferenceable(40)) #4 align 2

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #3

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 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)) #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 = { 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 #3 = { nounwind }
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" }

!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 = !{!"bool", !7, i64 0}
!11 = !{!"branch_weights", i32 1, i32 1048575}
!12 = !{!13, !6, i64 136}
!13 = !{!"_ZTSN8XFaceApp15ApplicationBaseE", !14, i64 0, !10, i64 96, !10, i64 97, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144}
!14 = !{!"_ZTSN8XFaceApp15TaskHandlerBaseE", !15, i64 8, !6, i64 88}
!15 = !{!"_ZTSSt5queueIN8XFaceApp4TaskESt5dequeIS1_SaIS1_EEE", !16, i64 0}
!16 = !{!"_ZTSSt5dequeIN8XFaceApp4TaskESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt11_Deque_baseIN8XFaceApp4TaskESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseIN8XFaceApp4TaskESaIS1_EE11_Deque_implE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseIN8XFaceApp4TaskESaIS1_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !21, i64 16, !21, i64 48}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSSt15_Deque_iteratorIN8XFaceApp4TaskERS1_PS1_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!23, !23, i64 0}
!23 = !{!"int", !7, i64 0}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!13, !6, i64 120}
!27 = !{!28, !28, i64 0}
!28 = !{!"vtable pointer", !8, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"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"

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count = external hidden local_unnamed_addr global i32, align 4
@_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE13missed_frames = external hidden local_unnamed_addr global i32, align 4
@_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time = external hidden local_unnamed_addr global i32, align 4
@_ZGVZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time = external hidden global i64, align 8
@.str.21 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8XFaceApp15ApplicationBase11synchronizeEb(ptr nocapture noundef nonnull readonly align 8 dereferenceable(152) %0, i1 noundef zeroext %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = load atomic i8, ptr @_ZGVZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time acquire, align 8
  %4 = icmp eq i8 %3, 0
  br i1 %4, label %5, label %12, !prof !5

5:                                                ; preds = %2
  %6 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time) #4
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %12, label %7

7:                                                ; preds = %5
  %8 = getelementptr inbounds i8, ptr %0, i64 136
  %9 = load ptr, ptr %8, align 8, !tbaa !6
  %10 = tail call noundef signext i16 @_ZNK5XFace10IFapStream6getFPSEv(ptr noundef nonnull align 8 dereferenceable(40) %9)
  %11 = sdiv i16 1000, %10
  %.sext4 = sext i16 %11 to i32
  store i32 %.sext4, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time, align 4, !tbaa !20
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time) #4
  br label %12

12:                                               ; preds = %7, %5, %2
  br i1 %1, label %13, label %23

13:                                               ; preds = %12
  %14 = getelementptr inbounds i8, ptr %0, i64 120
  %15 = load ptr, ptr %14, align 8, !tbaa !22
  %16 = load ptr, ptr %15, align 8, !tbaa !23
  %17 = load ptr, ptr %16, align 8
  %18 = tail call noundef i64 %17(ptr noundef nonnull align 8 dereferenceable(8) %15)
  store i32 0, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE13missed_frames, align 4, !tbaa !20
  store i32 0, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %0, i64 136
  %20 = load ptr, ptr %19, align 8, !tbaa !6
  %21 = tail call noundef signext i16 @_ZNK5XFace10IFapStream6getFPSEv(ptr noundef nonnull align 8 dereferenceable(40) %20)
  %22 = sdiv i16 1000, %21
  %.sext = sext i16 %22 to i32
  store i32 %.sext, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time, align 4, !tbaa !20
  br label %23

23:                                               ; preds = %13, %12
  %24 = getelementptr inbounds i8, ptr %0, i64 120
  %25 = load ptr, ptr %24, align 8, !tbaa !22
  %26 = load ptr, ptr %25, align 8, !tbaa !23
  %27 = getelementptr inbounds i8, ptr %26, i64 24
  %28 = load ptr, ptr %27, align 8
  %29 = tail call noundef i64 %28(ptr noundef nonnull align 8 dereferenceable(8) %25, i1 noundef zeroext false)
  %30 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time, align 4, !tbaa !20
  %31 = zext i32 %30 to i64
  %32 = udiv i64 %29, %31
  %33 = trunc i64 %32 to i32
  %34 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !20
  %35 = icmp ult i32 %34, %33
  br i1 %35, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %23, %.lr.ph
  %36 = phi i32 [ %44, %.lr.ph ], [ %34, %23 ]
  %37 = add nuw i32 %36, 1
  store i32 %37, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !20
  %38 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE13missed_frames, align 4, !tbaa !20
  %39 = add i32 %38, 1
  store i32 %39, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE13missed_frames, align 4, !tbaa !20
  %40 = 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.21)
  %41 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE13missed_frames, align 4, !tbaa !20
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEj(ptr noundef nonnull align 8 dereferenceable(8) %40, i32 noundef %41)
  %43 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %44 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !20
  %45 = icmp ult i32 %44, %33
  br i1 %45, label %.lr.ph, label %._crit_edge, !llvm.loop !25

._crit_edge:                                      ; preds = %.lr.ph, %23
  %46 = load ptr, ptr %24, align 8, !tbaa !22
  %47 = load ptr, ptr %46, align 8, !tbaa !23
  %48 = getelementptr inbounds i8, ptr %47, i64 16
  %49 = load ptr, ptr %48, align 8
  %50 = tail call noundef i64 %49(ptr noundef nonnull align 8 dereferenceable(8) %46, i1 noundef zeroext false)
  %51 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE10frame_time, align 4, !tbaa !20
  %52 = zext i32 %51 to i64
  %53 = icmp ult i64 %50, %52
  br i1 %53, label %54, label %64

54:                                               ; preds = %._crit_edge
  %55 = load ptr, ptr %24, align 8, !tbaa !22
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = load ptr, ptr %57, align 8
  %59 = tail call noundef i64 %58(ptr noundef nonnull align 8 dereferenceable(8) %55, i1 noundef zeroext false)
  %60 = sub i64 %52, %59
  %61 = load ptr, ptr %55, align 8, !tbaa !23
  %62 = getelementptr inbounds i8, ptr %61, i64 8
  %63 = load ptr, ptr %62, align 8
  tail call void %63(ptr noundef nonnull align 8 dereferenceable(8) %55, i64 noundef %60)
  br label %64

64:                                               ; preds = %54, %._crit_edge
  %65 = load i32, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !20
  %66 = add i32 %65, 1
  store i32 %66, ptr @_ZZNK8XFaceApp15ApplicationBase11synchronizeEbE11frame_count, align 4, !tbaa !20
  %67 = load ptr, ptr %24, align 8, !tbaa !22
  %68 = load ptr, ptr %67, align 8, !tbaa !23
  %69 = getelementptr inbounds i8, ptr %68, i64 16
  %70 = load ptr, ptr %69, align 8
  %71 = tail call noundef i64 %70(ptr noundef nonnull align 8 dereferenceable(8) %67, i1 noundef zeroext true)
  ret void
}

declare i32 @__gxx_personality_v0(...)

; 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: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef signext i16 @_ZNK5XFace10IFapStream6getFPSEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3 align 2

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #2

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

; 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 #0 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)) #1

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 = { nofree nounwind }
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 = { 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 = !{!"branch_weights", i32 1, i32 1048575}
!6 = !{!7, !14, i64 136}
!7 = !{!"_ZTSN8XFaceApp15ApplicationBaseE", !8, i64 0, !19, i64 96, !19, i64 97, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !14, i64 136, !14, i64 144}
!8 = !{!"_ZTSN8XFaceApp15TaskHandlerBaseE", !9, i64 8, !14, i64 88}
!9 = !{!"_ZTSSt5queueIN8XFaceApp4TaskESt5dequeIS1_SaIS1_EEE", !10, i64 0}
!10 = !{!"_ZTSSt5dequeIN8XFaceApp4TaskESaIS1_EE", !11, i64 0}
!11 = !{!"_ZTSSt11_Deque_baseIN8XFaceApp4TaskESaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSNSt11_Deque_baseIN8XFaceApp4TaskESaIS1_EE11_Deque_implE", !13, i64 0}
!13 = !{!"_ZTSNSt11_Deque_baseIN8XFaceApp4TaskESaIS1_EE16_Deque_impl_dataE", !14, i64 0, !17, i64 8, !18, i64 16, !18, i64 48}
!14 = !{!"any pointer", !15, i64 0}
!15 = !{!"omnipotent char", !16, i64 0}
!16 = !{!"Simple C++ TBAA"}
!17 = !{!"long", !15, i64 0}
!18 = !{!"_ZTSSt15_Deque_iteratorIN8XFaceApp4TaskERS1_PS1_E", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!19 = !{!"bool", !15, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"int", !15, i64 0}
!22 = !{!7, !14, i64 120}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !16, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass