; LLVM IR from fwip/fastqz :: libzpaq.ll (ZN7libzpaq5ZPAQL4readEPNS_6ReaderE)

; 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.libzpaq::ZPAQL" = type { ptr, ptr, %"class.libzpaq::Array.0", i32, i32, i32, [4 x i8], %"class.libzpaq::Array.0", %"class.libzpaq::Array", %"class.libzpaq::Array", %"class.libzpaq::Array.4", i32, i32, i32, i32, i32, i32, i32, i32, ptr }
%"class.libzpaq::Array.0" = type <{ ptr, i64, i32, [4 x i8] }>
%"class.libzpaq::Array" = type <{ ptr, i64, i32, [4 x i8] }>
%"class.libzpaq::Array.4" = type <{ ptr, i64, i32, [4 x i8] }>

@_ZN7libzpaq8compsizeE = external dso_local constant <{ [10 x i32], [246 x i32] }>, align 16
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 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: mustprogress uwtable
declare dso_local void @_ZN7libzpaq6allocxERPhRii(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #1

declare void @_ZN7libzpaq5errorEPKc(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7libzpaq5ArrayIhE6resizeEmi(ptr noundef nonnull align 8 dereferenceable(20), i64 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7libzpaq5ZPAQL4readEPNS_6ReaderE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %13 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = getelementptr inbounds ptr, ptr %15, i64 0
  %17 = load ptr, ptr %16, align 8
  %18 = call noundef i32 %17(ptr noundef nonnull align 8 dereferenceable(8) %14)
  store i32 %18, ptr %5, align 4, !tbaa !11
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds ptr, ptr %20, i64 0
  %22 = load ptr, ptr %21, align 8
  %23 = call noundef i32 %22(ptr noundef nonnull align 8 dereferenceable(8) %19)
  %24 = mul nsw i32 %23, 256
  %25 = load i32, ptr %5, align 4, !tbaa !11
  %26 = add nsw i32 %25, %24
  store i32 %26, ptr %5, align 4, !tbaa !11
  %27 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %28 = load i32, ptr %5, align 4, !tbaa !11
  %29 = add nsw i32 %28, 300
  %30 = sext i32 %29 to i64
  call void @_ZN7libzpaq5ArrayIhE6resizeEmi(ptr noundef nonnull align 8 dereferenceable(20) %27, i64 noundef %30, i32 noundef 0)
  %31 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 5
  store i32 0, ptr %31, align 8, !tbaa !13
  %32 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 4
  store i32 0, ptr %32, align 4, !tbaa !19
  %33 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  store i32 0, ptr %33, align 8, !tbaa !20
  %34 = load i32, ptr %5, align 4, !tbaa !11
  %35 = and i32 %34, 255
  %36 = trunc i32 %35 to i8
  %37 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %38 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %39 = load i32, ptr %38, align 8, !tbaa !20
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %38, align 8, !tbaa !20
  %41 = sext i32 %39 to i64
  %42 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %37, i64 noundef %41)
  store i8 %36, ptr %42, align 1, !tbaa !21
  %43 = load i32, ptr %5, align 4, !tbaa !11
  %44 = ashr i32 %43, 8
  %45 = trunc i32 %44 to i8
  %46 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %47 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %48 = load i32, ptr %47, align 8, !tbaa !20
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %47, align 8, !tbaa !20
  %50 = sext i32 %48 to i64
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %46, i64 noundef %50)
  store i8 %45, ptr %51, align 1, !tbaa !21
  br label %52

52:                                               ; preds = %56, %2
  %53 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %54 = load i32, ptr %53, align 8, !tbaa !20
  %55 = icmp slt i32 %54, 7
  br i1 %55, label %56, label %69

56:                                               ; preds = %52
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = getelementptr inbounds ptr, ptr %58, i64 0
  %60 = load ptr, ptr %59, align 8
  %61 = call noundef i32 %60(ptr noundef nonnull align 8 dereferenceable(8) %57)
  %62 = trunc i32 %61 to i8
  %63 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %64 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %65 = load i32, ptr %64, align 8, !tbaa !20
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %64, align 8, !tbaa !20
  %67 = sext i32 %65 to i64
  %68 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %63, i64 noundef %67)
  store i8 %62, ptr %68, align 1, !tbaa !21
  br label %52, !llvm.loop !22

69:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %70 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %71 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %72 = load i32, ptr %71, align 8, !tbaa !20
  %73 = sub nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %70, i64 noundef %74)
  %76 = load i8, ptr %75, align 1, !tbaa !21
  %77 = zext i8 %76 to i32
  store i32 %77, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %78

78:                                               ; preds = %141, %69
  %79 = load i32, ptr %7, align 4, !tbaa !11
  %80 = load i32, ptr %6, align 4, !tbaa !11
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %144

83:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = load ptr, ptr %84, align 8, !tbaa !9
  %86 = getelementptr inbounds ptr, ptr %85, i64 0
  %87 = load ptr, ptr %86, align 8
  %88 = call noundef i32 %87(ptr noundef nonnull align 8 dereferenceable(8) %84)
  store i32 %88, ptr %9, align 4, !tbaa !11
  %89 = load i32, ptr %9, align 4, !tbaa !11
  %90 = icmp eq i32 %89, -1
  br i1 %90, label %91, label %92

91:                                               ; preds = %83
  call void @_ZN7libzpaq5errorEPKc(ptr noundef @.str.1)
  br label %92

92:                                               ; preds = %91, %83
  %93 = load i32, ptr %9, align 4, !tbaa !11
  %94 = trunc i32 %93 to i8
  %95 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %96 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %97 = load i32, ptr %96, align 8, !tbaa !20
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %96, align 8, !tbaa !20
  %99 = sext i32 %97 to i64
  %100 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %95, i64 noundef %99)
  store i8 %94, ptr %100, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %101 = load i32, ptr %9, align 4, !tbaa !11
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [256 x i32], ptr @_ZN7libzpaq8compsizeE, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !11
  store i32 %104, ptr %10, align 4, !tbaa !11
  %105 = load i32, ptr %10, align 4, !tbaa !11
  %106 = icmp slt i32 %105, 1
  br i1 %106, label %107, label %108

107:                                              ; preds = %92
  call void @_ZN7libzpaq5errorEPKc(ptr noundef @.str.2)
  br label %108

108:                                              ; preds = %107, %92
  %109 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %110 = load i32, ptr %109, align 8, !tbaa !20
  %111 = load i32, ptr %10, align 4, !tbaa !11
  %112 = add nsw i32 %110, %111
  %113 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %114 = call noundef i32 @_ZNK7libzpaq5ArrayIhE5isizeEv(ptr noundef nonnull align 8 dereferenceable(20) %113)
  %115 = sub nsw i32 %114, 8
  %116 = icmp sgt i32 %112, %115
  br i1 %116, label %117, label %118

117:                                              ; preds = %108
  call void @_ZN7libzpaq5errorEPKc(ptr noundef @.str.3)
  br label %118

118:                                              ; preds = %117, %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 1, ptr %11, align 4, !tbaa !11
  br label %119

119:                                              ; preds = %137, %118
  %120 = load i32, ptr %11, align 4, !tbaa !11
  %121 = load i32, ptr %10, align 4, !tbaa !11
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %140

124:                                              ; preds = %119
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = load ptr, ptr %125, align 8, !tbaa !9
  %127 = getelementptr inbounds ptr, ptr %126, i64 0
  %128 = load ptr, ptr %127, align 8
  %129 = call noundef i32 %128(ptr noundef nonnull align 8 dereferenceable(8) %125)
  %130 = trunc i32 %129 to i8
  %131 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %132 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %133 = load i32, ptr %132, align 8, !tbaa !20
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %132, align 8, !tbaa !20
  %135 = sext i32 %133 to i64
  %136 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %131, i64 noundef %135)
  store i8 %130, ptr %136, align 1, !tbaa !21
  br label %137

137:                                              ; preds = %124
  %138 = load i32, ptr %11, align 4, !tbaa !11
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %11, align 4, !tbaa !11
  br label %119, !llvm.loop !24

140:                                              ; preds = %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %7, align 4, !tbaa !11
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %7, align 4, !tbaa !11
  br label %78, !llvm.loop !25

144:                                              ; preds = %82
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = load ptr, ptr %145, align 8, !tbaa !9
  %147 = getelementptr inbounds ptr, ptr %146, i64 0
  %148 = load ptr, ptr %147, align 8
  %149 = call noundef i32 %148(ptr noundef nonnull align 8 dereferenceable(8) %145)
  %150 = trunc i32 %149 to i8
  %151 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %152 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %153 = load i32, ptr %152, align 8, !tbaa !20
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %152, align 8, !tbaa !20
  %155 = sext i32 %153 to i64
  %156 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %151, i64 noundef %155)
  store i8 %150, ptr %156, align 1, !tbaa !21
  %157 = zext i8 %150 to i32
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %160

159:                                              ; preds = %144
  call void @_ZN7libzpaq5errorEPKc(ptr noundef @.str.4)
  br label %160

160:                                              ; preds = %159, %144
  %161 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %162 = load i32, ptr %161, align 8, !tbaa !20
  %163 = add nsw i32 %162, 128
  %164 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 5
  store i32 %163, ptr %164, align 8, !tbaa !13
  %165 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 4
  store i32 %163, ptr %165, align 4, !tbaa !19
  br label %166

166:                                              ; preds = %181, %160
  %167 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 5
  %168 = load i32, ptr %167, align 8, !tbaa !13
  %169 = load i32, ptr %5, align 4, !tbaa !11
  %170 = add nsw i32 %169, 129
  %171 = icmp slt i32 %168, %170
  br i1 %171, label %172, label %190

172:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = load ptr, ptr %173, align 8, !tbaa !9
  %175 = getelementptr inbounds ptr, ptr %174, i64 0
  %176 = load ptr, ptr %175, align 8
  %177 = call noundef i32 %176(ptr noundef nonnull align 8 dereferenceable(8) %173)
  store i32 %177, ptr %12, align 4, !tbaa !11
  %178 = load i32, ptr %12, align 4, !tbaa !11
  %179 = icmp eq i32 %178, -1
  br i1 %179, label %180, label %181

180:                                              ; preds = %172
  call void @_ZN7libzpaq5errorEPKc(ptr noundef @.str.1)
  br label %181

181:                                              ; preds = %180, %172
  %182 = load i32, ptr %12, align 4, !tbaa !11
  %183 = trunc i32 %182 to i8
  %184 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %185 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 5
  %186 = load i32, ptr %185, align 8, !tbaa !13
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %185, align 8, !tbaa !13
  %188 = sext i32 %186 to i64
  %189 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %184, i64 noundef %188)
  store i8 %183, ptr %189, align 1, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %166, !llvm.loop !26

190:                                              ; preds = %166
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = load ptr, ptr %191, align 8, !tbaa !9
  %193 = getelementptr inbounds ptr, ptr %192, i64 0
  %194 = load ptr, ptr %193, align 8
  %195 = call noundef i32 %194(ptr noundef nonnull align 8 dereferenceable(8) %191)
  %196 = trunc i32 %195 to i8
  %197 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 2
  %198 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 5
  %199 = load i32, ptr %198, align 8, !tbaa !13
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %198, align 8, !tbaa !13
  %201 = sext i32 %199 to i64
  %202 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %197, i64 noundef %201)
  store i8 %196, ptr %202, align 1, !tbaa !21
  %203 = zext i8 %196 to i32
  %204 = icmp ne i32 %203, 0
  br i1 %204, label %205, label %206

205:                                              ; preds = %190
  call void @_ZN7libzpaq5errorEPKc(ptr noundef @.str.5)
  br label %206

206:                                              ; preds = %205, %190
  %207 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 19
  %208 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 18
  call void @_ZN7libzpaq6allocxERPhRii(ptr noundef nonnull align 8 dereferenceable(8) %207, ptr noundef nonnull align 4 dereferenceable(4) %208, i32 noundef 0)
  %209 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 3
  %210 = load i32, ptr %209, align 8, !tbaa !20
  %211 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 5
  %212 = load i32, ptr %211, align 8, !tbaa !13
  %213 = add nsw i32 %210, %212
  %214 = getelementptr inbounds %"class.libzpaq::ZPAQL", ptr %13, i32 0, i32 4
  %215 = load i32, ptr %214, align 4, !tbaa !19
  %216 = sub nsw i32 %213, %215
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret i32 %216
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7libzpaq5ArrayIhE5isizeEv(ptr noundef nonnull align 8 dereferenceable(20)) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 48}
!14 = !{!"_ZTSN7libzpaq5ZPAQLE", !6, i64 0, !6, i64 8, !15, i64 16, !12, i64 40, !12, i64 44, !12, i64 48, !15, i64 56, !17, i64 80, !17, i64 104, !18, i64 128, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180, !6, i64 184}
!15 = !{!"_ZTSN7libzpaq5ArrayIhEE", !6, i64 0, !16, i64 8, !12, i64 16}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTSN7libzpaq5ArrayIjEE", !6, i64 0, !16, i64 8, !12, i64 16}
!18 = !{!"_ZTSN7libzpaq5ArrayIcEE", !6, i64 0, !16, i64 8, !12, i64 16}
!19 = !{!14, !12, i64 44}
!20 = !{!14, !12, i64 40}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = distinct !{!25, !23}
!26 = distinct !{!26, !23}


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

@_ZN7libzpaq8compsizeE = external dso_local local_unnamed_addr constant <{ [10 x i32], [246 x i32] }>, align 16
@.str.1 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7libzpaq6allocxERPhRii(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #0

declare void @_ZN7libzpaq5errorEPKc(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7libzpaq5ArrayIhE6resizeEmi(ptr noundef nonnull align 8 dereferenceable(20), i64 noundef, i32 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7libzpaq5ZPAQL4readEPNS_6ReaderE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %1) local_unnamed_addr #0 align 2 {
  %3 = load ptr, ptr %1, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8
  %5 = tail call noundef i32 %4(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = load ptr, ptr %6, align 8
  %8 = tail call noundef i32 %7(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %9 = shl nsw i32 %8, 8
  %10 = add nsw i32 %9, %5
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = add nsw i32 %10, 300
  %13 = sext i32 %12 to i64
  tail call void @_ZN7libzpaq5ArrayIhE6resizeEmi(ptr noundef nonnull align 8 dereferenceable(20) %11, i64 noundef %13, i32 noundef 0)
  %14 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 0, ptr %14, align 8, !tbaa !8
  %15 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 0, ptr %15, align 4, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  %17 = trunc i32 %5 to i8
  store i32 1, ptr %16, align 8, !tbaa !18
  %18 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %11, i64 noundef 0)
  store i8 %17, ptr %18, align 1, !tbaa !19
  %19 = lshr i32 %10, 8
  %20 = trunc i32 %19 to i8
  %21 = load i32, ptr %16, align 8, !tbaa !18
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %16, align 8, !tbaa !18
  %23 = sext i32 %21 to i64
  %24 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %11, i64 noundef %23)
  store i8 %20, ptr %24, align 1, !tbaa !19
  %25 = load i32, ptr %16, align 8, !tbaa !18
  %26 = icmp slt i32 %25, 7
  br i1 %26, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %.lr.ph
  %27 = load ptr, ptr %1, align 8, !tbaa !5
  %28 = load ptr, ptr %27, align 8
  %29 = tail call noundef i32 %28(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %30 = trunc i32 %29 to i8
  %31 = load i32, ptr %16, align 8, !tbaa !18
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %16, align 8, !tbaa !18
  %33 = sext i32 %31 to i64
  %34 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %11, i64 noundef %33)
  store i8 %30, ptr %34, align 1, !tbaa !19
  %35 = load i32, ptr %16, align 8, !tbaa !18
  %36 = icmp slt i32 %35, 7
  br i1 %36, label %.lr.ph, label %._crit_edge, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph, %2
  %.lcssa = phi i32 [ %25, %2 ], [ %35, %.lr.ph ]
  %37 = add nsw i32 %.lcssa, -1
  %38 = zext nneg i32 %37 to i64
  %39 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %11, i64 noundef %38)
  %40 = load i8, ptr %39, align 1, !tbaa !19
  %41 = zext i8 %40 to i32
  %.not40 = icmp eq i8 %40, 0
  br i1 %.not40, label %._crit_edge36, label %.lr.ph35

._crit_edge36:                                    ; preds = %._crit_edge32, %._crit_edge
  %42 = load ptr, ptr %1, align 8, !tbaa !5
  %43 = load ptr, ptr %42, align 8
  %44 = tail call noundef i32 %43(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %45 = trunc i32 %44 to i8
  %46 = load i32, ptr %16, align 8, !tbaa !18
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %16, align 8, !tbaa !18
  %48 = sext i32 %46 to i64
  %49 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %11, i64 noundef %48)
  store i8 %45, ptr %49, align 1, !tbaa !19
  %50 = and i32 %44, 255
  %.not = icmp eq i32 %50, 0
  br i1 %.not, label %87, label %86

.lr.ph35:                                         ; preds = %._crit_edge, %._crit_edge32
  %.02633 = phi i32 [ %76, %._crit_edge32 ], [ 0, %._crit_edge ]
  %51 = load ptr, ptr %1, align 8, !tbaa !5
  %52 = load ptr, ptr %51, align 8
  %53 = tail call noundef i32 %52(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %54 = icmp eq i32 %53, -1
  br i1 %54, label %55, label %56

55:                                               ; preds = %.lr.ph35
  tail call void @_ZN7libzpaq5errorEPKc(ptr noundef nonnull @.str.1)
  br label %56

56:                                               ; preds = %55, %.lr.ph35
  %57 = trunc i32 %53 to i8
  %58 = load i32, ptr %16, align 8, !tbaa !18
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %16, align 8, !tbaa !18
  %60 = sext i32 %58 to i64
  %61 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %11, i64 noundef %60)
  store i8 %57, ptr %61, align 1, !tbaa !19
  %62 = sext i32 %53 to i64
  %63 = getelementptr inbounds [256 x i32], ptr @_ZN7libzpaq8compsizeE, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !22
  %65 = icmp slt i32 %64, 1
  br i1 %65, label %66, label %67

66:                                               ; preds = %56
  tail call void @_ZN7libzpaq5errorEPKc(ptr noundef nonnull @.str.2)
  br label %67

67:                                               ; preds = %66, %56
  %68 = load i32, ptr %16, align 8, !tbaa !18
  %69 = add nsw i32 %68, %64
  %70 = tail call noundef i32 @_ZNK7libzpaq5ArrayIhE5isizeEv(ptr noundef nonnull align 8 dereferenceable(20) %11)
  %71 = add nsw i32 %70, -8
  %72 = icmp sgt i32 %69, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %67
  tail call void @_ZN7libzpaq5errorEPKc(ptr noundef nonnull @.str.3)
  br label %74

74:                                               ; preds = %73, %67
  %75 = icmp sgt i32 %64, 1
  br i1 %75, label %.lr.ph31, label %._crit_edge32

._crit_edge32:                                    ; preds = %.lr.ph31, %74
  %76 = add nuw nsw i32 %.02633, 1
  %exitcond42.not = icmp eq i32 %76, %41
  br i1 %exitcond42.not, label %._crit_edge36, label %.lr.ph35, !llvm.loop !23

.lr.ph31:                                         ; preds = %74, %.lr.ph31
  %.029 = phi i32 [ %85, %.lr.ph31 ], [ 1, %74 ]
  %77 = load ptr, ptr %1, align 8, !tbaa !5
  %78 = load ptr, ptr %77, align 8
  %79 = tail call noundef i32 %78(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %80 = trunc i32 %79 to i8
  %81 = load i32, ptr %16, align 8, !tbaa !18
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %16, align 8, !tbaa !18
  %83 = sext i32 %81 to i64
  %84 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %11, i64 noundef %83)
  store i8 %80, ptr %84, align 1, !tbaa !19
  %85 = add nuw nsw i32 %.029, 1
  %exitcond.not = icmp eq i32 %85, %64
  br i1 %exitcond.not, label %._crit_edge32, label %.lr.ph31, !llvm.loop !24

86:                                               ; preds = %._crit_edge36
  tail call void @_ZN7libzpaq5errorEPKc(ptr noundef nonnull @.str.4)
  br label %87

87:                                               ; preds = %86, %._crit_edge36
  %88 = load i32, ptr %16, align 8, !tbaa !18
  %89 = add nsw i32 %88, 128
  store i32 %89, ptr %14, align 8, !tbaa !8
  store i32 %89, ptr %15, align 4, !tbaa !17
  %90 = add nsw i32 %10, 129
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %.lr.ph38, label %._crit_edge39

.lr.ph38:                                         ; preds = %87, %97
  %92 = load ptr, ptr %1, align 8, !tbaa !5
  %93 = load ptr, ptr %92, align 8
  %94 = tail call noundef i32 %93(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %95 = icmp eq i32 %94, -1
  br i1 %95, label %96, label %97

96:                                               ; preds = %.lr.ph38
  tail call void @_ZN7libzpaq5errorEPKc(ptr noundef nonnull @.str.1)
  br label %97

97:                                               ; preds = %96, %.lr.ph38
  %98 = trunc i32 %94 to i8
  %99 = load i32, ptr %14, align 8, !tbaa !8
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %14, align 8, !tbaa !8
  %101 = sext i32 %99 to i64
  %102 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %11, i64 noundef %101)
  store i8 %98, ptr %102, align 1, !tbaa !19
  %103 = load i32, ptr %14, align 8, !tbaa !8
  %104 = icmp slt i32 %103, %90
  br i1 %104, label %.lr.ph38, label %._crit_edge39, !llvm.loop !25

._crit_edge39:                                    ; preds = %97, %87
  %105 = load ptr, ptr %1, align 8, !tbaa !5
  %106 = load ptr, ptr %105, align 8
  %107 = tail call noundef i32 %106(ptr noundef nonnull align 8 dereferenceable(8) %1)
  %108 = trunc i32 %107 to i8
  %109 = load i32, ptr %14, align 8, !tbaa !8
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %14, align 8, !tbaa !8
  %111 = sext i32 %109 to i64
  %112 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIhEixEm(ptr noundef nonnull align 8 dereferenceable(20) %11, i64 noundef %111)
  store i8 %108, ptr %112, align 1, !tbaa !19
  %113 = and i32 %107, 255
  %.not28 = icmp eq i32 %113, 0
  br i1 %.not28, label %115, label %114

114:                                              ; preds = %._crit_edge39
  tail call void @_ZN7libzpaq5errorEPKc(ptr noundef nonnull @.str.5)
  br label %115

115:                                              ; preds = %114, %._crit_edge39
  %116 = getelementptr inbounds i8, ptr %0, i64 184
  %117 = getelementptr inbounds i8, ptr %0, i64 180
  tail call void @_ZN7libzpaq6allocxERPhRii(ptr noundef nonnull align 8 dereferenceable(8) %116, ptr noundef nonnull align 4 dereferenceable(4) %117, i32 noundef 0)
  %118 = load i32, ptr %16, align 8, !tbaa !18
  %119 = load i32, ptr %14, align 8, !tbaa !8
  %120 = add nsw i32 %119, %118
  %121 = load i32, ptr %15, align 4, !tbaa !17
  %122 = sub i32 %120, %121
  ret i32 %122
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7libzpaq5ArrayIhE5isizeEv(ptr noundef nonnull align 8 dereferenceable(20)) local_unnamed_addr #2 align 2

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 = { "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" }

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !14, i64 48}
!9 = !{!"_ZTSN7libzpaq5ZPAQLE", !10, i64 0, !10, i64 8, !12, i64 16, !14, i64 40, !14, i64 44, !14, i64 48, !12, i64 56, !15, i64 80, !15, i64 104, !16, i64 128, !14, i64 152, !14, i64 156, !14, i64 160, !14, i64 164, !14, i64 168, !14, i64 172, !14, i64 176, !14, i64 180, !10, i64 184}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"_ZTSN7libzpaq5ArrayIhEE", !10, i64 0, !13, i64 8, !14, i64 16}
!13 = !{!"long", !11, i64 0}
!14 = !{!"int", !11, i64 0}
!15 = !{!"_ZTSN7libzpaq5ArrayIjEE", !10, i64 0, !13, i64 8, !14, i64 16}
!16 = !{!"_ZTSN7libzpaq5ArrayIcEE", !10, i64 0, !13, i64 8, !14, i64 16}
!17 = !{!9, !14, i64 44}
!18 = !{!9, !14, i64 40}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!14, !14, i64 0}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}


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