; LLVM IR from mkazhdan/DMG :: Util/MultiStreamIO.ll (ZN19FixedIOClientStream7ServiceEv)

; 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.FixedIOClientStream = type { %class.IOClient, i32, ptr, ptr, i32, i32, i32, i32, ptr, i8, i32, i32, i32 }
%class.IOClient = type { ptr, %"class.boost::recursive_timed_mutex", ptr }
%"class.boost::recursive_timed_mutex" = type <{ %union.pthread_mutex_t, %union.pthread_cond_t, i8, [7 x i8], i64, i32, [4 x i8] }>
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }

@_ZN8IOClient10WriteBytesE = external global i64, align 8
@_ZN8IOClient9ReadBytesE = external global i64, align 8
@_ZN8IOClient16BYTES_PER_SECTORE = external constant i32, align 4
@.str.23 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [33 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z20EnterCriticalSectionPN5boost21recursive_timed_mutexExPKc(ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z14SeekFileHandleP11_FileHandlex(ptr noundef, i64 noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_Z14ReadFileHandleP11_FileHandlePhx(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN19FixedIOClientStream7ServiceEv(ptr noundef nonnull align 8 dereferenceable(192) %0) unnamed_addr #3 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %21 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %22 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %23 = load i32, ptr %22, align 8, !tbaa !9
  store i32 %23, ptr %5, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %24 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 1
  %25 = load i32, ptr %24, align 8, !tbaa !17
  store i32 %25, ptr %6, align 4, !tbaa !16
  %26 = getelementptr inbounds %class.IOClient, ptr %21, i32 0, i32 1
  call void @_Z20EnterCriticalSectionPN5boost21recursive_timed_mutexExPKc(ptr noundef %26, i64 noundef 100, ptr noundef @.str.23)
  %27 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 11
  %28 = load i32, ptr %27, align 8, !tbaa !18
  %29 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 4
  %30 = load i32, ptr %29, align 8, !tbaa !19
  %31 = icmp slt i32 %28, %30
  br i1 %31, label %32, label %143

32:                                               ; preds = %1
  %33 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 11
  %34 = load i32, ptr %33, align 8, !tbaa !18
  %35 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %36 = load i32, ptr %35, align 8, !tbaa !9
  %37 = add nsw i32 %34, %36
  %38 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %39 = load i32, ptr %38, align 4, !tbaa !20
  %40 = sub nsw i32 %37, %39
  %41 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %42 = load i32, ptr %41, align 8, !tbaa !9
  %43 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 7
  %44 = load i32, ptr %43, align 4, !tbaa !21
  %45 = mul nsw i32 %42, %44
  %46 = icmp sle i32 %40, %45
  br i1 %46, label %47, label %143

47:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %48 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 11
  %49 = load i32, ptr %48, align 8, !tbaa !18
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 5
  %52 = load i32, ptr %51, align 4, !tbaa !22
  %53 = sext i32 %52 to i64
  %54 = mul nsw i64 %50, %53
  store i64 %54, ptr %7, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %55 = load i64, ptr %7, align 8, !tbaa !23
  %56 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %57 = sext i32 %56 to i64
  %58 = sdiv i64 %55, %57
  %59 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %60 = sext i32 %59 to i64
  %61 = mul nsw i64 %58, %60
  store i64 %61, ptr %8, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %62 = load i64, ptr %7, align 8, !tbaa !23
  %63 = load i64, ptr %8, align 8, !tbaa !23
  %64 = sub nsw i64 %62, %63
  %65 = trunc i64 %64 to i32
  store i32 %65, ptr %9, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %66 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 11
  %67 = load i32, ptr %66, align 8, !tbaa !18
  %68 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %69 = load i32, ptr %68, align 8, !tbaa !9
  %70 = sdiv i32 %67, %69
  %71 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 7
  %72 = load i32, ptr %71, align 4, !tbaa !21
  %73 = srem i32 %70, %72
  store i32 %73, ptr %10, align 4, !tbaa !16
  %74 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 9
  %75 = load i8, ptr %74, align 8, !tbaa !25, !range !26, !noundef !27
  %76 = trunc i8 %75 to i1
  br i1 %76, label %77, label %131

77:                                               ; preds = %47
  %78 = getelementptr inbounds %class.IOClient, ptr %21, i32 0, i32 1
  call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef %78)
  %79 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 11
  %80 = load i32, ptr %79, align 8, !tbaa !18
  %81 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %82 = load i32, ptr %81, align 8, !tbaa !9
  %83 = add nsw i32 %80, %82
  %84 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 4
  %85 = load i32, ptr %84, align 8, !tbaa !19
  %86 = icmp sle i32 %83, %85
  br i1 %86, label %87, label %90

87:                                               ; preds = %77
  %88 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %89 = load i32, ptr %88, align 8, !tbaa !9
  store i32 %89, ptr %5, align 4, !tbaa !16
  br label %96

90:                                               ; preds = %77
  %91 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 4
  %92 = load i32, ptr %91, align 8, !tbaa !19
  %93 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 11
  %94 = load i32, ptr %93, align 8, !tbaa !18
  %95 = sub nsw i32 %92, %94
  store i32 %95, ptr %5, align 4, !tbaa !16
  br label %96

96:                                               ; preds = %90, %87
  %97 = load i32, ptr %9, align 4, !tbaa !16
  %98 = load i32, ptr %5, align 4, !tbaa !16
  %99 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 5
  %100 = load i32, ptr %99, align 4, !tbaa !22
  %101 = mul nsw i32 %98, %100
  %102 = add nsw i32 %97, %101
  %103 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %104 = add nsw i32 %102, %103
  %105 = sub nsw i32 %104, 1
  %106 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %107 = sdiv i32 %105, %106
  %108 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %109 = mul nsw i32 %107, %108
  store i32 %109, ptr %6, align 4, !tbaa !16
  %110 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 8
  %111 = load ptr, ptr %110, align 8, !tbaa !28
  %112 = load i64, ptr %8, align 8, !tbaa !23
  %113 = call noundef zeroext i1 @_Z14SeekFileHandleP11_FileHandlex(ptr noundef %111, i64 noundef %112)
  %114 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 8
  %115 = load ptr, ptr %114, align 8, !tbaa !28
  %116 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 3
  %117 = load ptr, ptr %116, align 8, !tbaa !29
  %118 = load i32, ptr %10, align 4, !tbaa !16
  %119 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 1
  %120 = load i32, ptr %119, align 8, !tbaa !17
  %121 = mul nsw i32 %118, %120
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i8, ptr %117, i64 %122
  %124 = load i32, ptr %6, align 4, !tbaa !16
  %125 = sext i32 %124 to i64
  %126 = call noundef i64 @_Z14ReadFileHandleP11_FileHandlePhx(ptr noundef %115, ptr noundef %123, i64 noundef %125)
  store i64 %126, ptr %4, align 8, !tbaa !23
  %127 = load i64, ptr %4, align 8, !tbaa !23
  %128 = load i64, ptr @_ZN8IOClient9ReadBytesE, align 8, !tbaa !23
  %129 = add nsw i64 %128, %127
  store i64 %129, ptr @_ZN8IOClient9ReadBytesE, align 8, !tbaa !23
  %130 = getelementptr inbounds %class.IOClient, ptr %21, i32 0, i32 1
  call void @_Z20EnterCriticalSectionPN5boost21recursive_timed_mutexExPKc(ptr noundef %130, i64 noundef 100, ptr noundef @.str.24)
  br label %131

131:                                              ; preds = %96, %47
  %132 = load i32, ptr %9, align 4, !tbaa !16
  %133 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !30
  %135 = load i32, ptr %10, align 4, !tbaa !16
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %134, i64 %136
  store i32 %132, ptr %137, align 4, !tbaa !16
  %138 = load i32, ptr %5, align 4, !tbaa !16
  %139 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 11
  %140 = load i32, ptr %139, align 8, !tbaa !18
  %141 = add nsw i32 %140, %138
  store i32 %141, ptr %139, align 8, !tbaa !18
  %142 = getelementptr inbounds %class.IOClient, ptr %21, i32 0, i32 1
  call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef %142)
  store i32 1, ptr %2, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %338

143:                                              ; preds = %32, %1
  %144 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %145 = load i32, ptr %144, align 4, !tbaa !20
  %146 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %147 = load i32, ptr %146, align 8, !tbaa !9
  %148 = add nsw i32 %145, %147
  %149 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 10
  %150 = load i32, ptr %149, align 4, !tbaa !31
  %151 = icmp sle i32 %148, %150
  br i1 %151, label %158, label %152

152:                                              ; preds = %143
  %153 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 10
  %154 = load i32, ptr %153, align 4, !tbaa !31
  %155 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 4
  %156 = load i32, ptr %155, align 8, !tbaa !19
  %157 = icmp sge i32 %154, %156
  br i1 %157, label %158, label %328

158:                                              ; preds = %152, %143
  %159 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %160 = load i32, ptr %159, align 4, !tbaa !20
  %161 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 4
  %162 = load i32, ptr %161, align 8, !tbaa !19
  %163 = icmp slt i32 %160, %162
  br i1 %163, label %164, label %328

164:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %165 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %166 = load i32, ptr %165, align 4, !tbaa !20
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 5
  %169 = load i32, ptr %168, align 4, !tbaa !22
  %170 = sext i32 %169 to i64
  %171 = mul nsw i64 %167, %170
  store i64 %171, ptr %12, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %172 = load i64, ptr %12, align 8, !tbaa !23
  %173 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %174 = sext i32 %173 to i64
  %175 = sdiv i64 %172, %174
  %176 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %177 = sext i32 %176 to i64
  %178 = mul nsw i64 %175, %177
  store i64 %178, ptr %13, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %179 = load i64, ptr %12, align 8, !tbaa !23
  %180 = load i64, ptr %13, align 8, !tbaa !23
  %181 = sub nsw i64 %179, %180
  %182 = trunc i64 %181 to i32
  store i32 %182, ptr %14, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %183 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %184 = load i32, ptr %183, align 4, !tbaa !20
  %185 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %186 = load i32, ptr %185, align 8, !tbaa !9
  %187 = sdiv i32 %184, %186
  %188 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 7
  %189 = load i32, ptr %188, align 4, !tbaa !21
  %190 = srem i32 %187, %189
  store i32 %190, ptr %15, align 4, !tbaa !16
  %191 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 9
  %192 = load i8, ptr %191, align 8, !tbaa !25, !range !26, !noundef !27
  %193 = trunc i8 %192 to i1
  br i1 %193, label %248, label %194

194:                                              ; preds = %164
  %195 = getelementptr inbounds %class.IOClient, ptr %21, i32 0, i32 1
  call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef %195)
  %196 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %197 = load i32, ptr %196, align 4, !tbaa !20
  %198 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %199 = load i32, ptr %198, align 8, !tbaa !9
  %200 = add nsw i32 %197, %199
  %201 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 4
  %202 = load i32, ptr %201, align 8, !tbaa !19
  %203 = icmp sle i32 %200, %202
  br i1 %203, label %204, label %207

204:                                              ; preds = %194
  %205 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %206 = load i32, ptr %205, align 8, !tbaa !9
  store i32 %206, ptr %5, align 4, !tbaa !16
  br label %213

207:                                              ; preds = %194
  %208 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 4
  %209 = load i32, ptr %208, align 8, !tbaa !19
  %210 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %211 = load i32, ptr %210, align 4, !tbaa !20
  %212 = sub nsw i32 %209, %211
  store i32 %212, ptr %5, align 4, !tbaa !16
  br label %213

213:                                              ; preds = %207, %204
  %214 = load i32, ptr %14, align 4, !tbaa !16
  %215 = load i32, ptr %5, align 4, !tbaa !16
  %216 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 5
  %217 = load i32, ptr %216, align 4, !tbaa !22
  %218 = mul nsw i32 %215, %217
  %219 = add nsw i32 %214, %218
  %220 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %221 = add nsw i32 %219, %220
  %222 = sub nsw i32 %221, 1
  %223 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %224 = sdiv i32 %222, %223
  %225 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %226 = mul nsw i32 %224, %225
  store i32 %226, ptr %6, align 4, !tbaa !16
  %227 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 8
  %228 = load ptr, ptr %227, align 8, !tbaa !28
  %229 = load i64, ptr %13, align 8, !tbaa !23
  %230 = call noundef zeroext i1 @_Z14SeekFileHandleP11_FileHandlex(ptr noundef %228, i64 noundef %229)
  %231 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 8
  %232 = load ptr, ptr %231, align 8, !tbaa !28
  %233 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 3
  %234 = load ptr, ptr %233, align 8, !tbaa !29
  %235 = load i32, ptr %15, align 4, !tbaa !16
  %236 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 1
  %237 = load i32, ptr %236, align 8, !tbaa !17
  %238 = mul nsw i32 %235, %237
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds i8, ptr %234, i64 %239
  %241 = load i32, ptr %6, align 4, !tbaa !16
  %242 = sext i32 %241 to i64
  %243 = call noundef i64 @_Z15WriteFileHandleP11_FileHandlePhx(ptr noundef %232, ptr noundef %240, i64 noundef %242)
  store i64 %243, ptr %4, align 8, !tbaa !23
  %244 = load i64, ptr %4, align 8, !tbaa !23
  %245 = load i64, ptr @_ZN8IOClient10WriteBytesE, align 8, !tbaa !23
  %246 = add nsw i64 %245, %244
  store i64 %246, ptr @_ZN8IOClient10WriteBytesE, align 8, !tbaa !23
  %247 = getelementptr inbounds %class.IOClient, ptr %21, i32 0, i32 1
  call void @_Z20EnterCriticalSectionPN5boost21recursive_timed_mutexExPKc(ptr noundef %247, i64 noundef 100, ptr noundef @.str.25)
  br label %248

248:                                              ; preds = %213, %164
  %249 = load i32, ptr %5, align 4, !tbaa !16
  %250 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %251 = load i32, ptr %250, align 4, !tbaa !20
  %252 = add nsw i32 %251, %249
  store i32 %252, ptr %250, align 4, !tbaa !20
  %253 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 9
  %254 = load i8, ptr %253, align 8, !tbaa !25, !range !26, !noundef !27
  %255 = trunc i8 %254 to i1
  br i1 %255, label %326, label %256

256:                                              ; preds = %248
  %257 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %258 = load i32, ptr %257, align 4, !tbaa !20
  %259 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 4
  %260 = load i32, ptr %259, align 8, !tbaa !19
  %261 = icmp slt i32 %258, %260
  br i1 %261, label %262, label %326

262:                                              ; preds = %256
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %263 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %264 = load i32, ptr %263, align 4, !tbaa !20
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 5
  %267 = load i32, ptr %266, align 4, !tbaa !22
  %268 = sext i32 %267 to i64
  %269 = mul nsw i64 %265, %268
  store i64 %269, ptr %16, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %270 = load i64, ptr %16, align 8, !tbaa !23
  %271 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %272 = sext i32 %271 to i64
  %273 = sdiv i64 %270, %272
  %274 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %275 = sext i32 %274 to i64
  %276 = mul nsw i64 %273, %275
  store i64 %276, ptr %17, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %277 = load i64, ptr %16, align 8, !tbaa !23
  %278 = load i64, ptr %17, align 8, !tbaa !23
  %279 = sub nsw i64 %277, %278
  %280 = trunc i64 %279 to i32
  store i32 %280, ptr %18, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %281 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %282 = load i32, ptr %281, align 4, !tbaa !20
  %283 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 6
  %284 = load i32, ptr %283, align 8, !tbaa !9
  %285 = sdiv i32 %282, %284
  %286 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 7
  %287 = load i32, ptr %286, align 4, !tbaa !21
  %288 = srem i32 %285, %287
  store i32 %288, ptr %19, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %289 = load i32, ptr %19, align 4, !tbaa !16
  %290 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 7
  %291 = load i32, ptr %290, align 4, !tbaa !21
  %292 = add nsw i32 %289, %291
  %293 = sub nsw i32 %292, 1
  %294 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 7
  %295 = load i32, ptr %294, align 4, !tbaa !21
  %296 = srem i32 %293, %295
  store i32 %296, ptr %20, align 4, !tbaa !16
  %297 = load i32, ptr %18, align 4, !tbaa !16
  %298 = icmp ne i32 %297, 0
  br i1 %298, label %299, label %325

299:                                              ; preds = %262
  %300 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 3
  %301 = load ptr, ptr %300, align 8, !tbaa !29
  %302 = load i32, ptr %19, align 4, !tbaa !16
  %303 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 1
  %304 = load i32, ptr %303, align 8, !tbaa !17
  %305 = mul nsw i32 %302, %304
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds i8, ptr %301, i64 %306
  %308 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 3
  %309 = load ptr, ptr %308, align 8, !tbaa !29
  %310 = load i32, ptr %20, align 4, !tbaa !16
  %311 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 1
  %312 = load i32, ptr %311, align 8, !tbaa !17
  %313 = mul nsw i32 %310, %312
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds i8, ptr %309, i64 %314
  %316 = load i32, ptr %6, align 4, !tbaa !16
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds i8, ptr %315, i64 %317
  %319 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %320 = sext i32 %319 to i64
  %321 = sub i64 0, %320
  %322 = getelementptr inbounds i8, ptr %318, i64 %321
  %323 = load i32, ptr %18, align 4, !tbaa !16
  %324 = sext i32 %323 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %307, ptr align 1 %322, i64 %324, i1 false)
  br label %325

325:                                              ; preds = %299, %262
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %326

326:                                              ; preds = %325, %256, %248
  %327 = getelementptr inbounds %class.IOClient, ptr %21, i32 0, i32 1
  call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef %327)
  store i32 1, ptr %2, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %338

328:                                              ; preds = %158, %152
  %329 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 12
  %330 = load i32, ptr %329, align 4, !tbaa !20
  %331 = getelementptr inbounds %class.FixedIOClientStream, ptr %21, i32 0, i32 4
  %332 = load i32, ptr %331, align 8, !tbaa !19
  %333 = icmp sge i32 %330, %332
  br i1 %333, label %334, label %336

334:                                              ; preds = %328
  %335 = getelementptr inbounds %class.IOClient, ptr %21, i32 0, i32 1
  call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef %335)
  store i32 2, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %338

336:                                              ; preds = %328
  %337 = getelementptr inbounds %class.IOClient, ptr %21, i32 0, i32 1
  call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef %337)
  store i32 0, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %338

338:                                              ; preds = %336, %334, %326, %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %339 = load i32, ptr %2, align 4
  ret i32 %339
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_Z15WriteFileHandleP11_FileHandlePhx(ptr noundef, ptr noundef, i64 noundef) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !15, i64 160}
!10 = !{!"_ZTS19FixedIOClientStream", !11, i64 0, !15, i64 128, !6, i64 136, !6, i64 144, !15, i64 152, !15, i64 156, !15, i64 160, !15, i64 164, !6, i64 168, !13, i64 176, !15, i64 180, !15, i64 184, !15, i64 188}
!11 = !{!"_ZTS8IOClient", !12, i64 8, !6, i64 120}
!12 = !{!"_ZTSN5boost21recursive_timed_mutexE", !7, i64 0, !7, i64 40, !13, i64 88, !14, i64 96, !15, i64 104}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!15, !15, i64 0}
!17 = !{!10, !15, i64 128}
!18 = !{!10, !15, i64 184}
!19 = !{!10, !15, i64 152}
!20 = !{!10, !15, i64 188}
!21 = !{!10, !15, i64 164}
!22 = !{!10, !15, i64 156}
!23 = !{!24, !24, i64 0}
!24 = !{!"long long", !7, i64 0}
!25 = !{!10, !13, i64 176}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!10, !6, i64 168}
!29 = !{!10, !6, i64 144}
!30 = !{!10, !6, i64 136}
!31 = !{!10, !15, i64 180}


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

@_ZN8IOClient10WriteBytesE = external local_unnamed_addr global i64, align 8
@_ZN8IOClient9ReadBytesE = external local_unnamed_addr global i64, align 8
@_ZN8IOClient16BYTES_PER_SECTORE = external local_unnamed_addr constant i32, align 4
@.str.23 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [33 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_Z20EnterCriticalSectionPN5boost21recursive_timed_mutexExPKc(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z14SeekFileHandleP11_FileHandlex(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_Z14ReadFileHandleP11_FileHandlePhx(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 3) i32 @_ZN19FixedIOClientStream7ServiceEv(ptr noundef nonnull align 8 dereferenceable(192) %0) unnamed_addr #2 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 160
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 128
  %5 = load i32, ptr %4, align 8, !tbaa !15
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_Z20EnterCriticalSectionPN5boost21recursive_timed_mutexExPKc(ptr noundef nonnull %6, i64 noundef 100, ptr noundef nonnull @.str.23)
  %7 = getelementptr inbounds i8, ptr %0, i64 184
  %8 = load i32, ptr %7, align 8, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %0, i64 152
  %10 = load i32, ptr %9, align 8
  %11 = icmp slt i32 %8, %10
  br i1 %11, label %12, label %._crit_edge

._crit_edge:                                      ; preds = %1
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 188
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !17
  %.pre59 = load i32, ptr %2, align 8, !tbaa !5
  br label %71

12:                                               ; preds = %1
  %13 = load i32, ptr %2, align 8, !tbaa !5
  %14 = add nsw i32 %13, %8
  %15 = getelementptr inbounds i8, ptr %0, i64 188
  %16 = load i32, ptr %15, align 4, !tbaa !17
  %17 = sub i32 %14, %16
  %18 = getelementptr inbounds i8, ptr %0, i64 164
  %19 = load i32, ptr %18, align 4, !tbaa !18
  %20 = mul nsw i32 %19, %13
  %.not = icmp sgt i32 %17, %20
  br i1 %.not, label %71, label %21

21:                                               ; preds = %12
  %22 = sext i32 %8 to i64
  %23 = getelementptr inbounds i8, ptr %0, i64 156
  %24 = load i32, ptr %23, align 4, !tbaa !19
  %25 = sext i32 %24 to i64
  %26 = mul nsw i64 %25, %22
  %.fr49 = freeze i64 %26
  %27 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !20
  %28 = sext i32 %27 to i64
  %29 = srem i64 %.fr49, %28
  %30 = trunc nsw i64 %29 to i32
  %31 = sdiv i32 %8, %13
  %32 = srem i32 %31, %19
  %33 = getelementptr inbounds i8, ptr %0, i64 176
  %34 = load i8, ptr %33, align 8, !tbaa !21, !range !22, !noundef !23
  %35 = trunc nuw i8 %34 to i1
  br i1 %35, label %36, label %64

36:                                               ; preds = %21
  %37 = sub nsw i64 %.fr49, %29
  tail call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef nonnull %6)
  %38 = load i32, ptr %7, align 8, !tbaa !16
  %39 = load i32, ptr %2, align 8, !tbaa !5
  %40 = add nsw i32 %39, %38
  %41 = load i32, ptr %9, align 8, !tbaa !24
  %.not50 = icmp sgt i32 %40, %41
  %42 = sub nsw i32 %41, %38
  %.032 = select i1 %.not50, i32 %42, i32 %39
  %43 = load i32, ptr %23, align 4, !tbaa !19
  %44 = mul nsw i32 %.032, %43
  %45 = add i32 %27, %30
  %46 = add i32 %45, %44
  %.fr52 = freeze i32 %46
  %47 = add i32 %.fr52, -1
  %48 = srem i32 %47, %27
  %49 = sub nsw i32 %47, %48
  %50 = getelementptr inbounds i8, ptr %0, i64 168
  %51 = load ptr, ptr %50, align 8, !tbaa !25
  %52 = tail call noundef zeroext i1 @_Z14SeekFileHandleP11_FileHandlex(ptr noundef %51, i64 noundef %37)
  %53 = load ptr, ptr %50, align 8, !tbaa !25
  %54 = getelementptr inbounds i8, ptr %0, i64 144
  %55 = load ptr, ptr %54, align 8, !tbaa !26
  %56 = load i32, ptr %4, align 8, !tbaa !15
  %57 = mul nsw i32 %56, %32
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i8, ptr %55, i64 %58
  %60 = sext i32 %49 to i64
  %61 = tail call noundef i64 @_Z14ReadFileHandleP11_FileHandlePhx(ptr noundef %53, ptr noundef %59, i64 noundef %60)
  %62 = load i64, ptr @_ZN8IOClient9ReadBytesE, align 8, !tbaa !27
  %63 = add nsw i64 %62, %61
  store i64 %63, ptr @_ZN8IOClient9ReadBytesE, align 8, !tbaa !27
  tail call void @_Z20EnterCriticalSectionPN5boost21recursive_timed_mutexExPKc(ptr noundef nonnull %6, i64 noundef 100, ptr noundef nonnull @.str.24)
  br label %64

64:                                               ; preds = %36, %21
  %.1 = phi i32 [ %.032, %36 ], [ %3, %21 ]
  %65 = getelementptr inbounds i8, ptr %0, i64 136
  %66 = load ptr, ptr %65, align 8, !tbaa !29
  %67 = sext i32 %32 to i64
  %68 = getelementptr inbounds i32, ptr %66, i64 %67
  store i32 %30, ptr %68, align 4, !tbaa !20
  %69 = load i32, ptr %7, align 8, !tbaa !16
  %70 = add nsw i32 %69, %.1
  store i32 %70, ptr %7, align 8, !tbaa !16
  tail call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef nonnull %6)
  br label %161

71:                                               ; preds = %._crit_edge, %12
  %72 = phi i32 [ %.pre59, %._crit_edge ], [ %13, %12 ]
  %73 = phi i32 [ %.pre, %._crit_edge ], [ %16, %12 ]
  %74 = getelementptr inbounds i8, ptr %0, i64 188
  %75 = add nsw i32 %72, %73
  %76 = getelementptr inbounds i8, ptr %0, i64 180
  %77 = load i32, ptr %76, align 4, !tbaa !30
  %.not41 = icmp sle i32 %75, %77
  %.not42 = icmp sge i32 %77, %10
  %or.cond.not57 = or i1 %.not41, %.not42
  %78 = icmp slt i32 %73, %10
  %or.cond56 = and i1 %78, %or.cond.not57
  br i1 %or.cond56, label %79, label %160

79:                                               ; preds = %71
  %80 = getelementptr inbounds i8, ptr %0, i64 156
  %81 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !20
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i8, ptr %0, i64 164
  %84 = getelementptr inbounds i8, ptr %0, i64 176
  %85 = load i8, ptr %84, align 8, !tbaa !21, !range !22, !noundef !23
  %86 = trunc nuw i8 %85 to i1
  br i1 %86, label %124, label %87

87:                                               ; preds = %79
  %88 = sdiv i32 %73, %72
  %89 = load i32, ptr %83, align 4, !tbaa !18
  %90 = srem i32 %88, %89
  %91 = sext i32 %73 to i64
  %92 = load i32, ptr %80, align 4, !tbaa !19
  %93 = sext i32 %92 to i64
  %94 = mul nsw i64 %93, %91
  %.fr = freeze i64 %94
  %95 = srem i64 %.fr, %82
  %96 = trunc nsw i64 %95 to i32
  %97 = sub nsw i64 %.fr, %95
  tail call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef nonnull %6)
  %98 = load i32, ptr %74, align 4, !tbaa !17
  %99 = load i32, ptr %2, align 8, !tbaa !5
  %100 = add nsw i32 %99, %98
  %101 = load i32, ptr %9, align 8, !tbaa !24
  %.not44 = icmp sgt i32 %100, %101
  %102 = sub nsw i32 %101, %98
  %.2 = select i1 %.not44, i32 %102, i32 %99
  %103 = load i32, ptr %80, align 4, !tbaa !19
  %104 = mul nsw i32 %.2, %103
  %105 = add i32 %81, %96
  %106 = add i32 %105, %104
  %.fr46 = freeze i32 %106
  %107 = add i32 %.fr46, -1
  %108 = srem i32 %107, %81
  %109 = sub nsw i32 %107, %108
  %110 = getelementptr inbounds i8, ptr %0, i64 168
  %111 = load ptr, ptr %110, align 8, !tbaa !25
  %112 = tail call noundef zeroext i1 @_Z14SeekFileHandleP11_FileHandlex(ptr noundef %111, i64 noundef %97)
  %113 = load ptr, ptr %110, align 8, !tbaa !25
  %114 = getelementptr inbounds i8, ptr %0, i64 144
  %115 = load ptr, ptr %114, align 8, !tbaa !26
  %116 = load i32, ptr %4, align 8, !tbaa !15
  %117 = mul nsw i32 %116, %90
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i8, ptr %115, i64 %118
  %120 = sext i32 %109 to i64
  %121 = tail call noundef i64 @_Z15WriteFileHandleP11_FileHandlePhx(ptr noundef %113, ptr noundef %119, i64 noundef %120)
  %122 = load i64, ptr @_ZN8IOClient10WriteBytesE, align 8, !tbaa !27
  %123 = add nsw i64 %122, %121
  store i64 %123, ptr @_ZN8IOClient10WriteBytesE, align 8, !tbaa !27
  tail call void @_Z20EnterCriticalSectionPN5boost21recursive_timed_mutexExPKc(ptr noundef nonnull %6, i64 noundef 100, ptr noundef nonnull @.str.25)
  %.pre60 = load i32, ptr %74, align 4, !tbaa !17
  %.pre61 = load i8, ptr %84, align 8, !tbaa !21, !range !22
  %.pre62 = load i32, ptr %9, align 8
  br label %124

124:                                              ; preds = %87, %79
  %125 = phi i32 [ %10, %79 ], [ %.pre62, %87 ]
  %126 = phi i8 [ %85, %79 ], [ %.pre61, %87 ]
  %127 = phi i32 [ %73, %79 ], [ %.pre60, %87 ]
  %.033 = phi i32 [ %5, %79 ], [ %109, %87 ]
  %.3 = phi i32 [ %3, %79 ], [ %.2, %87 ]
  %128 = add nsw i32 %127, %.3
  store i32 %128, ptr %74, align 4, !tbaa !17
  %129 = trunc nuw i8 %126 to i1
  %130 = icmp sge i32 %128, %125
  %or.cond55.not = select i1 %129, i1 true, i1 %130
  br i1 %or.cond55.not, label %159, label %131

131:                                              ; preds = %124
  %132 = sext i32 %128 to i64
  %133 = load i32, ptr %80, align 4, !tbaa !19
  %134 = sext i32 %133 to i64
  %135 = mul nsw i64 %134, %132
  %.fr47 = freeze i64 %135
  %136 = srem i64 %.fr47, %82
  %137 = and i64 %136, 4294967295
  %.not48 = icmp eq i64 %137, 0
  br i1 %.not48, label %159, label %138

138:                                              ; preds = %131
  %139 = load i32, ptr %2, align 8, !tbaa !5
  %140 = sdiv i32 %128, %139
  %141 = load i32, ptr %83, align 4, !tbaa !18
  %142 = srem i32 %140, %141
  %143 = add i32 %141, -1
  %144 = add i32 %143, %142
  %145 = srem i32 %144, %141
  %146 = getelementptr inbounds i8, ptr %0, i64 144
  %147 = load ptr, ptr %146, align 8, !tbaa !26
  %148 = load i32, ptr %4, align 8, !tbaa !15
  %149 = mul nsw i32 %148, %142
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds i8, ptr %147, i64 %150
  %152 = mul nsw i32 %148, %145
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i8, ptr %147, i64 %153
  %155 = sext i32 %.033 to i64
  %156 = getelementptr inbounds i8, ptr %154, i64 %155
  %157 = sub nsw i64 0, %82
  %158 = getelementptr inbounds i8, ptr %156, i64 %157
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %151, ptr nonnull align 1 %158, i64 %136, i1 false)
  br label %159

159:                                              ; preds = %131, %138, %124
  tail call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef nonnull %6)
  br label %161

160:                                              ; preds = %71
  tail call void @_Z20LeaveCriticalSectionPN5boost21recursive_timed_mutexE(ptr noundef nonnull %6)
  %. = select i1 %78, i32 0, i32 2
  br label %161

161:                                              ; preds = %160, %159, %64
  %.0 = phi i32 [ 1, %64 ], [ 1, %159 ], [ %., %160 ]
  ret i32 %.0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i64 @_Z15WriteFileHandleP11_FileHandlePhx(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !13, i64 160}
!6 = !{!"_ZTS19FixedIOClientStream", !7, i64 0, !13, i64 128, !14, i64 136, !14, i64 144, !13, i64 152, !13, i64 156, !13, i64 160, !13, i64 164, !14, i64 168, !11, i64 176, !13, i64 180, !13, i64 184, !13, i64 188}
!7 = !{!"_ZTS8IOClient", !8, i64 8, !14, i64 120}
!8 = !{!"_ZTSN5boost21recursive_timed_mutexE", !9, i64 0, !9, i64 40, !11, i64 88, !12, i64 96, !13, i64 104}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"bool", !9, i64 0}
!12 = !{!"long", !9, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!"any pointer", !9, i64 0}
!15 = !{!6, !13, i64 128}
!16 = !{!6, !13, i64 184}
!17 = !{!6, !13, i64 188}
!18 = !{!6, !13, i64 164}
!19 = !{!6, !13, i64 156}
!20 = !{!13, !13, i64 0}
!21 = !{!6, !11, i64 176}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!6, !13, i64 152}
!25 = !{!6, !14, i64 168}
!26 = !{!6, !14, i64 144}
!27 = !{!28, !28, i64 0}
!28 = !{!"long long", !9, i64 0}
!29 = !{!6, !14, i64 136}
!30 = !{!6, !13, i64 180}


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