; 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_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 }

@fheap_min = external dso_local global { ptr, ptr, ptr, ptr, i32, i32, { %struct.mln_event_tm_s, [72 x i8] } }, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @mln_event_new() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %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
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %25 = call noalias ptr @malloc(i64 noundef 584) #7
  store ptr %25, ptr %3, align 8, !tbaa !5
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %0
  store ptr null, ptr %1, align 8
  store i32 1, ptr %4, align 4
  br label %462

29:                                               ; preds = %0
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.mln_event_s, ptr %30, i32 0, i32 3
  store ptr null, ptr %31, align 8, !tbaa !9
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.mln_event_s, ptr %32, i32 0, i32 4
  store ptr null, ptr %33, align 8, !tbaa !13
  %34 = call ptr @mln_rbtree_new(ptr noundef null)
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.mln_event_s, ptr %35, i32 0, i32 10
  store ptr %34, ptr %36, align 8, !tbaa !14
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.mln_event_s, ptr %37, i32 0, i32 10
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %42

41:                                               ; preds = %29
  br label %460

42:                                               ; preds = %29
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.mln_event_s, ptr %43, i32 0, i32 11
  store ptr null, ptr %44, align 8, !tbaa !15
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.mln_event_s, ptr %45, i32 0, i32 12
  store ptr null, ptr %46, align 8, !tbaa !16
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.mln_event_s, ptr %47, i32 0, i32 13
  store ptr null, ptr %48, align 8, !tbaa !17
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.mln_event_s, ptr %49, i32 0, i32 14
  store ptr null, ptr %50, align 8, !tbaa !18
  %51 = call ptr @mln_fheap_new(ptr noundef @fheap_min, ptr noundef null)
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.mln_event_s, ptr %52, i32 0, i32 15
  store ptr %51, ptr %53, align 8, !tbaa !19
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.mln_event_s, ptr %54, i32 0, i32 15
  %56 = load ptr, ptr %55, align 8, !tbaa !19
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %59

58:                                               ; preds = %42
  br label %456

59:                                               ; preds = %42
  %60 = call ptr @mln_fheap_new_fast(ptr noundef @fheap_min, ptr noundef @mln_event_fheap_timer_cmp, ptr noundef @mln_event_fheap_timer_copy, ptr noundef @mln_event_desc_free)
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.mln_event_s, ptr %61, i32 0, i32 16
  store ptr %60, ptr %62, align 8, !tbaa !20
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.mln_event_s, ptr %63, i32 0, i32 16
  %65 = load ptr, ptr %64, align 8, !tbaa !20
  %66 = icmp eq ptr %65, null
  br i1 %66, label %67, label %68

67:                                               ; preds = %59
  br label %309

68:                                               ; preds = %59
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.mln_event_s, ptr %69, i32 0, i32 5
  %71 = load i32, ptr %70, align 8
  %72 = and i32 %71, -2
  %73 = or i32 %72, 0
  store i32 %73, ptr %70, align 8
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.mln_event_s, ptr %74, i32 0, i32 6
  store i32 3, ptr %75, align 4, !tbaa !21
  br label %76

76:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.mln_event_s, ptr %77, i32 0, i32 7
  store ptr %78, ptr %6, align 8, !tbaa !5
  store i32 0, ptr %5, align 4, !tbaa !22
  br label %79

79:                                               ; preds = %89, %76
  %80 = load i32, ptr %5, align 4, !tbaa !22
  %81 = zext i32 %80 to i64
  %82 = icmp ult i64 %81, 16
  br i1 %82, label %83, label %92

83:                                               ; preds = %79
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.fd_set, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %5, align 4, !tbaa !22
  %87 = zext i32 %86 to i64
  %88 = getelementptr inbounds [16 x i64], ptr %85, i64 0, i64 %87
  store i64 0, ptr %88, align 8, !tbaa !23
  br label %89

89:                                               ; preds = %83
  %90 = load i32, ptr %5, align 4, !tbaa !22
  %91 = add i32 %90, 1
  store i32 %91, ptr %5, align 4, !tbaa !22
  br label %79, !llvm.loop !25

92:                                               ; preds = %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.mln_event_s, ptr %96, i32 0, i32 8
  store ptr %97, ptr %8, align 8, !tbaa !5
  store i32 0, ptr %7, align 4, !tbaa !22
  br label %98

98:                                               ; preds = %108, %95
  %99 = load i32, ptr %7, align 4, !tbaa !22
  %100 = zext i32 %99 to i64
  %101 = icmp ult i64 %100, 16
  br i1 %101, label %102, label %111

102:                                              ; preds = %98
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.fd_set, ptr %103, i32 0, i32 0
  %105 = load i32, ptr %7, align 4, !tbaa !22
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds [16 x i64], ptr %104, i64 0, i64 %106
  store i64 0, ptr %107, align 8, !tbaa !23
  br label %108

108:                                              ; preds = %102
  %109 = load i32, ptr %7, align 4, !tbaa !22
  %110 = add i32 %109, 1
  store i32 %110, ptr %7, align 4, !tbaa !22
  br label %98, !llvm.loop !27

111:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %112

112:                                              ; preds = %111
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.mln_event_s, ptr %115, i32 0, i32 9
  store ptr %116, ptr %10, align 8, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !22
  br label %117

117:                                              ; preds = %127, %114
  %118 = load i32, ptr %9, align 4, !tbaa !22
  %119 = zext i32 %118 to i64
  %120 = icmp ult i64 %119, 16
  br i1 %120, label %121, label %130

121:                                              ; preds = %117
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.fd_set, ptr %122, i32 0, i32 0
  %124 = load i32, ptr %9, align 4, !tbaa !22
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds [16 x i64], ptr %123, i64 0, i64 %125
  store i64 0, ptr %126, align 8, !tbaa !23
  br label %127

127:                                              ; preds = %121
  %128 = load i32, ptr %9, align 4, !tbaa !22
  %129 = add i32 %128, 1
  store i32 %129, ptr %9, align 4, !tbaa !22
  br label %117, !llvm.loop !28

130:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.mln_event_s, ptr %133, i32 0, i32 0
  %135 = call i32 @pthread_mutex_init(ptr noundef %134, ptr noundef null) #6
  store i32 %135, ptr %2, align 4, !tbaa !22
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.mln_event_s, ptr %136, i32 0, i32 1
  %138 = call i32 @pthread_mutex_init(ptr noundef %137, ptr noundef null) #6
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %141

140:                                              ; preds = %132
  store i32 -1, ptr %2, align 4, !tbaa !22
  br label %141

141:                                              ; preds = %140, %132
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.mln_event_s, ptr %142, i32 0, i32 2
  %144 = call i32 @pthread_mutex_init(ptr noundef %143, ptr noundef null) #6
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %147

146:                                              ; preds = %141
  store i32 -1, ptr %2, align 4, !tbaa !22
  br label %147

147:                                              ; preds = %146, %141
  %148 = load i32, ptr %2, align 4, !tbaa !22
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %160

150:                                              ; preds = %147
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.mln_event_s, ptr %151, i32 0, i32 0
  %153 = call i32 @pthread_mutex_destroy(ptr noundef %152) #6
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.mln_event_s, ptr %154, i32 0, i32 1
  %156 = call i32 @pthread_mutex_destroy(ptr noundef %155) #6
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.mln_event_s, ptr %157, i32 0, i32 2
  %159 = call i32 @pthread_mutex_destroy(ptr noundef %158) #6
  br label %162

160:                                              ; preds = %147
  %161 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %161, ptr %1, align 8
  store i32 1, ptr %4, align 4
  br label %462

162:                                              ; preds = %150
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.mln_event_s, ptr %163, i32 0, i32 16
  %165 = load ptr, ptr %164, align 8, !tbaa !20
  %166 = icmp ne ptr %165, null
  br i1 %166, label %167, label %308

167:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  br label %168

168:                                              ; preds = %286, %167
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr @mln_event_fheap_timer_cmp, ptr %12, align 8, !tbaa !5
  %169 = load ptr, ptr %12, align 8, !tbaa !5
  %170 = icmp eq ptr %169, null
  br i1 %170, label %171, label %177

171:                                              ; preds = %168
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.mln_event_s, ptr %172, i32 0, i32 16
  %174 = load ptr, ptr %173, align 8, !tbaa !20
  %175 = getelementptr inbounds %struct.mln_fheap_t, ptr %174, i32 0, i32 2
  %176 = load ptr, ptr %175, align 8, !tbaa !29
  store ptr %176, ptr %12, align 8, !tbaa !5
  br label %177

177:                                              ; preds = %171, %168
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %178 = load ptr, ptr %3, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.mln_event_s, ptr %178, i32 0, i32 16
  %180 = load ptr, ptr %179, align 8, !tbaa !20
  %181 = getelementptr inbounds %struct.mln_fheap_t, ptr %180, i32 0, i32 1
  %182 = load ptr, ptr %181, align 8, !tbaa !31
  store ptr %182, ptr %13, align 8, !tbaa !5
  %183 = load ptr, ptr %13, align 8, !tbaa !5
  %184 = icmp ne ptr %183, null
  br i1 %184, label %185, label %233

185:                                              ; preds = %177
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  br label %186

186:                                              ; preds = %191, %185
  %187 = load ptr, ptr %13, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %187, i32 0, i32 2
  %189 = call ptr @mln_fheap_remove_child(ptr noundef %188)
  store ptr %189, ptr %14, align 8, !tbaa !5
  %190 = icmp ne ptr %189, null
  br i1 %190, label %191, label %199

191:                                              ; preds = %186
  %192 = load ptr, ptr %3, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.mln_event_s, ptr %192, i32 0, i32 16
  %194 = load ptr, ptr %193, align 8, !tbaa !20
  %195 = getelementptr inbounds %struct.mln_fheap_t, ptr %194, i32 0, i32 0
  %196 = load ptr, ptr %14, align 8, !tbaa !5
  call void @mln_fheap_add_child(ptr noundef %195, ptr noundef %196)
  %197 = load ptr, ptr %14, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %197, i32 0, i32 1
  store ptr null, ptr %198, align 8, !tbaa !32
  br label %186, !llvm.loop !34

199:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %200 = load ptr, ptr %13, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %200, i32 0, i32 4
  %202 = load ptr, ptr %201, align 8, !tbaa !35
  store ptr %202, ptr %15, align 8, !tbaa !5
  %203 = load ptr, ptr %3, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.mln_event_s, ptr %203, i32 0, i32 16
  %205 = load ptr, ptr %204, align 8, !tbaa !20
  %206 = getelementptr inbounds %struct.mln_fheap_t, ptr %205, i32 0, i32 0
  %207 = load ptr, ptr %13, align 8, !tbaa !5
  call void @mln_fheap_del_child(ptr noundef %206, ptr noundef %207)
  %208 = load ptr, ptr %13, align 8, !tbaa !5
  %209 = load ptr, ptr %15, align 8, !tbaa !5
  %210 = icmp eq ptr %208, %209
  br i1 %210, label %211, label %216

211:                                              ; preds = %199
  %212 = load ptr, ptr %3, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.mln_event_s, ptr %212, i32 0, i32 16
  %214 = load ptr, ptr %213, align 8, !tbaa !20
  %215 = getelementptr inbounds %struct.mln_fheap_t, ptr %214, i32 0, i32 1
  store ptr null, ptr %215, align 8, !tbaa !31
  br label %226

216:                                              ; preds = %199
  %217 = load ptr, ptr %15, align 8, !tbaa !5
  %218 = load ptr, ptr %3, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.mln_event_s, ptr %218, i32 0, i32 16
  %220 = load ptr, ptr %219, align 8, !tbaa !20
  %221 = getelementptr inbounds %struct.mln_fheap_t, ptr %220, i32 0, i32 1
  store ptr %217, ptr %221, align 8, !tbaa !31
  %222 = load ptr, ptr %3, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.mln_event_s, ptr %222, i32 0, i32 16
  %224 = load ptr, ptr %223, align 8, !tbaa !20
  %225 = load ptr, ptr %12, align 8, !tbaa !5
  call void @mln_fheap_consolidate(ptr noundef %224, ptr noundef %225)
  br label %226

226:                                              ; preds = %216, %211
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.mln_event_s, ptr %227, i32 0, i32 16
  %229 = load ptr, ptr %228, align 8, !tbaa !20
  %230 = getelementptr inbounds %struct.mln_fheap_t, ptr %229, i32 0, i32 5
  %231 = load i64, ptr %230, align 8, !tbaa !36
  %232 = add i64 %231, -1
  store i64 %232, ptr %230, align 8, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %233

233:                                              ; preds = %226, %177
  %234 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %234, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %235 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %235, ptr %11, align 8, !tbaa !5
  %236 = icmp ne ptr %235, null
  br i1 %236, label %237, label %287

237:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store ptr @mln_event_desc_free, ptr %17, align 8, !tbaa !5
  %238 = load ptr, ptr %17, align 8, !tbaa !5
  %239 = icmp eq ptr %238, null
  br i1 %239, label %240, label %246

240:                                              ; preds = %237
  %241 = load ptr, ptr %3, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.mln_event_s, ptr %241, i32 0, i32 16
  %243 = load ptr, ptr %242, align 8, !tbaa !20
  %244 = getelementptr inbounds %struct.mln_fheap_t, ptr %243, i32 0, i32 4
  %245 = load ptr, ptr %244, align 8, !tbaa !37
  store ptr %245, ptr %17, align 8, !tbaa !5
  br label %246

246:                                              ; preds = %240, %237
  %247 = load ptr, ptr %11, align 8, !tbaa !5
  %248 = icmp ne ptr %247, null
  br i1 %248, label %249, label %286

249:                                              ; preds = %246
  %250 = load ptr, ptr %17, align 8, !tbaa !5
  %251 = icmp ne ptr %250, null
  br i1 %251, label %252, label %262

252:                                              ; preds = %249
  %253 = load ptr, ptr %11, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %253, i32 0, i32 0
  %255 = load ptr, ptr %254, align 8, !tbaa !38
  %256 = icmp ne ptr %255, null
  br i1 %256, label %257, label %262

257:                                              ; preds = %252
  %258 = load ptr, ptr %17, align 8, !tbaa !5
  %259 = load ptr, ptr %11, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %259, i32 0, i32 0
  %261 = load ptr, ptr %260, align 8, !tbaa !38
  call void %258(ptr noundef %261)
  br label %262

262:                                              ; preds = %257, %252, %249
  %263 = load ptr, ptr %11, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %263, i32 0, i32 6
  %265 = load i32, ptr %264, align 8
  %266 = and i32 %265, 1
  %267 = icmp ne i32 %266, 0
  br i1 %267, label %285, label %268

268:                                              ; preds = %262
  %269 = load ptr, ptr %3, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.mln_event_s, ptr %269, i32 0, i32 16
  %271 = load ptr, ptr %270, align 8, !tbaa !20
  %272 = getelementptr inbounds %struct.mln_fheap_t, ptr %271, i32 0, i32 7
  %273 = load ptr, ptr %272, align 8, !tbaa !39
  %274 = icmp ne ptr %273, null
  br i1 %274, label %275, label %282

275:                                              ; preds = %268
  %276 = load ptr, ptr %3, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.mln_event_s, ptr %276, i32 0, i32 16
  %278 = load ptr, ptr %277, align 8, !tbaa !20
  %279 = getelementptr inbounds %struct.mln_fheap_t, ptr %278, i32 0, i32 9
  %280 = load ptr, ptr %279, align 8, !tbaa !40
  %281 = load ptr, ptr %11, align 8, !tbaa !5
  call void %280(ptr noundef %281)
  br label %284

282:                                              ; preds = %268
  %283 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %283) #6
  br label %284

284:                                              ; preds = %282, %275
  br label %285

285:                                              ; preds = %284, %262
  br label %286

286:                                              ; preds = %285, %246
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %168, !llvm.loop !41

287:                                              ; preds = %233
  %288 = load ptr, ptr %3, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.mln_event_s, ptr %288, i32 0, i32 16
  %290 = load ptr, ptr %289, align 8, !tbaa !20
  %291 = getelementptr inbounds %struct.mln_fheap_t, ptr %290, i32 0, i32 7
  %292 = load ptr, ptr %291, align 8, !tbaa !39
  %293 = icmp ne ptr %292, null
  br i1 %293, label %294, label %303

294:                                              ; preds = %287
  %295 = load ptr, ptr %3, align 8, !tbaa !5
  %296 = getelementptr inbounds %struct.mln_event_s, ptr %295, i32 0, i32 16
  %297 = load ptr, ptr %296, align 8, !tbaa !20
  %298 = getelementptr inbounds %struct.mln_fheap_t, ptr %297, i32 0, i32 9
  %299 = load ptr, ptr %298, align 8, !tbaa !40
  %300 = load ptr, ptr %3, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.mln_event_s, ptr %300, i32 0, i32 16
  %302 = load ptr, ptr %301, align 8, !tbaa !20
  call void %299(ptr noundef %302)
  br label %307

303:                                              ; preds = %287
  %304 = load ptr, ptr %3, align 8, !tbaa !5
  %305 = getelementptr inbounds %struct.mln_event_s, ptr %304, i32 0, i32 16
  %306 = load ptr, ptr %305, align 8, !tbaa !20
  call void @free(ptr noundef %306) #6
  br label %307

307:                                              ; preds = %303, %294
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %308

308:                                              ; preds = %307, %162
  br label %309

309:                                              ; preds = %308, %67
  %310 = load ptr, ptr %3, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.mln_event_s, ptr %310, i32 0, i32 15
  %312 = load ptr, ptr %311, align 8, !tbaa !19
  %313 = icmp ne ptr %312, null
  br i1 %313, label %314, label %455

314:                                              ; preds = %309
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  br label %315

315:                                              ; preds = %433, %314
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store ptr @mln_event_fd_timeout_cmp, ptr %19, align 8, !tbaa !5
  %316 = load ptr, ptr %19, align 8, !tbaa !5
  %317 = icmp eq ptr %316, null
  br i1 %317, label %318, label %324

318:                                              ; preds = %315
  %319 = load ptr, ptr %3, align 8, !tbaa !5
  %320 = getelementptr inbounds %struct.mln_event_s, ptr %319, i32 0, i32 15
  %321 = load ptr, ptr %320, align 8, !tbaa !19
  %322 = getelementptr inbounds %struct.mln_fheap_t, ptr %321, i32 0, i32 2
  %323 = load ptr, ptr %322, align 8, !tbaa !29
  store ptr %323, ptr %19, align 8, !tbaa !5
  br label %324

324:                                              ; preds = %318, %315
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %325 = load ptr, ptr %3, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct.mln_event_s, ptr %325, i32 0, i32 15
  %327 = load ptr, ptr %326, align 8, !tbaa !19
  %328 = getelementptr inbounds %struct.mln_fheap_t, ptr %327, i32 0, i32 1
  %329 = load ptr, ptr %328, align 8, !tbaa !31
  store ptr %329, ptr %20, align 8, !tbaa !5
  %330 = load ptr, ptr %20, align 8, !tbaa !5
  %331 = icmp ne ptr %330, null
  br i1 %331, label %332, label %380

332:                                              ; preds = %324
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  br label %333

333:                                              ; preds = %338, %332
  %334 = load ptr, ptr %20, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %334, i32 0, i32 2
  %336 = call ptr @mln_fheap_remove_child(ptr noundef %335)
  store ptr %336, ptr %21, align 8, !tbaa !5
  %337 = icmp ne ptr %336, null
  br i1 %337, label %338, label %346

338:                                              ; preds = %333
  %339 = load ptr, ptr %3, align 8, !tbaa !5
  %340 = getelementptr inbounds %struct.mln_event_s, ptr %339, i32 0, i32 15
  %341 = load ptr, ptr %340, align 8, !tbaa !19
  %342 = getelementptr inbounds %struct.mln_fheap_t, ptr %341, i32 0, i32 0
  %343 = load ptr, ptr %21, align 8, !tbaa !5
  call void @mln_fheap_add_child(ptr noundef %342, ptr noundef %343)
  %344 = load ptr, ptr %21, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %344, i32 0, i32 1
  store ptr null, ptr %345, align 8, !tbaa !32
  br label %333, !llvm.loop !42

346:                                              ; preds = %333
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %347 = load ptr, ptr %20, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %347, i32 0, i32 4
  %349 = load ptr, ptr %348, align 8, !tbaa !35
  store ptr %349, ptr %22, align 8, !tbaa !5
  %350 = load ptr, ptr %3, align 8, !tbaa !5
  %351 = getelementptr inbounds %struct.mln_event_s, ptr %350, i32 0, i32 15
  %352 = load ptr, ptr %351, align 8, !tbaa !19
  %353 = getelementptr inbounds %struct.mln_fheap_t, ptr %352, i32 0, i32 0
  %354 = load ptr, ptr %20, align 8, !tbaa !5
  call void @mln_fheap_del_child(ptr noundef %353, ptr noundef %354)
  %355 = load ptr, ptr %20, align 8, !tbaa !5
  %356 = load ptr, ptr %22, align 8, !tbaa !5
  %357 = icmp eq ptr %355, %356
  br i1 %357, label %358, label %363

358:                                              ; preds = %346
  %359 = load ptr, ptr %3, align 8, !tbaa !5
  %360 = getelementptr inbounds %struct.mln_event_s, ptr %359, i32 0, i32 15
  %361 = load ptr, ptr %360, align 8, !tbaa !19
  %362 = getelementptr inbounds %struct.mln_fheap_t, ptr %361, i32 0, i32 1
  store ptr null, ptr %362, align 8, !tbaa !31
  br label %373

363:                                              ; preds = %346
  %364 = load ptr, ptr %22, align 8, !tbaa !5
  %365 = load ptr, ptr %3, align 8, !tbaa !5
  %366 = getelementptr inbounds %struct.mln_event_s, ptr %365, i32 0, i32 15
  %367 = load ptr, ptr %366, align 8, !tbaa !19
  %368 = getelementptr inbounds %struct.mln_fheap_t, ptr %367, i32 0, i32 1
  store ptr %364, ptr %368, align 8, !tbaa !31
  %369 = load ptr, ptr %3, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct.mln_event_s, ptr %369, i32 0, i32 15
  %371 = load ptr, ptr %370, align 8, !tbaa !19
  %372 = load ptr, ptr %19, align 8, !tbaa !5
  call void @mln_fheap_consolidate(ptr noundef %371, ptr noundef %372)
  br label %373

373:                                              ; preds = %363, %358
  %374 = load ptr, ptr %3, align 8, !tbaa !5
  %375 = getelementptr inbounds %struct.mln_event_s, ptr %374, i32 0, i32 15
  %376 = load ptr, ptr %375, align 8, !tbaa !19
  %377 = getelementptr inbounds %struct.mln_fheap_t, ptr %376, i32 0, i32 5
  %378 = load i64, ptr %377, align 8, !tbaa !36
  %379 = add i64 %378, -1
  store i64 %379, ptr %377, align 8, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %380

380:                                              ; preds = %373, %324
  %381 = load ptr, ptr %20, align 8, !tbaa !5
  store ptr %381, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  %382 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %382, ptr %18, align 8, !tbaa !5
  %383 = icmp ne ptr %382, null
  br i1 %383, label %384, label %434

384:                                              ; preds = %380
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  store ptr null, ptr %24, align 8, !tbaa !5
  %385 = load ptr, ptr %24, align 8, !tbaa !5
  %386 = icmp eq ptr %385, null
  br i1 %386, label %387, label %393

387:                                              ; preds = %384
  %388 = load ptr, ptr %3, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.mln_event_s, ptr %388, i32 0, i32 15
  %390 = load ptr, ptr %389, align 8, !tbaa !19
  %391 = getelementptr inbounds %struct.mln_fheap_t, ptr %390, i32 0, i32 4
  %392 = load ptr, ptr %391, align 8, !tbaa !37
  store ptr %392, ptr %24, align 8, !tbaa !5
  br label %393

393:                                              ; preds = %387, %384
  %394 = load ptr, ptr %18, align 8, !tbaa !5
  %395 = icmp ne ptr %394, null
  br i1 %395, label %396, label %433

396:                                              ; preds = %393
  %397 = load ptr, ptr %24, align 8, !tbaa !5
  %398 = icmp ne ptr %397, null
  br i1 %398, label %399, label %409

399:                                              ; preds = %396
  %400 = load ptr, ptr %18, align 8, !tbaa !5
  %401 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %400, i32 0, i32 0
  %402 = load ptr, ptr %401, align 8, !tbaa !38
  %403 = icmp ne ptr %402, null
  br i1 %403, label %404, label %409

404:                                              ; preds = %399
  %405 = load ptr, ptr %24, align 8, !tbaa !5
  %406 = load ptr, ptr %18, align 8, !tbaa !5
  %407 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %406, i32 0, i32 0
  %408 = load ptr, ptr %407, align 8, !tbaa !38
  call void %405(ptr noundef %408)
  br label %409

409:                                              ; preds = %404, %399, %396
  %410 = load ptr, ptr %18, align 8, !tbaa !5
  %411 = getelementptr inbounds %struct.mln_fheap_node_s, ptr %410, i32 0, i32 6
  %412 = load i32, ptr %411, align 8
  %413 = and i32 %412, 1
  %414 = icmp ne i32 %413, 0
  br i1 %414, label %432, label %415

415:                                              ; preds = %409
  %416 = load ptr, ptr %3, align 8, !tbaa !5
  %417 = getelementptr inbounds %struct.mln_event_s, ptr %416, i32 0, i32 15
  %418 = load ptr, ptr %417, align 8, !tbaa !19
  %419 = getelementptr inbounds %struct.mln_fheap_t, ptr %418, i32 0, i32 7
  %420 = load ptr, ptr %419, align 8, !tbaa !39
  %421 = icmp ne ptr %420, null
  br i1 %421, label %422, label %429

422:                                              ; preds = %415
  %423 = load ptr, ptr %3, align 8, !tbaa !5
  %424 = getelementptr inbounds %struct.mln_event_s, ptr %423, i32 0, i32 15
  %425 = load ptr, ptr %424, align 8, !tbaa !19
  %426 = getelementptr inbounds %struct.mln_fheap_t, ptr %425, i32 0, i32 9
  %427 = load ptr, ptr %426, align 8, !tbaa !40
  %428 = load ptr, ptr %18, align 8, !tbaa !5
  call void %427(ptr noundef %428)
  br label %431

429:                                              ; preds = %415
  %430 = load ptr, ptr %18, align 8, !tbaa !5
  call void @free(ptr noundef %430) #6
  br label %431

431:                                              ; preds = %429, %422
  br label %432

432:                                              ; preds = %431, %409
  br label %433

433:                                              ; preds = %432, %393
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %315, !llvm.loop !43

434:                                              ; preds = %380
  %435 = load ptr, ptr %3, align 8, !tbaa !5
  %436 = getelementptr inbounds %struct.mln_event_s, ptr %435, i32 0, i32 15
  %437 = load ptr, ptr %436, align 8, !tbaa !19
  %438 = getelementptr inbounds %struct.mln_fheap_t, ptr %437, i32 0, i32 7
  %439 = load ptr, ptr %438, align 8, !tbaa !39
  %440 = icmp ne ptr %439, null
  br i1 %440, label %441, label %450

441:                                              ; preds = %434
  %442 = load ptr, ptr %3, align 8, !tbaa !5
  %443 = getelementptr inbounds %struct.mln_event_s, ptr %442, i32 0, i32 15
  %444 = load ptr, ptr %443, align 8, !tbaa !19
  %445 = getelementptr inbounds %struct.mln_fheap_t, ptr %444, i32 0, i32 9
  %446 = load ptr, ptr %445, align 8, !tbaa !40
  %447 = load ptr, ptr %3, align 8, !tbaa !5
  %448 = getelementptr inbounds %struct.mln_event_s, ptr %447, i32 0, i32 15
  %449 = load ptr, ptr %448, align 8, !tbaa !19
  call void %446(ptr noundef %449)
  br label %454

450:                                              ; preds = %434
  %451 = load ptr, ptr %3, align 8, !tbaa !5
  %452 = getelementptr inbounds %struct.mln_event_s, ptr %451, i32 0, i32 15
  %453 = load ptr, ptr %452, align 8, !tbaa !19
  call void @free(ptr noundef %453) #6
  br label %454

454:                                              ; preds = %450, %441
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  br label %455

455:                                              ; preds = %454, %309
  br label %456

456:                                              ; preds = %455, %58
  %457 = load ptr, ptr %3, align 8, !tbaa !5
  %458 = getelementptr inbounds %struct.mln_event_s, ptr %457, i32 0, i32 10
  %459 = load ptr, ptr %458, align 8, !tbaa !14
  call void @mln_rbtree_free(ptr noundef %459)
  br label %460

460:                                              ; preds = %456, %41
  %461 = load ptr, ptr %3, align 8, !tbaa !5
  call void @free(ptr noundef %461) #6
  store ptr null, ptr %1, align 8
  store i32 1, ptr %4, align 4
  br label %462

462:                                              ; preds = %460, %160, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %463 = load ptr, ptr %1, align 8
  ret ptr %463
}

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

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

declare ptr @mln_rbtree_new(ptr noundef) #3

declare ptr @mln_fheap_new(ptr noundef, ptr noundef) #3

declare ptr @mln_fheap_new_fast(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

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

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

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

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

; Function Attrs: nounwind
declare i32 @pthread_mutex_init(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind
declare i32 @pthread_mutex_destroy(ptr noundef) #5

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

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

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mln_event_fd_timeout_cmp(ptr noundef, ptr noundef) #4

declare void @mln_rbtree_free(ptr noundef) #3

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = { 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, !6, i64 120}
!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 = !{!10, !6, i64 128}
!14 = !{!10, !6, i64 528}
!15 = !{!10, !6, i64 536}
!16 = !{!10, !6, i64 544}
!17 = !{!10, !6, i64 552}
!18 = !{!10, !6, i64 560}
!19 = !{!10, !6, i64 568}
!20 = !{!10, !6, i64 576}
!21 = !{!10, !11, i64 140}
!22 = !{!11, !11, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}
!28 = distinct !{!28, !26}
!29 = !{!30, !6, i64 16}
!30 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !24, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!31 = !{!30, !6, i64 8}
!32 = !{!33, !6, i64 8}
!33 = !{!"mln_fheap_node_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !24, i64 40, !11, i64 48, !11, i64 48}
!34 = distinct !{!34, !26}
!35 = !{!33, !6, i64 32}
!36 = !{!30, !24, i64 40}
!37 = !{!30, !6, i64 32}
!38 = !{!33, !6, i64 0}
!39 = !{!30, !6, i64 56}
!40 = !{!30, !6, i64 72}
!41 = distinct !{!41, !26}
!42 = distinct !{!42, !26}
!43 = distinct !{!43, !26}


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

@fheap_min = external dso_local global { ptr, ptr, ptr, ptr, i32, i32, { %struct.mln_event_tm_s, [72 x i8] } }, align 8

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @mln_event_new() local_unnamed_addr #0 {
  %1 = tail call noalias dereferenceable_or_null(584) ptr @malloc(i64 noundef 584) #7
  %2 = icmp eq ptr %1, null
  br i1 %2, label %136, label %3

3:                                                ; preds = %0
  %4 = getelementptr inbounds i8, ptr %1, i64 120
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  %5 = tail call ptr @mln_rbtree_new(ptr noundef null) #8
  %6 = getelementptr inbounds i8, ptr %1, i64 528
  store ptr %5, ptr %6, align 8, !tbaa !5
  %7 = icmp eq ptr %5, null
  br i1 %7, label %135, label %8

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %1, i64 536
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %9, i8 0, i64 32, i1 false)
  %10 = tail call ptr @mln_fheap_new(ptr noundef nonnull @fheap_min, ptr noundef null) #8
  %11 = getelementptr inbounds i8, ptr %1, i64 568
  store ptr %10, ptr %11, align 8, !tbaa !12
  %12 = icmp eq ptr %10, null
  br i1 %12, label %133, label %13

13:                                               ; preds = %8
  %14 = tail call ptr @mln_fheap_new_fast(ptr noundef nonnull @fheap_min, ptr noundef nonnull @mln_event_fheap_timer_cmp, ptr noundef nonnull @mln_event_fheap_timer_copy, ptr noundef nonnull @mln_event_desc_free) #8
  %15 = getelementptr inbounds i8, ptr %1, i64 576
  store ptr %14, ptr %15, align 8, !tbaa !13
  %16 = icmp eq ptr %14, null
  br i1 %16, label %81, label %17

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %1, i64 136
  %19 = load i32, ptr %18, align 8
  %20 = and i32 %19, -2
  store i32 %20, ptr %18, align 8
  %21 = getelementptr inbounds i8, ptr %1, i64 140
  store i32 3, ptr %21, align 4, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %1, i64 144
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(384) %22, i8 0, i64 384, i1 false)
  %23 = tail call i32 @pthread_mutex_init(ptr noundef nonnull %1, ptr noundef null) #8
  %24 = getelementptr inbounds i8, ptr %1, i64 40
  %25 = tail call i32 @pthread_mutex_init(ptr noundef nonnull %24, ptr noundef null) #8
  %.not = icmp eq i32 %25, 0
  %26 = getelementptr inbounds i8, ptr %1, i64 80
  %27 = tail call i32 @pthread_mutex_init(ptr noundef nonnull %26, ptr noundef null) #8
  %.not138 = icmp eq i32 %27, 0
  %28 = select i1 %.not138, i1 %.not, i1 false
  %.not139157 = icmp eq i32 %23, 0
  %.not139 = select i1 %28, i1 %.not139157, i1 false
  br i1 %.not139, label %136, label %29

29:                                               ; preds = %17
  %30 = tail call i32 @pthread_mutex_destroy(ptr noundef nonnull %1) #8
  %31 = tail call i32 @pthread_mutex_destroy(ptr noundef nonnull %24) #8
  %32 = tail call i32 @pthread_mutex_destroy(ptr noundef nonnull %26) #8
  %33 = load ptr, ptr %15, align 8, !tbaa !13
  %.not140 = icmp eq ptr %33, null
  br i1 %.not140, label %81, label %.preheader160

.preheader160:                                    ; preds = %29
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !15
  %.not141165 = icmp eq ptr %35, null
  br i1 %.not141165, label %.critedge, label %.preheader159

.preheader159:                                    ; preds = %.preheader160, %70
  %36 = phi ptr [ %73, %70 ], [ %35, %.preheader160 ]
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = tail call ptr @mln_fheap_remove_child(ptr noundef nonnull %37)
  %.not142164 = icmp eq ptr %38, null
  br i1 %.not142164, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader159, %.lr.ph
  %39 = phi ptr [ %42, %.lr.ph ], [ %38, %.preheader159 ]
  %40 = load ptr, ptr %15, align 8, !tbaa !13
  tail call void @mln_fheap_add_child(ptr noundef %40, ptr noundef nonnull %39)
  %41 = getelementptr inbounds i8, ptr %39, i64 8
  store ptr null, ptr %41, align 8, !tbaa !18
  %42 = tail call ptr @mln_fheap_remove_child(ptr noundef nonnull %37)
  %.not142 = icmp eq ptr %42, null
  br i1 %.not142, label %._crit_edge, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph, %.preheader159
  %43 = getelementptr inbounds i8, ptr %36, i64 32
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  %45 = load ptr, ptr %15, align 8, !tbaa !13
  tail call void @mln_fheap_del_child(ptr noundef %45, ptr noundef nonnull %36)
  %46 = icmp eq ptr %36, %44
  %47 = load ptr, ptr %15, align 8, !tbaa !13
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  br i1 %46, label %49, label %50

49:                                               ; preds = %._crit_edge
  store ptr null, ptr %48, align 8, !tbaa !15
  br label %51

50:                                               ; preds = %._crit_edge
  store ptr %44, ptr %48, align 8, !tbaa !15
  tail call void @mln_fheap_consolidate(ptr noundef %47, ptr noundef nonnull @mln_event_fheap_timer_cmp)
  %.pre = load ptr, ptr %15, align 8, !tbaa !13
  br label %51

51:                                               ; preds = %49, %50
  %52 = phi ptr [ %47, %49 ], [ %.pre, %50 ]
  %53 = getelementptr inbounds i8, ptr %52, i64 40
  %54 = load i64, ptr %53, align 8, !tbaa !23
  %55 = add i64 %54, -1
  store i64 %55, ptr %53, align 8, !tbaa !23
  %56 = load ptr, ptr %36, align 8, !tbaa !24
  %.not144 = icmp eq ptr %56, null
  br i1 %.not144, label %58, label %57

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

58:                                               ; preds = %57, %51
  %59 = getelementptr inbounds i8, ptr %36, i64 48
  %60 = load i32, ptr %59, align 8
  %61 = and i32 %60, 1
  %.not145 = icmp eq i32 %61, 0
  br i1 %.not145, label %62, label %70

62:                                               ; preds = %58
  %63 = load ptr, ptr %15, align 8, !tbaa !13
  %64 = getelementptr inbounds i8, ptr %63, i64 56
  %65 = load ptr, ptr %64, align 8, !tbaa !25
  %.not146 = icmp eq ptr %65, null
  br i1 %.not146, label %69, label %66

66:                                               ; preds = %62
  %67 = getelementptr inbounds i8, ptr %63, i64 72
  %68 = load ptr, ptr %67, align 8, !tbaa !26
  tail call void %68(ptr noundef nonnull %36) #8
  br label %70

69:                                               ; preds = %62
  tail call void @free(ptr noundef nonnull %36) #8
  br label %70

70:                                               ; preds = %58, %69, %66
  %71 = load ptr, ptr %15, align 8, !tbaa !13
  %72 = getelementptr inbounds i8, ptr %71, i64 8
  %73 = load ptr, ptr %72, align 8, !tbaa !15
  %.not141 = icmp eq ptr %73, null
  br i1 %.not141, label %.critedge, label %.preheader159, !llvm.loop !27

.critedge:                                        ; preds = %70, %.preheader160
  %74 = phi ptr [ %33, %.preheader160 ], [ %71, %70 ]
  %75 = getelementptr inbounds i8, ptr %74, i64 56
  %76 = load ptr, ptr %75, align 8, !tbaa !25
  %.not143 = icmp eq ptr %76, null
  br i1 %.not143, label %80, label %77

77:                                               ; preds = %.critedge
  %78 = getelementptr inbounds i8, ptr %74, i64 72
  %79 = load ptr, ptr %78, align 8, !tbaa !26
  tail call void %79(ptr noundef nonnull %74) #8
  br label %81

80:                                               ; preds = %.critedge
  tail call void @free(ptr noundef nonnull %74) #8
  br label %81

81:                                               ; preds = %77, %80, %29, %13
  %82 = load ptr, ptr %11, align 8, !tbaa !12
  %.not147 = icmp eq ptr %82, null
  br i1 %.not147, label %133, label %.preheader158

.preheader158:                                    ; preds = %81
  %83 = getelementptr inbounds i8, ptr %82, i64 8
  %84 = load ptr, ptr %83, align 8, !tbaa !15
  %.not148169 = icmp eq ptr %84, null
  br i1 %.not148169, label %.critedge156, label %.preheader

.preheader:                                       ; preds = %.preheader158, %122
  %85 = phi ptr [ %125, %122 ], [ %84, %.preheader158 ]
  %86 = getelementptr inbounds i8, ptr %85, i64 16
  %87 = tail call ptr @mln_fheap_remove_child(ptr noundef nonnull %86)
  %.not149166 = icmp eq ptr %87, null
  br i1 %.not149166, label %._crit_edge168, label %.lr.ph167

.lr.ph167:                                        ; preds = %.preheader, %.lr.ph167
  %88 = phi ptr [ %91, %.lr.ph167 ], [ %87, %.preheader ]
  %89 = load ptr, ptr %11, align 8, !tbaa !12
  tail call void @mln_fheap_add_child(ptr noundef %89, ptr noundef nonnull %88)
  %90 = getelementptr inbounds i8, ptr %88, i64 8
  store ptr null, ptr %90, align 8, !tbaa !18
  %91 = tail call ptr @mln_fheap_remove_child(ptr noundef nonnull %86)
  %.not149 = icmp eq ptr %91, null
  br i1 %.not149, label %._crit_edge168, label %.lr.ph167, !llvm.loop !28

._crit_edge168:                                   ; preds = %.lr.ph167, %.preheader
  %92 = getelementptr inbounds i8, ptr %85, i64 32
  %93 = load ptr, ptr %92, align 8, !tbaa !22
  %94 = load ptr, ptr %11, align 8, !tbaa !12
  tail call void @mln_fheap_del_child(ptr noundef %94, ptr noundef nonnull %85)
  %95 = icmp eq ptr %85, %93
  %96 = load ptr, ptr %11, align 8, !tbaa !12
  %97 = getelementptr inbounds i8, ptr %96, i64 8
  br i1 %95, label %98, label %99

98:                                               ; preds = %._crit_edge168
  store ptr null, ptr %97, align 8, !tbaa !15
  br label %100

99:                                               ; preds = %._crit_edge168
  store ptr %93, ptr %97, align 8, !tbaa !15
  tail call void @mln_fheap_consolidate(ptr noundef %96, ptr noundef nonnull @mln_event_fd_timeout_cmp)
  %.pre173 = load ptr, ptr %11, align 8, !tbaa !12
  br label %100

100:                                              ; preds = %98, %99
  %101 = phi ptr [ %96, %98 ], [ %.pre173, %99 ]
  %102 = getelementptr inbounds i8, ptr %101, i64 40
  %103 = load i64, ptr %102, align 8, !tbaa !23
  %104 = add i64 %103, -1
  store i64 %104, ptr %102, align 8, !tbaa !23
  %105 = getelementptr inbounds i8, ptr %101, i64 32
  %106 = load ptr, ptr %105, align 8, !tbaa !29
  %.not151 = icmp eq ptr %106, null
  br i1 %.not151, label %110, label %107

107:                                              ; preds = %100
  %108 = load ptr, ptr %85, align 8, !tbaa !24
  %.not152 = icmp eq ptr %108, null
  br i1 %.not152, label %110, label %109

109:                                              ; preds = %107
  tail call void %106(ptr noundef nonnull %108) #8
  br label %110

110:                                              ; preds = %109, %107, %100
  %111 = getelementptr inbounds i8, ptr %85, i64 48
  %112 = load i32, ptr %111, align 8
  %113 = and i32 %112, 1
  %.not153 = icmp eq i32 %113, 0
  br i1 %.not153, label %114, label %122

114:                                              ; preds = %110
  %115 = load ptr, ptr %11, align 8, !tbaa !12
  %116 = getelementptr inbounds i8, ptr %115, i64 56
  %117 = load ptr, ptr %116, align 8, !tbaa !25
  %.not154 = icmp eq ptr %117, null
  br i1 %.not154, label %121, label %118

118:                                              ; preds = %114
  %119 = getelementptr inbounds i8, ptr %115, i64 72
  %120 = load ptr, ptr %119, align 8, !tbaa !26
  tail call void %120(ptr noundef nonnull %85) #8
  br label %122

121:                                              ; preds = %114
  tail call void @free(ptr noundef nonnull %85) #8
  br label %122

122:                                              ; preds = %110, %121, %118
  %123 = load ptr, ptr %11, align 8, !tbaa !12
  %124 = getelementptr inbounds i8, ptr %123, i64 8
  %125 = load ptr, ptr %124, align 8, !tbaa !15
  %.not148 = icmp eq ptr %125, null
  br i1 %.not148, label %.critedge156, label %.preheader, !llvm.loop !30

.critedge156:                                     ; preds = %122, %.preheader158
  %126 = phi ptr [ %82, %.preheader158 ], [ %123, %122 ]
  %127 = getelementptr inbounds i8, ptr %126, i64 56
  %128 = load ptr, ptr %127, align 8, !tbaa !25
  %.not150 = icmp eq ptr %128, null
  br i1 %.not150, label %132, label %129

129:                                              ; preds = %.critedge156
  %130 = getelementptr inbounds i8, ptr %126, i64 72
  %131 = load ptr, ptr %130, align 8, !tbaa !26
  tail call void %131(ptr noundef nonnull %126) #8
  br label %133

132:                                              ; preds = %.critedge156
  tail call void @free(ptr noundef nonnull %126) #8
  br label %133

133:                                              ; preds = %129, %132, %81, %8
  %134 = load ptr, ptr %6, align 8, !tbaa !5
  tail call void @mln_rbtree_free(ptr noundef %134) #8
  br label %135

135:                                              ; preds = %3, %133
  tail call void @free(ptr noundef nonnull %1) #8
  br label %136

136:                                              ; preds = %17, %0, %135
  %.0116 = phi ptr [ null, %135 ], [ null, %0 ], [ %1, %17 ]
  ret ptr %.0116
}

; 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

declare ptr @mln_rbtree_new(ptr noundef) local_unnamed_addr #2

declare ptr @mln_fheap_new(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @mln_fheap_new_fast(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind
declare i32 @pthread_mutex_init(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @pthread_mutex_destroy(ptr noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mln_fheap_consolidate(ptr noundef, ptr noundef) 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 #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @mln_event_fd_timeout_cmp(ptr noundef, ptr noundef) #3

declare void @mln_rbtree_free(ptr noundef) local_unnamed_addr #2

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass