; LLVM IR from erthink/libmdbx :: src (dbi)

; 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.libmdbx_globals = type { %union.bin128, i32, i32, i8, i8, i8, i8, i32, %union.logger_union, %union.pthread_mutex_t, i64, ptr }
%union.bin128 = type { %struct.anon }
%struct.anon = type { i64, i64 }
%union.logger_union = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.MDBX_env = type { %union.mdbx_atomic_uint32_t, i32, i32, %struct.osal_mmap, i32, i32, %struct.osal_mmap, ptr, i16, i16, i16, i16, i16, i16, %union.mdbx_atomic_uint32_t, i8, i8, i16, i32, i32, i32, i32, %struct.anon.9, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i64, %struct.anon.10, %struct.anon.14, i8, ptr, ptr, ptr, %struct.anon.15, %union.pthread_mutex_t, i32, i32, ptr, %struct.osal_ioring, %union.pthread_mutex_t, [71 x %union.mdbx_atomic_uint64_t] }
%struct.osal_mmap = type { %union.anon.8, i32, i64, i64, i64 }
%union.anon.8 = type { ptr }
%union.mdbx_atomic_uint32_t = type { i32 }
%struct.anon.9 = type { ptr, ptr, ptr, ptr }
%struct.anon.10 = type { i32, i32, i32, i32, i64, i8, i8, i8, i8, i32, i32, i8, i8, i8, %struct.anon.11, %union.anon.12 }
%struct.anon.11 = type { i16, i16, i16, i16 }
%union.anon.12 = type { i32 }
%struct.anon.14 = type { i64, i64, i64, i64, i64 }
%struct.anon.15 = type { i64 }
%struct.osal_ioring = type { i32, i32, i32, ptr, ptr, ptr }
%union.mdbx_atomic_uint64_t = type { i64 }
%struct.defer_free_item = type { ptr, i64 }

@globals = external global %struct.libmdbx_globals, align 8
@.str.10 = external hidden unnamed_addr constant [20 x i8], align 1
@__func__.dbi_defer_release = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [55 x i8], align 1

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

; Function Attrs: noreturn
declare void @mdbx_assert_fail(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @dbi_defer_release(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %13 = call i64 @osal_monotime()
  store i64 %13, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.MDBX_env, ptr %14, i32 0, i32 37
  store ptr %15, ptr %8, align 8, !tbaa !5
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.MDBX_env, ptr %16, i32 0, i32 37
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %52

20:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %21 = call i64 @osal_16dot16_to_monotime(i32 noundef 65536)
  store i64 %21, ptr %9, align 8, !tbaa !9
  br label %22

22:                                               ; preds = %47, %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %24, ptr %10, align 8, !tbaa !5
  %25 = load i64, ptr %7, align 8, !tbaa !9
  %26 = load ptr, ptr %10, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.defer_free_item, ptr %26, i32 0, i32 1
  %28 = load i64, ptr %27, align 8, !tbaa !23
  %29 = sub i64 %25, %28
  %30 = load i64, ptr %9, align 8, !tbaa !9
  %31 = icmp ult i64 %29, %30
  br i1 %31, label %32, label %37

32:                                               ; preds = %22
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.defer_free_item, ptr %33, i32 0, i32 0
  store ptr %34, ptr %8, align 8, !tbaa !5
  %35 = load i64, ptr %5, align 8, !tbaa !9
  %36 = add i64 %35, 1
  store i64 %36, ptr %5, align 8, !tbaa !9
  br label %46

37:                                               ; preds = %22
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.defer_free_item, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !25
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %40, ptr %41, align 8, !tbaa !5
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.defer_free_item, ptr %43, i32 0, i32 0
  store ptr %42, ptr %44, align 8, !tbaa !25
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %45, ptr %6, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %37, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %22, label %51, !llvm.loop !26

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %52

52:                                               ; preds = %51, %2
  br label %53

53:                                               ; preds = %52
  %54 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !28
  %55 = zext i8 %54 to i32
  %56 = and i32 %55, 1
  %57 = icmp ne i32 %56, 0
  %58 = xor i1 %57, true
  %59 = xor i1 %58, true
  %60 = zext i1 %59 to i32
  %61 = sext i32 %60 to i64
  %62 = call i64 @llvm.expect.i64(i64 %61, i64 1)
  %63 = icmp ne i64 %62, 0
  br i1 %63, label %64, label %81

64:                                               ; preds = %53
  br label %65

65:                                               ; preds = %64
  %66 = load ptr, ptr %8, align 8, !tbaa !5
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = icmp eq ptr %67, null
  %69 = xor i1 %68, true
  %70 = xor i1 %69, true
  %71 = xor i1 %70, true
  %72 = zext i1 %71 to i32
  %73 = sext i32 %72 to i64
  %74 = call i64 @llvm.expect.i64(i64 %73, i64 0)
  %75 = icmp ne i64 %74, 0
  br i1 %75, label %76, label %78

76:                                               ; preds = %65
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  call void @mdbx_assert_fail(ptr noundef %77, ptr noundef @.str.10, ptr noundef @__func__.dbi_defer_release, i32 noundef 149) #7
  unreachable

78:                                               ; preds = %65
  br label %79

79:                                               ; preds = %78
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80, %53
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %101

86:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %87, ptr %11, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %95, %86
  %89 = load i64, ptr %7, align 8, !tbaa !9
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.defer_free_item, ptr %90, i32 0, i32 1
  store i64 %89, ptr %91, align 8, !tbaa !23
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.defer_free_item, ptr %92, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !25
  store ptr %94, ptr %11, align 8, !tbaa !5
  br label %95

95:                                               ; preds = %88
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = icmp ne ptr %96, null
  br i1 %97, label %88, label %98, !llvm.loop !30

98:                                               ; preds = %95
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %99, ptr %100, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %101

101:                                              ; preds = %98, %83
  br label %102

102:                                              ; preds = %101
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.MDBX_env, ptr %103, i32 0, i32 41
  %105 = call i32 @osal_fastmutex_release(ptr noundef %104)
  %106 = icmp eq i32 %105, 0
  %107 = xor i1 %106, true
  %108 = xor i1 %107, true
  %109 = xor i1 %108, true
  %110 = zext i1 %109 to i32
  %111 = sext i32 %110 to i64
  %112 = call i64 @llvm.expect.i64(i64 %111, i64 0)
  %113 = icmp ne i64 %112, 0
  br i1 %113, label %114, label %116

114:                                              ; preds = %102
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  call void @mdbx_assert_fail(ptr noundef %115, ptr noundef @.str.11, ptr noundef @__func__.dbi_defer_release, i32 noundef 162) #7
  unreachable

116:                                              ; preds = %102
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  %119 = load i64, ptr %5, align 8, !tbaa !9
  %120 = icmp ugt i64 %119, 42
  br i1 %120, label %121, label %123

121:                                              ; preds = %118
  %122 = call i32 @sched_yield() #6
  br label %123

123:                                              ; preds = %121, %118
  br label %124

124:                                              ; preds = %127, %123
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = icmp ne ptr %125, null
  br i1 %126, label %127, label %133

127:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %128, ptr %12, align 8, !tbaa !5
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.defer_free_item, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !25
  store ptr %131, ptr %6, align 8, !tbaa !5
  %132 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %132) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %124, !llvm.loop !31

133:                                              ; preds = %124
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  %136 = zext i1 %135 to i64
  %137 = select i1 %135, i32 0, i32 -30780
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret i32 %137
}

declare i64 @osal_monotime() #4

declare i64 @osal_16dot16_to_monotime(i32 noundef) #4

declare i32 @osal_fastmutex_release(ptr noundef) #4

; Function Attrs: nounwind
declare i32 @sched_yield() #5

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #1 = { noreturn "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nounwind }
attributes #7 = { noreturn }

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 368}
!12 = !{!"MDBX_env", !7, i64 0, !13, i64 4, !13, i64 8, !14, i64 16, !13, i64 56, !13, i64 60, !14, i64 64, !6, i64 104, !15, i64 112, !15, i64 114, !15, i64 116, !15, i64 118, !15, i64 120, !15, i64 122, !7, i64 124, !7, i64 128, !7, i64 129, !15, i64 130, !13, i64 132, !13, i64 136, !13, i64 140, !13, i64 144, !16, i64 152, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !13, i64 224, !13, i64 228, !13, i64 232, !6, i64 240, !6, i64 248, !10, i64 256, !17, i64 264, !20, i64 320, !18, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !21, i64 392, !7, i64 400, !13, i64 440, !13, i64 444, !6, i64 448, !22, i64 456, !7, i64 496, !7, i64 536}
!13 = !{!"int", !7, i64 0}
!14 = !{!"osal_mmap", !7, i64 0, !13, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!15 = !{!"short", !7, i64 0}
!16 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !10, i64 16, !7, i64 24, !7, i64 25, !7, i64 26, !7, i64 27, !13, i64 28, !13, i64 32, !18, i64 36, !18, i64 37, !18, i64 38, !19, i64 40, !7, i64 48}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!"", !15, i64 0, !15, i64 2, !15, i64 4, !15, i64 6}
!20 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!21 = !{!"", !10, i64 0}
!22 = !{!"osal_ioring", !13, i64 0, !13, i64 4, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = !{!24, !10, i64 8}
!24 = !{!"defer_free_item", !6, i64 0, !10, i64 8}
!25 = !{!24, !6, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!29, !7, i64 25}
!29 = !{!"libmdbx_globals", !7, i64 0, !13, i64 16, !13, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !18, i64 27, !13, i64 28, !7, i64 32, !7, i64 40, !10, i64 80, !6, i64 88}
!30 = distinct !{!30, !27}
!31 = distinct !{!31, !27}


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

@__func__.dbi_defer_release = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [55 x i8], align 1

; Function Attrs: noreturn
declare void @mdbx_assert_fail(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef range(i32 -30780, 1) i32 @dbi_defer_release(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = tail call i64 @osal_monotime() #5
  %4 = getelementptr inbounds i8, ptr %0, i64 368
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %22, label %6

6:                                                ; preds = %2
  %7 = tail call i64 @osal_16dot16_to_monotime(i32 noundef 65536) #5
  %.pre = load ptr, ptr %4, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %18, %6
  %9 = phi ptr [ %.pre, %6 ], [ %19, %18 ]
  %.035 = phi ptr [ %4, %6 ], [ %.136, %18 ]
  %.032 = phi ptr [ null, %6 ], [ %.133, %18 ]
  %.0 = phi i64 [ 0, %6 ], [ %.1, %18 ]
  %10 = getelementptr inbounds i8, ptr %9, i64 8
  %11 = load i64, ptr %10, align 8, !tbaa !9
  %12 = sub i64 %3, %11
  %13 = icmp ult i64 %12, %7
  br i1 %13, label %14, label %16

14:                                               ; preds = %8
  %15 = add i64 %.0, 1
  br label %18

16:                                               ; preds = %8
  %17 = load ptr, ptr %9, align 8, !tbaa !12
  store ptr %17, ptr %.035, align 8, !tbaa !5
  store ptr %.032, ptr %9, align 8, !tbaa !12
  br label %18

18:                                               ; preds = %16, %14
  %.136 = phi ptr [ %9, %14 ], [ %.035, %16 ]
  %.133 = phi ptr [ %.032, %14 ], [ %9, %16 ]
  %.1 = phi i64 [ %15, %14 ], [ %.0, %16 ]
  %19 = load ptr, ptr %.136, align 8, !tbaa !5
  %.not39 = icmp eq ptr %19, null
  br i1 %.not39, label %20, label %8, !llvm.loop !13

20:                                               ; preds = %18
  %21 = icmp ugt i64 %.1, 42
  br label %22

22:                                               ; preds = %20, %2
  %.237 = phi ptr [ %.136, %20 ], [ %4, %2 ]
  %.234 = phi ptr [ %.133, %20 ], [ null, %2 ]
  %.2 = phi i1 [ %21, %20 ], [ false, %2 ]
  %.not42 = icmp eq ptr %1, null
  br i1 %.not42, label %26, label %.preheader

.preheader:                                       ; preds = %22, %.preheader
  %.031 = phi ptr [ %24, %.preheader ], [ %1, %22 ]
  %23 = getelementptr inbounds i8, ptr %.031, i64 8
  store i64 %3, ptr %23, align 8, !tbaa !9
  %24 = load ptr, ptr %.031, align 8, !tbaa !12
  %.not43 = icmp eq ptr %24, null
  br i1 %.not43, label %25, label %.preheader, !llvm.loop !15

25:                                               ; preds = %.preheader
  store ptr %1, ptr %.237, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %22, %25
  %27 = getelementptr inbounds i8, ptr %0, i64 400
  %28 = tail call i32 @osal_fastmutex_release(ptr noundef nonnull %27) #5
  %.not44 = icmp eq i32 %28, 0
  br i1 %.not44, label %30, label %29, !prof !16

29:                                               ; preds = %26
  tail call void @mdbx_assert_fail(ptr noundef %0, ptr noundef nonnull @.str.11, ptr noundef nonnull @__func__.dbi_defer_release, i32 noundef 162) #6
  unreachable

30:                                               ; preds = %26
  br i1 %.2, label %31, label %33

31:                                               ; preds = %30
  %32 = tail call i32 @sched_yield() #5
  br label %33

33:                                               ; preds = %31, %30
  %.not4546 = icmp eq ptr %.234, null
  br i1 %.not4546, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %33, %.lr.ph
  %.347 = phi ptr [ %34, %.lr.ph ], [ %.234, %33 ]
  %34 = load ptr, ptr %.347, align 8, !tbaa !12
  tail call void @free(ptr noundef nonnull %.347) #5
  %.not45 = icmp eq ptr %34, null
  br i1 %.not45, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %.lr.ph, %33
  %35 = select i1 %.not42, i32 -30780, i32 0
  ret i32 %35
}

declare i64 @osal_monotime() local_unnamed_addr #2

declare i64 @osal_16dot16_to_monotime(i32 noundef) local_unnamed_addr #2

declare i32 @osal_fastmutex_release(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare i32 @sched_yield() local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

attributes #0 = { noreturn "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 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { 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/C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"defer_free_item", !6, i64 0, !11, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!17 = distinct !{!17, !14}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass