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

; 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
@__FUNCTION__._ZN4ardb7Channel8WriteNowEPNS_6BufferE = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [40 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

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv() #1

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv() #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4ardb7Channel13HandleIOErrorEi(ptr noundef nonnull align 8 dereferenceable(256), i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4ardb7Channel5FlushEv(ptr noundef nonnull align 8 dereferenceable(256)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4ardb7Channel15IsEnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4ardb7Channel13EnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4ardb7Channel20CreateFlushTimerTaskEv(ptr noundef nonnull align 8 dereferenceable(256)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4ardb7Channel8WriteNowEPNS_6BufferE(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef %1) unnamed_addr #4 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8
  %13 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 19
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = icmp ne ptr null, %14
  br i1 %15, label %16, label %24

16:                                               ; preds = %2
  br label %17

17:                                               ; preds = %16
  %18 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %19 = call noundef zeroext i1 %18(i32 noundef 3)
  br i1 %19, label %20, label %22

20:                                               ; preds = %17
  %21 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  call void (i32, ptr, ptr, i32, ptr, ...) %21(i32 noundef 3, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN4ardb7Channel8WriteNowEPNS_6BufferE, i32 noundef 338, ptr noundef @.str.10)
  br label %22

22:                                               ; preds = %20, %17
  br label %23

23:                                               ; preds = %22
  store i32 0, ptr %3, align 4
  br label %201

24:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = icmp ne ptr null, %25
  br i1 %26, label %27, label %30

27:                                               ; preds = %24
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %28)
  br label %31

30:                                               ; preds = %24
  br label %31

31:                                               ; preds = %30, %27
  %32 = phi i64 [ %29, %27 ], [ 0, %30 ]
  %33 = trunc i64 %32 to i32
  store i32 %33, ptr %6, align 4, !tbaa !24
  %34 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 10
  %35 = call noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33) %34)
  br i1 %35, label %36, label %106

36:                                               ; preds = %31
  %37 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %38 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %37, i32 0, i32 9
  %39 = load i32, ptr %38, align 4, !tbaa !25
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %41, label %76

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %42 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 10
  %43 = call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %42)
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %7, align 4, !tbaa !24
  %45 = load i32, ptr %7, align 4, !tbaa !24
  %46 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %47 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %46, i32 0, i32 9
  %48 = load i32, ptr %47, align 4, !tbaa !25
  %49 = icmp ugt i32 %45, %48
  br i1 %49, label %58, label %50

50:                                               ; preds = %41
  %51 = load i32, ptr %7, align 4, !tbaa !24
  %52 = load i32, ptr %6, align 4, !tbaa !24
  %53 = add i32 %51, %52
  %54 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %55 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %54, i32 0, i32 9
  %56 = load i32, ptr %55, align 4, !tbaa !25
  %57 = icmp ugt i32 %53, %56
  br i1 %57, label %58, label %72

58:                                               ; preds = %50, %41
  br label %59

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

62:                                               ; preds = %59
  %63 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  %64 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 7
  %65 = load i32, ptr %64, align 8, !tbaa !26
  %66 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %67 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %66, i32 0, i32 9
  %68 = load i32, ptr %67, align 4, !tbaa !25
  call void (i32, ptr, ptr, i32, ptr, ...) %63(i32 noundef 3, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN4ardb7Channel8WriteNowEPNS_6BufferE, i32 noundef 351, ptr noundef @.str.11, i32 noundef %65, i32 noundef %68)
  br label %69

69:                                               ; preds = %62, %59
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %73

72:                                               ; preds = %50
  store i32 0, ptr %8, align 4
  br label %73

73:                                               ; preds = %72, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %74 = load i32, ptr %8, align 4
  switch i32 %74, label %200 [
    i32 0, label %75
  ]

75:                                               ; preds = %73
  br label %76

76:                                               ; preds = %75, %36
  %77 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 10
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = load i32, ptr %6, align 4, !tbaa !24
  %80 = zext i32 %79 to i64
  %81 = call noundef i32 @_ZN4ardb6Buffer5WriteEPS0_m(ptr noundef nonnull align 8 dereferenceable(33) %77, ptr noundef %78, i64 noundef %80)
  %82 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %83 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %82, i32 0, i32 7
  %84 = load i32, ptr %83, align 4, !tbaa !27
  %85 = icmp ugt i32 %84, 0
  br i1 %85, label %86, label %95

86:                                               ; preds = %76
  %87 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 10
  %88 = call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %87)
  %89 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %90 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %89, i32 0, i32 7
  %91 = load i32, ptr %90, align 4, !tbaa !27
  %92 = zext i32 %91 to i64
  %93 = icmp ult i64 %88, %92
  br i1 %93, label %94, label %95

94:                                               ; preds = %86
  call void @_ZN4ardb7Channel20CreateFlushTimerTaskEv(ptr noundef nonnull align 8 dereferenceable(256) %12)
  br label %104

95:                                               ; preds = %86, %76
  %96 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %97 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %96, i32 0, i32 11
  %98 = load i8, ptr %97, align 1, !tbaa !28, !range !29, !noundef !30
  %99 = trunc i8 %98 to i1
  br i1 %99, label %100, label %101

100:                                              ; preds = %95
  call void @_ZN4ardb7Channel13EnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256) %12)
  br label %103

101:                                              ; preds = %95
  %102 = call noundef zeroext i1 @_ZN4ardb7Channel5FlushEv(ptr noundef nonnull align 8 dereferenceable(256) %12)
  br label %103

103:                                              ; preds = %101, %100
  br label %104

104:                                              ; preds = %103, %94
  %105 = load i32, ptr %6, align 4, !tbaa !24
  store i32 %105, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %200

106:                                              ; preds = %31
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %107 = call noundef zeroext i1 @_ZN4ardb7Channel15IsEnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256) %12)
  %108 = zext i1 %107 to i8
  store i8 %108, ptr %9, align 1, !tbaa !31
  %109 = load i32, ptr %6, align 4, !tbaa !24
  %110 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %111 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %110, i32 0, i32 7
  %112 = load i32, ptr %111, align 4, !tbaa !27
  %113 = icmp ult i32 %109, %112
  br i1 %113, label %122, label %114

114:                                              ; preds = %106
  %115 = load i8, ptr %9, align 1, !tbaa !31, !range !29, !noundef !30
  %116 = trunc i8 %115 to i1
  br i1 %116, label %122, label %117

117:                                              ; preds = %114
  %118 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %119 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %118, i32 0, i32 11
  %120 = load i8, ptr %119, align 1, !tbaa !28, !range !29, !noundef !30
  %121 = trunc i8 %120 to i1
  br i1 %121, label %122, label %140

122:                                              ; preds = %117, %114, %106
  %123 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 10
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = load i32, ptr %6, align 4, !tbaa !24
  %126 = zext i32 %125 to i64
  %127 = call noundef i32 @_ZN4ardb6Buffer5WriteEPS0_m(ptr noundef nonnull align 8 dereferenceable(33) %123, ptr noundef %124, i64 noundef %126)
  %128 = load i8, ptr %9, align 1, !tbaa !31, !range !29, !noundef !30
  %129 = trunc i8 %128 to i1
  br i1 %129, label %138, label %130

130:                                              ; preds = %122
  %131 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %132 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %131, i32 0, i32 11
  %133 = load i8, ptr %132, align 1, !tbaa !28, !range !29, !noundef !30
  %134 = trunc i8 %133 to i1
  br i1 %134, label %135, label %136

135:                                              ; preds = %130
  call void @_ZN4ardb7Channel13EnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256) %12)
  br label %137

136:                                              ; preds = %130
  call void @_ZN4ardb7Channel20CreateFlushTimerTaskEv(ptr noundef nonnull align 8 dereferenceable(256) %12)
  br label %137

137:                                              ; preds = %136, %135
  br label %138

138:                                              ; preds = %137, %122
  %139 = load i32, ptr %6, align 4, !tbaa !24
  store i32 %139, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %199

140:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = load ptr, ptr %12, align 8, !tbaa !32
  %143 = getelementptr inbounds ptr, ptr %142, i64 15
  %144 = load ptr, ptr %143, align 8
  %145 = call noundef i32 %144(ptr noundef nonnull align 8 dereferenceable(256) %12)
  %146 = call noundef i32 @_ZN4ardb6Buffer7WriteFDEiRi(ptr noundef nonnull align 8 dereferenceable(33) %141, i32 noundef %145, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i32 %146, ptr %11, align 4, !tbaa !24
  %147 = load i32, ptr %11, align 4, !tbaa !24
  %148 = icmp slt i32 %147, 0
  br i1 %148, label %149, label %174

149:                                              ; preds = %140
  %150 = load i32, ptr %10, align 4, !tbaa !24
  %151 = icmp eq i32 %150, 4
  br i1 %151, label %158, label %152

152:                                              ; preds = %149
  %153 = load i32, ptr %10, align 4, !tbaa !24
  %154 = icmp eq i32 %153, 11
  br i1 %154, label %158, label %155

155:                                              ; preds = %152
  %156 = load i32, ptr %10, align 4, !tbaa !24
  %157 = icmp eq i32 %156, 11
  br i1 %157, label %158, label %171

158:                                              ; preds = %155, %152, %149
  %159 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 1
  %160 = getelementptr inbounds %"struct.ardb::ChannelOptions", ptr %159, i32 0, i32 9
  %161 = load i32, ptr %160, align 4, !tbaa !25
  %162 = icmp eq i32 %161, 0
  br i1 %162, label %163, label %164

163:                                              ; preds = %158
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %198

164:                                              ; preds = %158
  %165 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 10
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = load i32, ptr %6, align 4, !tbaa !24
  %168 = zext i32 %167 to i64
  %169 = call noundef i32 @_ZN4ardb6Buffer5WriteEPS0_m(ptr noundef nonnull align 8 dereferenceable(33) %165, ptr noundef %166, i64 noundef %168)
  call void @_ZN4ardb7Channel13EnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256) %12)
  %170 = load i32, ptr %6, align 4, !tbaa !24
  store i32 %170, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %198

171:                                              ; preds = %155
  %172 = load i32, ptr %10, align 4, !tbaa !24
  %173 = call noundef i32 @_ZN4ardb7Channel13HandleIOErrorEi(ptr noundef nonnull align 8 dereferenceable(256) %12, i32 noundef %172)
  store i32 %173, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %198

174:                                              ; preds = %140
  %175 = load i32, ptr %11, align 4, !tbaa !24
  %176 = icmp eq i32 %175, 0
  br i1 %176, label %177, label %182

177:                                              ; preds = %174
  %178 = load ptr, ptr %12, align 8, !tbaa !32
  %179 = getelementptr inbounds ptr, ptr %178, i64 14
  %180 = load ptr, ptr %179, align 8
  %181 = call noundef i32 %180(ptr noundef nonnull align 8 dereferenceable(256) %12, i32 noundef 16)
  store i32 %181, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %198

182:                                              ; preds = %174
  %183 = load i32, ptr %11, align 4, !tbaa !24
  %184 = sext i32 %183 to i64
  %185 = load i32, ptr %6, align 4, !tbaa !24
  %186 = zext i32 %185 to i64
  %187 = icmp ult i64 %184, %186
  br i1 %187, label %188, label %196

188:                                              ; preds = %182
  %189 = getelementptr inbounds %"class.ardb::Channel", ptr %12, i32 0, i32 10
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = load i32, ptr %6, align 4, !tbaa !24
  %192 = load i32, ptr %11, align 4, !tbaa !24
  %193 = sub i32 %191, %192
  %194 = zext i32 %193 to i64
  %195 = call noundef i32 @_ZN4ardb6Buffer5WriteEPS0_m(ptr noundef nonnull align 8 dereferenceable(33) %189, ptr noundef %190, i64 noundef %194)
  call void @_ZN4ardb7Channel13EnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256) %12)
  br label %196

196:                                              ; preds = %188, %182
  %197 = load i32, ptr %6, align 4, !tbaa !24
  store i32 %197, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %198

198:                                              ; preds = %196, %177, %171, %164, %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %199

199:                                              ; preds = %198, %138
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %200

200:                                              ; preds = %199, %104, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %201

201:                                              ; preds = %200, %23
  %202 = load i32, ptr %3, align 4
  ret i32 %202
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN4ardb6Buffer5WriteEPS0_m(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef, i64 noundef) #2 align 2

declare noundef i32 @_ZN4ardb6Buffer7WriteFDEiRi(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #3 = { 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 #4 = { 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 #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, !6, i64 232}
!10 = !{!"_ZTSN4ardb7ChannelE", !11, i64 0, !12, i64 8, !14, i64 44, !14, i64 45, !13, i64 48, !15, i64 56, !6, i64 88, !13, i64 96, !13, i64 100, !22, i64 104, !22, i64 144, !13, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !14, i64 224, !14, i64 225, !14, i64 226, !6, i64 232, !6, i64 240, !6, i64 248}
!11 = !{!"_ZTSN4ardb8RunnableE"}
!12 = !{!"_ZTSN4ardb14ChannelOptionsE", !13, i64 0, !13, i64 4, !14, i64 8, !13, i64 12, !14, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !14, i64 32, !14, i64 33}
!13 = !{!"int", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTSN4ardb15ChannelPipelineE", !6, i64 0, !6, i64 8, !6, i64 16, !16, i64 24}
!16 = !{!"_ZTSN5btree9btree_mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS6_ESaISt4pairIKS6_S9_EELi256EEE", !17, i64 0}
!17 = !{!"_ZTSN5btree19btree_map_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !18, i64 0}
!18 = !{!"_ZTSN5btree22btree_unique_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !19, i64 0}
!19 = !{!"_ZTSN5btree15btree_containerINS_5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS8_ESaISt4pairIKS8_SB_EELi256EEEEEEE", !20, i64 0}
!20 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEEE", !21, i64 0}
!21 = !{!"_ZTSN5btree5btreeINS_16btree_map_paramsINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPN4ardb21ChannelHandlerContextESt4lessIS7_ESaISt4pairIKS7_SA_EELi256EEEE17empty_base_handleIS6_PNS_10btree_nodeISH_EEEE", !6, i64 0}
!22 = !{!"_ZTSN4ardb6BufferE", !6, i64 0, !23, i64 8, !23, i64 16, !23, i64 24, !14, i64 32}
!23 = !{!"long", !7, i64 0}
!24 = !{!13, !13, i64 0}
!25 = !{!10, !13, i64 36}
!26 = !{!10, !13, i64 96}
!27 = !{!10, !13, i64 28}
!28 = !{!10, !14, i64 41}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!14, !14, i64 0}
!32 = !{!33, !33, i64 0}
!33 = !{!"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
@__FUNCTION__._ZN4ardb7Channel8WriteNowEPNS_6BufferE = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1

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

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

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv() local_unnamed_addr #1

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv() local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN4ardb7Channel13HandleIOErrorEi(ptr noundef nonnull align 8 dereferenceable(256), i32 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4ardb7Channel5FlushEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4ardb7Channel15IsEnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4ardb7Channel13EnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4ardb7Channel20CreateFlushTimerTaskEv(ptr noundef nonnull align 8 dereferenceable(256)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN4ardb7Channel8WriteNowEPNS_6BufferE(ptr noundef nonnull align 8 dereferenceable(256) %0, ptr noundef %1) unnamed_addr #4 align 2 {
  %3 = alloca i32, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 232
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %11, label %6

6:                                                ; preds = %2
  %7 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %8 = tail call noundef zeroext i1 %7(i32 noundef 3)
  br i1 %8, label %9, label %.critedge

9:                                                ; preds = %6
  %10 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  tail call void (i32, ptr, ptr, i32, ptr, ...) %10(i32 noundef 3, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN4ardb7Channel8WriteNowEPNS_6BufferE, i32 noundef 338, ptr noundef nonnull @.str.10)
  br label %.critedge

11:                                               ; preds = %2
  %.not37 = icmp eq ptr %1, null
  br i1 %.not37, label %14, label %12

12:                                               ; preds = %11
  %13 = tail call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %1)
  br label %14

14:                                               ; preds = %11, %12
  %15 = phi i64 [ %13, %12 ], [ 0, %11 ]
  %16 = trunc i64 %15 to i32
  %17 = getelementptr inbounds i8, ptr %0, i64 144
  %18 = tail call noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33) %17)
  br i1 %18, label %19, label %56

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %0, i64 36
  %21 = load i32, ptr %20, align 4, !tbaa !23
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %23, label %38

23:                                               ; preds = %19
  %24 = tail call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %17)
  %25 = trunc i64 %24 to i32
  %26 = load i32, ptr %20, align 4, !tbaa !23
  %27 = icmp ult i32 %26, %25
  %28 = add i32 %25, %16
  %29 = icmp ugt i32 %28, %26
  %or.cond40 = or i1 %27, %29
  br i1 %or.cond40, label %30, label %38

30:                                               ; preds = %23
  %31 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %32 = tail call noundef zeroext i1 %31(i32 noundef 3)
  br i1 %32, label %33, label %.critedge

33:                                               ; preds = %30
  %34 = tail call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  %35 = getelementptr inbounds i8, ptr %0, i64 96
  %36 = load i32, ptr %35, align 8, !tbaa !24
  %37 = load i32, ptr %20, align 4, !tbaa !23
  tail call void (i32, ptr, ptr, i32, ptr, ...) %34(i32 noundef 3, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN4ardb7Channel8WriteNowEPNS_6BufferE, i32 noundef 351, ptr noundef nonnull @.str.11, i32 noundef %36, i32 noundef %37)
  br label %.critedge

38:                                               ; preds = %23, %19
  %39 = and i64 %15, 4294967295
  %40 = tail call noundef i32 @_ZN4ardb6Buffer5WriteEPS0_m(ptr noundef nonnull align 8 dereferenceable(33) %17, ptr noundef %1, i64 noundef %39)
  %41 = getelementptr inbounds i8, ptr %0, i64 28
  %42 = load i32, ptr %41, align 4, !tbaa !25
  %.not38 = icmp eq i32 %42, 0
  br i1 %.not38, label %49, label %43

43:                                               ; preds = %38
  %44 = tail call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %17)
  %45 = load i32, ptr %41, align 4, !tbaa !25
  %46 = zext i32 %45 to i64
  %47 = icmp ult i64 %44, %46
  br i1 %47, label %48, label %49

48:                                               ; preds = %43
  tail call void @_ZN4ardb7Channel20CreateFlushTimerTaskEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  br label %.critedge

49:                                               ; preds = %43, %38
  %50 = getelementptr inbounds i8, ptr %0, i64 41
  %51 = load i8, ptr %50, align 1, !tbaa !26, !range !27, !noundef !28
  %52 = trunc nuw i8 %51 to i1
  br i1 %52, label %53, label %54

53:                                               ; preds = %49
  tail call void @_ZN4ardb7Channel13EnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  br label %.critedge

54:                                               ; preds = %49
  %55 = tail call noundef zeroext i1 @_ZN4ardb7Channel5FlushEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  br label %.critedge

56:                                               ; preds = %14
  %57 = tail call noundef zeroext i1 @_ZN4ardb7Channel15IsEnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  %58 = getelementptr inbounds i8, ptr %0, i64 28
  %59 = load i32, ptr %58, align 4, !tbaa !25
  %60 = icmp ugt i32 %59, %16
  %brmerge = or i1 %57, %60
  br i1 %brmerge, label %65, label %61

61:                                               ; preds = %56
  %62 = getelementptr inbounds i8, ptr %0, i64 41
  %63 = load i8, ptr %62, align 1, !tbaa !26, !range !27, !noundef !28
  %64 = trunc nuw i8 %63 to i1
  br i1 %64, label %65, label %74

65:                                               ; preds = %56, %61
  %66 = and i64 %15, 4294967295
  %67 = tail call noundef i32 @_ZN4ardb6Buffer5WriteEPS0_m(ptr noundef nonnull align 8 dereferenceable(33) %17, ptr noundef %1, i64 noundef %66)
  br i1 %57, label %.critedge, label %68

68:                                               ; preds = %65
  %69 = getelementptr inbounds i8, ptr %0, i64 41
  %70 = load i8, ptr %69, align 1, !tbaa !26, !range !27, !noundef !28
  %71 = trunc nuw i8 %70 to i1
  br i1 %71, label %72, label %73

72:                                               ; preds = %68
  tail call void @_ZN4ardb7Channel13EnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  br label %.critedge

73:                                               ; preds = %68
  tail call void @_ZN4ardb7Channel20CreateFlushTimerTaskEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  br label %.critedge

74:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %75 = load ptr, ptr %0, align 8, !tbaa !29
  %76 = getelementptr inbounds i8, ptr %75, i64 120
  %77 = load ptr, ptr %76, align 8
  %78 = tail call noundef i32 %77(ptr noundef nonnull align 8 dereferenceable(256) %0)
  %79 = call noundef i32 @_ZN4ardb6Buffer7WriteFDEiRi(ptr noundef nonnull align 8 dereferenceable(33) %1, i32 noundef %78, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %80 = icmp slt i32 %79, 0
  br i1 %80, label %81, label %92

81:                                               ; preds = %74
  %82 = load i32, ptr %3, align 4
  switch i32 %82, label %90 [
    i32 11, label %83
    i32 4, label %83
  ]

83:                                               ; preds = %81, %81
  %84 = getelementptr inbounds i8, ptr %0, i64 36
  %85 = load i32, ptr %84, align 4, !tbaa !23
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %107, label %87

87:                                               ; preds = %83
  %88 = and i64 %15, 4294967295
  %89 = call noundef i32 @_ZN4ardb6Buffer5WriteEPS0_m(ptr noundef nonnull align 8 dereferenceable(33) %17, ptr noundef nonnull %1, i64 noundef %88)
  call void @_ZN4ardb7Channel13EnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  br label %107

90:                                               ; preds = %81
  %91 = call noundef i32 @_ZN4ardb7Channel13HandleIOErrorEi(ptr noundef nonnull align 8 dereferenceable(256) %0, i32 noundef %82)
  br label %107

92:                                               ; preds = %74
  %93 = icmp eq i32 %79, 0
  br i1 %93, label %94, label %99

94:                                               ; preds = %92
  %95 = load ptr, ptr %0, align 8, !tbaa !29
  %96 = getelementptr inbounds i8, ptr %95, i64 112
  %97 = load ptr, ptr %96, align 8
  %98 = call noundef i32 %97(ptr noundef nonnull align 8 dereferenceable(256) %0, i32 noundef 16)
  br label %107

99:                                               ; preds = %92
  %100 = zext nneg i32 %79 to i64
  %101 = and i64 %15, 4294967295
  %102 = icmp ugt i64 %101, %100
  br i1 %102, label %103, label %107

103:                                              ; preds = %99
  %104 = sub i32 %16, %79
  %105 = zext i32 %104 to i64
  %106 = call noundef i32 @_ZN4ardb6Buffer5WriteEPS0_m(ptr noundef nonnull align 8 dereferenceable(33) %17, ptr noundef nonnull %1, i64 noundef %105)
  call void @_ZN4ardb7Channel13EnableWritingEv(ptr noundef nonnull align 8 dereferenceable(256) %0)
  br label %107

107:                                              ; preds = %99, %103, %83, %94, %90, %87
  %.1 = phi i32 [ %16, %87 ], [ %91, %90 ], [ %98, %94 ], [ 0, %83 ], [ %16, %103 ], [ %16, %99 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  br label %.critedge

.critedge:                                        ; preds = %53, %54, %48, %65, %73, %72, %107, %30, %33, %9, %6
  %.4 = phi i32 [ 0, %6 ], [ 0, %9 ], [ %16, %53 ], [ %16, %54 ], [ %16, %48 ], [ %.1, %107 ], [ %16, %72 ], [ %16, %73 ], [ %16, %65 ], [ 0, %30 ], [ 0, %33 ]
  ret i32 %.4
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN4ardb6Buffer5WriteEPS0_m(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef, i64 noundef) local_unnamed_addr #2 align 2

declare noundef i32 @_ZN4ardb6Buffer7WriteFDEiRi(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #3 = { 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 #4 = { 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 #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, !14, i64 232}
!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 = !{!6, !9, i64 36}
!24 = !{!6, !9, i64 96}
!25 = !{!6, !9, i64 28}
!26 = !{!6, !12, i64 41}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !11, i64 0}


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