; LLVM IR from cjmcv/hpc :: coroutine/libco/libco/src (co_routine)

; 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.stPollItem_t = type <{ %struct.stTimeoutItem_t, ptr, ptr, %struct.epoll_event, [4 x i8] }>
%struct.stTimeoutItem_t = type { ptr, ptr, ptr, i64, ptr, ptr, ptr, i8 }
%struct.epoll_event = type <{ i32, %union.epoll_data }>
%union.epoll_data = type { ptr }
%struct.stCoEpoll_t = type { i32, ptr, ptr, ptr, ptr }
%struct.stPoll_t = type <{ %struct.stTimeoutItem_t, ptr, i64, ptr, i32, i32, i32, [4 x i8] }>
%struct.stCoRoutine_t = type { ptr, ptr, ptr, %struct.coctx_t, i8, i8, i8, i8, i8, ptr, ptr, ptr, i32, ptr, [1024 x %struct.stCoSpec_t] }
%struct.coctx_t = type { [14 x ptr], i64, ptr }
%struct.stCoSpec_t = type { ptr }
%struct.pollfd = type { i32, i16, i16 }

@.str.3 = external hidden unnamed_addr constant [69 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z10co_log_errPKcz(ptr noundef, ...) #0

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZL9GetTickMSv() #0

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z10AddTimeoutP11stTimeout_tP15stTimeoutItem_ty(ptr noundef, ptr noundef, i64 noundef) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z22co_get_curr_thread_envv() #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12co_yield_envP16stCoRoutineEnv_t(ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z18OnPollProcessEventP15stTimeoutItem_t(ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z16OnPollPreparePfnP15stTimeoutItem_tR11epoll_eventP19stTimeoutItemLink_t(ptr noundef, ptr noundef nonnull align 1 dereferenceable(12), ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z14RemoveFromLinkI15stTimeoutItem_t19stTimeoutItemLink_tEvPT_(ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z9GetCurrCoP16stCoRoutineEnv_t(ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z13co_poll_innerP11stCoEpoll_tP6pollfdmiPFiS2_miE(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr noundef %4) #5 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca [2 x %struct.stPollItem_t], align 16
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i64 %2, ptr %9, align 8, !tbaa !9
  store i32 %3, ptr %10, align 4, !tbaa !11
  store ptr %4, ptr %11, align 8, !tbaa !5
  %25 = load i32, ptr %10, align 4, !tbaa !11
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %33

27:                                               ; preds = %5
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load i64, ptr %9, align 8, !tbaa !9
  %31 = load i32, ptr %10, align 4, !tbaa !11
  %32 = call noundef i32 %28(ptr noundef %29, i64 noundef %30, i32 noundef %31)
  store i32 %32, ptr %6, align 4
  br label %284

33:                                               ; preds = %5
  %34 = load i32, ptr %10, align 4, !tbaa !11
  %35 = icmp slt i32 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %33
  store i32 2147483647, ptr %10, align 4, !tbaa !11
  br label %37

37:                                               ; preds = %36, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.stCoEpoll_t, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !13
  store i32 %40, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %41 = call noundef ptr @_Z7co_selfv()
  store ptr %41, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %42 = call noalias ptr @malloc(i64 noundef 104) #10
  store ptr %42, ptr %14, align 8, !tbaa !5
  %43 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %43, i8 0, i64 104, i1 false)
  %44 = load i32, ptr %12, align 4, !tbaa !11
  %45 = load ptr, ptr %14, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.stPoll_t, ptr %45, i32 0, i32 5
  store i32 %44, ptr %46, align 4, !tbaa !15
  %47 = load i64, ptr %9, align 8, !tbaa !9
  %48 = call noalias ptr @calloc(i64 noundef %47, i64 noundef 8) #11
  %49 = load ptr, ptr %14, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.stPoll_t, ptr %49, i32 0, i32 1
  store ptr %48, ptr %50, align 8, !tbaa !20
  %51 = load i64, ptr %9, align 8, !tbaa !9
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.stPoll_t, ptr %52, i32 0, i32 2
  store i64 %51, ptr %53, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 192, ptr %15) #9
  %54 = load i64, ptr %9, align 8, !tbaa !9
  %55 = icmp ult i64 %54, 2
  br i1 %55, label %56, label %65

56:                                               ; preds = %37
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.stCoRoutine_t, ptr %57, i32 0, i32 8
  %59 = load i8, ptr %58, align 4, !tbaa !22
  %60 = icmp ne i8 %59, 0
  br i1 %60, label %65, label %61

61:                                               ; preds = %56
  %62 = getelementptr inbounds [2 x %struct.stPollItem_t], ptr %15, i64 0, i64 0
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.stPoll_t, ptr %63, i32 0, i32 3
  store ptr %62, ptr %64, align 8, !tbaa !25
  br label %71

65:                                               ; preds = %56, %37
  %66 = load i64, ptr %9, align 8, !tbaa !9
  %67 = mul i64 %66, 96
  %68 = call noalias ptr @malloc(i64 noundef %67) #10
  %69 = load ptr, ptr %14, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.stPoll_t, ptr %69, i32 0, i32 3
  store ptr %68, ptr %70, align 8, !tbaa !25
  br label %71

71:                                               ; preds = %65, %61
  %72 = load ptr, ptr %14, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.stPoll_t, ptr %72, i32 0, i32 3
  %74 = load ptr, ptr %73, align 8, !tbaa !25
  %75 = load i64, ptr %9, align 8, !tbaa !9
  %76 = mul i64 %75, 96
  call void @llvm.memset.p0.i64(ptr align 8 %74, i8 0, i64 %76, i1 false)
  %77 = load ptr, ptr %14, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.stTimeoutItem_t, ptr %77, i32 0, i32 5
  store ptr @_Z18OnPollProcessEventP15stTimeoutItem_t, ptr %78, align 8, !tbaa !26
  %79 = call noundef ptr @_Z22co_get_curr_thread_envv()
  %80 = call noundef ptr @_Z9GetCurrCoP16stCoRoutineEnv_t(ptr noundef %79)
  %81 = load ptr, ptr %14, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.stTimeoutItem_t, ptr %81, i32 0, i32 6
  store ptr %80, ptr %82, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %83

83:                                               ; preds = %191, %71
  %84 = load i64, ptr %16, align 8, !tbaa !9
  %85 = load i64, ptr %9, align 8, !tbaa !9
  %86 = icmp ult i64 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 2, ptr %17, align 4
  br label %194

88:                                               ; preds = %83
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.stPoll_t, ptr %89, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !20
  %92 = load i64, ptr %16, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.pollfd, ptr %91, i64 %92
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.stPoll_t, ptr %94, i32 0, i32 3
  %96 = load ptr, ptr %95, align 8, !tbaa !25
  %97 = load i64, ptr %16, align 8, !tbaa !9
  %98 = getelementptr inbounds %struct.stPollItem_t, ptr %96, i64 %97
  %99 = getelementptr inbounds %struct.stPollItem_t, ptr %98, i32 0, i32 1
  store ptr %93, ptr %99, align 8, !tbaa !28
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  %101 = load ptr, ptr %14, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.stPoll_t, ptr %101, i32 0, i32 3
  %103 = load ptr, ptr %102, align 8, !tbaa !25
  %104 = load i64, ptr %16, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.stPollItem_t, ptr %103, i64 %104
  %106 = getelementptr inbounds %struct.stPollItem_t, ptr %105, i32 0, i32 2
  store ptr %100, ptr %106, align 8, !tbaa !31
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.stPoll_t, ptr %107, i32 0, i32 3
  %109 = load ptr, ptr %108, align 8, !tbaa !25
  %110 = load i64, ptr %16, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.stPollItem_t, ptr %109, i64 %110
  %112 = getelementptr inbounds %struct.stTimeoutItem_t, ptr %111, i32 0, i32 4
  store ptr @_Z16OnPollPreparePfnP15stTimeoutItem_tR11epoll_eventP19stTimeoutItemLink_t, ptr %112, align 8, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.stPoll_t, ptr %113, i32 0, i32 3
  %115 = load ptr, ptr %114, align 8, !tbaa !25
  %116 = load i64, ptr %16, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct.stPollItem_t, ptr %115, i64 %116
  %118 = getelementptr inbounds %struct.stPollItem_t, ptr %117, i32 0, i32 3
  store ptr %118, ptr %18, align 8, !tbaa !5
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = load i64, ptr %16, align 8, !tbaa !9
  %121 = getelementptr inbounds %struct.pollfd, ptr %119, i64 %120
  %122 = getelementptr inbounds %struct.pollfd, ptr %121, i32 0, i32 0
  %123 = load i32, ptr %122, align 4, !tbaa !33
  %124 = icmp sgt i32 %123, -1
  br i1 %124, label %125, label %187

125:                                              ; preds = %88
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.stPoll_t, ptr %126, i32 0, i32 3
  %128 = load ptr, ptr %127, align 8, !tbaa !25
  %129 = load i64, ptr %16, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.stPollItem_t, ptr %128, i64 %129
  %131 = load ptr, ptr %18, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.epoll_event, ptr %131, i32 0, i32 1
  store ptr %130, ptr %132, align 1, !tbaa !36
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = load i64, ptr %16, align 8, !tbaa !9
  %135 = getelementptr inbounds %struct.pollfd, ptr %133, i64 %134
  %136 = getelementptr inbounds %struct.pollfd, ptr %135, i32 0, i32 1
  %137 = load i16, ptr %136, align 4, !tbaa !37
  %138 = call noundef i32 @_ZL15PollEvent2Epolls(i16 noundef signext %137)
  %139 = load ptr, ptr %18, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.epoll_event, ptr %139, i32 0, i32 0
  store i32 %138, ptr %140, align 1, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  %141 = load i32, ptr %12, align 4, !tbaa !11
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = load i64, ptr %16, align 8, !tbaa !9
  %144 = getelementptr inbounds %struct.pollfd, ptr %142, i64 %143
  %145 = getelementptr inbounds %struct.pollfd, ptr %144, i32 0, i32 0
  %146 = load i32, ptr %145, align 4, !tbaa !33
  %147 = load ptr, ptr %18, align 8, !tbaa !5
  %148 = call noundef i32 @_Z12co_epoll_ctliiiP11epoll_event(i32 noundef %141, i32 noundef 1, i32 noundef %146, ptr noundef %147)
  store i32 %148, ptr %19, align 4, !tbaa !11
  %149 = load i32, ptr %19, align 4, !tbaa !11
  %150 = icmp slt i32 %149, 0
  br i1 %150, label %151, label %183

151:                                              ; preds = %125
  %152 = call ptr @__errno_location() #12
  %153 = load i32, ptr %152, align 4, !tbaa !11
  %154 = icmp eq i32 %153, 1
  br i1 %154, label %155, label %183

155:                                              ; preds = %151
  %156 = load i64, ptr %9, align 8, !tbaa !9
  %157 = icmp eq i64 %156, 1
  br i1 %157, label %158, label %183

158:                                              ; preds = %155
  %159 = load ptr, ptr %11, align 8, !tbaa !5
  %160 = icmp ne ptr %159, null
  br i1 %160, label %161, label %183

161:                                              ; preds = %158
  %162 = load ptr, ptr %14, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.stPoll_t, ptr %162, i32 0, i32 3
  %164 = load ptr, ptr %163, align 8, !tbaa !25
  %165 = getelementptr inbounds [2 x %struct.stPollItem_t], ptr %15, i64 0, i64 0
  %166 = icmp ne ptr %164, %165
  br i1 %166, label %167, label %173

167:                                              ; preds = %161
  %168 = load ptr, ptr %14, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.stPoll_t, ptr %168, i32 0, i32 3
  %170 = load ptr, ptr %169, align 8, !tbaa !25
  call void @free(ptr noundef %170) #9
  %171 = load ptr, ptr %14, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.stPoll_t, ptr %171, i32 0, i32 3
  store ptr null, ptr %172, align 8, !tbaa !25
  br label %173

173:                                              ; preds = %167, %161
  %174 = load ptr, ptr %14, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.stPoll_t, ptr %174, i32 0, i32 1
  %176 = load ptr, ptr %175, align 8, !tbaa !20
  call void @free(ptr noundef %176) #9
  %177 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %177) #9
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = load i64, ptr %9, align 8, !tbaa !9
  %181 = load i32, ptr %10, align 4, !tbaa !11
  %182 = call noundef i32 %178(ptr noundef %179, i64 noundef %180, i32 noundef %181)
  store i32 %182, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %184

183:                                              ; preds = %158, %155, %151, %125
  store i32 0, ptr %17, align 4
  br label %184

184:                                              ; preds = %183, %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  %185 = load i32, ptr %17, align 4
  switch i32 %185, label %188 [
    i32 0, label %186
  ]

186:                                              ; preds = %184
  br label %187

187:                                              ; preds = %186, %88
  store i32 0, ptr %17, align 4
  br label %188

188:                                              ; preds = %187, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  %189 = load i32, ptr %17, align 4
  switch i32 %189, label %194 [
    i32 0, label %190
  ]

190:                                              ; preds = %188
  br label %191

191:                                              ; preds = %190
  %192 = load i64, ptr %16, align 8, !tbaa !9
  %193 = add i64 %192, 1
  store i64 %193, ptr %16, align 8, !tbaa !9
  br label %83, !llvm.loop !39

194:                                              ; preds = %188, %87
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  %195 = load i32, ptr %17, align 4
  switch i32 %195, label %283 [
    i32 2, label %196
  ]

196:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  %197 = call noundef i64 @_ZL9GetTickMSv()
  store i64 %197, ptr %20, align 8, !tbaa !41
  %198 = load i64, ptr %20, align 8, !tbaa !41
  %199 = load i32, ptr %10, align 4, !tbaa !11
  %200 = sext i32 %199 to i64
  %201 = add i64 %198, %200
  %202 = load ptr, ptr %14, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.stTimeoutItem_t, ptr %202, i32 0, i32 3
  store i64 %201, ptr %203, align 8, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  %204 = load ptr, ptr %7, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.stCoEpoll_t, ptr %204, i32 0, i32 1
  %206 = load ptr, ptr %205, align 8, !tbaa !43
  %207 = load ptr, ptr %14, align 8, !tbaa !5
  %208 = load i64, ptr %20, align 8, !tbaa !41
  %209 = call noundef i32 @_Z10AddTimeoutP11stTimeout_tP15stTimeoutItem_ty(ptr noundef %206, ptr noundef %207, i64 noundef %208)
  store i32 %209, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !11
  %210 = load i32, ptr %21, align 4, !tbaa !11
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %212, label %220

212:                                              ; preds = %196
  %213 = load i32, ptr %21, align 4, !tbaa !11
  %214 = load i64, ptr %20, align 8, !tbaa !41
  %215 = load i32, ptr %10, align 4, !tbaa !11
  %216 = load ptr, ptr %14, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.stTimeoutItem_t, ptr %216, i32 0, i32 3
  %218 = load i64, ptr %217, align 8, !tbaa !42
  call void (ptr, ...) @_Z10co_log_errPKcz(ptr noundef @.str.3, i32 noundef %213, i64 noundef %214, i32 noundef %215, i64 noundef %218)
  %219 = call ptr @__errno_location() #12
  store i32 22, ptr %219, align 4, !tbaa !11
  store i32 -1, ptr %22, align 4, !tbaa !11
  br label %225

220:                                              ; preds = %196
  %221 = call noundef ptr @_Z22co_get_curr_thread_envv()
  call void @_Z12co_yield_envP16stCoRoutineEnv_t(ptr noundef %221)
  %222 = load ptr, ptr %14, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.stPoll_t, ptr %222, i32 0, i32 6
  %224 = load i32, ptr %223, align 8, !tbaa !44
  store i32 %224, ptr %22, align 4, !tbaa !11
  br label %225

225:                                              ; preds = %220, %212
  %226 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_Z14RemoveFromLinkI15stTimeoutItem_t19stTimeoutItemLink_tEvPT_(ptr noundef %226)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  store i64 0, ptr %23, align 8, !tbaa !9
  br label %227

227:                                              ; preds = %262, %225
  %228 = load i64, ptr %23, align 8, !tbaa !9
  %229 = load i64, ptr %9, align 8, !tbaa !9
  %230 = icmp ult i64 %228, %229
  br i1 %230, label %232, label %231

231:                                              ; preds = %227
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  br label %265

232:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  %233 = load ptr, ptr %8, align 8, !tbaa !5
  %234 = load i64, ptr %23, align 8, !tbaa !9
  %235 = getelementptr inbounds %struct.pollfd, ptr %233, i64 %234
  %236 = getelementptr inbounds %struct.pollfd, ptr %235, i32 0, i32 0
  %237 = load i32, ptr %236, align 4, !tbaa !33
  store i32 %237, ptr %24, align 4, !tbaa !11
  %238 = load i32, ptr %24, align 4, !tbaa !11
  %239 = icmp sgt i32 %238, -1
  br i1 %239, label %240, label %250

240:                                              ; preds = %232
  %241 = load i32, ptr %12, align 4, !tbaa !11
  %242 = load i32, ptr %24, align 4, !tbaa !11
  %243 = load ptr, ptr %14, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.stPoll_t, ptr %243, i32 0, i32 3
  %245 = load ptr, ptr %244, align 8, !tbaa !25
  %246 = load i64, ptr %23, align 8, !tbaa !9
  %247 = getelementptr inbounds %struct.stPollItem_t, ptr %245, i64 %246
  %248 = getelementptr inbounds %struct.stPollItem_t, ptr %247, i32 0, i32 3
  %249 = call noundef i32 @_Z12co_epoll_ctliiiP11epoll_event(i32 noundef %241, i32 noundef 2, i32 noundef %242, ptr noundef %248)
  br label %250

250:                                              ; preds = %240, %232
  %251 = load ptr, ptr %14, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.stPoll_t, ptr %251, i32 0, i32 1
  %253 = load ptr, ptr %252, align 8, !tbaa !20
  %254 = load i64, ptr %23, align 8, !tbaa !9
  %255 = getelementptr inbounds %struct.pollfd, ptr %253, i64 %254
  %256 = getelementptr inbounds %struct.pollfd, ptr %255, i32 0, i32 2
  %257 = load i16, ptr %256, align 2, !tbaa !45
  %258 = load ptr, ptr %8, align 8, !tbaa !5
  %259 = load i64, ptr %23, align 8, !tbaa !9
  %260 = getelementptr inbounds %struct.pollfd, ptr %258, i64 %259
  %261 = getelementptr inbounds %struct.pollfd, ptr %260, i32 0, i32 2
  store i16 %257, ptr %261, align 2, !tbaa !45
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %262

262:                                              ; preds = %250
  %263 = load i64, ptr %23, align 8, !tbaa !9
  %264 = add i64 %263, 1
  store i64 %264, ptr %23, align 8, !tbaa !9
  br label %227, !llvm.loop !46

265:                                              ; preds = %231
  %266 = load ptr, ptr %14, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.stPoll_t, ptr %266, i32 0, i32 3
  %268 = load ptr, ptr %267, align 8, !tbaa !25
  %269 = getelementptr inbounds [2 x %struct.stPollItem_t], ptr %15, i64 0, i64 0
  %270 = icmp ne ptr %268, %269
  br i1 %270, label %271, label %277

271:                                              ; preds = %265
  %272 = load ptr, ptr %14, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.stPoll_t, ptr %272, i32 0, i32 3
  %274 = load ptr, ptr %273, align 8, !tbaa !25
  call void @free(ptr noundef %274) #9
  %275 = load ptr, ptr %14, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.stPoll_t, ptr %275, i32 0, i32 3
  store ptr null, ptr %276, align 8, !tbaa !25
  br label %277

277:                                              ; preds = %271, %265
  %278 = load ptr, ptr %14, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.stPoll_t, ptr %278, i32 0, i32 1
  %280 = load ptr, ptr %279, align 8, !tbaa !20
  call void @free(ptr noundef %280) #9
  %281 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %281) #9
  %282 = load i32, ptr %22, align 4, !tbaa !11
  store i32 %282, ptr %6, align 4
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  br label %283

283:                                              ; preds = %277, %194
  call void @llvm.lifetime.end.p0(i64 192, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %284

284:                                              ; preds = %283, %27
  %285 = load i32, ptr %6, align 4
  ret i32 %285
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z7co_selfv() #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL15PollEvent2Epolls(i16 noundef signext) #0

declare noundef i32 @_Z12co_epoll_ctliiiP11epoll_event(i32 noundef, i32 noundef, i32 noundef, ptr noundef) #7

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #8

attributes #0 = { mustprogress 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 = { nounwind allocsize(0,1) "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { "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 = { nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { nounwind allocsize(0,1) }
attributes #12 = { nounwind willreturn memory(none) }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"_ZTS11stCoEpoll_t", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!15 = !{!16, !12, i64 92}
!16 = !{!"_ZTS8stPoll_t", !17, i64 0, !6, i64 64, !10, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96}
!17 = !{!"_ZTS15stTimeoutItem_t", !6, i64 0, !6, i64 8, !6, i64 16, !18, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !19, i64 56}
!18 = !{!"long long", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!16, !6, i64 64}
!21 = !{!16, !10, i64 72}
!22 = !{!23, !7, i64 156}
!23 = !{!"_ZTS13stCoRoutine_t", !6, i64 0, !6, i64 8, !6, i64 16, !24, i64 24, !7, i64 152, !7, i64 153, !7, i64 154, !7, i64 155, !7, i64 156, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !6, i64 192, !7, i64 200}
!24 = !{!"_ZTS7coctx_t", !7, i64 0, !10, i64 112, !6, i64 120}
!25 = !{!16, !6, i64 80}
!26 = !{!17, !6, i64 40}
!27 = !{!17, !6, i64 48}
!28 = !{!29, !6, i64 64}
!29 = !{!"_ZTS12stPollItem_t", !17, i64 0, !6, i64 64, !6, i64 72, !30, i64 80}
!30 = !{!"_ZTS11epoll_event", !12, i64 0, !7, i64 4}
!31 = !{!29, !6, i64 72}
!32 = !{!17, !6, i64 32}
!33 = !{!34, !12, i64 0}
!34 = !{!"_ZTS6pollfd", !12, i64 0, !35, i64 4, !35, i64 6}
!35 = !{!"short", !7, i64 0}
!36 = !{!7, !7, i64 0}
!37 = !{!34, !35, i64 4}
!38 = !{!30, !12, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!18, !18, i64 0}
!42 = !{!17, !18, i64 24}
!43 = !{!14, !6, i64 8}
!44 = !{!16, !12, i64 96}
!45 = !{!34, !35, i64 6}
!46 = distinct !{!46, !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.stPollItem_t = type <{ %struct.stTimeoutItem_t, ptr, ptr, %struct.epoll_event, [4 x i8] }>
%struct.stTimeoutItem_t = type { ptr, ptr, ptr, i64, ptr, ptr, ptr, i8 }
%struct.epoll_event = type <{ i32, %union.epoll_data }>
%union.epoll_data = type { ptr }
%struct.pollfd = type { i32, i16, i16 }

@.str.3 = external hidden unnamed_addr constant [69 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z10co_log_errPKcz(ptr noundef, ...) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZL9GetTickMSv() 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 #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z10AddTimeoutP11stTimeout_tP15stTimeoutItem_ty(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z22co_get_curr_thread_envv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12co_yield_envP16stCoRoutineEnv_t(ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z18OnPollProcessEventP15stTimeoutItem_t(ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z16OnPollPreparePfnP15stTimeoutItem_tR11epoll_eventP19stTimeoutItemLink_t(ptr noundef, ptr noundef nonnull align 1 dereferenceable(12), ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z14RemoveFromLinkI15stTimeoutItem_t19stTimeoutItemLink_tEvPT_(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z9GetCurrCoP16stCoRoutineEnv_t(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z13co_poll_innerP11stCoEpoll_tP6pollfdmiPFiS2_miE(ptr nocapture noundef readonly %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr noundef readonly %4) local_unnamed_addr #5 {
  %6 = alloca [2 x %struct.stPollItem_t], align 16
  %7 = icmp eq i32 %3, 0
  br i1 %7, label %8, label %10

8:                                                ; preds = %5
  %9 = tail call noundef i32 %4(ptr noundef %1, i64 noundef %2, i32 noundef 0)
  br label %115

10:                                               ; preds = %5
  %spec.store.select = tail call i32 @llvm.umin.i32(i32 %3, i32 2147483647)
  %11 = load i32, ptr %0, align 8, !tbaa !5
  %12 = tail call noundef ptr @_Z7co_selfv()
  %calloc = tail call dereferenceable_or_null(104) ptr @calloc(i64 1, i64 104)
  %13 = getelementptr inbounds i8, ptr %calloc, i64 92
  store i32 %11, ptr %13, align 4, !tbaa !11
  %14 = tail call noalias ptr @calloc(i64 noundef %2, i64 noundef 8) #10
  %15 = getelementptr inbounds i8, ptr %calloc, i64 64
  store ptr %14, ptr %15, align 8, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %calloc, i64 72
  store i64 %2, ptr %16, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %6) #11
  %17 = icmp ult i64 %2, 2
  br i1 %17, label %18, label %23

18:                                               ; preds = %10
  %19 = getelementptr inbounds i8, ptr %12, i64 156
  %20 = load i8, ptr %19, align 4, !tbaa !19
  %.not = icmp eq i8 %20, 0
  br i1 %.not, label %21, label %23

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %calloc, i64 80
  store ptr %6, ptr %22, align 8, !tbaa !22
  %.pre = mul nuw nsw i64 %2, 96
  br label %27

23:                                               ; preds = %18, %10
  %24 = mul i64 %2, 96
  %25 = tail call noalias ptr @malloc(i64 noundef %24) #12
  %26 = getelementptr inbounds i8, ptr %calloc, i64 80
  store ptr %25, ptr %26, align 8, !tbaa !22
  br label %27

27:                                               ; preds = %23, %21
  %.pre-phi = phi i64 [ %24, %23 ], [ %.pre, %21 ]
  %28 = phi ptr [ %25, %23 ], [ %6, %21 ]
  %29 = getelementptr inbounds i8, ptr %calloc, i64 80
  call void @llvm.memset.p0.i64(ptr align 8 %28, i8 0, i64 %.pre-phi, i1 false)
  %30 = getelementptr inbounds i8, ptr %calloc, i64 40
  store ptr @_Z18OnPollProcessEventP15stTimeoutItem_t, ptr %30, align 8, !tbaa !23
  %31 = call noundef ptr @_Z22co_get_curr_thread_envv()
  %32 = call noundef ptr @_Z9GetCurrCoP16stCoRoutineEnv_t(ptr noundef %31)
  %33 = getelementptr inbounds i8, ptr %calloc, i64 48
  store ptr %32, ptr %33, align 8, !tbaa !24
  %.not117125.not = icmp eq i64 %2, 0
  br i1 %.not117125.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %27
  %34 = icmp eq i64 %2, 1
  %35 = icmp ne ptr %4, null
  %36 = and i1 %35, %34
  br i1 %36, label %.lr.ph.split, label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph, %55
  %.0104126.us = phi i64 [ %56, %55 ], [ 0, %.lr.ph ]
  %37 = load ptr, ptr %15, align 8, !tbaa !17
  %38 = getelementptr inbounds %struct.pollfd, ptr %37, i64 %.0104126.us
  %39 = load ptr, ptr %29, align 8, !tbaa !22
  %40 = getelementptr inbounds %struct.stPollItem_t, ptr %39, i64 %.0104126.us, i32 1
  store ptr %38, ptr %40, align 8, !tbaa !25
  %41 = getelementptr inbounds %struct.stPollItem_t, ptr %39, i64 %.0104126.us, i32 2
  store ptr %calloc, ptr %41, align 8, !tbaa !28
  %42 = getelementptr inbounds %struct.stPollItem_t, ptr %39, i64 %.0104126.us, i32 0, i32 4
  store ptr @_Z16OnPollPreparePfnP15stTimeoutItem_tR11epoll_eventP19stTimeoutItemLink_t, ptr %42, align 8, !tbaa !29
  %43 = getelementptr inbounds %struct.pollfd, ptr %1, i64 %.0104126.us
  %44 = load i32, ptr %43, align 4, !tbaa !30
  %45 = icmp sgt i32 %44, -1
  br i1 %45, label %46, label %55

46:                                               ; preds = %.lr.ph.split.us
  %47 = getelementptr inbounds %struct.stPollItem_t, ptr %39, i64 %.0104126.us
  %48 = getelementptr inbounds i8, ptr %47, i64 80
  %49 = getelementptr inbounds i8, ptr %47, i64 84
  store ptr %47, ptr %49, align 1, !tbaa !33
  %50 = getelementptr inbounds i8, ptr %43, i64 4
  %51 = load i16, ptr %50, align 4, !tbaa !34
  %52 = call noundef i32 @_ZL15PollEvent2Epolls(i16 noundef signext %51)
  store i32 %52, ptr %48, align 1, !tbaa !35
  %53 = load i32, ptr %43, align 4, !tbaa !30
  %54 = call noundef i32 @_Z12co_epoll_ctliiiP11epoll_event(i32 noundef %11, i32 noundef 1, i32 noundef %53, ptr noundef nonnull %48)
  br label %55

55:                                               ; preds = %46, %.lr.ph.split.us
  %56 = add nuw i64 %.0104126.us, 1
  %exitcond.not = icmp eq i64 %56, %2
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !36

.lr.ph.split:                                     ; preds = %.lr.ph
  %57 = load ptr, ptr %15, align 8, !tbaa !17
  %58 = load ptr, ptr %29, align 8, !tbaa !22
  %59 = getelementptr inbounds i8, ptr %58, i64 64
  store ptr %57, ptr %59, align 8, !tbaa !25
  %60 = getelementptr inbounds i8, ptr %58, i64 72
  store ptr %calloc, ptr %60, align 8, !tbaa !28
  %61 = getelementptr inbounds i8, ptr %58, i64 32
  store ptr @_Z16OnPollPreparePfnP15stTimeoutItem_tR11epoll_eventP19stTimeoutItemLink_t, ptr %61, align 8, !tbaa !29
  %62 = load i32, ptr %1, align 4, !tbaa !30
  %63 = icmp sgt i32 %62, -1
  br i1 %63, label %64, label %._crit_edge

64:                                               ; preds = %.lr.ph.split
  %65 = getelementptr inbounds i8, ptr %58, i64 80
  %66 = getelementptr inbounds i8, ptr %58, i64 84
  store ptr %58, ptr %66, align 1, !tbaa !33
  %67 = getelementptr inbounds i8, ptr %1, i64 4
  %68 = load i16, ptr %67, align 4, !tbaa !34
  %69 = call noundef i32 @_ZL15PollEvent2Epolls(i16 noundef signext %68)
  store i32 %69, ptr %65, align 1, !tbaa !35
  %70 = load i32, ptr %1, align 4, !tbaa !30
  %71 = call noundef i32 @_Z12co_epoll_ctliiiP11epoll_event(i32 noundef %11, i32 noundef 1, i32 noundef %70, ptr noundef nonnull %65)
  %72 = icmp slt i32 %71, 0
  br i1 %72, label %73, label %._crit_edge

73:                                               ; preds = %64
  %74 = tail call ptr @__errno_location() #13
  %75 = load i32, ptr %74, align 4, !tbaa !38
  %76 = icmp eq i32 %75, 1
  br i1 %76, label %77, label %._crit_edge

77:                                               ; preds = %73
  %78 = load ptr, ptr %29, align 8, !tbaa !22
  %.not116 = icmp eq ptr %78, %6
  br i1 %.not116, label %.thread123, label %79

79:                                               ; preds = %77
  call void @free(ptr noundef %78) #11
  store ptr null, ptr %29, align 8, !tbaa !22
  br label %.thread123

.thread123:                                       ; preds = %79, %77
  %80 = load ptr, ptr %15, align 8, !tbaa !17
  call void @free(ptr noundef %80) #11
  call void @free(ptr noundef nonnull %calloc) #11
  %81 = call noundef i32 %4(ptr noundef nonnull %1, i64 noundef 1, i32 noundef %spec.store.select)
  br label %114

._crit_edge:                                      ; preds = %55, %.lr.ph.split, %73, %64, %27
  %82 = call noundef i64 @_ZL9GetTickMSv()
  %83 = zext nneg i32 %spec.store.select to i64
  %84 = add i64 %82, %83
  %85 = getelementptr inbounds i8, ptr %calloc, i64 24
  store i64 %84, ptr %85, align 8, !tbaa !39
  %86 = getelementptr inbounds i8, ptr %0, i64 8
  %87 = load ptr, ptr %86, align 8, !tbaa !40
  %88 = call noundef i32 @_Z10AddTimeoutP11stTimeout_tP15stTimeoutItem_ty(ptr noundef %87, ptr noundef nonnull %calloc, i64 noundef %82)
  %.not118 = icmp eq i32 %88, 0
  br i1 %.not118, label %92, label %89

89:                                               ; preds = %._crit_edge
  %90 = load i64, ptr %85, align 8, !tbaa !39
  call void (ptr, ...) @_Z10co_log_errPKcz(ptr noundef nonnull @.str.3, i32 noundef %88, i64 noundef %82, i32 noundef %spec.store.select, i64 noundef %90)
  %91 = tail call ptr @__errno_location() #13
  store i32 22, ptr %91, align 4, !tbaa !38
  br label %96

92:                                               ; preds = %._crit_edge
  %93 = call noundef ptr @_Z22co_get_curr_thread_envv()
  call void @_Z12co_yield_envP16stCoRoutineEnv_t(ptr noundef %93)
  %94 = getelementptr inbounds i8, ptr %calloc, i64 96
  %95 = load i32, ptr %94, align 8, !tbaa !41
  br label %96

96:                                               ; preds = %92, %89
  %.0103 = phi i32 [ -1, %89 ], [ %95, %92 ]
  call void @_Z14RemoveFromLinkI15stTimeoutItem_t19stTimeoutItemLink_tEvPT_(ptr noundef nonnull %calloc)
  br i1 %.not117125.not, label %._crit_edge130, label %.lr.ph129

._crit_edge130:                                   ; preds = %105, %96
  %97 = load ptr, ptr %29, align 8, !tbaa !22
  %.not119 = icmp eq ptr %97, %6
  br i1 %.not119, label %112, label %111

.lr.ph129:                                        ; preds = %96, %105
  %.0102127 = phi i64 [ %110, %105 ], [ 0, %96 ]
  %98 = getelementptr inbounds %struct.pollfd, ptr %1, i64 %.0102127
  %99 = load i32, ptr %98, align 4, !tbaa !30
  %100 = icmp sgt i32 %99, -1
  br i1 %100, label %101, label %105

101:                                              ; preds = %.lr.ph129
  %102 = load ptr, ptr %29, align 8, !tbaa !22
  %103 = getelementptr inbounds %struct.stPollItem_t, ptr %102, i64 %.0102127, i32 3
  %104 = call noundef i32 @_Z12co_epoll_ctliiiP11epoll_event(i32 noundef %11, i32 noundef 2, i32 noundef %99, ptr noundef nonnull %103)
  br label %105

105:                                              ; preds = %101, %.lr.ph129
  %106 = load ptr, ptr %15, align 8, !tbaa !17
  %107 = getelementptr inbounds %struct.pollfd, ptr %106, i64 %.0102127, i32 2
  %108 = load i16, ptr %107, align 2, !tbaa !42
  %109 = getelementptr inbounds i8, ptr %98, i64 6
  store i16 %108, ptr %109, align 2, !tbaa !42
  %110 = add nuw i64 %.0102127, 1
  %exitcond134.not = icmp eq i64 %110, %2
  br i1 %exitcond134.not, label %._crit_edge130, label %.lr.ph129, !llvm.loop !43

111:                                              ; preds = %._crit_edge130
  call void @free(ptr noundef %97) #11
  store ptr null, ptr %29, align 8, !tbaa !22
  br label %112

112:                                              ; preds = %111, %._crit_edge130
  %113 = load ptr, ptr %15, align 8, !tbaa !17
  call void @free(ptr noundef %113) #11
  call void @free(ptr noundef nonnull %calloc) #11
  br label %114

114:                                              ; preds = %.thread123, %112
  %.5 = phi i32 [ %.0103, %112 ], [ %81, %.thread123 ]
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %6) #11
  br label %115

115:                                              ; preds = %114, %8
  %.6 = phi i32 [ %9, %8 ], [ %.5, %114 ]
  ret i32 %.6
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z7co_selfv() local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL15PollEvent2Epolls(i16 noundef signext) local_unnamed_addr #0

declare noundef i32 @_Z12co_epoll_ctliiiP11epoll_event(i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #8

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #9

attributes #0 = { mustprogress 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { "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 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nounwind allocsize(0,1) }
attributes #11 = { nounwind }
attributes #12 = { nounwind allocsize(0) }
attributes #13 = { nounwind willreturn memory(none) }

!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 = !{!"_ZTS11stCoEpoll_t", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !7, i64 92}
!12 = !{!"_ZTS8stPoll_t", !13, i64 0, !10, i64 64, !16, i64 72, !10, i64 80, !7, i64 88, !7, i64 92, !7, i64 96}
!13 = !{!"_ZTS15stTimeoutItem_t", !10, i64 0, !10, i64 8, !10, i64 16, !14, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !15, i64 56}
!14 = !{!"long long", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!"long", !8, i64 0}
!17 = !{!12, !10, i64 64}
!18 = !{!12, !16, i64 72}
!19 = !{!20, !8, i64 156}
!20 = !{!"_ZTS13stCoRoutine_t", !10, i64 0, !10, i64 8, !10, i64 16, !21, i64 24, !8, i64 152, !8, i64 153, !8, i64 154, !8, i64 155, !8, i64 156, !10, i64 160, !10, i64 168, !10, i64 176, !7, i64 184, !10, i64 192, !8, i64 200}
!21 = !{!"_ZTS7coctx_t", !8, i64 0, !16, i64 112, !10, i64 120}
!22 = !{!12, !10, i64 80}
!23 = !{!13, !10, i64 40}
!24 = !{!13, !10, i64 48}
!25 = !{!26, !10, i64 64}
!26 = !{!"_ZTS12stPollItem_t", !13, i64 0, !10, i64 64, !10, i64 72, !27, i64 80}
!27 = !{!"_ZTS11epoll_event", !7, i64 0, !8, i64 4}
!28 = !{!26, !10, i64 72}
!29 = !{!13, !10, i64 32}
!30 = !{!31, !7, i64 0}
!31 = !{!"_ZTS6pollfd", !7, i64 0, !32, i64 4, !32, i64 6}
!32 = !{!"short", !8, i64 0}
!33 = !{!8, !8, i64 0}
!34 = !{!31, !32, i64 4}
!35 = !{!27, !7, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!7, !7, i64 0}
!39 = !{!13, !14, i64 24}
!40 = !{!6, !10, i64 8}
!41 = !{!12, !7, i64 96}
!42 = !{!31, !32, i64 6}
!43 = distinct !{!43, !37}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass