; LLVM IR from kdrag0n/fxdsp :: external/oboe/src/common/LatencyTuner.ll (ZN4oboe12LatencyTuner4tuneEv)

; 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.oboe::ResultWithValue" = type { i32, i32 }
%"class.oboe::LatencyTuner" = type { ptr, i32, i32, i32, i32, i32, i32, %"struct.std::atomic", %"struct.std::atomic" }
%"struct.std::atomic" = type { %"struct.std::__atomic_base" }
%"struct.std::__atomic_base" = type { i32 }

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4oboe12LatencyTuner5resetEv(ptr noundef nonnull align 8 dereferenceable(40)) #1 align 2

; 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 noundef i32 @_ZN4oboe12LatencyTuner4tuneEv(ptr noundef nonnull align 8 dereferenceable(40) %0) #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.oboe::ResultWithValue", align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.oboe::ResultWithValue", align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  %11 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 1
  %12 = load i32, ptr %11, align 8, !tbaa !9
  %13 = icmp eq i32 %12, 3
  br i1 %13, label %14, label %15

14:                                               ; preds = %1
  store i32 -890, ptr %2, align 4
  br label %111

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %16 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 7
  %17 = call noundef i32 @_ZNKSt13__atomic_baseIiE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %16, i32 noundef 5) #4
  store i32 %17, ptr %5, align 4, !tbaa !17
  %18 = load i32, ptr %5, align 4, !tbaa !17
  %19 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 8
  %20 = call noundef i32 @_ZNKSt13__atomic_baseIiE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %19, i32 noundef 5) #4
  %21 = icmp ne i32 %18, %20
  br i1 %21, label %22, label %25

22:                                               ; preds = %15
  %23 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 8
  %24 = load i32, ptr %5, align 4, !tbaa !17
  call void @_ZNSt13__atomic_baseIiE5storeEiSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %23, i32 noundef %24, i32 noundef 5) #4
  call void @_ZN4oboe12LatencyTuner5resetEv(ptr noundef nonnull align 8 dereferenceable(40) %10)
  br label %25

25:                                               ; preds = %22, %15
  %26 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 1
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %36

29:                                               ; preds = %25
  %30 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 4
  %31 = load i32, ptr %30, align 4, !tbaa !18
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr %30, align 4, !tbaa !18
  %33 = icmp sle i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %29
  %35 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 1
  store i32 1, ptr %35, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %34, %29, %25
  %37 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 1
  %38 = load i32, ptr %37, align 8, !tbaa !9
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %40, label %99

40:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %41 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !19
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  %44 = getelementptr inbounds ptr, ptr %43, i64 18
  %45 = load ptr, ptr %44, align 8
  %46 = call i64 %45(ptr noundef nonnull align 8 dereferenceable(238) %42)
  store i64 %46, ptr %6, align 4
  %47 = call noundef i32 @_ZNK4oboe15ResultWithValueIiEcvNS_6ResultEEv(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %96

49:                                               ; preds = %40
  %50 = call noundef i32 @_ZNK4oboe15ResultWithValueIiE5valueEv(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %51 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 3
  %52 = load i32, ptr %51, align 8, !tbaa !22
  %53 = sub nsw i32 %50, %52
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %55, label %95

55:                                               ; preds = %49
  %56 = call noundef i32 @_ZNK4oboe15ResultWithValueIiE5valueEv(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %57 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 3
  store i32 %56, ptr %57, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %58 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  %60 = load ptr, ptr %59, align 8, !tbaa !20
  %61 = getelementptr inbounds ptr, ptr %60, i64 2
  %62 = load ptr, ptr %61, align 8
  %63 = call noundef i32 %62(ptr noundef nonnull align 8 dereferenceable(152) %59)
  store i32 %63, ptr %7, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %64 = load i32, ptr %7, align 4, !tbaa !17
  %65 = call noundef i32 @_ZNK4oboe12LatencyTuner22getBufferSizeIncrementEv(ptr noundef nonnull align 8 dereferenceable(40) %10)
  %66 = add nsw i32 %64, %65
  store i32 %66, ptr %8, align 4, !tbaa !17
  %67 = load i32, ptr %8, align 4, !tbaa !17
  %68 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 2
  %69 = load i32, ptr %68, align 4, !tbaa !23
  %70 = icmp sgt i32 %67, %69
  br i1 %70, label %71, label %74

71:                                               ; preds = %55
  %72 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 2
  %73 = load i32, ptr %72, align 4, !tbaa !23
  store i32 %73, ptr %8, align 4, !tbaa !17
  br label %74

74:                                               ; preds = %71, %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %75 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !19
  %77 = load i32, ptr %8, align 4, !tbaa !17
  %78 = load ptr, ptr %76, align 8, !tbaa !20
  %79 = getelementptr inbounds ptr, ptr %78, i64 17
  %80 = load ptr, ptr %79, align 8
  %81 = call i64 %80(ptr noundef nonnull align 8 dereferenceable(238) %76, i32 noundef %77)
  store i64 %81, ptr %9, align 4
  %82 = call noundef i32 @_ZNK4oboe15ResultWithValueIiEcvNS_6ResultEEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %87

84:                                               ; preds = %74
  %85 = call noundef i32 @_ZNK4oboe15ResultWithValueIiEcvNS_6ResultEEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
  store i32 %85, ptr %4, align 4, !tbaa !15
  %86 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 1
  store i32 3, ptr %86, align 8, !tbaa !9
  br label %94

87:                                               ; preds = %74
  %88 = call noundef i32 @_ZNK4oboe15ResultWithValueIiE5valueEv(ptr noundef nonnull align 4 dereferenceable(8) %9)
  %89 = load i32, ptr %7, align 4, !tbaa !17
  %90 = icmp eq i32 %88, %89
  br i1 %90, label %91, label %93

91:                                               ; preds = %87
  %92 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 1
  store i32 2, ptr %92, align 8, !tbaa !9
  br label %93

93:                                               ; preds = %91, %87
  br label %94

94:                                               ; preds = %93, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %95

95:                                               ; preds = %94, %49
  br label %98

96:                                               ; preds = %40
  %97 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 1
  store i32 3, ptr %97, align 8, !tbaa !9
  br label %98

98:                                               ; preds = %96, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %99

99:                                               ; preds = %98, %36
  %100 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 1
  %101 = load i32, ptr %100, align 8, !tbaa !9
  %102 = icmp eq i32 %101, 3
  br i1 %102, label %103, label %104

103:                                              ; preds = %99
  store i32 -890, ptr %4, align 4, !tbaa !15
  br label %104

104:                                              ; preds = %103, %99
  %105 = getelementptr inbounds %"class.oboe::LatencyTuner", ptr %10, i32 0, i32 1
  %106 = load i32, ptr %105, align 8, !tbaa !9
  %107 = icmp eq i32 %106, 2
  br i1 %107, label %108, label %109

108:                                              ; preds = %104
  store i32 0, ptr %4, align 4, !tbaa !15
  br label %109

109:                                              ; preds = %108, %104
  %110 = load i32, ptr %4, align 4, !tbaa !15
  store i32 %110, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %111

111:                                              ; preds = %109, %14
  %112 = load i32, ptr %2, align 4
  ret i32 %112
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNKSt13__atomic_baseIiE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZNSt13__atomic_baseIiE5storeEiSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4oboe15ResultWithValueIiEcvNS_6ResultEEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4oboe15ResultWithValueIiE5valueEv(ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4oboe12LatencyTuner22getBufferSizeIncrementEv(ptr noundef nonnull align 8 dereferenceable(40)) #3 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 = { alwaysinline 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 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 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTSN4oboe12LatencyTunerE", !6, i64 0, !11, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !13, i64 32, !13, i64 36}
!11 = !{!"_ZTSN4oboe12LatencyTuner5StateE", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSSt6atomicIiE", !14, i64 0}
!14 = !{!"_ZTSSt13__atomic_baseIiE", !12, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"_ZTSN4oboe6ResultE", !7, i64 0}
!17 = !{!12, !12, i64 0}
!18 = !{!10, !12, i64 20}
!19 = !{!10, !6, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !8, i64 0}
!22 = !{!10, !12, i64 16}
!23 = !{!10, !12, i64 12}


; 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.oboe::ResultWithValue" = type { i32, i32 }

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4oboe12LatencyTuner5resetEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress 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 noundef i32 @_ZN4oboe12LatencyTuner4tuneEv(ptr noundef nonnull align 8 dereferenceable(40) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"class.oboe::ResultWithValue", align 8
  %3 = alloca %"class.oboe::ResultWithValue", align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp eq i32 %5, 3
  br i1 %6, label %61, label %7

7:                                                ; preds = %1
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  %9 = tail call noundef i32 @_ZNKSt13__atomic_baseIiE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef 5) #5
  %10 = getelementptr inbounds i8, ptr %0, i64 36
  %11 = tail call noundef i32 @_ZNKSt13__atomic_baseIiE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 noundef 5) #5
  %.not = icmp eq i32 %9, %11
  br i1 %.not, label %13, label %12

12:                                               ; preds = %7
  tail call void @_ZNSt13__atomic_baseIiE5storeEiSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 noundef %9, i32 noundef 5) #5
  tail call void @_ZN4oboe12LatencyTuner5resetEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  br label %13

13:                                               ; preds = %12, %7
  %14 = load i32, ptr %4, align 8, !tbaa !5
  switch i32 %14, label %thread-pre-split.thread [
    i32 0, label %15
    i32 1, label %20
  ]

15:                                               ; preds = %13
  %16 = getelementptr inbounds i8, ptr %0, i64 20
  %17 = load i32, ptr %16, align 4, !tbaa !14
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr %16, align 4, !tbaa !14
  %19 = icmp slt i32 %17, 2
  br i1 %19, label %.thread, label %thread-pre-split.thread

.thread:                                          ; preds = %15
  store i32 1, ptr %4, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %13, %.thread
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %21 = load ptr, ptr %0, align 8, !tbaa !15
  %22 = load ptr, ptr %21, align 8, !tbaa !16
  %23 = getelementptr inbounds i8, ptr %22, i64 144
  %24 = load ptr, ptr %23, align 8
  %25 = tail call i64 %24(ptr noundef nonnull align 8 dereferenceable(238) %21)
  store i64 %25, ptr %2, align 8
  %26 = call noundef i32 @_ZNK4oboe15ResultWithValueIiEcvNS_6ResultEEv(ptr noundef nonnull align 4 dereferenceable(8) %2)
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %56

28:                                               ; preds = %20
  %29 = call noundef i32 @_ZNK4oboe15ResultWithValueIiE5valueEv(ptr noundef nonnull align 4 dereferenceable(8) %2)
  %30 = getelementptr inbounds i8, ptr %0, i64 16
  %31 = load i32, ptr %30, align 8, !tbaa !18
  %32 = icmp sgt i32 %29, %31
  br i1 %32, label %33, label %57

33:                                               ; preds = %28
  %34 = call noundef i32 @_ZNK4oboe15ResultWithValueIiE5valueEv(ptr noundef nonnull align 4 dereferenceable(8) %2)
  store i32 %34, ptr %30, align 8, !tbaa !18
  %35 = load ptr, ptr %0, align 8, !tbaa !15
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = load ptr, ptr %37, align 8
  %39 = call noundef i32 %38(ptr noundef nonnull align 8 dereferenceable(152) %35)
  %40 = call noundef i32 @_ZNK4oboe12LatencyTuner22getBufferSizeIncrementEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  %41 = add nsw i32 %40, %39
  %42 = getelementptr inbounds i8, ptr %0, i64 12
  %43 = load i32, ptr %42, align 4, !tbaa !19
  %spec.select = call i32 @llvm.smin.i32(i32 %41, i32 %43)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %44 = load ptr, ptr %0, align 8, !tbaa !15
  %45 = load ptr, ptr %44, align 8, !tbaa !16
  %46 = getelementptr inbounds i8, ptr %45, i64 136
  %47 = load ptr, ptr %46, align 8
  %48 = call i64 %47(ptr noundef nonnull align 8 dereferenceable(238) %44, i32 noundef %spec.select)
  store i64 %48, ptr %3, align 8
  %49 = call noundef i32 @_ZNK4oboe15ResultWithValueIiEcvNS_6ResultEEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %.not13 = icmp eq i32 %49, 0
  br i1 %.not13, label %52, label %50

50:                                               ; preds = %33
  %51 = call noundef i32 @_ZNK4oboe15ResultWithValueIiEcvNS_6ResultEEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  br label %.sink.split

52:                                               ; preds = %33
  %53 = call noundef i32 @_ZNK4oboe15ResultWithValueIiE5valueEv(ptr noundef nonnull align 4 dereferenceable(8) %3)
  %54 = icmp eq i32 %53, %39
  br i1 %54, label %.sink.split, label %55

.sink.split:                                      ; preds = %52, %50
  %.sink = phi i32 [ 3, %50 ], [ 2, %52 ]
  %.09.ph = phi i32 [ %51, %50 ], [ 0, %52 ]
  store i32 %.sink, ptr %4, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %.sink.split, %52
  %.09 = phi i32 [ 0, %52 ], [ %.09.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %57

56:                                               ; preds = %20
  store i32 3, ptr %4, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %28, %55, %56
  %.1 = phi i32 [ %.09, %55 ], [ 0, %28 ], [ 0, %56 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %.pre = load i32, ptr %4, align 8, !tbaa !5
  br label %thread-pre-split.thread

thread-pre-split.thread:                          ; preds = %13, %15, %57
  %58 = phi i32 [ %.pre, %57 ], [ 0, %15 ], [ %14, %13 ]
  %.2 = phi i32 [ %.1, %57 ], [ 0, %15 ], [ 0, %13 ]
  %59 = icmp eq i32 %58, 3
  %spec.select14 = select i1 %59, i32 -890, i32 %.2
  %60 = icmp eq i32 %58, 2
  %.4 = select i1 %60, i32 0, i32 %spec.select14
  br label %61

61:                                               ; preds = %1, %thread-pre-split.thread
  %.08 = phi i32 [ %.4, %thread-pre-split.thread ], [ -890, %1 ]
  ret i32 %.08
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNKSt13__atomic_baseIiE4loadESt12memory_order(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZNSt13__atomic_baseIiE5storeEiSt12memory_order(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4oboe15ResultWithValueIiEcvNS_6ResultEEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4oboe15ResultWithValueIiE5valueEv(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

attributes #0 = { mustprogress 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 = { alwaysinline 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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !10, i64 8}
!6 = !{!"_ZTSN4oboe12LatencyTunerE", !7, i64 0, !10, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !12, i64 32, !12, i64 36}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4oboe12LatencyTuner5StateE", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_ZTSSt6atomicIiE", !13, i64 0}
!13 = !{!"_ZTSSt13__atomic_baseIiE", !11, i64 0}
!14 = !{!6, !11, i64 20}
!15 = !{!6, !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !9, i64 0}
!18 = !{!6, !11, i64 16}
!19 = !{!6, !11, i64 12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass