; LLVM IR from yinqiwen/ardb :: src/common/channel/timer/timer.ll (ZN4ardb5Timer21AdjustNextTriggerTimeEjlNS_8TimeUnitE)

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

%"struct.btree::btree_iterator" = type <{ ptr, i32, [4 x i8] }>
%"struct.btree::btree_iterator.3" = type <{ ptr, i32, [4 x i8] }>
%"class.ardb::Timer" = type { ptr, %"class.ardb::TimerTaskQueue", %"class.btree::btree_map" }
%"class.ardb::TimerTaskQueue" = type { ptr, i32, i32 }
%"class.btree::btree_map" = type { %"class.btree::btree_map_container" }
%"class.btree::btree_map_container" = type { %"class.btree::btree_unique_container" }
%"class.btree::btree_unique_container" = type { %"class.btree::btree_container" }
%"class.btree::btree_container" = type { %"class.btree::btree" }
%"class.btree::btree" = type { %"struct.btree::btree<btree::btree_map_params<unsigned int, ardb::TimerTask *, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, ardb::TimerTask *>>, 256>>::empty_base_handle" }
%"struct.btree::btree<btree::btree_map_params<unsigned int, ardb::TimerTask *, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, ardb::TimerTask *>>, 256>>::empty_base_handle" = type { ptr }
%"struct.std::pair" = type { i32, ptr }
%"class.ardb::TimerTask" = type <{ i32, i32, i64, i64, i32, [4 x i8], i64, ptr, ptr, i32, [4 x i8] }>

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [33 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@__func__._ZN4ardb5Timer21AdjustNextTriggerTimeEjlNS_8TimeUnitE = external hidden unnamed_addr constant [22 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
declare dso_local void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE4findERS9_(ptr dead_on_unwind noalias writable sret(%"struct.btree::btree_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EneERKNS0_IKSD_RKSA_PSI_EE(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.btree::btree_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5btree14btree_iteratorIKNS_10btree_nodeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEERKSA_PSF_EC2ERKNS0_ISD_RSA_PSA_EE(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #2 align 2

declare noundef i64 @_ZN4ardb10millistimeEmNS_8TimeUnitE(i64 noundef, i32 noundef) #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ardb5Timer21AdjustNextTriggerTimeEjlNS_8TimeUnitE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %1, i64 noundef %2, i32 noundef %3) #1 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.btree::btree_iterator", align 8
  %11 = alloca %"struct.btree::btree_iterator.3", align 8
  %12 = alloca %"struct.btree::btree_iterator", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !11
  store i32 %3, ptr %9, align 4, !tbaa !13
  %19 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #8
  %20 = getelementptr inbounds %"class.ardb::Timer", ptr %19, i32 0, i32 2
  call void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE4findERS9_(ptr dead_on_unwind writable sret(%"struct.btree::btree_iterator") align 8 %10, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #8
  %21 = getelementptr inbounds %"class.ardb::Timer", ptr %19, i32 0, i32 2
  call void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE3endEv(ptr dead_on_unwind writable sret(%"struct.btree::btree_iterator") align 8 %12, ptr noundef nonnull align 8 dereferenceable(8) %21)
  call void @_ZN5btree14btree_iteratorIKNS_10btree_nodeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEERKSA_PSF_EC2ERKNS0_ISD_RSA_PSA_EE(ptr noundef nonnull align 8 dereferenceable(12) %11, ptr noundef nonnull align 8 dereferenceable(12) %12)
  %22 = call noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EneERKNS0_IKSD_RKSA_PSI_EE(ptr noundef nonnull align 8 dereferenceable(12) %10, ptr noundef nonnull align 8 dereferenceable(12) %11)
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  br i1 %22, label %23, label %66

23:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %24 = call noundef ptr @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EptEv(ptr noundef nonnull align 8 dereferenceable(12) %10)
  %25 = getelementptr inbounds %"struct.std::pair", ptr %24, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !15
  store ptr %26, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %27 = load i64, ptr %8, align 8, !tbaa !11
  %28 = call i64 @llvm.abs.i64(i64 %27, i1 true)
  store i64 %28, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %29 = load i64, ptr %14, align 8, !tbaa !11
  %30 = load i32, ptr %9, align 4, !tbaa !13
  %31 = call noundef i64 @_ZN4ardb10millistimeEmNS_8TimeUnitE(i64 noundef %29, i32 noundef %30)
  store i64 %31, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %32 = load ptr, ptr %13, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.ardb::TimerTask", ptr %32, i32 0, i32 6
  %34 = load i64, ptr %33, align 8, !tbaa !17
  store i64 %34, ptr %16, align 8, !tbaa !11
  %35 = load i64, ptr %8, align 8, !tbaa !11
  %36 = icmp sgt i64 %35, 0
  br i1 %36, label %37, label %41

37:                                               ; preds = %23
  %38 = load i64, ptr %15, align 8, !tbaa !11
  %39 = load i64, ptr %16, align 8, !tbaa !11
  %40 = add i64 %39, %38
  store i64 %40, ptr %16, align 8, !tbaa !11
  br label %45

41:                                               ; preds = %23
  %42 = load i64, ptr %15, align 8, !tbaa !11
  %43 = load i64, ptr %16, align 8, !tbaa !11
  %44 = sub i64 %43, %42
  store i64 %44, ptr %16, align 8, !tbaa !11
  br label %45

45:                                               ; preds = %41, %37
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #8
  %46 = getelementptr inbounds %"class.ardb::Timer", ptr %19, i32 0, i32 1
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = load i64, ptr %16, align 8, !tbaa !11
  %49 = call noundef zeroext i1 @_ZN4ardb14TimerTaskQueue14RescheduleTaskEPNS_9TimerTaskEm(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef %47, i64 noundef %48)
  %50 = zext i1 %49 to i8
  store i8 %50, ptr %17, align 1, !tbaa !20
  br label %51

51:                                               ; preds = %45
  %52 = load i8, ptr %17, align 1, !tbaa !20, !range !22, !noundef !23
  %53 = trunc i8 %52 to i1
  %54 = xor i1 %53, true
  %55 = xor i1 %54, true
  %56 = xor i1 %55, true
  %57 = zext i1 %56 to i64
  %58 = call i64 @llvm.expect.i64(i64 %57, i64 0)
  %59 = icmp ne i64 %58, 0
  br i1 %59, label %60, label %63

60:                                               ; preds = %51
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 180, ptr noundef @.str.2, ptr noundef @__func__._ZN4ardb5Timer21AdjustNextTriggerTimeEjlNS_8TimeUnitE) #8
  call void @abort() #9
  unreachable

63:                                               ; preds = %51
  br label %64

64:                                               ; preds = %63
  br label %65

65:                                               ; preds = %64
  store i1 true, ptr %5, align 1
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %67

66:                                               ; preds = %4
  store i1 false, ptr %5, align 1
  store i32 1, ptr %18, align 4
  br label %67

67:                                               ; preds = %66, %65
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #8
  %68 = load i1, ptr %5, align 1
  ret i1 %68
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #4

declare noundef zeroext i1 @_ZN4ardb14TimerTaskQueue14RescheduleTaskEPNS_9TimerTaskEm(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #5

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #6

; Function Attrs: noreturn nounwind
declare void @abort() #7

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #6 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn 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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_ZTSN4ardb8TimeUnitE", !7, i64 0}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTSSt4pairIKjPN4ardb9TimerTaskEE", !10, i64 0, !6, i64 8}
!17 = !{!18, !12, i64 32}
!18 = !{!"_ZTSN4ardb9TimerTaskE", !10, i64 0, !19, i64 4, !12, i64 8, !12, i64 16, !14, i64 24, !12, i64 32, !6, i64 40, !6, i64 48, !10, i64 56}
!19 = !{!"_ZTSN4ardb14TimerTaskStateE", !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}


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

%"struct.btree::btree_iterator" = type <{ ptr, i32, [4 x i8] }>
%"struct.btree::btree_iterator.3" = type <{ ptr, i32, [4 x i8] }>

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [33 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@__func__._ZN4ardb5Timer21AdjustNextTriggerTimeEjlNS_8TimeUnitE = external hidden unnamed_addr constant [22 x i8], align 1

; 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 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 @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE4findERS9_(ptr dead_on_unwind noalias writable sret(%"struct.btree::btree_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EneERKNS0_IKSD_RKSA_PSI_EE(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE3endEv(ptr dead_on_unwind noalias writable sret(%"struct.btree::btree_iterator") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5btree14btree_iteratorIKNS_10btree_nodeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEERKSA_PSF_EC2ERKNS0_ISD_RSA_PSA_EE(ptr noundef nonnull align 8 dereferenceable(12), ptr noundef nonnull align 8 dereferenceable(12)) unnamed_addr #2 align 2

declare noundef i64 @_ZN4ardb10millistimeEmNS_8TimeUnitE(i64 noundef, i32 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ardb5Timer21AdjustNextTriggerTimeEjlNS_8TimeUnitE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %1, i64 noundef %2, i32 noundef %3) local_unnamed_addr #1 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca %"struct.btree::btree_iterator", align 8
  %7 = alloca %"struct.btree::btree_iterator.3", align 8
  %8 = alloca %"struct.btree::btree_iterator", align 8
  store i32 %1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  call void @_ZN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE4findERS9_(ptr dead_on_unwind nonnull writable sret(%"struct.btree::btree_iterator") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @_ZN5btree15btree_containerINS_5btreeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEEE3endEv(ptr dead_on_unwind nonnull writable sret(%"struct.btree::btree_iterator") align 8 %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @_ZN5btree14btree_iteratorIKNS_10btree_nodeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEERKSA_PSF_EC2ERKNS0_ISD_RSA_PSA_EE(ptr noundef nonnull align 8 dereferenceable(12) %7, ptr noundef nonnull align 8 dereferenceable(12) %8)
  %10 = call noundef zeroext i1 @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EneERKNS0_IKSD_RKSA_PSI_EE(ptr noundef nonnull align 8 dereferenceable(12) %6, ptr noundef nonnull align 8 dereferenceable(12) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br i1 %10, label %11, label %26

11:                                               ; preds = %4
  %12 = call noundef ptr @_ZNK5btree14btree_iteratorINS_10btree_nodeINS_16btree_map_paramsIjPN4ardb9TimerTaskESt4lessIjESaISt4pairIKjS5_EELi256EEEEERSA_PSA_EptEv(ptr noundef nonnull align 8 dereferenceable(12) %6)
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = call i64 @llvm.abs.i64(i64 %2, i1 true)
  %16 = call noundef i64 @_ZN4ardb10millistimeEmNS_8TimeUnitE(i64 noundef %15, i32 noundef %3)
  %17 = getelementptr inbounds i8, ptr %14, i64 32
  %18 = load i64, ptr %17, align 8, !tbaa !12
  %19 = icmp sgt i64 %2, 0
  %20 = sub i64 0, %16
  %.013.p = select i1 %19, i64 %16, i64 %20
  %.013 = add i64 %18, %.013.p
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = call noundef zeroext i1 @_ZN4ardb14TimerTaskQueue14RescheduleTaskEPNS_9TimerTaskEm(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef %14, i64 noundef %.013)
  br i1 %22, label %26, label %23, !prof !17

23:                                               ; preds = %11
  %24 = load ptr, ptr @stderr, align 8, !tbaa !18
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 180, ptr noundef nonnull @.str.2, ptr noundef nonnull @__func__._ZN4ardb5Timer21AdjustNextTriggerTimeEjlNS_8TimeUnitE) #8
  call void @abort() #9
  unreachable

26:                                               ; preds = %4, %11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  ret i1 %10
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #4

declare noundef zeroext i1 @_ZN4ardb14TimerTaskQueue14RescheduleTaskEPNS_9TimerTaskEm(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #6

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 = { 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 = { "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { cold nounwind }
attributes #9 = { noreturn 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, !11, i64 8}
!10 = !{!"_ZTSSt4pairIKjPN4ardb9TimerTaskEE", !6, i64 0, !11, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !15, i64 32}
!13 = !{!"_ZTSN4ardb9TimerTaskE", !6, i64 0, !14, i64 4, !15, i64 8, !15, i64 16, !16, i64 24, !15, i64 32, !11, i64 40, !11, i64 48, !6, i64 56}
!14 = !{!"_ZTSN4ardb14TimerTaskStateE", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"_ZTSN4ardb8TimeUnitE", !7, i64 0}
!17 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!18 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass