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

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

@stderr = external global ptr, align 8
@_ZN8IOClient13IO_BLOCK_SIZEE = external constant i32, align 4
@_ZN8IOClient9ReadBytesE = external global i64, align 8
@_ZN8IOClient16BYTES_PER_SECTORE = external constant i32, align 4
@.str.20 = external hidden unnamed_addr constant [59 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: nounwind
declare void @free(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z12AllocPointerIhEPT_m(i64 noundef) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19FixedIOClientStream5ResetEbi(ptr noundef nonnull align 8 dereferenceable(192) %0, i1 noundef zeroext %1, i32 noundef %2) #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  %8 = zext i1 %1 to i8
  store i8 %8, ptr %5, align 1, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !11
  %9 = load ptr, ptr %4, align 8
  %10 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %11 = trunc i8 %10 to i1
  %12 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 9
  %13 = zext i1 %11 to i8
  store i8 %13, ptr %12, align 8, !tbaa !15
  %14 = load i32, ptr %6, align 4, !tbaa !11
  %15 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 4
  %16 = load i32, ptr %15, align 8, !tbaa !20
  %17 = icmp slt i32 %14, %16
  br i1 %17, label %18, label %20

18:                                               ; preds = %3
  %19 = load i32, ptr %6, align 4, !tbaa !11
  br label %23

20:                                               ; preds = %3
  %21 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 4
  %22 = load i32, ptr %21, align 8, !tbaa !20
  br label %23

23:                                               ; preds = %20, %18
  %24 = phi i32 [ %19, %18 ], [ %22, %20 ]
  %25 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 6
  store i32 %24, ptr %25, align 8, !tbaa !21
  br label %26

26:                                               ; preds = %42, %23
  %27 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 6
  %28 = load i32, ptr %27, align 8, !tbaa !21
  %29 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 5
  %30 = load i32, ptr %29, align 4, !tbaa !22
  %31 = mul nsw i32 %28, %30
  %32 = load i32, ptr @_ZN8IOClient13IO_BLOCK_SIZEE, align 4, !tbaa !11
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %34, label %40

34:                                               ; preds = %26
  %35 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 6
  %36 = load i32, ptr %35, align 8, !tbaa !21
  %37 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 4
  %38 = load i32, ptr %37, align 8, !tbaa !20
  %39 = icmp slt i32 %36, %38
  br label %40

40:                                               ; preds = %34, %26
  %41 = phi i1 [ false, %26 ], [ %39, %34 ]
  br i1 %41, label %42, label %46

42:                                               ; preds = %40
  %43 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 6
  %44 = load i32, ptr %43, align 8, !tbaa !21
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %43, align 8, !tbaa !21
  br label %26, !llvm.loop !23

46:                                               ; preds = %40
  %47 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 6
  %48 = load i32, ptr %47, align 8, !tbaa !21
  %49 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 5
  %50 = load i32, ptr %49, align 4, !tbaa !22
  %51 = mul nsw i32 %48, %50
  %52 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !11
  %53 = sub nsw i32 %52, 1
  %54 = add nsw i32 %51, %53
  %55 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !11
  %56 = sdiv i32 %54, %55
  %57 = add nsw i32 %56, 1
  %58 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !11
  %59 = mul nsw i32 %57, %58
  %60 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 1
  store i32 %59, ptr %60, align 8, !tbaa !25
  %61 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 6
  %62 = load i32, ptr %61, align 8, !tbaa !21
  %63 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 5
  %64 = load i32, ptr %63, align 4, !tbaa !22
  %65 = mul nsw i32 %62, %64
  %66 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !11
  %67 = srem i32 %65, %66
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %74, label %69

69:                                               ; preds = %46
  %70 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !11
  %71 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !25
  %73 = sub nsw i32 %72, %70
  store i32 %73, ptr %71, align 8, !tbaa !25
  br label %74

74:                                               ; preds = %69, %46
  %75 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 3
  %76 = load ptr, ptr %75, align 8, !tbaa !26
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %82

78:                                               ; preds = %74
  %79 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !26
  call void @free(ptr noundef %80) #6
  %81 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 3
  store ptr null, ptr %81, align 8, !tbaa !26
  br label %82

82:                                               ; preds = %78, %74
  %83 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 1
  %84 = load i32, ptr %83, align 8, !tbaa !25
  %85 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 7
  %86 = load i32, ptr %85, align 4, !tbaa !27
  %87 = mul nsw i32 %84, %86
  %88 = sext i32 %87 to i64
  %89 = call noundef ptr @_Z12AllocPointerIhEPT_m(i64 noundef %88)
  %90 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 3
  store ptr %89, ptr %90, align 8, !tbaa !26
  %91 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 3
  %92 = load ptr, ptr %91, align 8, !tbaa !26
  %93 = icmp ne ptr %92, null
  br i1 %93, label %101, label %94

94:                                               ; preds = %82
  %95 = load ptr, ptr @stderr, align 8, !tbaa !5
  %96 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 1
  %97 = load i32, ptr %96, align 8, !tbaa !25
  %98 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 7
  %99 = load i32, ptr %98, align 4, !tbaa !27
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.20, i32 noundef %97, i32 noundef %99) #6
  call void @exit(i32 noundef 0) #7
  unreachable

101:                                              ; preds = %82
  %102 = load i8, ptr %5, align 1, !tbaa !9, !range !13, !noundef !14
  %103 = trunc i8 %102 to i1
  br i1 %103, label %104, label %119

104:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %105 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 8
  %106 = load ptr, ptr %105, align 8, !tbaa !28
  %107 = call noundef zeroext i1 @_Z14SeekFileHandleP11_FileHandlex(ptr noundef %106, i64 noundef 0)
  %108 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 8
  %109 = load ptr, ptr %108, align 8, !tbaa !28
  %110 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 3
  %111 = load ptr, ptr %110, align 8, !tbaa !26
  %112 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 1
  %113 = load i32, ptr %112, align 8, !tbaa !25
  %114 = sext i32 %113 to i64
  %115 = call noundef i64 @_Z14ReadFileHandleP11_FileHandlePhx(ptr noundef %109, ptr noundef %111, i64 noundef %114)
  store i64 %115, ptr %7, align 8, !tbaa !29
  %116 = load i64, ptr %7, align 8, !tbaa !29
  %117 = load i64, ptr @_ZN8IOClient9ReadBytesE, align 8, !tbaa !29
  %118 = add nsw i64 %117, %116
  store i64 %118, ptr @_ZN8IOClient9ReadBytesE, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %119

119:                                              ; preds = %104, %101
  %120 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 10
  store i32 0, ptr %120, align 4, !tbaa !31
  %121 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 12
  store i32 0, ptr %121, align 4, !tbaa !32
  %122 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 6
  %123 = load i32, ptr %122, align 8, !tbaa !21
  %124 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 11
  store i32 %123, ptr %124, align 8, !tbaa !33
  %125 = getelementptr inbounds %class.FixedIOClientStream, ptr %9, i32 0, i32 2
  %126 = load ptr, ptr %125, align 8, !tbaa !34
  %127 = getelementptr inbounds i32, ptr %126, i64 0
  store i32 0, ptr %127, align 4, !tbaa !11
  ret void
}

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

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

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

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

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


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

@stderr = external local_unnamed_addr global ptr, align 8
@_ZN8IOClient13IO_BLOCK_SIZEE = external local_unnamed_addr constant i32, align 4
@_ZN8IOClient9ReadBytesE = external local_unnamed_addr global i64, align 8
@_ZN8IOClient16BYTES_PER_SECTORE = external local_unnamed_addr constant i32, align 4
@.str.20 = external hidden unnamed_addr constant [59 x i8], align 1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z12AllocPointerIhEPT_m(i64 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN19FixedIOClientStream5ResetEbi(ptr nocapture noundef nonnull align 8 dereferenceable(192) %0, i1 noundef zeroext %1, i32 noundef %2) local_unnamed_addr #4 align 2 {
  %4 = zext i1 %1 to i8
  %5 = getelementptr inbounds i8, ptr %0, i64 176
  store i8 %4, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 152
  %7 = load i32, ptr %6, align 8
  %. = tail call i32 @llvm.smin.i32(i32 %7, i32 %2)
  %8 = getelementptr inbounds i8, ptr %0, i64 156
  %9 = load i32, ptr %8, align 4, !tbaa !15
  %10 = load i32, ptr @_ZN8IOClient13IO_BLOCK_SIZEE, align 4, !tbaa !16
  br label %11

11:                                               ; preds = %11, %3
  %storemerge = phi i32 [ %., %3 ], [ %15, %11 ]
  %12 = mul nsw i32 %9, %storemerge
  %13 = icmp slt i32 %12, %10
  %14 = icmp slt i32 %storemerge, %7
  %or.cond = select i1 %13, i1 %14, i1 false
  %15 = add nsw i32 %storemerge, 1
  br i1 %or.cond, label %11, label %.critedge, !llvm.loop !17

.critedge:                                        ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 160
  store i32 %storemerge, ptr %16, align 8, !tbaa !19
  %17 = load i32, ptr @_ZN8IOClient16BYTES_PER_SECTORE, align 4, !tbaa !16
  %18 = add i32 %12, -1
  %19 = add i32 %18, %17
  %20 = sdiv i32 %19, %17
  %21 = getelementptr inbounds i8, ptr %0, i64 128
  %22 = srem i32 %12, %17
  %.not = icmp ne i32 %22, 0
  %23 = zext i1 %.not to i32
  %spec.select = add nsw i32 %20, %23
  %storemerge11 = mul i32 %spec.select, %17
  store i32 %storemerge11, ptr %21, align 8, !tbaa !20
  %24 = getelementptr inbounds i8, ptr %0, i64 144
  %25 = load ptr, ptr %24, align 8, !tbaa !21
  %.not8 = icmp eq ptr %25, null
  br i1 %.not8, label %27, label %26

26:                                               ; preds = %.critedge
  tail call void @free(ptr noundef nonnull %25) #7
  store ptr null, ptr %24, align 8, !tbaa !21
  %.pre = load i32, ptr %21, align 8, !tbaa !20
  br label %27

27:                                               ; preds = %26, %.critedge
  %28 = phi i32 [ %.pre, %26 ], [ %storemerge11, %.critedge ]
  %29 = getelementptr inbounds i8, ptr %0, i64 164
  %30 = load i32, ptr %29, align 4, !tbaa !22
  %31 = mul nsw i32 %30, %28
  %32 = sext i32 %31 to i64
  %33 = tail call noundef ptr @_Z12AllocPointerIhEPT_m(i64 noundef %32)
  store ptr %33, ptr %24, align 8, !tbaa !21
  %.not9 = icmp eq ptr %33, null
  br i1 %.not9, label %34, label %39

34:                                               ; preds = %27
  %35 = load ptr, ptr @stderr, align 8, !tbaa !23
  %36 = load i32, ptr %21, align 8, !tbaa !20
  %37 = load i32, ptr %29, align 4, !tbaa !22
  %38 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.20, i32 noundef %36, i32 noundef %37) #8
  tail call void @exit(i32 noundef 0) #9
  unreachable

39:                                               ; preds = %27
  br i1 %1, label %40, label %51

40:                                               ; preds = %39
  %41 = getelementptr inbounds i8, ptr %0, i64 168
  %42 = load ptr, ptr %41, align 8, !tbaa !24
  %43 = tail call noundef zeroext i1 @_Z14SeekFileHandleP11_FileHandlex(ptr noundef %42, i64 noundef 0)
  %44 = load ptr, ptr %41, align 8, !tbaa !24
  %45 = load ptr, ptr %24, align 8, !tbaa !21
  %46 = load i32, ptr %21, align 8, !tbaa !20
  %47 = sext i32 %46 to i64
  %48 = tail call noundef i64 @_Z14ReadFileHandleP11_FileHandlePhx(ptr noundef %44, ptr noundef %45, i64 noundef %47)
  %49 = load i64, ptr @_ZN8IOClient9ReadBytesE, align 8, !tbaa !25
  %50 = add nsw i64 %49, %48
  store i64 %50, ptr @_ZN8IOClient9ReadBytesE, align 8, !tbaa !25
  br label %51

51:                                               ; preds = %40, %39
  %52 = getelementptr inbounds i8, ptr %0, i64 180
  store i32 0, ptr %52, align 4, !tbaa !27
  %53 = getelementptr inbounds i8, ptr %0, i64 188
  store i32 0, ptr %53, align 4, !tbaa !28
  %54 = load i32, ptr %16, align 8, !tbaa !19
  %55 = getelementptr inbounds i8, ptr %0, i64 184
  store i32 %54, ptr %55, align 8, !tbaa !29
  %56 = getelementptr inbounds i8, ptr %0, i64 136
  %57 = load ptr, ptr %56, align 8, !tbaa !30
  store i32 0, ptr %57, align 4, !tbaa !16
  ret void
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #2 = { 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 #3 = { noreturn 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { cold nounwind }
attributes #9 = { noreturn 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, !11, i64 176}
!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 156}
!16 = !{!13, !13, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!6, !13, i64 160}
!20 = !{!6, !13, i64 128}
!21 = !{!6, !14, i64 144}
!22 = !{!6, !13, i64 164}
!23 = !{!14, !14, i64 0}
!24 = !{!6, !14, i64 168}
!25 = !{!26, !26, i64 0}
!26 = !{!"long long", !9, i64 0}
!27 = !{!6, !13, i64 180}
!28 = !{!6, !13, i64 188}
!29 = !{!6, !13, i64 184}
!30 = !{!6, !14, i64 136}


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