; LLVM IR from yinqiwen/ardb :: src/common/channel (channel)

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

%"class.ardb::Channel" = type { %"class.ardb::Runnable", %"struct.ardb::ChannelOptions", i8, i8, i32, %"class.ardb::ChannelPipeline", ptr, i32, i32, %"class.ardb::Buffer", %"class.ardb::Buffer", i32, ptr, ptr, ptr, ptr, i8, i8, i8, ptr, ptr, ptr }
%"class.ardb::Runnable" = type { ptr }
%"struct.ardb::ChannelOptions" = type <{ i32, i32, i8, [3 x i8], i32, i8, [3 x i8], i32, i32, i32, i8, i8, [2 x i8] }>
%"class.ardb::ChannelPipeline" = type { ptr, ptr, ptr, %"class.btree::btree_map" }
%"class.btree::btree_map" = type { %"class.btree::btree_map_container" }
%"class.btree::btree_map_container" = type { %"class.btree::btree_unique_container" }
%"class.btree::btree_unique_container" = type { %"class.btree::btree_container" }
%"class.btree::btree_container" = type { %"class.btree::btree" }
%"class.btree::btree" = type { %"struct.btree::btree<btree::btree_map_params<std::__cxx11::basic_string<char>, ardb::ChannelHandlerContext *, std::less<std::__cxx11::basic_string<char>>, std::allocator<std::pair<const std::__cxx11::basic_string<char>, ardb::ChannelHandlerContext *>>, 256>>::empty_base_handle" }
%"struct.btree::btree<btree::btree_map_params<std::__cxx11::basic_string<char>, ardb::ChannelHandlerContext *, std::less<std::__cxx11::basic_string<char>>, std::allocator<std::pair<const std::__cxx11::basic_string<char>, ardb::ChannelHandlerContext *>>, 256>>::empty_base_handle" = type { ptr }
%"class.ardb::Buffer" = type <{ ptr, i64, i64, i64, i8, [7 x i8] }>

@.str = external hidden unnamed_addr constant [78 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [36 x i8], align 1
@__FUNCTION__._ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_ = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [62 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(288) ptr @_ZN4ardb7Channel10GetServiceEv(ptr noundef nonnull align 8 dereferenceable(256)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4ardb14ChannelService15GetRawEventLoopEv(ptr noundef nonnull align 8 dereferenceable(288)) #1 align 2

declare i32 @aeCreateFileEvent(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare i32 @close(i32 noundef) #2

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv() #2

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv() #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #3 align 2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  %13 = load ptr, ptr %6, align 8
  %14 = getelementptr inbounds %"class.ardb::Channel", ptr %13, i32 0, i32 16
  %15 = load i8, ptr %14, align 8, !tbaa !11, !range !25, !noundef !26
  %16 = trunc i8 %15 to i1
  br i1 %16, label %25, label %17

17:                                               ; preds = %4
  br label %18

18:                                               ; preds = %17
  %19 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %20 = call noundef zeroext i1 %19(i32 noundef 2)
  br i1 %20, label %21, label %23

21:                                               ; preds = %18
  %22 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  call void (i32, ptr, ptr, i32, ptr, ...) %22(i32 noundef 2, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_, i32 noundef 173, ptr noundef @.str.5)
  br label %23

23:                                               ; preds = %21, %18
  br label %24

24:                                               ; preds = %23
  store i1 false, ptr %5, align 1
  br label %114

25:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %26 = load ptr, ptr %13, align 8, !tbaa !27
  %27 = getelementptr inbounds ptr, ptr %26, i64 16
  %28 = load ptr, ptr %27, align 8
  %29 = call noundef i32 %28(ptr noundef nonnull align 8 dereferenceable(256) %13)
  store i32 %29, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %30 = load ptr, ptr %13, align 8, !tbaa !27
  %31 = getelementptr inbounds ptr, ptr %30, i64 15
  %32 = load ptr, ptr %31, align 8
  %33 = call noundef i32 %32(ptr noundef nonnull align 8 dereferenceable(256) %13)
  store i32 %33, ptr %11, align 4, !tbaa !9
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = load i32, ptr %11, align 4, !tbaa !9
  %36 = icmp eq i32 %34, %35
  br i1 %36, label %37, label %59

37:                                               ; preds = %25
  %38 = call noundef nonnull align 8 dereferenceable(288) ptr @_ZN4ardb7Channel10GetServiceEv(ptr noundef nonnull align 8 dereferenceable(256) %13)
  %39 = call noundef ptr @_ZN4ardb14ChannelService15GetRawEventLoopEv(ptr noundef nonnull align 8 dereferenceable(288) %38)
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = call i32 @aeCreateFileEvent(ptr noundef %39, i32 noundef %40, i32 noundef %41, ptr noundef %42, ptr noundef %43)
  %45 = icmp eq i32 %44, -1
  br i1 %45, label %46, label %58

46:                                               ; preds = %37
  %47 = load i32, ptr %10, align 4, !tbaa !9
  %48 = call i32 @close(i32 noundef %47)
  br label %49

49:                                               ; preds = %46
  %50 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %51 = call noundef zeroext i1 %50(i32 noundef 2)
  br i1 %51, label %52, label %55

52:                                               ; preds = %49
  %53 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  %54 = load i32, ptr %10, align 4, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %53(i32 noundef 2, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_, i32 noundef 184, ptr noundef @.str.2, i32 noundef %54)
  br label %55

55:                                               ; preds = %52, %49
  br label %56

56:                                               ; preds = %55
  br label %57

57:                                               ; preds = %56
  store i1 false, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %113

58:                                               ; preds = %37
  br label %111

59:                                               ; preds = %25
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = and i32 %60, 1
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %84

63:                                               ; preds = %59
  %64 = call noundef nonnull align 8 dereferenceable(288) ptr @_ZN4ardb7Channel10GetServiceEv(ptr noundef nonnull align 8 dereferenceable(256) %13)
  %65 = call noundef ptr @_ZN4ardb14ChannelService15GetRawEventLoopEv(ptr noundef nonnull align 8 dereferenceable(288) %64)
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = call i32 @aeCreateFileEvent(ptr noundef %65, i32 noundef %66, i32 noundef 1, ptr noundef %67, ptr noundef %68)
  %70 = icmp eq i32 %69, -1
  br i1 %70, label %71, label %83

71:                                               ; preds = %63
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = call i32 @close(i32 noundef %72)
  br label %74

74:                                               ; preds = %71
  %75 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %76 = call noundef zeroext i1 %75(i32 noundef 2)
  br i1 %76, label %77, label %80

77:                                               ; preds = %74
  %78 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  %79 = load i32, ptr %10, align 4, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %78(i32 noundef 2, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_, i32 noundef 196, ptr noundef @.str.2, i32 noundef %79)
  br label %80

80:                                               ; preds = %77, %74
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  store i1 false, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %113

83:                                               ; preds = %63
  br label %110

84:                                               ; preds = %59
  %85 = load i32, ptr %8, align 4, !tbaa !9
  %86 = and i32 %85, 2
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %109

88:                                               ; preds = %84
  %89 = call noundef nonnull align 8 dereferenceable(288) ptr @_ZN4ardb7Channel10GetServiceEv(ptr noundef nonnull align 8 dereferenceable(256) %13)
  %90 = call noundef ptr @_ZN4ardb14ChannelService15GetRawEventLoopEv(ptr noundef nonnull align 8 dereferenceable(288) %89)
  %91 = load i32, ptr %11, align 4, !tbaa !9
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = call i32 @aeCreateFileEvent(ptr noundef %90, i32 noundef %91, i32 noundef 2, ptr noundef %92, ptr noundef %93)
  %95 = icmp eq i32 %94, -1
  br i1 %95, label %96, label %108

96:                                               ; preds = %88
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = call i32 @close(i32 noundef %97)
  br label %99

99:                                               ; preds = %96
  %100 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %101 = call noundef zeroext i1 %100(i32 noundef 2)
  br i1 %101, label %102, label %105

102:                                              ; preds = %99
  %103 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  %104 = load i32, ptr %11, align 4, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) %103(i32 noundef 2, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_, i32 noundef 206, ptr noundef @.str.2, i32 noundef %104)
  br label %105

105:                                              ; preds = %102, %99
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106
  store i1 false, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %113

108:                                              ; preds = %88
  br label %109

109:                                              ; preds = %108, %84
  br label %110

110:                                              ; preds = %109, %83
  br label %111

111:                                              ; preds = %110, %58
  %112 = getelementptr inbounds %"class.ardb::Channel", ptr %13, i32 0, i32 16
  store i8 0, ptr %112, align 8, !tbaa !11
  store i1 true, ptr %5, align 1
  store i32 1, ptr %12, align 4
  br label %113

113:                                              ; preds = %111, %107, %82, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %114

114:                                              ; preds = %113, %24
  %115 = load i1, ptr %5, align 1
  ret i1 %115
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 = { 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 #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !15, i64 224}
!12 = !{!"_ZTSN4ardb7ChannelE", !13, i64 0, !14, i64 8, !15, i64 44, !15, i64 45, !10, i64 48, !16, i64 56, !6, i64 88, !10, i64 96, !10, i64 100, !23, i64 104, !23, i64 144, !10, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !15, i64 224, !15, i64 225, !15, i64 226, !6, i64 232, !6, i64 240, !6, i64 248}
!13 = !{!"_ZTSN4ardb8RunnableE"}
!14 = !{!"_ZTSN4ardb14ChannelOptionsE", !10, i64 0, !10, i64 4, !15, i64 8, !10, i64 12, !15, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !15, i64 32, !15, i64 33}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTSN4ardb15ChannelPipelineE", !6, i64 0, !6, i64 8, !6, i64 16, !17, i64 24}
!17 = !{!"_ZTSN5btree9btree_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS6_ESaISt4pairIKS6_S9_EELi256EEE", !18, i64 0}
!18 = !{!"_ZTSN5btree19btree_map_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !19, i64 0}
!19 = !{!"_ZTSN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !20, i64 0}
!20 = !{!"_ZTSN5btree15btree_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !21, i64 0}
!21 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEEE", !22, i64 0}
!22 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEE17empty_base_handleIS6_PNS_10btree_nodeISH_EEEE", !6, i64 0}
!23 = !{!"_ZTSN4ardb6BufferE", !6, i64 0, !24, i64 8, !24, i64 16, !24, i64 24, !15, i64 32}
!24 = !{!"long", !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = !{!28, !28, i64 0}
!28 = !{!"vtable pointer", !8, i64 0}


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

@.str = external hidden unnamed_addr constant [78 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [36 x i8], align 1
@__FUNCTION__._ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_ = external hidden unnamed_addr constant [19 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [62 x i8], align 1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(288) ptr @_ZN4ardb7Channel10GetServiceEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4ardb14ChannelService15GetRawEventLoopEv(ptr noundef nonnull align 8 dereferenceable(288)) local_unnamed_addr #0 align 2

declare i32 @aeCreateFileEvent(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @close(i32 noundef) local_unnamed_addr #1

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv() local_unnamed_addr #1

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #2 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 224
  %6 = load i8, ptr %5, align 8, !tbaa !5, !range !23, !noundef !24
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %13, label %8

8:                                                ; preds = %4
  %9 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %10 = tail call noundef zeroext i1 %9(i32 noundef 2)
  br i1 %10, label %11, label %61

11:                                               ; preds = %8
  %12 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  tail call void (i32, ptr, ptr, i32, ptr, ...) %12(i32 noundef 2, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_, i32 noundef 173, ptr noundef nonnull @.str.5)
  br label %61

13:                                               ; preds = %4
  %14 = load ptr, ptr %0, align 8, !tbaa !25
  %15 = getelementptr inbounds i8, ptr %14, i64 128
  %16 = load ptr, ptr %15, align 8
  %17 = tail call noundef i32 %16(ptr noundef nonnull align 8 dereferenceable(256) %0)
  %18 = load ptr, ptr %0, align 8, !tbaa !25
  %19 = getelementptr inbounds i8, ptr %18, i64 120
  %20 = load ptr, ptr %19, align 8
  %21 = tail call noundef i32 %20(ptr noundef nonnull align 8 dereferenceable(256) %0)
  %22 = icmp eq i32 %17, %21
  br i1 %22, label %23, label %34

23:                                               ; preds = %13
  %24 = tail call noundef nonnull align 8 dereferenceable(288) ptr @_ZN4ardb7Channel10GetServiceEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  %25 = tail call noundef ptr @_ZN4ardb14ChannelService15GetRawEventLoopEv(ptr noundef nonnull align 8 dereferenceable(288) %24)
  %26 = tail call i32 @aeCreateFileEvent(ptr noundef %25, i32 noundef %17, i32 noundef %2, ptr noundef %1, ptr noundef %3)
  %27 = icmp eq i32 %26, -1
  br i1 %27, label %28, label %60

28:                                               ; preds = %23
  %29 = tail call i32 @close(i32 noundef %17)
  %30 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %31 = tail call noundef zeroext i1 %30(i32 noundef 2)
  br i1 %31, label %32, label %61

32:                                               ; preds = %28
  %33 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  tail call void (i32, ptr, ptr, i32, ptr, ...) %33(i32 noundef 2, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_, i32 noundef 184, ptr noundef nonnull @.str.2, i32 noundef %17)
  br label %61

34:                                               ; preds = %13
  %35 = and i32 %2, 1
  %.not = icmp eq i32 %35, 0
  br i1 %.not, label %47, label %36

36:                                               ; preds = %34
  %37 = tail call noundef nonnull align 8 dereferenceable(288) ptr @_ZN4ardb7Channel10GetServiceEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  %38 = tail call noundef ptr @_ZN4ardb14ChannelService15GetRawEventLoopEv(ptr noundef nonnull align 8 dereferenceable(288) %37)
  %39 = tail call i32 @aeCreateFileEvent(ptr noundef %38, i32 noundef %17, i32 noundef 1, ptr noundef %1, ptr noundef %3)
  %40 = icmp eq i32 %39, -1
  br i1 %40, label %41, label %60

41:                                               ; preds = %36
  %42 = tail call i32 @close(i32 noundef %17)
  %43 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %44 = tail call noundef zeroext i1 %43(i32 noundef 2)
  br i1 %44, label %45, label %61

45:                                               ; preds = %41
  %46 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  tail call void (i32, ptr, ptr, i32, ptr, ...) %46(i32 noundef 2, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_, i32 noundef 196, ptr noundef nonnull @.str.2, i32 noundef %17)
  br label %61

47:                                               ; preds = %34
  %48 = and i32 %2, 2
  %.not24 = icmp eq i32 %48, 0
  br i1 %.not24, label %60, label %49

49:                                               ; preds = %47
  %50 = tail call noundef nonnull align 8 dereferenceable(288) ptr @_ZN4ardb7Channel10GetServiceEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  %51 = tail call noundef ptr @_ZN4ardb14ChannelService15GetRawEventLoopEv(ptr noundef nonnull align 8 dereferenceable(288) %50)
  %52 = tail call i32 @aeCreateFileEvent(ptr noundef %51, i32 noundef %21, i32 noundef 2, ptr noundef %1, ptr noundef %3)
  %53 = icmp eq i32 %52, -1
  br i1 %53, label %54, label %60

54:                                               ; preds = %49
  %55 = tail call i32 @close(i32 noundef %21)
  %56 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %57 = tail call noundef zeroext i1 %56(i32 noundef 2)
  br i1 %57, label %58, label %61

58:                                               ; preds = %54
  %59 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  tail call void (i32, ptr, ptr, i32, ptr, ...) %59(i32 noundef 2, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN4ardb7Channel18SetIOEventCallbackEPFvP11aeEventLoopiPviEiS3_, i32 noundef 206, ptr noundef nonnull @.str.2, i32 noundef %21)
  br label %61

60:                                               ; preds = %36, %49, %47, %23
  store i8 0, ptr %5, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %60, %32, %28, %45, %41, %58, %54, %11, %8
  %.1 = phi i1 [ false, %8 ], [ false, %11 ], [ true, %60 ], [ false, %32 ], [ false, %28 ], [ false, %45 ], [ false, %41 ], [ false, %58 ], [ false, %54 ]
  ret i1 %.1
}

attributes #0 = { inlinehint 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 = { "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 = { 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" }

!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, !12, i64 224}
!6 = !{!"_ZTSN4ardb7ChannelE", !7, i64 0, !8, i64 8, !12, i64 44, !12, i64 45, !9, i64 48, !13, i64 56, !14, i64 88, !9, i64 96, !9, i64 100, !21, i64 104, !21, i64 144, !9, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !14, i64 216, !12, i64 224, !12, i64 225, !12, i64 226, !14, i64 232, !14, i64 240, !14, i64 248}
!7 = !{!"_ZTSN4ardb8RunnableE"}
!8 = !{!"_ZTSN4ardb14ChannelOptionsE", !9, i64 0, !9, i64 4, !12, i64 8, !9, i64 12, !12, i64 16, !9, i64 20, !9, i64 24, !9, i64 28, !12, i64 32, !12, i64 33}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"bool", !10, i64 0}
!13 = !{!"_ZTSN4ardb15ChannelPipelineE", !14, i64 0, !14, i64 8, !14, i64 16, !15, i64 24}
!14 = !{!"any pointer", !10, i64 0}
!15 = !{!"_ZTSN5btree9btree_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS6_ESaISt4pairIKS6_S9_EELi256EEE", !16, i64 0}
!16 = !{!"_ZTSN5btree19btree_map_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !17, i64 0}
!17 = !{!"_ZTSN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !18, i64 0}
!18 = !{!"_ZTSN5btree15btree_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !19, i64 0}
!19 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEEE", !20, i64 0}
!20 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEE17empty_base_handleIS6_PNS_10btree_nodeISH_EEEE", !14, i64 0}
!21 = !{!"_ZTSN4ardb6BufferE", !14, i64 0, !22, i64 8, !22, i64 16, !22, i64 24, !12, i64 32}
!22 = !{!"long", !10, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!26, !26, i64 0}
!26 = !{!"vtable pointer", !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass