; LLVM IR from Water-Melon/Melon :: src (mln_event)

; 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.timeval = type { i64, i64 }
%struct.mln_event_desc_s = type { ptr, ptr, ptr, ptr, i32, i32, %union.anon }
%union.anon = type { %struct.mln_event_fd_s }
%struct.mln_event_fd_s = type { i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64 }
%struct.mln_event_tm_s = type { ptr, ptr, i64 }
%struct.mln_event_s = type { %union.pthread_mutex_t, %union.pthread_mutex_t, %union.pthread_mutex_t, ptr, ptr, i32, i32, %struct.fd_set, %struct.fd_set, %struct.fd_set, ptr, ptr, ptr, ptr, ptr, ptr, 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.fd_set = type { [16 x i64] }
%struct.mln_fheap_t = type { ptr, ptr, ptr, ptr, ptr, i64, ptr, ptr, ptr, ptr }
%struct.mln_fheap_node_s = type { ptr, ptr, ptr, ptr, ptr, i64, i32 }

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mln_event_fheap_timer_cmp(ptr noundef nonnull, ptr noundef nonnull) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_fheap_add_child(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local ptr @mln_event_timer_set(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #4 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.timeval, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %17 = call i32 @gettimeofday(ptr noundef %10, ptr noundef null) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %18 = getelementptr inbounds %struct.timeval, ptr %10, i32 0, i32 0
  %19 = load i64, ptr %18, align 8, !tbaa !11
  %20 = mul nsw i64 %19, 1000000
  %21 = getelementptr inbounds %struct.timeval, ptr %10, i32 0, i32 1
  %22 = load i64, ptr %21, align 8, !tbaa !14
  %23 = add nsw i64 %20, %22
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = mul i32 %24, 1000
  %26 = zext i32 %25 to i64
  %27 = add nsw i64 %23, %26
  store i64 %27, ptr %11, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %28 = call noalias ptr @malloc(i64 noundef 136) #7
  store ptr %28, ptr %12, align 8, !tbaa !5
  %29 = load ptr, ptr %12, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %4
  store ptr null, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %132

32:                                               ; preds = %4
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.mln_event_desc_s, ptr %33, i32 0, i32 4
  store i32 1, ptr %34, align 8, !tbaa !16
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.mln_event_desc_s, ptr %35, i32 0, i32 5
  store i32 0, ptr %36, align 4, !tbaa !18
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.mln_event_desc_s, ptr %38, i32 0, i32 6
  %40 = getelementptr inbounds %struct.mln_event_tm_s, ptr %39, i32 0, i32 0
  store ptr %37, ptr %40, align 8, !tbaa !19
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.mln_event_desc_s, ptr %42, i32 0, i32 6
  %44 = getelementptr inbounds %struct.mln_event_tm_s, ptr %43, i32 0, i32 1
  store ptr %41, ptr %44, align 8, !tbaa !19
  %45 = load i64, ptr %11, align 8, !tbaa !15
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.mln_event_desc_s, ptr %46, i32 0, i32 6
  %48 = getelementptr inbounds %struct.mln_event_tm_s, ptr %47, i32 0, i32 2
  store i64 %45, ptr %48, align 8, !tbaa !19
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.mln_event_desc_s, ptr %49, i32 0, i32 0
  store ptr null, ptr %50, align 8, !tbaa !20
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.mln_event_desc_s, ptr %51, i32 0, i32 1
  store ptr null, ptr %52, align 8, !tbaa !21
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.mln_event_desc_s, ptr %53, i32 0, i32 2
  store ptr null, ptr %54, align 8, !tbaa !22
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.mln_event_desc_s, ptr %55, i32 0, i32 3
  store ptr null, ptr %56, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.mln_event_s, ptr %57, i32 0, i32 16
  %59 = load ptr, ptr %58, align 8, !tbaa !24
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = call ptr @mln_fheap_node_new(ptr noundef %59, ptr noundef %60)
  store ptr %61, ptr %14, align 8, !tbaa !5
  %62 = load ptr, ptr %14, align 8, !tbaa !5
  %63 = icmp eq ptr %62, null
  br i1 %63, label %64, label %66

64:                                               ; preds = %32
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %65) #6
  store ptr null, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %131

66:                                               ; preds = %32
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.mln_event_s, ptr %67, i32 0, i32 1
  %69 = call i32 @pthread_mutex_lock(ptr noundef %68) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store ptr @mln_event_fheap_timer_cmp, ptr %15, align 8, !tbaa !5
  %70 = load ptr, ptr %15, align 8, !tbaa !5
  %71 = icmp eq ptr %70, null
  br i1 %71, label %72, label %78

72:                                               ; preds = %66
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.mln_event_s, ptr %73, i32 0, i32 16
  %75 = load ptr, ptr %74, align 8, !tbaa !24
  %76 = getelementptr inbounds %struct.mln_fheap_t, ptr %75, i32 0, i32 2
  %77 = load ptr, ptr %76, align 8, !tbaa !27
  store ptr %77, ptr %15, align 8, !tbaa !5
  br label %78

78:                                               ; preds = %72, %66
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.mln_event_s, ptr %79, i32 0, i32 16
  %81 = load ptr, ptr %80, align 8, !tbaa !24
  %82 = getelementptr inbounds %struct.mln_fheap_t, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %14, align 8, !tbaa !5
  call void @mln_fheap_add_child(ptr noundef %82, ptr noundef %83)
  %84 = load ptr, ptr %14, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %84, i32 0, i32 1
  store ptr null, ptr %85, align 8, !tbaa !29
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.mln_event_s, ptr %86, i32 0, i32 16
  %88 = load ptr, ptr %87, align 8, !tbaa !24
  %89 = getelementptr inbounds %struct.mln_fheap_t, ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !31
  %91 = icmp eq ptr %90, null
  br i1 %91, label %92, label %98

92:                                               ; preds = %78
  %93 = load ptr, ptr %14, align 8, !tbaa !5
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.mln_event_s, ptr %94, i32 0, i32 16
  %96 = load ptr, ptr %95, align 8, !tbaa !24
  %97 = getelementptr inbounds %struct.mln_fheap_t, ptr %96, i32 0, i32 1
  store ptr %93, ptr %97, align 8, !tbaa !31
  br label %119

98:                                               ; preds = %78
  %99 = load ptr, ptr %15, align 8, !tbaa !5
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !32
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.mln_event_s, ptr %103, i32 0, i32 16
  %105 = load ptr, ptr %104, align 8, !tbaa !24
  %106 = getelementptr inbounds %struct.mln_fheap_t, ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !31
  %108 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !32
  %110 = call i32 %99(ptr noundef %102, ptr noundef %109)
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %118, label %112

112:                                              ; preds = %98
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.mln_event_s, ptr %114, i32 0, i32 16
  %116 = load ptr, ptr %115, align 8, !tbaa !24
  %117 = getelementptr inbounds %struct.mln_fheap_t, ptr %116, i32 0, i32 1
  store ptr %113, ptr %117, align 8, !tbaa !31
  br label %118

118:                                              ; preds = %112, %98
  br label %119

119:                                              ; preds = %118, %92
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.mln_event_s, ptr %120, i32 0, i32 16
  %122 = load ptr, ptr %121, align 8, !tbaa !24
  %123 = getelementptr inbounds %struct.mln_fheap_t, ptr %122, i32 0, i32 5
  %124 = load i64, ptr %123, align 8, !tbaa !33
  %125 = add i64 %124, 1
  store i64 %125, ptr %123, align 8, !tbaa !33
  store i64 %125, ptr %16, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %126 = load i64, ptr %16, align 8, !tbaa !15
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.mln_event_s, ptr %127, i32 0, i32 1
  %129 = call i32 @pthread_mutex_unlock(ptr noundef %128) #6
  %130 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %130, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %131

131:                                              ; preds = %119, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %132

132:                                              ; preds = %131, %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  %133 = load ptr, ptr %5, align 8
  ret ptr %133
}

; Function Attrs: nounwind
declare i32 @gettimeofday(ptr noundef, ptr noundef) #3

declare ptr @mln_fheap_node_new(ptr noundef, ptr noundef) #5

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

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

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"timeval", !13, i64 0, !13, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!13, !13, i64 0}
!16 = !{!17, !10, i64 32}
!17 = !{!"mln_event_desc_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !7, i64 40}
!18 = !{!17, !10, i64 36}
!19 = !{!7, !7, i64 0}
!20 = !{!17, !6, i64 0}
!21 = !{!17, !6, i64 8}
!22 = !{!17, !6, i64 16}
!23 = !{!17, !6, i64 24}
!24 = !{!25, !6, i64 576}
!25 = !{!"mln_event_s", !7, i64 0, !7, i64 40, !7, i64 80, !6, i64 120, !6, i64 128, !10, i64 136, !10, i64 136, !10, i64 140, !26, i64 144, !26, i64 272, !26, i64 400, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576}
!26 = !{!"", !7, i64 0}
!27 = !{!28, !6, i64 16}
!28 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!29 = !{!30, !6, i64 8}
!30 = !{!"mln_fheap_node_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !10, i64 48, !10, i64 48}
!31 = !{!28, !6, i64 8}
!32 = !{!30, !6, i64 0}
!33 = !{!28, !13, i64 40}


; 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.timeval = type { i64, i64 }

; 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mln_event_fheap_timer_cmp(ptr noundef nonnull, ptr noundef nonnull) local_unnamed_addr #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: inlinehint nounwind uwtable
declare hidden void @mln_fheap_add_child(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local ptr @mln_event_timer_set(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #4 {
  %5 = alloca %struct.timeval, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #9
  %6 = call i32 @gettimeofday(ptr noundef nonnull %5, ptr noundef null) #9
  %7 = load i64, ptr %5, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %5, i64 8
  %9 = load i64, ptr %8, align 8, !tbaa !10
  %10 = tail call noalias dereferenceable_or_null(136) ptr @malloc(i64 noundef 136) #10
  %11 = icmp eq ptr %10, null
  br i1 %11, label %49, label %12

12:                                               ; preds = %4
  %13 = mul nsw i64 %7, 1000000
  %14 = mul i32 %1, 1000
  %15 = zext i32 %14 to i64
  %16 = add i64 %9, %15
  %17 = add i64 %16, %13
  %18 = getelementptr inbounds i8, ptr %10, i64 32
  store i32 1, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %10, i64 36
  store i32 0, ptr %19, align 4, !tbaa !15
  %20 = getelementptr inbounds i8, ptr %10, i64 40
  store ptr %2, ptr %20, align 8, !tbaa !16
  %21 = getelementptr inbounds i8, ptr %10, i64 48
  store ptr %3, ptr %21, align 8, !tbaa !16
  %22 = getelementptr inbounds i8, ptr %10, i64 56
  store i64 %17, ptr %22, align 8, !tbaa !16
  %23 = getelementptr inbounds i8, ptr %0, i64 576
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %10, i8 0, i64 32, i1 false)
  %24 = load ptr, ptr %23, align 8, !tbaa !17
  %25 = tail call ptr @mln_fheap_node_new(ptr noundef %24, ptr noundef nonnull %10) #9
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %12
  tail call void @free(ptr noundef nonnull %10) #9
  br label %49

28:                                               ; preds = %12
  %29 = getelementptr inbounds i8, ptr %0, i64 40
  %30 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %29) #9
  %31 = load ptr, ptr %23, align 8, !tbaa !17
  tail call void @mln_fheap_add_child(ptr noundef %31, ptr noundef nonnull %25)
  %32 = getelementptr inbounds i8, ptr %25, i64 8
  store ptr null, ptr %32, align 8, !tbaa !20
  %33 = load ptr, ptr %23, align 8, !tbaa !17
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !22
  %36 = icmp eq ptr %35, null
  br i1 %36, label %.sink.split, label %37

37:                                               ; preds = %28
  %38 = load ptr, ptr %25, align 8, !tbaa !24
  %39 = load ptr, ptr %35, align 8, !tbaa !24
  %40 = tail call i32 @mln_event_fheap_timer_cmp(ptr noundef %38, ptr noundef %39)
  %.not = icmp eq i32 %40, 0
  %.pre = load ptr, ptr %23, align 8, !tbaa !17
  br i1 %.not, label %41, label %43

41:                                               ; preds = %37
  %42 = getelementptr inbounds i8, ptr %.pre, i64 8
  br label %.sink.split

.sink.split:                                      ; preds = %28, %41
  %.sink = phi ptr [ %42, %41 ], [ %34, %28 ]
  %.ph = phi ptr [ %.pre, %41 ], [ %33, %28 ]
  store ptr %25, ptr %.sink, align 8, !tbaa !22
  br label %43

43:                                               ; preds = %.sink.split, %37
  %44 = phi ptr [ %.pre, %37 ], [ %.ph, %.sink.split ]
  %45 = getelementptr inbounds i8, ptr %44, i64 40
  %46 = load i64, ptr %45, align 8, !tbaa !25
  %47 = add i64 %46, 1
  store i64 %47, ptr %45, align 8, !tbaa !25
  %48 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %29) #9
  br label %49

49:                                               ; preds = %27, %43, %4
  %.1 = phi ptr [ null, %4 ], [ null, %27 ], [ %25, %43 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #9
  ret ptr %.1
}

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

declare ptr @mln_fheap_node_new(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) local_unnamed_addr #7

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) local_unnamed_addr #7

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #2 = { 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 #3 = { 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 #4 = { 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 #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 = { "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 "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }

!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 = !{!"timeval", !7, i64 0, !7, i64 8}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!12, !14, i64 32}
!12 = !{!"mln_event_desc_s", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !14, i64 32, !14, i64 36, !8, i64 40}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!12, !14, i64 36}
!16 = !{!8, !8, i64 0}
!17 = !{!18, !13, i64 576}
!18 = !{!"mln_event_s", !8, i64 0, !8, i64 40, !8, i64 80, !13, i64 120, !13, i64 128, !14, i64 136, !14, i64 136, !14, i64 140, !19, i64 144, !19, i64 272, !19, i64 400, !13, i64 528, !13, i64 536, !13, i64 544, !13, i64 552, !13, i64 560, !13, i64 568, !13, i64 576}
!19 = !{!"", !8, i64 0}
!20 = !{!21, !13, i64 8}
!21 = !{!"mln_fheap_node_s", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !7, i64 40, !14, i64 48, !14, i64 48}
!22 = !{!23, !13, i64 8}
!23 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !7, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72}
!24 = !{!21, !13, i64 0}
!25 = !{!23, !7, i64 40}


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