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

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.ardb::codec::DirSyncDecoder" = type <{ %"class.ardb::codec::StackFrameDecoder", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", ptr, i64, i64, i8, [7 x i8] }>
%"class.ardb::codec::StackFrameDecoder" = type { %"class.ardb::ChannelUpstreamHandler", %"class.ardb::Buffer" }
%"class.ardb::ChannelUpstreamHandler" = type { %"class.ardb::AbstractChannelHandler" }
%"class.ardb::AbstractChannelHandler" = type { %"class.ardb::ChannelHandler" }
%"class.ardb::ChannelHandler" = type { ptr }
%"class.ardb::Buffer" = type <{ ptr, i64, i64, i64, i8, [7 x i8] }>
%"struct.ardb::codec::DirSyncStatus" = type { %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i32 }

@.str = external hidden unnamed_addr constant [42 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@__FUNCTION__._ZN4ardb5codec14DirSyncDecoder6DecodeERNS_21ChannelHandlerContextEPNS_7ChannelERNS_6BufferERNS0_13DirSyncStatusE = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4ardb5codec14DirSyncDecoder16CloseCurrentFileEv(ptr noundef nonnull align 8 dereferenceable(137)) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ardb5codec14DirSyncDecoder6DecodeERNS_21ChannelHandlerContextEPNS_7ChannelERNS_6BufferERNS0_13DirSyncStatusE(ptr noundef nonnull align 8 dereferenceable(137) %0, ptr noundef nonnull align 8 dereferenceable(66) %1, ptr noundef %2, ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(72) %4) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca i1, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::__cxx11::basic_string", align 8
  %18 = alloca %"class.std::__cxx11::basic_string", align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  %21 = load ptr, ptr %7, align 8
  %22 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 2
  %23 = load ptr, ptr %11, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %23, i32 0, i32 0
  %25 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %24, ptr noundef nonnull align 8 dereferenceable(32) %22)
  br label %26

26:                                               ; preds = %296, %5
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = call noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33) %27)
  br i1 %28, label %29, label %298

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = call noundef i64 @_ZNK4ardb6Buffer12GetReadIndexEv(ptr noundef nonnull align 8 dereferenceable(33) %30)
  store i64 %31, ptr %12, align 8, !tbaa !9
  %32 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  %33 = load i8, ptr %32, align 8, !tbaa !11
  %34 = zext i8 %33 to i32
  switch i32 %34, label %284 [
    i32 0, label %35
    i32 1, label %103
    i32 2, label %200
    i32 3, label %277
  ]

35:                                               ; preds = %29
  br label %36

36:                                               ; preds = %48, %35
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = call noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33) %37)
  br i1 %38, label %39, label %46

39:                                               ; preds = %36
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = call noundef ptr @_ZNK4ardb6Buffer16GetRawReadBufferEv(ptr noundef nonnull align 8 dereferenceable(33) %40)
  %42 = getelementptr inbounds i8, ptr %41, i64 0
  %43 = load i8, ptr %42, align 1, !tbaa !21
  %44 = sext i8 %43 to i32
  %45 = icmp eq i32 %44, 10
  br label %46

46:                                               ; preds = %39, %36
  %47 = phi i1 [ false, %36 ], [ %45, %39 ]
  br i1 %47, label %48, label %50

48:                                               ; preds = %46
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN4ardb6Buffer16AdvanceReadIndexEi(ptr noundef nonnull align 8 dereferenceable(33) %49, i32 noundef 1)
  br label %36, !llvm.loop !22

50:                                               ; preds = %46
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = call noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33) %51)
  br i1 %52, label %53, label %81

53:                                               ; preds = %50
  %54 = load ptr, ptr %10, align 8, !tbaa !5
  %55 = call noundef ptr @_ZNK4ardb6Buffer16GetRawReadBufferEv(ptr noundef nonnull align 8 dereferenceable(33) %54)
  %56 = getelementptr inbounds i8, ptr %55, i64 0
  %57 = load i8, ptr %56, align 1, !tbaa !21
  %58 = sext i8 %57 to i32
  %59 = icmp ne i32 %58, 35
  br i1 %59, label %60, label %79

60:                                               ; preds = %53
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %61, i32 0, i32 3
  store i32 -1, ptr %62, align 4, !tbaa !24
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %63, i32 0, i32 1
  %65 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %64, ptr noundef @.str)
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %66, i32 0, i32 2
  store i32 5, ptr %67, align 8, !tbaa !27
  br label %68

68:                                               ; preds = %60
  %69 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %70 = call noundef zeroext i1 %69(i32 noundef 2)
  br i1 %70, label %71, label %76

71:                                               ; preds = %68
  %72 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %73, i32 0, i32 1
  %75 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %74) #8
  call void (i32, ptr, ptr, i32, ptr, ...) %72(i32 noundef 2, ptr noundef @.str.1, ptr noundef @__FUNCTION__._ZN4ardb5codec14DirSyncDecoder6DecodeERNS_21ChannelHandlerContextEPNS_7ChannelERNS_6BufferERNS0_13DirSyncStatusE, i32 noundef 88, ptr noundef @.str.2, ptr noundef %75)
  br label %76

76:                                               ; preds = %71, %68
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  store i1 true, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %296

79:                                               ; preds = %53
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN4ardb6Buffer16AdvanceReadIndexEi(ptr noundef nonnull align 8 dereferenceable(33) %80, i32 noundef 1)
  br label %82

81:                                               ; preds = %50
  store i1 false, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %296

82:                                               ; preds = %79
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 5
  %85 = call noundef zeroext i1 @_ZN4ardb12BufferHelper12ReadFixInt64ERNS_6BufferERlb(ptr noundef nonnull align 8 dereferenceable(33) %83, ptr noundef nonnull align 8 dereferenceable(8) %84, i1 noundef zeroext true)
  br i1 %85, label %89, label %86

86:                                               ; preds = %82
  %87 = load ptr, ptr %10, align 8, !tbaa !5
  %88 = load i64, ptr %12, align 8, !tbaa !9
  call void @_ZN4ardb6Buffer12SetReadIndexEm(ptr noundef nonnull align 8 dereferenceable(33) %87, i64 noundef %88)
  store i1 false, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %296

89:                                               ; preds = %82
  %90 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 5
  %91 = load i64, ptr %90, align 8, !tbaa !28
  %92 = icmp sle i64 %91, 0
  br i1 %92, label %93, label %96

93:                                               ; preds = %89
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %94, i32 0, i32 2
  store i32 4, ptr %95, align 8, !tbaa !27
  store i1 true, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %296

96:                                               ; preds = %89
  %97 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  store i8 1, ptr %97, align 8, !tbaa !11
  %98 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  %99 = load i8, ptr %98, align 8, !tbaa !11
  %100 = zext i8 %99 to i32
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %101, i32 0, i32 2
  store i32 %100, ptr %102, align 8, !tbaa !27
  store i32 2, ptr %13, align 4
  br label %296, !llvm.loop !29

103:                                              ; preds = %29
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #8
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = invoke noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %104)
          to label %106 unwind label %109

106:                                              ; preds = %103
  %107 = icmp ult i64 %105, 12
  br i1 %107, label %108, label %113

108:                                              ; preds = %106
  store i1 false, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %198

109:                                              ; preds = %127, %126, %122, %117, %113, %103
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %15, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %16, align 4
  br label %199

113:                                              ; preds = %106
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = invoke noundef zeroext i1 @_ZN4ardb12BufferHelper13ReadVarStringERNS_6BufferERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(33) %114, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %116 unwind label %109

116:                                              ; preds = %113
  br i1 %115, label %117, label %122

117:                                              ; preds = %116
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 4
  %120 = invoke noundef zeroext i1 @_ZN4ardb12BufferHelper12ReadFixInt64ERNS_6BufferERlb(ptr noundef nonnull align 8 dereferenceable(33) %118, ptr noundef nonnull align 8 dereferenceable(8) %119, i1 noundef zeroext true)
          to label %121 unwind label %109

121:                                              ; preds = %117
  br i1 %120, label %126, label %122

122:                                              ; preds = %121, %116
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = load i64, ptr %12, align 8, !tbaa !9
  invoke void @_ZN4ardb6Buffer12SetReadIndexEm(ptr noundef nonnull align 8 dereferenceable(33) %123, i64 noundef %124)
          to label %125 unwind label %109

125:                                              ; preds = %122
  store i1 false, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %198

126:                                              ; preds = %121
  invoke void @_ZN4ardb5codec14DirSyncDecoder16CloseCurrentFileEv(ptr noundef nonnull align 8 dereferenceable(137) %21)
          to label %127 unwind label %109

127:                                              ; preds = %126
  %128 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 2
  %129 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %128, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %130 unwind label %109

130:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #8
  %131 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 1
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %18, ptr noundef nonnull align 8 dereferenceable(32) %131, ptr noundef @.str.3)
          to label %132 unwind label %172

132:                                              ; preds = %130
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_RKS8_(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %17, ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %133 unwind label %176

133:                                              ; preds = %132
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  %134 = invoke noundef zeroext i1 @_ZN4ardb9make_fileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %17)
          to label %135 unwind label %181

135:                                              ; preds = %133
  %136 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 4
  %137 = load i64, ptr %136, align 8, !tbaa !30
  %138 = icmp sgt i64 %137, 0
  br i1 %138, label %139, label %189

139:                                              ; preds = %135
  %140 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  %141 = invoke noalias ptr @fopen(ptr noundef %140, ptr noundef @.str.4)
          to label %142 unwind label %181

142:                                              ; preds = %139
  %143 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 3
  store ptr %141, ptr %143, align 8, !tbaa !31
  %144 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 3
  %145 = load ptr, ptr %144, align 8, !tbaa !31
  %146 = icmp eq ptr %145, null
  br i1 %146, label %147, label %188

147:                                              ; preds = %142
  %148 = call ptr @__errno_location() #9
  %149 = load i32, ptr %148, align 4, !tbaa !32
  %150 = load ptr, ptr %11, align 8, !tbaa !5
  %151 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %150, i32 0, i32 3
  store i32 %149, ptr %151, align 4, !tbaa !24
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  %153 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %152, i32 0, i32 3
  %154 = load i32, ptr %153, align 4, !tbaa !24
  %155 = call ptr @strerror(i32 noundef %154) #8
  %156 = load ptr, ptr %11, align 8, !tbaa !5
  %157 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %156, i32 0, i32 1
  %158 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %157, ptr noundef %155)
          to label %159 unwind label %181

159:                                              ; preds = %147
  %160 = load ptr, ptr %11, align 8, !tbaa !5
  %161 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %160, i32 0, i32 2
  store i32 5, ptr %161, align 8, !tbaa !27
  br label %162

162:                                              ; preds = %159
  %163 = invoke noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
          to label %164 unwind label %181

164:                                              ; preds = %162
  %165 = invoke noundef zeroext i1 %163(i32 noundef 2)
          to label %166 unwind label %181

166:                                              ; preds = %164
  br i1 %165, label %167, label %185

167:                                              ; preds = %166
  %168 = invoke noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
          to label %169 unwind label %181

169:                                              ; preds = %167
  %170 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  invoke void (i32, ptr, ptr, i32, ptr, ...) %168(i32 noundef 2, ptr noundef @.str.1, ptr noundef @__FUNCTION__._ZN4ardb5codec14DirSyncDecoder6DecodeERNS_21ChannelHandlerContextEPNS_7ChannelERNS_6BufferERNS0_13DirSyncStatusE, i32 noundef 138, ptr noundef @.str.5, ptr noundef %170)
          to label %171 unwind label %181

171:                                              ; preds = %169
  br label %185

172:                                              ; preds = %130
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %15, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %16, align 4
  br label %180

176:                                              ; preds = %132
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %15, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %16, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %18) #8
  br label %180

180:                                              ; preds = %176, %172
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #8
  br label %197

181:                                              ; preds = %169, %167, %164, %162, %147, %139, %133
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %15, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %16, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  br label %197

185:                                              ; preds = %171, %166
  br label %186

186:                                              ; preds = %185
  br label %187

187:                                              ; preds = %186
  store i1 true, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %196

188:                                              ; preds = %142
  br label %189

189:                                              ; preds = %188, %135
  %190 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  store i8 2, ptr %190, align 8, !tbaa !11
  %191 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  %192 = load i8, ptr %191, align 8, !tbaa !11
  %193 = zext i8 %192 to i32
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %194, i32 0, i32 2
  store i32 %193, ptr %195, align 8, !tbaa !27
  store i32 2, ptr %13, align 4
  br label %196, !llvm.loop !29

196:                                              ; preds = %189, %187
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %17) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  br label %198

197:                                              ; preds = %181, %180
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #8
  br label %199

198:                                              ; preds = %196, %125, %108
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #8
  br label %296

199:                                              ; preds = %197, %109
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %301

200:                                              ; preds = %29
  %201 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 4
  %202 = load i64, ptr %201, align 8, !tbaa !30
  %203 = icmp sgt i64 %202, 0
  br i1 %203, label %204, label %250

204:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %205 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 4
  %206 = load i64, ptr %205, align 8, !tbaa !30
  store i64 %206, ptr %19, align 8, !tbaa !9
  %207 = load ptr, ptr %10, align 8, !tbaa !5
  %208 = call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %207)
  %209 = load i64, ptr %19, align 8, !tbaa !9
  %210 = icmp ult i64 %208, %209
  br i1 %210, label %211, label %214

211:                                              ; preds = %204
  %212 = load ptr, ptr %10, align 8, !tbaa !5
  %213 = call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %212)
  store i64 %213, ptr %19, align 8, !tbaa !9
  br label %214

214:                                              ; preds = %211, %204
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %215 = load ptr, ptr %10, align 8, !tbaa !5
  %216 = call noundef ptr @_ZNK4ardb6Buffer16GetRawReadBufferEv(ptr noundef nonnull align 8 dereferenceable(33) %215)
  %217 = load i64, ptr %19, align 8, !tbaa !9
  %218 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 3
  %219 = load ptr, ptr %218, align 8, !tbaa !31
  %220 = call i64 @fwrite(ptr noundef %216, i64 noundef %217, i64 noundef 1, ptr noundef %219)
  %221 = trunc i64 %220 to i32
  store i32 %221, ptr %20, align 4, !tbaa !32
  %222 = load i32, ptr %20, align 4, !tbaa !32
  %223 = icmp sgt i32 %222, 0
  br i1 %223, label %224, label %232

224:                                              ; preds = %214
  %225 = load i64, ptr %19, align 8, !tbaa !9
  %226 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 4
  %227 = load i64, ptr %226, align 8, !tbaa !30
  %228 = sub i64 %227, %225
  store i64 %228, ptr %226, align 8, !tbaa !30
  %229 = load ptr, ptr %10, align 8, !tbaa !5
  %230 = load i64, ptr %19, align 8, !tbaa !9
  %231 = trunc i64 %230 to i32
  call void @_ZN4ardb6Buffer16AdvanceReadIndexEi(ptr noundef nonnull align 8 dereferenceable(33) %229, i32 noundef %231)
  br label %246

232:                                              ; preds = %214
  %233 = call ptr @__errno_location() #9
  %234 = load i32, ptr %233, align 4, !tbaa !32
  %235 = load ptr, ptr %11, align 8, !tbaa !5
  %236 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %235, i32 0, i32 3
  store i32 %234, ptr %236, align 4, !tbaa !24
  %237 = load ptr, ptr %11, align 8, !tbaa !5
  %238 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %237, i32 0, i32 3
  %239 = load i32, ptr %238, align 4, !tbaa !24
  %240 = call ptr @strerror(i32 noundef %239) #8
  %241 = load ptr, ptr %11, align 8, !tbaa !5
  %242 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %241, i32 0, i32 1
  %243 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %242, ptr noundef %240)
  %244 = load ptr, ptr %11, align 8, !tbaa !5
  %245 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %244, i32 0, i32 2
  store i32 5, ptr %245, align 8, !tbaa !27
  store i1 true, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %247

246:                                              ; preds = %224
  store i32 0, ptr %13, align 4
  br label %247

247:                                              ; preds = %246, %232
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  %248 = load i32, ptr %13, align 4
  switch i32 %248, label %296 [
    i32 0, label %249
  ]

249:                                              ; preds = %247
  br label %250

250:                                              ; preds = %249, %200
  %251 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 4
  %252 = load i64, ptr %251, align 8, !tbaa !30
  %253 = icmp eq i64 0, %252
  br i1 %253, label %254, label %276

254:                                              ; preds = %250
  call void @_ZN4ardb5codec14DirSyncDecoder16CloseCurrentFileEv(ptr noundef nonnull align 8 dereferenceable(137) %21)
  %255 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 5
  %256 = load i64, ptr %255, align 8, !tbaa !28
  %257 = add nsw i64 %256, -1
  store i64 %257, ptr %255, align 8, !tbaa !28
  %258 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 5
  %259 = load i64, ptr %258, align 8, !tbaa !28
  %260 = icmp eq i64 %259, 0
  br i1 %260, label %261, label %268

261:                                              ; preds = %254
  %262 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  store i8 4, ptr %262, align 8, !tbaa !11
  %263 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  %264 = load i8, ptr %263, align 8, !tbaa !11
  %265 = zext i8 %264 to i32
  %266 = load ptr, ptr %11, align 8, !tbaa !5
  %267 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %266, i32 0, i32 2
  store i32 %265, ptr %267, align 8, !tbaa !27
  br label %275

268:                                              ; preds = %254
  %269 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  store i8 3, ptr %269, align 8, !tbaa !11
  %270 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  %271 = load i8, ptr %270, align 8, !tbaa !11
  %272 = zext i8 %271 to i32
  %273 = load ptr, ptr %11, align 8, !tbaa !5
  %274 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %273, i32 0, i32 2
  store i32 %272, ptr %274, align 8, !tbaa !27
  br label %275

275:                                              ; preds = %268, %261
  store i1 true, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %296

276:                                              ; preds = %250
  store i32 2, ptr %13, align 4
  br label %296, !llvm.loop !29

277:                                              ; preds = %29
  %278 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  store i8 1, ptr %278, align 8, !tbaa !11
  %279 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  %280 = load i8, ptr %279, align 8, !tbaa !11
  %281 = zext i8 %280 to i32
  %282 = load ptr, ptr %11, align 8, !tbaa !5
  %283 = getelementptr inbounds %"struct.ardb::codec::DirSyncStatus", ptr %282, i32 0, i32 2
  store i32 %281, ptr %283, align 8, !tbaa !27
  store i32 2, ptr %13, align 4
  br label %296, !llvm.loop !29

284:                                              ; preds = %29
  br label %285

285:                                              ; preds = %284
  %286 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %287 = call noundef zeroext i1 %286(i32 noundef 2)
  br i1 %287, label %288, label %293

288:                                              ; preds = %285
  %289 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  %290 = getelementptr inbounds %"class.ardb::codec::DirSyncDecoder", ptr %21, i32 0, i32 6
  %291 = load i8, ptr %290, align 8, !tbaa !11
  %292 = zext i8 %291 to i32
  call void (i32, ptr, ptr, i32, ptr, ...) %289(i32 noundef 2, ptr noundef @.str.1, ptr noundef @__FUNCTION__._ZN4ardb5codec14DirSyncDecoder6DecodeERNS_21ChannelHandlerContextEPNS_7ChannelERNS_6BufferERNS0_13DirSyncStatusE, i32 noundef 195, ptr noundef @.str.6, i32 noundef %292)
  br label %293

293:                                              ; preds = %288, %285
  br label %294

294:                                              ; preds = %293
  br label %295

295:                                              ; preds = %294
  store i1 false, ptr %6, align 1
  store i32 1, ptr %13, align 4
  br label %296

296:                                              ; preds = %295, %277, %276, %275, %247, %198, %96, %93, %86, %81, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  %297 = load i32, ptr %13, align 4
  switch i32 %297, label %306 [
    i32 1, label %299
    i32 2, label %26
  ]

298:                                              ; preds = %26
  store i1 true, ptr %6, align 1
  br label %299

299:                                              ; preds = %298, %296
  %300 = load i1, ptr %6, align 1
  ret i1 %300

301:                                              ; preds = %199
  %302 = load ptr, ptr %15, align 8
  %303 = load i32, ptr %16, align 4
  %304 = insertvalue { ptr, i32 } poison, ptr %302, 0
  %305 = insertvalue { ptr, i32 } %304, i32 %303, 1
  resume { ptr, i32 } %305

306:                                              ; preds = %296
  unreachable
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #0 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb6Buffer16AdvanceReadIndexEi(ptr noundef nonnull align 8 dereferenceable(33), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #0 align 2

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv() #3

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv() #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

declare noundef zeroext i1 @_ZN4ardb12BufferHelper12ReadFixInt64ERNS_6BufferERlb(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4ardb6Buffer12SetReadIndexEm(ptr noundef nonnull align 8 dereferenceable(33), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

declare i32 @__gxx_personality_v0(...)

declare noundef zeroext i1 @_ZN4ardb12BufferHelper13ReadVarStringERNS_6BufferERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(32)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

declare noundef zeroext i1 @_ZN4ardb9make_fileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) #3

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #7

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

attributes #0 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #6 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { 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, !7, i64 136}
!12 = !{!"_ZTSN4ardb5codec14DirSyncDecoderE", !13, i64 0, !19, i64 48, !19, i64 80, !6, i64 112, !10, i64 120, !10, i64 128, !7, i64 136}
!13 = !{!"_ZTSN4ardb5codec17StackFrameDecoderINS0_13DirSyncStatusEEE", !14, i64 0, !17, i64 8}
!14 = !{!"_ZTSN4ardb22ChannelUpstreamHandlerINS_6BufferEEE", !15, i64 0}
!15 = !{!"_ZTSN4ardb22AbstractChannelHandlerINS_6BufferEEE", !16, i64 0}
!16 = !{!"_ZTSN4ardb14ChannelHandlerE"}
!17 = !{!"_ZTSN4ardb6BufferE", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !18, i64 32}
!18 = !{!"bool", !7, i64 0}
!19 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !20, i64 0, !10, i64 8, !7, i64 16}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !26, i64 68}
!25 = !{!"_ZTSN4ardb5codec13DirSyncStatusE", !19, i64 0, !19, i64 32, !26, i64 64, !26, i64 68}
!26 = !{!"int", !7, i64 0}
!27 = !{!25, !26, i64 64}
!28 = !{!12, !10, i64 128}
!29 = distinct !{!29, !23}
!30 = !{!12, !10, i64 120}
!31 = !{!12, !6, i64 112}
!32 = !{!26, !26, 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"

%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@.str = external hidden unnamed_addr constant [42 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@__FUNCTION__._ZN4ardb5codec14DirSyncDecoder6DecodeERNS_21ChannelHandlerContextEPNS_7ChannelERNS_6BufferERNS0_13DirSyncStatusE = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4ardb5codec14DirSyncDecoder16CloseCurrentFileEv(ptr noundef nonnull align 8 dereferenceable(137)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN4ardb5codec14DirSyncDecoder6DecodeERNS_21ChannelHandlerContextEPNS_7ChannelERNS_6BufferERNS0_13DirSyncStatusE(ptr noundef nonnull align 8 dereferenceable(137) %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(66) %1, ptr nocapture noundef readnone %2, ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(72) %4) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = getelementptr inbounds i8, ptr %0, i64 80
  %10 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %9)
  %11 = getelementptr inbounds i8, ptr %0, i64 136
  %12 = getelementptr inbounds i8, ptr %4, i64 64
  %13 = getelementptr inbounds i8, ptr %0, i64 120
  %14 = getelementptr inbounds i8, ptr %0, i64 112
  %15 = getelementptr inbounds i8, ptr %0, i64 48
  %16 = getelementptr inbounds i8, ptr %4, i64 68
  %17 = getelementptr inbounds i8, ptr %4, i64 32
  %18 = getelementptr inbounds i8, ptr %0, i64 128
  br label %19

19:                                               ; preds = %140, %5
  %.0 = phi i1 [ undef, %5 ], [ %.5, %140 ]
  %20 = call noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  br i1 %20, label %21, label %.thread66

21:                                               ; preds = %19
  %22 = call noundef i64 @_ZNK4ardb6Buffer12GetReadIndexEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  %23 = load i8, ptr %11, align 8, !tbaa !5
  switch i8 %23, label %133 [
    i8 0, label %.preheader
    i8 1, label %49
    i8 2, label %101
    i8 3, label %132
  ]

.preheader:                                       ; preds = %21
  %24 = call noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  br i1 %24, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.preheader, %28
  %25 = call noundef ptr @_ZNK4ardb6Buffer16GetRawReadBufferEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  %26 = load i8, ptr %25, align 1, !tbaa !19
  %27 = icmp eq i8 %26, 10
  br i1 %27, label %28, label %.critedge

28:                                               ; preds = %.lr.ph
  call void @_ZN4ardb6Buffer16AdvanceReadIndexEi(ptr noundef nonnull align 8 dereferenceable(33) %3, i32 noundef 1)
  %29 = call noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  br i1 %29, label %.lr.ph, label %.critedge, !llvm.loop !20

.critedge:                                        ; preds = %.lr.ph, %28, %.preheader
  %30 = call noundef zeroext i1 @_ZNK4ardb6Buffer8ReadableEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  br i1 %30, label %31, label %.thread66

31:                                               ; preds = %.critedge
  %32 = call noundef ptr @_ZNK4ardb6Buffer16GetRawReadBufferEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  %33 = load i8, ptr %32, align 1, !tbaa !19
  %.not = icmp eq i8 %33, 35
  br i1 %.not, label %41, label %34

34:                                               ; preds = %31
  store i32 -1, ptr %16, align 4, !tbaa !22
  %35 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef nonnull @.str)
  store i32 5, ptr %12, align 8, !tbaa !25
  %36 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %37 = call noundef zeroext i1 %36(i32 noundef 2)
  br i1 %37, label %38, label %.thread66

38:                                               ; preds = %34
  %39 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  %40 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %17) #9
  call void (i32, ptr, ptr, i32, ptr, ...) %39(i32 noundef 2, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__._ZN4ardb5codec14DirSyncDecoder6DecodeERNS_21ChannelHandlerContextEPNS_7ChannelERNS_6BufferERNS0_13DirSyncStatusE, i32 noundef 88, ptr noundef nonnull @.str.2, ptr noundef %40)
  br label %.thread66

41:                                               ; preds = %31
  call void @_ZN4ardb6Buffer16AdvanceReadIndexEi(ptr noundef nonnull align 8 dereferenceable(33) %3, i32 noundef 1)
  %42 = call noundef zeroext i1 @_ZN4ardb12BufferHelper12ReadFixInt64ERNS_6BufferERlb(ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(8) %18, i1 noundef zeroext true)
  br i1 %42, label %44, label %43

43:                                               ; preds = %41
  call void @_ZN4ardb6Buffer12SetReadIndexEm(ptr noundef nonnull align 8 dereferenceable(33) %3, i64 noundef %22)
  br label %.thread66

44:                                               ; preds = %41
  %45 = load i64, ptr %18, align 8, !tbaa !26
  %46 = icmp slt i64 %45, 1
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  store i32 4, ptr %12, align 8, !tbaa !25
  br label %.thread66

48:                                               ; preds = %44
  store i8 1, ptr %11, align 8, !tbaa !5
  store i32 1, ptr %12, align 8, !tbaa !25
  br label %140, !llvm.loop !27

49:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  %50 = call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  %51 = icmp ult i64 %50, 12
  br i1 %51, label %99, label %54

52:                                               ; preds = %62, %61, %57, %54
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %100

54:                                               ; preds = %49
  %55 = invoke noundef zeroext i1 @_ZN4ardb12BufferHelper13ReadVarStringERNS_6BufferERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %56 unwind label %52

56:                                               ; preds = %54
  br i1 %55, label %57, label %60

57:                                               ; preds = %56
  %58 = invoke noundef zeroext i1 @_ZN4ardb12BufferHelper12ReadFixInt64ERNS_6BufferERlb(ptr noundef nonnull align 8 dereferenceable(33) %3, ptr noundef nonnull align 8 dereferenceable(8) %13, i1 noundef zeroext true)
          to label %59 unwind label %52

59:                                               ; preds = %57
  br i1 %58, label %61, label %60

60:                                               ; preds = %59, %56
  call void @_ZN4ardb6Buffer12SetReadIndexEm(ptr noundef nonnull align 8 dereferenceable(33) %3, i64 noundef %22)
  br label %99

61:                                               ; preds = %59
  invoke void @_ZN4ardb5codec14DirSyncDecoder16CloseCurrentFileEv(ptr noundef nonnull align 8 dereferenceable(137) %0)
          to label %62 unwind label %52

62:                                               ; preds = %61
  %63 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %64 unwind label %52

64:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #9
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull @.str.3)
          to label %65 unwind label %89

65:                                               ; preds = %64
  invoke void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_RKS8_(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %7, ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %66 unwind label %91

66:                                               ; preds = %65
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #9
  %67 = invoke noundef zeroext i1 @_ZN4ardb9make_fileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %68 unwind label %94

68:                                               ; preds = %66
  %69 = load i64, ptr %13, align 8, !tbaa !28
  %70 = icmp sgt i64 %69, 0
  br i1 %70, label %71, label %96

71:                                               ; preds = %68
  %72 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  %73 = call noalias ptr @fopen(ptr noundef %72, ptr noundef nonnull @.str.4)
  store ptr %73, ptr %14, align 8, !tbaa !29
  %74 = icmp eq ptr %73, null
  br i1 %74, label %75, label %96

75:                                               ; preds = %71
  %76 = tail call ptr @__errno_location() #10
  %77 = load i32, ptr %76, align 4, !tbaa !30
  store i32 %77, ptr %16, align 4, !tbaa !22
  %78 = call ptr @strerror(i32 noundef %77) #9
  %79 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef %78)
          to label %80 unwind label %94

80:                                               ; preds = %75
  store i32 5, ptr %12, align 8, !tbaa !25
  %81 = invoke noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
          to label %82 unwind label %94

82:                                               ; preds = %80
  %83 = invoke noundef zeroext i1 %81(i32 noundef 2)
          to label %84 unwind label %94

84:                                               ; preds = %82
  br i1 %83, label %85, label %97

85:                                               ; preds = %84
  %86 = invoke noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
          to label %87 unwind label %94

87:                                               ; preds = %85
  %88 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  invoke void (i32, ptr, ptr, i32, ptr, ...) %86(i32 noundef 2, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__._ZN4ardb5codec14DirSyncDecoder6DecodeERNS_21ChannelHandlerContextEPNS_7ChannelERNS_6BufferERNS0_13DirSyncStatusE, i32 noundef 138, ptr noundef nonnull @.str.5, ptr noundef %88)
          to label %97 unwind label %94

89:                                               ; preds = %64
  %90 = landingpad { ptr, i32 }
          cleanup
  br label %93

91:                                               ; preds = %65
  %92 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #9
  br label %93

93:                                               ; preds = %91, %89
  %.pn = phi { ptr, i32 } [ %92, %91 ], [ %90, %89 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #9
  br label %98

94:                                               ; preds = %87, %85, %82, %80, %75, %66
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  br label %98

96:                                               ; preds = %71, %68
  store i8 2, ptr %11, align 8, !tbaa !5
  store i32 2, ptr %12, align 8, !tbaa !25
  br label %97, !llvm.loop !27

97:                                               ; preds = %84, %87, %96
  %.056 = phi i32 [ 2, %96 ], [ 1, %87 ], [ 1, %84 ]
  %.1 = phi i1 [ %.0, %96 ], [ true, %87 ], [ true, %84 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #9
  br label %99

98:                                               ; preds = %94, %93
  %.pn62 = phi { ptr, i32 } [ %95, %94 ], [ %.pn, %93 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #9
  br label %100

99:                                               ; preds = %49, %97, %60
  %.157 = phi i32 [ %.056, %97 ], [ 1, %60 ], [ 1, %49 ]
  %.2 = phi i1 [ %.1, %97 ], [ false, %60 ], [ false, %49 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #9
  br label %140

100:                                              ; preds = %98, %52
  %.pn62.pn = phi { ptr, i32 } [ %.pn62, %98 ], [ %53, %52 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #9
  resume { ptr, i32 } %.pn62.pn

101:                                              ; preds = %21
  %102 = load i64, ptr %13, align 8, !tbaa !28
  %103 = icmp sgt i64 %102, 0
  br i1 %103, label %104, label %123

104:                                              ; preds = %101
  %105 = call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  %106 = icmp ult i64 %105, %102
  br i1 %106, label %107, label %109

107:                                              ; preds = %104
  %108 = call noundef i64 @_ZNK4ardb6Buffer13ReadableBytesEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  br label %109

109:                                              ; preds = %107, %104
  %.049 = phi i64 [ %108, %107 ], [ %102, %104 ]
  %110 = call noundef ptr @_ZNK4ardb6Buffer16GetRawReadBufferEv(ptr noundef nonnull align 8 dereferenceable(33) %3)
  %111 = load ptr, ptr %14, align 8, !tbaa !29
  %112 = call i64 @fwrite(ptr noundef %110, i64 noundef %.049, i64 noundef 1, ptr noundef %111)
  %113 = trunc i64 %112 to i32
  %114 = icmp sgt i32 %113, 0
  br i1 %114, label %.thread, label %118

.thread:                                          ; preds = %109
  %115 = load i64, ptr %13, align 8, !tbaa !28
  %116 = sub i64 %115, %.049
  store i64 %116, ptr %13, align 8, !tbaa !28
  %117 = trunc i64 %.049 to i32
  call void @_ZN4ardb6Buffer16AdvanceReadIndexEi(ptr noundef nonnull align 8 dereferenceable(33) %3, i32 noundef %117)
  %.pr = load i64, ptr %13, align 8, !tbaa !28
  br label %123

118:                                              ; preds = %109
  %119 = tail call ptr @__errno_location() #10
  %120 = load i32, ptr %119, align 4, !tbaa !30
  store i32 %120, ptr %16, align 4, !tbaa !22
  %121 = call ptr @strerror(i32 noundef %120) #9
  %122 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %17, ptr noundef %121)
  store i32 5, ptr %12, align 8, !tbaa !25
  br label %.thread66

123:                                              ; preds = %.thread, %101
  %124 = phi i64 [ %.pr, %.thread ], [ %102, %101 ]
  %125 = icmp eq i64 %124, 0
  br i1 %125, label %126, label %140, !llvm.loop !27

126:                                              ; preds = %123
  call void @_ZN4ardb5codec14DirSyncDecoder16CloseCurrentFileEv(ptr noundef nonnull align 8 dereferenceable(137) %0)
  %127 = load i64, ptr %18, align 8, !tbaa !26
  %128 = add nsw i64 %127, -1
  store i64 %128, ptr %18, align 8, !tbaa !26
  %129 = icmp eq i64 %128, 0
  br i1 %129, label %130, label %131

130:                                              ; preds = %126
  store i8 4, ptr %11, align 8, !tbaa !5
  store i32 4, ptr %12, align 8, !tbaa !25
  br label %.thread66

131:                                              ; preds = %126
  store i8 3, ptr %11, align 8, !tbaa !5
  store i32 3, ptr %12, align 8, !tbaa !25
  br label %.thread66

132:                                              ; preds = %21
  store i8 1, ptr %11, align 8, !tbaa !5
  store i32 1, ptr %12, align 8, !tbaa !25
  br label %140, !llvm.loop !27

133:                                              ; preds = %21
  %134 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv()
  %135 = call noundef zeroext i1 %134(i32 noundef 2)
  br i1 %135, label %136, label %.thread66

136:                                              ; preds = %133
  %137 = call noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv()
  %138 = load i8, ptr %11, align 8, !tbaa !5
  %139 = zext i8 %138 to i32
  call void (i32, ptr, ptr, i32, ptr, ...) %137(i32 noundef 2, ptr noundef nonnull @.str.1, ptr noundef nonnull @__FUNCTION__._ZN4ardb5codec14DirSyncDecoder6DecodeERNS_21ChannelHandlerContextEPNS_7ChannelERNS_6BufferERNS0_13DirSyncStatusE, i32 noundef 195, ptr noundef nonnull @.str.6, i32 noundef %139)
  br label %.thread66

140:                                              ; preds = %123, %132, %99, %48
  %.359 = phi i32 [ 2, %132 ], [ %.157, %99 ], [ 2, %48 ], [ 2, %123 ]
  %.5 = phi i1 [ %.0, %132 ], [ %.2, %99 ], [ %.0, %48 ], [ %.0, %123 ]
  %switch = icmp eq i32 %.359, 1
  br i1 %switch, label %.thread66, label %19

.thread66:                                        ; preds = %.critedge, %19, %140, %133, %136, %130, %131, %34, %38, %43, %47, %118
  %.6 = phi i1 [ false, %133 ], [ false, %136 ], [ true, %130 ], [ true, %131 ], [ true, %34 ], [ true, %38 ], [ false, %43 ], [ true, %47 ], [ true, %118 ], [ false, %.critedge ], [ true, %19 ], [ %.5, %140 ]
  ret i1 %.6
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #0 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 #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #0 align 2

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogCheckerEv() local_unnamed_addr #3

declare noundef ptr @_ZN4ardb10ArdbLogger13GetLogHandlerEv() local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

declare noundef zeroext i1 @_ZN4ardb12BufferHelper12ReadFixInt64ERNS_6BufferERlb(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

declare i32 @__gxx_personality_v0(...)

declare noundef zeroext i1 @_ZN4ardb12BufferHelper13ReadVarStringERNS_6BufferERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(33), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_RKS8_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_PKS5_(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #4 align 2

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

declare noundef zeroext i1 @_ZN4ardb9make_fileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #6

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #8

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6

attributes #0 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 #6 = { nofree 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 #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { 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, !13, i64 136}
!6 = !{!"_ZTSN4ardb5codec14DirSyncDecoderE", !7, i64 0, !17, i64 48, !17, i64 80, !12, i64 112, !15, i64 120, !15, i64 128, !13, i64 136}
!7 = !{!"_ZTSN4ardb5codec17StackFrameDecoderINS0_13DirSyncStatusEEE", !8, i64 0, !11, i64 8}
!8 = !{!"_ZTSN4ardb22ChannelUpstreamHandlerINS_6BufferEEE", !9, i64 0}
!9 = !{!"_ZTSN4ardb22AbstractChannelHandlerINS_6BufferEEE", !10, i64 0}
!10 = !{!"_ZTSN4ardb14ChannelHandlerE"}
!11 = !{!"_ZTSN4ardb6BufferE", !12, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !16, i64 32}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"long", !13, i64 0}
!16 = !{!"bool", !13, i64 0}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !15, i64 8, !13, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !12, i64 0}
!19 = !{!13, !13, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !24, i64 68}
!23 = !{!"_ZTSN4ardb5codec13DirSyncStatusE", !17, i64 0, !17, i64 32, !24, i64 64, !24, i64 68}
!24 = !{!"int", !13, i64 0}
!25 = !{!23, !24, i64 64}
!26 = !{!6, !15, i64 128}
!27 = distinct !{!27, !21}
!28 = !{!6, !15, i64 120}
!29 = !{!6, !12, i64 112}
!30 = !{!24, !24, i64 0}


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