; 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.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: inlinehint nounwind uwtable
declare hidden i32 @mln_event_fheap_timer_cmp(ptr noundef nonnull, ptr noundef nonnull) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_event_fheap_timer_copy(ptr noundef nonnull, ptr noundef nonnull) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_event_desc_free(ptr noundef) #1

; 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 ptr @mln_fheap_remove_child(ptr noundef) #1

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

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

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

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

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

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

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

22:                                               ; preds = %2
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.mln_event_s, ptr %23, i32 0, i32 16
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.mln_fheap_t, ptr %25, i32 0, i32 2
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  store ptr %27, ptr %5, align 8, !tbaa !5
  br label %28

28:                                               ; preds = %22, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store ptr @mln_event_fheap_timer_copy, ptr %6, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %37

31:                                               ; preds = %28
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.mln_event_s, ptr %32, i32 0, i32 16
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.mln_fheap_t, ptr %34, i32 0, i32 3
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  store ptr %36, ptr %6, align 8, !tbaa !5
  br label %37

37:                                               ; preds = %31, %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !17
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.mln_event_s, ptr %42, i32 0, i32 16
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.mln_fheap_t, ptr %44, i32 0, i32 6
  %46 = load ptr, ptr %45, align 8, !tbaa !20
  %47 = call i32 %38(ptr noundef %41, ptr noundef %46)
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %50, label %49

49:                                               ; preds = %37
  store i32 -1, ptr %7, align 4, !tbaa !17
  br label %114

50:                                               ; preds = %37
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.mln_event_s, ptr %55, i32 0, i32 16
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.mln_fheap_t, ptr %57, i32 0, i32 6
  %59 = load ptr, ptr %58, align 8, !tbaa !20
  call void %51(ptr noundef %54, ptr noundef %59)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  store ptr %62, ptr %8, align 8, !tbaa !5
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %85

65:                                               ; preds = %50
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %67, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !18
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !18
  %73 = call i32 %66(ptr noundef %69, ptr noundef %72)
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %85, label %75

75:                                               ; preds = %65
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.mln_event_s, ptr %76, i32 0, i32 16
  %78 = load ptr, ptr %77, align 8, !tbaa !9
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  call void @mln_fheap_cut(ptr noundef %78, ptr noundef %79, ptr noundef %80)
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.mln_event_s, ptr %81, i32 0, i32 16
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  call void @mln_fheap_cascading_cut(ptr noundef %83, ptr noundef %84)
  br label %85

85:                                               ; preds = %75, %65, %50
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.mln_event_s, ptr %87, i32 0, i32 16
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.mln_fheap_t, ptr %89, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !22
  %92 = icmp ne ptr %86, %91
  br i1 %92, label %93, label %113

93:                                               ; preds = %85
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !18
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.mln_event_s, ptr %98, i32 0, i32 16
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  %101 = getelementptr inbounds %struct.mln_fheap_t, ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !22
  %103 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %102, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !18
  %105 = call i32 %94(ptr noundef %97, ptr noundef %104)
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %113, label %107

107:                                              ; preds = %93
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.mln_event_s, ptr %109, i32 0, i32 16
  %111 = load ptr, ptr %110, align 8, !tbaa !9
  %112 = getelementptr inbounds %struct.mln_fheap_t, ptr %111, i32 0, i32 1
  store ptr %108, ptr %112, align 8, !tbaa !22
  br label %113

113:                                              ; preds = %107, %93, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %114

114:                                              ; preds = %113, %49
  %115 = load i32, ptr %7, align 4, !tbaa !17
  store i32 %115, ptr %9, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  %116 = load i32, ptr %9, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store ptr @mln_event_fheap_timer_cmp, ptr %11, align 8, !tbaa !5
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = icmp eq ptr %117, null
  br i1 %118, label %119, label %125

119:                                              ; preds = %114
  %120 = load ptr, ptr %3, 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 !9
  %123 = getelementptr inbounds %struct.mln_fheap_t, ptr %122, i32 0, i32 2
  %124 = load ptr, ptr %123, align 8, !tbaa !13
  store ptr %124, ptr %11, align 8, !tbaa !5
  br label %125

125:                                              ; preds = %119, %114
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.mln_event_s, ptr %126, i32 0, i32 16
  %128 = load ptr, ptr %127, align 8, !tbaa !9
  %129 = getelementptr inbounds %struct.mln_fheap_t, ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !22
  store ptr %130, ptr %12, align 8, !tbaa !5
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = icmp ne ptr %131, null
  br i1 %132, label %133, label %181

133:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  br label %134

134:                                              ; preds = %139, %133
  %135 = load ptr, ptr %12, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %135, i32 0, i32 2
  %137 = call ptr @mln_fheap_remove_child(ptr noundef %136)
  store ptr %137, ptr %13, align 8, !tbaa !5
  %138 = icmp ne ptr %137, null
  br i1 %138, label %139, label %147

139:                                              ; preds = %134
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.mln_event_s, ptr %140, i32 0, i32 16
  %142 = load ptr, ptr %141, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct.mln_fheap_t, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %13, align 8, !tbaa !5
  call void @mln_fheap_add_child(ptr noundef %143, ptr noundef %144)
  %145 = load ptr, ptr %13, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %145, i32 0, i32 1
  store ptr null, ptr %146, align 8, !tbaa !21
  br label %134, !llvm.loop !23

147:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %148, i32 0, i32 4
  %150 = load ptr, ptr %149, align 8, !tbaa !25
  store ptr %150, ptr %14, align 8, !tbaa !5
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.mln_event_s, ptr %151, i32 0, i32 16
  %153 = load ptr, ptr %152, align 8, !tbaa !9
  %154 = getelementptr inbounds %struct.mln_fheap_t, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %12, align 8, !tbaa !5
  call void @mln_fheap_del_child(ptr noundef %154, ptr noundef %155)
  %156 = load ptr, ptr %12, align 8, !tbaa !5
  %157 = load ptr, ptr %14, align 8, !tbaa !5
  %158 = icmp eq ptr %156, %157
  br i1 %158, label %159, label %164

159:                                              ; preds = %147
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.mln_event_s, ptr %160, i32 0, i32 16
  %162 = load ptr, ptr %161, align 8, !tbaa !9
  %163 = getelementptr inbounds %struct.mln_fheap_t, ptr %162, i32 0, i32 1
  store ptr null, ptr %163, align 8, !tbaa !22
  br label %174

164:                                              ; preds = %147
  %165 = load ptr, ptr %14, align 8, !tbaa !5
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.mln_event_s, ptr %166, i32 0, i32 16
  %168 = load ptr, ptr %167, align 8, !tbaa !9
  %169 = getelementptr inbounds %struct.mln_fheap_t, ptr %168, i32 0, i32 1
  store ptr %165, ptr %169, align 8, !tbaa !22
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.mln_event_s, ptr %170, i32 0, i32 16
  %172 = load ptr, ptr %171, align 8, !tbaa !9
  %173 = load ptr, ptr %11, align 8, !tbaa !5
  call void @mln_fheap_consolidate(ptr noundef %172, ptr noundef %173)
  br label %174

174:                                              ; preds = %164, %159
  %175 = load ptr, ptr %3, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.mln_event_s, ptr %175, i32 0, i32 16
  %177 = load ptr, ptr %176, align 8, !tbaa !9
  %178 = getelementptr inbounds %struct.mln_fheap_t, ptr %177, i32 0, i32 5
  %179 = load i64, ptr %178, align 8, !tbaa !26
  %180 = add i64 %179, -1
  store i64 %180, ptr %178, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %181

181:                                              ; preds = %174, %125
  %182 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %182, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %183 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %183, ptr %10, align 8, !tbaa !5
  %184 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store ptr @mln_event_desc_free, ptr %16, align 8, !tbaa !5
  %185 = load ptr, ptr %16, align 8, !tbaa !5
  %186 = icmp eq ptr %185, null
  br i1 %186, label %187, label %193

187:                                              ; preds = %181
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.mln_event_s, ptr %188, i32 0, i32 16
  %190 = load ptr, ptr %189, align 8, !tbaa !9
  %191 = getelementptr inbounds %struct.mln_fheap_t, ptr %190, i32 0, i32 4
  %192 = load ptr, ptr %191, align 8, !tbaa !27
  store ptr %192, ptr %16, align 8, !tbaa !5
  br label %193

193:                                              ; preds = %187, %181
  %194 = load ptr, ptr %4, align 8, !tbaa !5
  %195 = icmp ne ptr %194, null
  br i1 %195, label %196, label %233

196:                                              ; preds = %193
  %197 = load ptr, ptr %16, align 8, !tbaa !5
  %198 = icmp ne ptr %197, null
  br i1 %198, label %199, label %209

199:                                              ; preds = %196
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %200, i32 0, i32 0
  %202 = load ptr, ptr %201, align 8, !tbaa !18
  %203 = icmp ne ptr %202, null
  br i1 %203, label %204, label %209

204:                                              ; preds = %199
  %205 = load ptr, ptr %16, align 8, !tbaa !5
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %206, i32 0, i32 0
  %208 = load ptr, ptr %207, align 8, !tbaa !18
  call void %205(ptr noundef %208)
  br label %209

209:                                              ; preds = %204, %199, %196
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %210, i32 0, i32 6
  %212 = load i32, ptr %211, align 8
  %213 = and i32 %212, 1
  %214 = icmp ne i32 %213, 0
  br i1 %214, label %232, label %215

215:                                              ; preds = %209
  %216 = load ptr, ptr %3, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.mln_event_s, ptr %216, i32 0, i32 16
  %218 = load ptr, ptr %217, align 8, !tbaa !9
  %219 = getelementptr inbounds %struct.mln_fheap_t, ptr %218, i32 0, i32 7
  %220 = load ptr, ptr %219, align 8, !tbaa !28
  %221 = icmp ne ptr %220, null
  br i1 %221, label %222, label %229

222:                                              ; preds = %215
  %223 = load ptr, ptr %3, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.mln_event_s, ptr %223, i32 0, i32 16
  %225 = load ptr, ptr %224, align 8, !tbaa !9
  %226 = getelementptr inbounds %struct.mln_fheap_t, ptr %225, i32 0, i32 9
  %227 = load ptr, ptr %226, align 8, !tbaa !29
  %228 = load ptr, ptr %4, align 8, !tbaa !5
  call void %227(ptr noundef %228)
  br label %231

229:                                              ; preds = %215
  %230 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %230) #4
  br label %231

231:                                              ; preds = %229, %222
  br label %232

232:                                              ; preds = %231, %209
  br label %233

233:                                              ; preds = %232, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %234 = load ptr, ptr %3, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.mln_event_s, ptr %234, i32 0, i32 1
  %236 = call i32 @pthread_mutex_unlock(ptr noundef %235) #4
  ret void
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { 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, !6, i64 576}
!10 = !{!"mln_event_s", !7, i64 0, !7, i64 40, !7, i64 80, !6, i64 120, !6, i64 128, !11, i64 136, !11, i64 136, !11, i64 140, !12, i64 144, !12, i64 272, !12, i64 400, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !7, i64 0}
!13 = !{!14, !6, i64 16}
!14 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !15, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !6, i64 24}
!17 = !{!11, !11, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"mln_fheap_node_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !15, i64 40, !11, i64 48, !11, i64 48}
!20 = !{!14, !6, i64 48}
!21 = !{!19, !6, i64 8}
!22 = !{!14, !6, i64 8}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!19, !6, i64 32}
!26 = !{!14, !15, i64 40}
!27 = !{!14, !6, i64 32}
!28 = !{!14, !6, i64 56}
!29 = !{!14, !6, i64 72}


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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_event_fheap_timer_copy(ptr noundef nonnull, ptr noundef nonnull) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_event_desc_free(ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @mln_fheap_remove_child(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_fheap_del_child(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_fheap_consolidate(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mln_event_timer_cancel(ptr noundef nonnull %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = getelementptr inbounds i8, ptr %0, i64 40
  %4 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %3) #4
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 576
  %7 = load ptr, ptr %6, align 8, !tbaa !12
  %8 = getelementptr inbounds i8, ptr %7, i64 48
  %9 = load ptr, ptr %8, align 8, !tbaa !15
  %10 = tail call i32 @mln_event_fheap_timer_cmp(ptr noundef %5, ptr noundef %9)
  %.not = icmp eq i32 %10, 0
  %.pre = load ptr, ptr %6, align 8, !tbaa !12
  br i1 %.not, label %34, label %11

11:                                               ; preds = %2
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %.pre, i64 48
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  tail call void @mln_event_fheap_timer_copy(ptr noundef %12, ptr noundef %14)
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  %16 = load ptr, ptr %15, align 8, !tbaa !17
  %.not75 = icmp eq ptr %16, null
  br i1 %.not75, label %24, label %17

17:                                               ; preds = %11
  %18 = load ptr, ptr %1, align 8, !tbaa !5
  %19 = load ptr, ptr %16, align 8, !tbaa !5
  %20 = tail call i32 @mln_event_fheap_timer_cmp(ptr noundef %18, ptr noundef %19)
  %.not76 = icmp eq i32 %20, 0
  br i1 %.not76, label %21, label %24

21:                                               ; preds = %17
  %22 = load ptr, ptr %6, align 8, !tbaa !12
  tail call void @mln_fheap_cut(ptr noundef %22, ptr noundef nonnull %1, ptr noundef nonnull %16)
  %23 = load ptr, ptr %6, align 8, !tbaa !12
  tail call void @mln_fheap_cascading_cut(ptr noundef %23, ptr noundef nonnull %16)
  br label %24

24:                                               ; preds = %21, %17, %11
  %25 = load ptr, ptr %6, align 8, !tbaa !12
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !18
  %.not77 = icmp eq ptr %27, %1
  br i1 %.not77, label %34, label %28

28:                                               ; preds = %24
  %29 = load ptr, ptr %1, align 8, !tbaa !5
  %30 = load ptr, ptr %27, align 8, !tbaa !5
  %31 = tail call i32 @mln_event_fheap_timer_cmp(ptr noundef %29, ptr noundef %30)
  %.not78 = icmp eq i32 %31, 0
  %.pre85 = load ptr, ptr %6, align 8, !tbaa !12
  br i1 %.not78, label %32, label %34

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %.pre85, i64 8
  store ptr %1, ptr %33, align 8, !tbaa !18
  br label %34

34:                                               ; preds = %2, %32, %28, %24
  %35 = phi ptr [ %.pre, %2 ], [ %.pre85, %32 ], [ %.pre85, %28 ], [ %25, %24 ]
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = load ptr, ptr %36, align 8, !tbaa !18
  %.not79 = icmp eq ptr %37, null
  br i1 %.not79, label %57, label %.preheader

.preheader:                                       ; preds = %34
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  %39 = tail call ptr @mln_fheap_remove_child(ptr noundef nonnull %38)
  %.not8084 = icmp eq ptr %39, null
  br i1 %.not8084, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %40 = phi ptr [ %43, %.lr.ph ], [ %39, %.preheader ]
  %41 = load ptr, ptr %6, align 8, !tbaa !12
  tail call void @mln_fheap_add_child(ptr noundef %41, ptr noundef nonnull %40)
  %42 = getelementptr inbounds i8, ptr %40, i64 8
  store ptr null, ptr %42, align 8, !tbaa !17
  %43 = tail call ptr @mln_fheap_remove_child(ptr noundef nonnull %38)
  %.not80 = icmp eq ptr %43, null
  br i1 %.not80, label %._crit_edge, label %.lr.ph, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %44 = getelementptr inbounds i8, ptr %37, i64 32
  %45 = load ptr, ptr %44, align 8, !tbaa !21
  %46 = load ptr, ptr %6, align 8, !tbaa !12
  tail call void @mln_fheap_del_child(ptr noundef %46, ptr noundef nonnull %37)
  %47 = icmp eq ptr %37, %45
  %48 = load ptr, ptr %6, align 8, !tbaa !12
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  br i1 %47, label %50, label %51

50:                                               ; preds = %._crit_edge
  store ptr null, ptr %49, align 8, !tbaa !18
  br label %52

51:                                               ; preds = %._crit_edge
  store ptr %45, ptr %49, align 8, !tbaa !18
  tail call void @mln_fheap_consolidate(ptr noundef %48, ptr noundef nonnull @mln_event_fheap_timer_cmp)
  %.pre86 = load ptr, ptr %6, align 8, !tbaa !12
  br label %52

52:                                               ; preds = %51, %50
  %53 = phi ptr [ %.pre86, %51 ], [ %48, %50 ]
  %54 = getelementptr inbounds i8, ptr %53, i64 40
  %55 = load i64, ptr %54, align 8, !tbaa !22
  %56 = add i64 %55, -1
  store i64 %56, ptr %54, align 8, !tbaa !22
  br label %57

57:                                               ; preds = %34, %52
  %58 = load ptr, ptr %1, align 8, !tbaa !5
  %.not81 = icmp eq ptr %58, null
  br i1 %.not81, label %60, label %59

59:                                               ; preds = %57
  tail call void @mln_event_desc_free(ptr noundef nonnull %58)
  br label %60

60:                                               ; preds = %59, %57
  %61 = getelementptr inbounds i8, ptr %1, i64 48
  %62 = load i32, ptr %61, align 8
  %63 = and i32 %62, 1
  %.not82 = icmp eq i32 %63, 0
  br i1 %.not82, label %64, label %72

64:                                               ; preds = %60
  %65 = load ptr, ptr %6, align 8, !tbaa !12
  %66 = getelementptr inbounds i8, ptr %65, i64 56
  %67 = load ptr, ptr %66, align 8, !tbaa !23
  %.not83 = icmp eq ptr %67, null
  br i1 %.not83, label %71, label %68

68:                                               ; preds = %64
  %69 = getelementptr inbounds i8, ptr %65, i64 72
  %70 = load ptr, ptr %69, align 8, !tbaa !24
  tail call void %70(ptr noundef nonnull %1) #4
  br label %72

71:                                               ; preds = %64
  tail call void @free(ptr noundef nonnull %1) #4
  br label %72

72:                                               ; preds = %60, %71, %68
  %73 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %3) #4
  ret void
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_fheap_cut(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_fheap_cascading_cut(ptr noundef, ptr noundef) local_unnamed_addr #0

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


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