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

; 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.6 }
%struct.anon.6 = 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.anon.24 = type { i64, i64, i64, i64, i64, ptr, ptr, ptr }

@globals = external global %struct.libmdbx_globals, align 8
@.str.54 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [9 x i8], align 1
@__func__.osal_guid = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: cold noreturn nounwind optsize uwtable
declare dso_local void @mdbx_assert_fail(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #0

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare i32 @open64(ptr noundef, i32 noundef, ...) #4

declare i32 @close(i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local i64 @osal_monotime() #5

; Function Attrs: nounwind uwtable
declare dso_local i64 @osal_cputime(ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local { i64, i64 } @osal_guid(ptr noundef %0) #5 {
  %2 = alloca %union.bin128, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.anon.24, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %4) #9
  %9 = call i64 @osal_monotime()
  %10 = getelementptr inbounds %struct.anon.24, ptr %4, i32 0, i32 0
  store i64 %9, ptr %10, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 8 %2, i8 0, i64 16, i1 false)
  %11 = call zeroext i1 @proc_read_uuid(ptr noundef @.str.54, ptr noundef %2) #10
  br i1 %11, label %12, label %19

12:                                               ; preds = %1
  %13 = getelementptr inbounds { i64, i64 }, ptr %2, i32 0, i32 0
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds { i64, i64 }, ptr %2, i32 0, i32 1
  %16 = load i64, ptr %15, align 8
  %17 = call zeroext i1 @check_uuid(i64 %14, i64 %16)
  br i1 %17, label %18, label %19

18:                                               ; preds = %12
  store i32 1, ptr %5, align 4
  br label %106

19:                                               ; preds = %12, %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %20 = call i32 (ptr, i32, ...) @open64(ptr noundef @.str.55, i32 noundef 0)
  store i32 %20, ptr %6, align 4, !tbaa !12
  %21 = load i32, ptr %6, align 4, !tbaa !12
  %22 = icmp ne i32 %21, -1
  br i1 %22, label %23, label %71

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  %24 = load i32, ptr %6, align 4, !tbaa !12
  %25 = call i64 @read(i32 noundef %24, ptr noundef %2, i64 noundef 16)
  store i64 %25, ptr %7, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  %26 = load i32, ptr %6, align 4, !tbaa !12
  %27 = call i32 @close(i32 noundef %26)
  store i32 %27, ptr %8, align 4, !tbaa !12
  br label %28

28:                                               ; preds = %23
  %29 = load i8, ptr getelementptr inbounds (%struct.libmdbx_globals, ptr @globals, i32 0, i32 4), align 1, !tbaa !15
  %30 = zext i8 %29 to i32
  %31 = and i32 %30, 1
  %32 = icmp ne i32 %31, 0
  %33 = xor i1 %32, true
  %34 = xor i1 %33, true
  %35 = zext i1 %34 to i32
  %36 = sext i32 %35 to i64
  %37 = call i64 @llvm.expect.i64(i64 %36, i64 1)
  %38 = icmp ne i64 %37, 0
  br i1 %38, label %39, label %54

39:                                               ; preds = %28
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %8, align 4, !tbaa !12
  %42 = icmp eq i32 %41, 0
  %43 = xor i1 %42, true
  %44 = xor i1 %43, true
  %45 = xor i1 %44, true
  %46 = zext i1 %45 to i32
  %47 = sext i32 %46 to i64
  %48 = call i64 @llvm.expect.i64(i64 %47, i64 0)
  %49 = icmp ne i64 %48, 0
  br i1 %49, label %50, label %51

50:                                               ; preds = %40
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef @.str.56, ptr noundef @__func__.osal_guid, i32 noundef 3399) #11
  unreachable

51:                                               ; preds = %40
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52
  br label %54

54:                                               ; preds = %53, %28
  br label %55

55:                                               ; preds = %54
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %8, align 4, !tbaa !12
  %58 = load i64, ptr %7, align 8, !tbaa !14
  %59 = icmp eq i64 %58, 16
  br i1 %59, label %60, label %67

60:                                               ; preds = %56
  %61 = getelementptr inbounds { i64, i64 }, ptr %2, i32 0, i32 0
  %62 = load i64, ptr %61, align 8
  %63 = getelementptr inbounds { i64, i64 }, ptr %2, i32 0, i32 1
  %64 = load i64, ptr %63, align 8
  %65 = call zeroext i1 @check_uuid(i64 %62, i64 %64)
  br i1 %65, label %66, label %67

66:                                               ; preds = %60
  store i32 1, ptr %5, align 4
  br label %68

67:                                               ; preds = %60, %56
  store i32 0, ptr %5, align 4
  br label %68

68:                                               ; preds = %67, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  %69 = load i32, ptr %5, align 4
  switch i32 %69, label %105 [
    i32 0, label %70
  ]

70:                                               ; preds = %68
  br label %71

71:                                               ; preds = %70, %19
  %72 = call i64 @getrandom(ptr noundef %2, i64 noundef 16, i32 noundef 0)
  %73 = icmp eq i64 %72, 16
  br i1 %73, label %74, label %81

74:                                               ; preds = %71
  %75 = getelementptr inbounds { i64, i64 }, ptr %2, i32 0, i32 0
  %76 = load i64, ptr %75, align 8
  %77 = getelementptr inbounds { i64, i64 }, ptr %2, i32 0, i32 1
  %78 = load i64, ptr %77, align 8
  %79 = call zeroext i1 @check_uuid(i64 %76, i64 %78)
  br i1 %79, label %80, label %81

80:                                               ; preds = %74
  store i32 1, ptr %5, align 4
  br label %105

81:                                               ; preds = %74, %71
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %2, ptr align 8 @globals, i64 16, i1 false), !tbaa.struct !18
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  call void @bootid_collect(ptr noundef %2, ptr noundef %82, i64 noundef 1104) #10
  %83 = call i64 @osal_thread_self()
  %84 = getelementptr inbounds %struct.anon.24, ptr %4, i32 0, i32 3
  store i64 %83, ptr %84, align 8, !tbaa !20
  %85 = call i32 @osal_getpid()
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds %struct.anon.24, ptr %4, i32 0, i32 4
  store i64 %86, ptr %87, align 8, !tbaa !21
  %88 = getelementptr inbounds %struct.anon.24, ptr %4, i32 0, i32 5
  store ptr %4, ptr %88, align 8, !tbaa !22
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.anon.24, ptr %4, i32 0, i32 6
  store ptr %89, ptr %90, align 8, !tbaa !23
  %91 = getelementptr inbounds %struct.anon.24, ptr %4, i32 0, i32 7
  store ptr @osal_guid, ptr %91, align 8, !tbaa !24
  br label %92

92:                                               ; preds = %97, %81
  %93 = call i64 @osal_cputime(ptr noundef null)
  %94 = getelementptr inbounds %struct.anon.24, ptr %4, i32 0, i32 2
  store i64 %93, ptr %94, align 8, !tbaa !25
  %95 = call i64 @osal_monotime()
  %96 = getelementptr inbounds %struct.anon.24, ptr %4, i32 0, i32 1
  store i64 %95, ptr %96, align 8, !tbaa !26
  call void @bootid_collect(ptr noundef %2, ptr noundef %4, i64 noundef 64) #10
  br label %97

97:                                               ; preds = %92
  %98 = getelementptr inbounds { i64, i64 }, ptr %2, i32 0, i32 0
  %99 = load i64, ptr %98, align 8
  %100 = getelementptr inbounds { i64, i64 }, ptr %2, i32 0, i32 1
  %101 = load i64, ptr %100, align 8
  %102 = call zeroext i1 @check_uuid(i64 %99, i64 %101)
  %103 = xor i1 %102, true
  br i1 %103, label %92, label %104, !llvm.loop !27

104:                                              ; preds = %97
  store i32 1, ptr %5, align 4
  br label %105

105:                                              ; preds = %104, %80, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %106

106:                                              ; preds = %105, %18
  call void @llvm.lifetime.end.p0(i64 64, ptr %4) #9
  %107 = getelementptr inbounds %union.bin128, ptr %2, i32 0, i32 0
  %108 = load { i64, i64 }, ptr %107, align 8
  ret { i64, i64 } %108
}

; Function Attrs: cold nounwind optsize uwtable
declare hidden zeroext i1 @proc_read_uuid(ptr noundef, ptr noundef) #6

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @check_uuid(i64, i64) #5

declare i64 @read(i32 noundef, ptr noundef, i64 noundef) #4

declare i64 @getrandom(ptr noundef, i64 noundef, i32 noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: cold nounwind optsize uwtable
declare hidden void @bootid_collect(ptr noundef, ptr noundef, i64 noundef) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @osal_thread_self() #8

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @osal_getpid() #8

attributes #0 = { cold noreturn nounwind optsize 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 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 #6 = { cold nounwind optsize 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { inlinehint 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 #9 = { nounwind }
attributes #10 = { cold }
attributes #11 = { cold 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, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !7, i64 25}
!16 = !{!"libmdbx_globals", !7, i64 0, !13, i64 16, !13, i64 20, !7, i64 24, !7, i64 25, !7, i64 26, !17, i64 27, !13, i64 28, !7, i64 32, !7, i64 40, !11, i64 80, !6, i64 88}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{i64 0, i64 16, !19}
!19 = !{!7, !7, i64 0}
!20 = !{!10, !11, i64 24}
!21 = !{!10, !11, i64 32}
!22 = !{!10, !6, i64 40}
!23 = !{!10, !6, i64 48}
!24 = !{!10, !6, i64 56}
!25 = !{!10, !11, i64 16}
!26 = !{!10, !11, i64 8}
!27 = distinct !{!27, !28}
!28 = !{!"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"

%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.6 }
%struct.anon.6 = 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.anon.24 = type { i64, i64, i64, i64, i64, ptr, ptr, ptr }

@globals = external local_unnamed_addr global %struct.libmdbx_globals, align 8
@.str.54 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [9 x i8], align 1
@__func__.osal_guid = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: cold noreturn nounwind optsize uwtable
declare dso_local void @mdbx_assert_fail(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nofree
declare noundef i32 @open64(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #3

declare i32 @close(i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local i64 @osal_monotime() local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare dso_local i64 @osal_cputime(ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local { i64, i64 } @osal_guid(ptr noundef %0) #5 {
  %2 = alloca %union.bin128, align 8
  %3 = alloca %struct.anon.24, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #9
  %4 = tail call i64 @osal_monotime()
  store i64 %4, ptr %3, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false)
  %5 = call zeroext i1 @proc_read_uuid(ptr noundef nonnull @.str.54, ptr noundef nonnull %2) #10
  br i1 %5, label %6, label %11

6:                                                ; preds = %1
  %7 = load i64, ptr %2, align 8
  %8 = getelementptr inbounds i8, ptr %2, i64 8
  %9 = load i64, ptr %8, align 8
  %10 = call zeroext i1 @check_uuid(i64 %7, i64 %9)
  br i1 %10, label %.loopexit, label %11

11:                                               ; preds = %6, %1
  %12 = call i32 (ptr, i32, ...) @open64(ptr noundef nonnull @.str.55, i32 noundef 0) #9
  %.not = icmp eq i32 %12, -1
  br i1 %.not, label %.critedge, label %13

13:                                               ; preds = %11
  %14 = call i64 @read(i32 noundef %12, ptr noundef nonnull %2, i64 noundef 16) #9
  %15 = call i32 @close(i32 noundef %12) #9
  %16 = load i8, ptr getelementptr inbounds (i8, ptr @globals, i64 25), align 1, !tbaa !11
  %17 = and i8 %16, 1
  %.not9 = icmp eq i8 %17, 0
  %.not10 = icmp eq i32 %15, 0
  %or.cond = select i1 %.not9, i1 true, i1 %.not10
  br i1 %or.cond, label %19, label %18, !prof !15

18:                                               ; preds = %13
  call void @mdbx_assert_fail(ptr noundef null, ptr noundef nonnull @.str.56, ptr noundef nonnull @__func__.osal_guid, i32 noundef 3399) #11
  unreachable

19:                                               ; preds = %13
  %20 = icmp eq i64 %14, 16
  br i1 %20, label %21, label %.critedge

21:                                               ; preds = %19
  %22 = load i64, ptr %2, align 8
  %23 = getelementptr inbounds i8, ptr %2, i64 8
  %24 = load i64, ptr %23, align 8
  %25 = call zeroext i1 @check_uuid(i64 %22, i64 %24)
  br i1 %25, label %.loopexit, label %.critedge

.critedge:                                        ; preds = %19, %21, %11
  %26 = call i64 @getrandom(ptr noundef nonnull %2, i64 noundef 16, i32 noundef 0) #9
  %27 = icmp eq i64 %26, 16
  br i1 %27, label %28, label %33

28:                                               ; preds = %.critedge
  %29 = load i64, ptr %2, align 8
  %30 = getelementptr inbounds i8, ptr %2, i64 8
  %31 = load i64, ptr %30, align 8
  %32 = call zeroext i1 @check_uuid(i64 %29, i64 %31)
  br i1 %32, label %.loopexit, label %33

33:                                               ; preds = %28, %.critedge
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) @globals, i64 16, i1 false), !tbaa.struct !16
  call void @bootid_collect(ptr noundef nonnull %2, ptr noundef %0, i64 noundef 1104) #10
  %34 = call i64 @osal_thread_self()
  %35 = getelementptr inbounds i8, ptr %3, i64 24
  store i64 %34, ptr %35, align 8, !tbaa !18
  %36 = call i32 @osal_getpid()
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds i8, ptr %3, i64 32
  store i64 %37, ptr %38, align 8, !tbaa !19
  %39 = getelementptr inbounds i8, ptr %3, i64 40
  store ptr %3, ptr %39, align 8, !tbaa !20
  %40 = getelementptr inbounds i8, ptr %3, i64 48
  store ptr %0, ptr %40, align 8, !tbaa !21
  %41 = getelementptr inbounds i8, ptr %3, i64 56
  store ptr @osal_guid, ptr %41, align 8, !tbaa !22
  %42 = getelementptr inbounds i8, ptr %3, i64 16
  %43 = getelementptr inbounds i8, ptr %3, i64 8
  %44 = getelementptr inbounds i8, ptr %2, i64 8
  br label %45

45:                                               ; preds = %45, %33
  %46 = call i64 @osal_cputime(ptr noundef null)
  store i64 %46, ptr %42, align 8, !tbaa !23
  %47 = call i64 @osal_monotime()
  store i64 %47, ptr %43, align 8, !tbaa !24
  call void @bootid_collect(ptr noundef nonnull %2, ptr noundef nonnull %3, i64 noundef 64) #10
  %48 = load i64, ptr %2, align 8
  %49 = load i64, ptr %44, align 8
  %50 = call zeroext i1 @check_uuid(i64 %48, i64 %49)
  br i1 %50, label %.loopexit, label %45, !llvm.loop !25

.loopexit:                                        ; preds = %45, %21, %28, %6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #9
  %.fca.0.load = load i64, ptr %2, align 8
  %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %.fca.0.load, 0
  %.fca.1.gep = getelementptr inbounds i8, ptr %2, i64 8
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8
  %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %.fca.1.load, 1
  ret { i64, i64 } %.fca.1.insert
}

; Function Attrs: cold nounwind optsize uwtable
declare hidden zeroext i1 @proc_read_uuid(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @check_uuid(i64, i64) local_unnamed_addr #5

; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3

declare i64 @getrandom(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

; Function Attrs: cold nounwind optsize uwtable
declare hidden void @bootid_collect(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @osal_thread_self() local_unnamed_addr #8

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @osal_getpid() local_unnamed_addr #8

attributes #0 = { cold noreturn nounwind optsize uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree "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 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 #6 = { cold nounwind optsize 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { inlinehint 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 #9 = { nounwind }
attributes #10 = { cold }
attributes #11 = { cold 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 48, !10, i64 56}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !8, i64 25}
!12 = !{!"libmdbx_globals", !8, i64 0, !13, i64 16, !13, i64 20, !8, i64 24, !8, i64 25, !8, i64 26, !14, i64 27, !13, i64 28, !8, i64 32, !8, i64 40, !7, i64 80, !10, i64 88}
!13 = !{!"int", !8, i64 0}
!14 = !{!"_Bool", !8, i64 0}
!15 = !{!"branch_weights", i32 4002001, i32 2000}
!16 = !{i64 0, i64 16, !17}
!17 = !{!8, !8, i64 0}
!18 = !{!6, !7, i64 24}
!19 = !{!6, !7, i64 32}
!20 = !{!6, !10, i64 40}
!21 = !{!6, !10, i64 48}
!22 = !{!6, !10, i64 56}
!23 = !{!6, !7, i64 16}
!24 = !{!6, !7, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass,TailCallElimPass