; LLVM IR from yinqiwen/ardb :: src/common/channel/socket/socket_channel.ll (ZN4ardb13SocketChannel11GetSocketFDEi)

; 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 [92 x i8], align 1
@__FUNCTION__._ZN4ardb13SocketChannel11GetSocketFDEi = external hidden unnamed_addr constant [12 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [39 x i8], align 1

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv() #0

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv() #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
declare i32 @setsockopt(i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 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: mustprogress uwtable
define dso_local noundef i32 @_ZN4ardb13SocketChannel11GetSocketFDEi(ptr noundef nonnull align 8 dereferenceable(276) %0, i32 noundef %1) #3 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %11 = load ptr, ptr %4, align 8
  %12 = getelementptr inbounds %"class.ardb::Channel", ptr %11, i32 0, i32 8
  %13 = load i32, ptr %12, align 4, !tbaa !11
  %14 = icmp slt i32 %13, 0
  br i1 %14, label %15, label %86

15:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = load ptr, ptr %11, align 8, !tbaa !25
  %18 = getelementptr inbounds ptr, ptr %17, i64 22
  %19 = load ptr, ptr %18, align 8
  %20 = call noundef i32 %19(ptr noundef nonnull align 8 dereferenceable(276) %11)
  %21 = call i32 @socket(i32 noundef %16, i32 noundef %20, i32 noundef 0) #5
  store i32 %21, ptr %6, align 4, !tbaa !9
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = icmp slt i32 %22, 0
  br i1 %23, label %24, label %26

24:                                               ; preds = %15
  %25 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %25, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %83

26:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = call i32 (i32, i32, ...) @fcntl(i32 noundef %27, i32 noundef 3)
  store i32 %28, ptr %8, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %26
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = call i32 @close(i32 noundef %31)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %82

33:                                               ; preds = %26
  %34 = load i32, ptr %6, align 4, !tbaa !9
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = or i32 %35, 1
  %37 = call i32 (i32, i32, ...) @fcntl(i32 noundef %34, i32 noundef 2, i32 noundef %36)
  %38 = icmp slt i32 %37, 0
  br i1 %38, label %39, label %42

39:                                               ; preds = %33
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = call i32 @close(i32 noundef %40)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %82

42:                                               ; preds = %33
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = call noundef i32 @_ZN4ardb19make_fd_nonblockingEi(i32 noundef %43)
  %45 = icmp slt i32 %44, 0
  br i1 %45, label %46, label %49

46:                                               ; preds = %42
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = call i32 @close(i32 noundef %47)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %82

49:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !9
  %50 = getelementptr inbounds %"class.ardb::Channel", ptr %11, i32 0, i32 1
  %51 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %50, i32 0, i32 5
  %52 = load i8, ptr %51, align 8, !tbaa !27, !range !28, !noundef !29
  %53 = trunc i8 %52 to i1
  br i1 %53, label %54, label %69

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = call i32 @setsockopt(i32 noundef %55, i32 noundef 1, i32 noundef 2, ptr noundef %9, i32 noundef 4) #5
  store i32 %56, ptr %10, align 4, !tbaa !9
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %68

59:                                               ; preds = %54
  br label %60

60:                                               ; preds = %59
  %61 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %62 = call noundef zeroext i1 %61(i32 noundef 3)
  br i1 %62, label %63, label %65

63:                                               ; preds = %60
  %64 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  call void (i32, ptr, ptr, i32, ptr, ...) %64(i32 noundef 3, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN4ardb13SocketChannel11GetSocketFDEi, i32 noundef 323, ptr noundef @.str.12)
  br label %65

65:                                               ; preds = %63, %60
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %69

69:                                               ; preds = %68, %49
  %70 = call noundef nonnull align 8 dereferenceable(288) ptr @_ZN4ardb7Channel10GetServiceEv(ptr noundef nonnull align 8 dereferenceable(256) %11)
  %71 = call noundef ptr @_ZN4ardb14ChannelService15GetRawEventLoopEv(ptr noundef nonnull align 8 dereferenceable(288) %70)
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = call i32 @aeCreateFileEvent(ptr noundef %71, i32 noundef %72, i32 noundef 3, ptr noundef @_ZN4ardb7Channel15IOEventCallbackEP11aeEventLoopiPvi, ptr noundef %11)
  %74 = icmp eq i32 %73, -1
  br i1 %74, label %75, label %78

75:                                               ; preds = %69
  %76 = load i32, ptr %6, align 4, !tbaa !9
  %77 = call i32 @close(i32 noundef %76)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %81

78:                                               ; preds = %69
  %79 = load i32, ptr %6, align 4, !tbaa !9
  %80 = getelementptr inbounds %"class.ardb::Channel", ptr %11, i32 0, i32 8
  store i32 %79, ptr %80, align 4, !tbaa !11
  store i32 0, ptr %7, align 4
  br label %81

81:                                               ; preds = %78, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %82

82:                                               ; preds = %81, %46, %39, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %83

83:                                               ; preds = %82, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %84 = load i32, ptr %7, align 4
  switch i32 %84, label %91 [
    i32 0, label %85
    i32 1, label %89
  ]

85:                                               ; preds = %83
  br label %86

86:                                               ; preds = %85, %2
  %87 = getelementptr inbounds %"class.ardb::Channel", ptr %11, i32 0, i32 8
  %88 = load i32, ptr %87, align 4, !tbaa !11
  store i32 %88, ptr %3, align 4
  br label %89

89:                                               ; preds = %86, %83
  %90 = load i32, ptr %3, align 4
  ret i32 %90

91:                                               ; preds = %83
  unreachable
}

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) #2

declare i32 @fcntl(i32 noundef, i32 noundef, ...) #0

declare i32 @close(i32 noundef) #0

declare noundef i32 @_ZN4ardb19make_fd_nonblockingEi(i32 noundef) #0

declare i32 @aeCreateFileEvent(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #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)) #4 align 2

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

declare void @_ZN4ardb7Channel15IOEventCallbackEP11aeEventLoopiPvi(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #0

attributes #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 "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 = { 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 #5 = { 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, !10, i64 100}
!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 = !{!26, !26, i64 0}
!26 = !{!"vtable pointer", !8, i64 0}
!27 = !{!12, !15, i64 24}
!28 = !{i8 0, i8 2}
!29 = !{}


; 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 [92 x i8], align 1
@__FUNCTION__._ZN4ardb13SocketChannel11GetSocketFDEi = external hidden unnamed_addr constant [12 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [39 x i8], align 1

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv() local_unnamed_addr #0

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv() 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: nounwind
declare i32 @setsockopt(i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 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 uwtable
define dso_local noundef i32 @_ZN4ardb13SocketChannel11GetSocketFDEi(ptr noundef nonnull align 8 dereferenceable(276) %0, i32 noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca i32, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 100
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = icmp slt i32 %5, 0
  br i1 %6, label %7, label %.thread

7:                                                ; preds = %2
  %8 = load ptr, ptr %0, align 8, !tbaa !23
  %9 = getelementptr inbounds i8, ptr %8, i64 176
  %10 = load ptr, ptr %9, align 8
  %11 = tail call noundef i32 %10(ptr noundef nonnull align 8 dereferenceable(276) %0)
  %12 = tail call i32 @socket(i32 noundef %1, i32 noundef %11, i32 noundef 0) #5
  %13 = icmp slt i32 %12, 0
  br i1 %13, label %.thread, label %14

14:                                               ; preds = %7
  %15 = tail call i32 (i32, i32, ...) @fcntl(i32 noundef %12, i32 noundef 3)
  %16 = icmp slt i32 %15, 0
  br i1 %16, label %17, label %19

17:                                               ; preds = %14
  %18 = tail call i32 @close(i32 noundef %12)
  br label %.thread

19:                                               ; preds = %14
  %20 = or i32 %15, 1
  %21 = tail call i32 (i32, i32, ...) @fcntl(i32 noundef %12, i32 noundef 2, i32 noundef %20)
  %22 = icmp slt i32 %21, 0
  br i1 %22, label %23, label %25

23:                                               ; preds = %19
  %24 = tail call i32 @close(i32 noundef %12)
  br label %.thread

25:                                               ; preds = %19
  %26 = tail call noundef i32 @_ZN4ardb19make_fd_nonblockingEi(i32 noundef %12)
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %28, label %30

28:                                               ; preds = %25
  %29 = tail call i32 @close(i32 noundef %12)
  br label %.thread

30:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 1, ptr %3, align 4, !tbaa !25
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  %32 = load i8, ptr %31, align 8, !tbaa !26, !range !27, !noundef !28
  %33 = trunc nuw i8 %32 to i1
  br i1 %33, label %34, label %41

34:                                               ; preds = %30
  %35 = call i32 @setsockopt(i32 noundef %12, i32 noundef 1, i32 noundef 2, ptr noundef nonnull %3, i32 noundef 4) #5
  %.not = icmp eq i32 %35, 0
  br i1 %.not, label %41, label %36

36:                                               ; preds = %34
  %37 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %38 = call noundef zeroext i1 %37(i32 noundef 3)
  br i1 %38, label %39, label %41

39:                                               ; preds = %36
  %40 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  call void (i32, ptr, ptr, i32, ptr, ...) %40(i32 noundef 3, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN4ardb13SocketChannel11GetSocketFDEi, i32 noundef 323, ptr noundef nonnull @.str.12)
  br label %41

41:                                               ; preds = %34, %39, %36, %30
  %42 = call noundef nonnull align 8 dereferenceable(288) ptr @_ZN4ardb7Channel10GetServiceEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  %43 = call noundef ptr @_ZN4ardb14ChannelService15GetRawEventLoopEv(ptr noundef nonnull align 8 dereferenceable(288) %42)
  %44 = call i32 @aeCreateFileEvent(ptr noundef %43, i32 noundef %12, i32 noundef 3, ptr noundef nonnull @_ZN4ardb7Channel15IOEventCallbackEP11aeEventLoopiPvi, ptr noundef nonnull %0)
  %45 = icmp eq i32 %44, -1
  br i1 %45, label %46, label %.thread24

.thread24:                                        ; preds = %41
  store i32 %12, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %.thread

46:                                               ; preds = %41
  %47 = call i32 @close(i32 noundef %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %.thread

.thread:                                          ; preds = %2, %.thread24, %28, %23, %17, %7, %46
  %.3 = phi i32 [ -1, %46 ], [ -1, %17 ], [ -1, %23 ], [ -1, %28 ], [ %12, %7 ], [ %12, %.thread24 ], [ %5, %2 ]
  ret i32 %.3
}

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @fcntl(i32 noundef, i32 noundef, ...) local_unnamed_addr #0

declare i32 @close(i32 noundef) local_unnamed_addr #0

declare noundef i32 @_ZN4ardb19make_fd_nonblockingEi(i32 noundef) local_unnamed_addr #0

declare i32 @aeCreateFileEvent(ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #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)) local_unnamed_addr #4 align 2

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

declare void @_ZN4ardb7Channel15IOEventCallbackEP11aeEventLoopiPvi(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #0

attributes #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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 #5 = { 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 100}
!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 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !11, i64 0}
!25 = !{!9, !9, i64 0}
!26 = !{!6, !12, i64 24}
!27 = !{i8 0, i8 2}
!28 = !{}


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