; LLVM IR from mncoppola/rpef :: utilities_src/squashfs2.1/lzma/C/7zip/Archive/7z_C (7zIn)

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

%struct._CSzByteBuffer = type { i64, ptr }
%struct._CSzState = type { ptr, i64 }
%struct._CArchiveDatabaseEx = type { %struct._CArchiveDatabase, %struct._CInArchiveInfo, ptr, ptr, ptr, ptr }
%struct._CArchiveDatabase = type { i32, ptr, ptr, ptr, i32, ptr, i32, ptr }
%struct._CInArchiveInfo = type { i32, i32 }
%struct._ISzInStream = type { ptr, ptr }
%struct._ISzAlloc = type { ptr, ptr }

; 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 uwtable
declare dso_local i32 @SafeReadDirect(ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @SafeReadDirectByte(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @SafeReadDirectUInt32(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @SafeReadDirectUInt64(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @TestSignatureCandidate(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @SzReadID(ptr noundef, ptr noundef) #1

declare i32 @SzByteBufferCreate(ptr noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @SzReadHeader(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @CrcVerifyDigest(i32 noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @SzReadAndDecodePackedStreams(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @SzArchiveOpen2(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #1 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca [6 x i8], align 1
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct._CSzByteBuffer, align 8
  %19 = alloca %struct._CSzState, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i64, align 8
  %31 = alloca %struct._CSzByteBuffer, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 6, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %34 = call i32 @SafeReadDirect(ptr noundef %32, ptr noundef %33, i64 noundef 6)
  store i32 %34, ptr %21, align 4, !tbaa !9
  %35 = load i32, ptr %21, align 4, !tbaa !9
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %39

37:                                               ; preds = %4
  %38 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %38, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %40

39:                                               ; preds = %4
  store i32 0, ptr %22, align 4
  br label %40

40:                                               ; preds = %39, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  %41 = load i32, ptr %22, align 4
  switch i32 %41, label %233 [
    i32 0, label %42
  ]

42:                                               ; preds = %40
  %43 = getelementptr inbounds [6 x i8], ptr %10, i64 0, i64 0
  %44 = call i32 @TestSignatureCandidate(ptr noundef %43)
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 6, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %233

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = call i32 @SafeReadDirectByte(ptr noundef %48, ptr noundef %11)
  store i32 %49, ptr %23, align 4, !tbaa !9
  %50 = load i32, ptr %23, align 4, !tbaa !9
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %54

52:                                               ; preds = %47
  %53 = load i32, ptr %23, align 4, !tbaa !9
  store i32 %53, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %55

54:                                               ; preds = %47
  store i32 0, ptr %22, align 4
  br label %55

55:                                               ; preds = %54, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  %56 = load i32, ptr %22, align 4
  switch i32 %56, label %233 [
    i32 0, label %57
  ]

57:                                               ; preds = %55
  %58 = load i8, ptr %11, align 1, !tbaa !11
  %59 = zext i8 %58 to i32
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %57
  store i32 6, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %233

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = call i32 @SafeReadDirectByte(ptr noundef %63, ptr noundef %11)
  store i32 %64, ptr %24, align 4, !tbaa !9
  %65 = load i32, ptr %24, align 4, !tbaa !9
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %69

67:                                               ; preds = %62
  %68 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %68, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %70

69:                                               ; preds = %62
  store i32 0, ptr %22, align 4
  br label %70

70:                                               ; preds = %69, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  %71 = load i32, ptr %22, align 4
  switch i32 %71, label %233 [
    i32 0, label %72
  ]

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = call i32 @SafeReadDirectUInt32(ptr noundef %73, ptr noundef %12)
  store i32 %74, ptr %25, align 4, !tbaa !9
  %75 = load i32, ptr %25, align 4, !tbaa !9
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %79

77:                                               ; preds = %72
  %78 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %78, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %80

79:                                               ; preds = %72
  store i32 0, ptr %22, align 4
  br label %80

80:                                               ; preds = %79, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  %81 = load i32, ptr %22, align 4
  switch i32 %81, label %233 [
    i32 0, label %82
  ]

82:                                               ; preds = %80
  call void @CrcInit(ptr noundef %16)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = call i32 @SafeReadDirectUInt64(ptr noundef %83, ptr noundef %13)
  store i32 %84, ptr %26, align 4, !tbaa !9
  %85 = load i32, ptr %26, align 4, !tbaa !9
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %89

87:                                               ; preds = %82
  %88 = load i32, ptr %26, align 4, !tbaa !9
  store i32 %88, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %90

89:                                               ; preds = %82
  store i32 0, ptr %22, align 4
  br label %90

90:                                               ; preds = %89, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  %91 = load i32, ptr %22, align 4
  switch i32 %91, label %233 [
    i32 0, label %92
  ]

92:                                               ; preds = %90
  %93 = load i64, ptr %13, align 8, !tbaa !12
  call void @CrcUpdateUInt64(ptr noundef %16, i64 noundef %93)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = call i32 @SafeReadDirectUInt64(ptr noundef %94, ptr noundef %14)
  store i32 %95, ptr %27, align 4, !tbaa !9
  %96 = load i32, ptr %27, align 4, !tbaa !9
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %100

98:                                               ; preds = %92
  %99 = load i32, ptr %27, align 4, !tbaa !9
  store i32 %99, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %101

100:                                              ; preds = %92
  store i32 0, ptr %22, align 4
  br label %101

101:                                              ; preds = %100, %98
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  %102 = load i32, ptr %22, align 4
  switch i32 %102, label %233 [
    i32 0, label %103
  ]

103:                                              ; preds = %101
  %104 = load i64, ptr %14, align 8, !tbaa !12
  call void @CrcUpdateUInt64(ptr noundef %16, i64 noundef %104)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = call i32 @SafeReadDirectUInt32(ptr noundef %105, ptr noundef %15)
  store i32 %106, ptr %28, align 4, !tbaa !9
  %107 = load i32, ptr %28, align 4, !tbaa !9
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %111

109:                                              ; preds = %103
  %110 = load i32, ptr %28, align 4, !tbaa !9
  store i32 %110, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %112

111:                                              ; preds = %103
  store i32 0, ptr %22, align 4
  br label %112

112:                                              ; preds = %111, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  %113 = load i32, ptr %22, align 4
  switch i32 %113, label %233 [
    i32 0, label %114
  ]

114:                                              ; preds = %112
  %115 = load i32, ptr %15, align 4, !tbaa !9
  call void @CrcUpdateUInt32(ptr noundef %16, i32 noundef %115)
  store i32 32, ptr %17, align 4, !tbaa !9
  %116 = load i32, ptr %17, align 4, !tbaa !9
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._CArchiveDatabaseEx, ptr %117, i32 0, i32 1
  %119 = getelementptr inbounds %struct._CInArchiveInfo, ptr %118, i32 0, i32 0
  store i32 %116, ptr %119, align 8, !tbaa !14
  %120 = call i32 @CrcGetDigest(ptr noundef %16)
  %121 = load i32, ptr %12, align 4, !tbaa !9
  %122 = icmp ne i32 %120, %121
  br i1 %122, label %123, label %124

123:                                              ; preds = %114
  store i32 6, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %233

124:                                              ; preds = %114
  %125 = load i64, ptr %14, align 8, !tbaa !12
  %126 = icmp eq i64 %125, 0
  br i1 %126, label %127, label %128

127:                                              ; preds = %124
  store i32 0, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %233

128:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #3
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct._ISzInStream, ptr %129, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !18
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = load i32, ptr %17, align 4, !tbaa !9
  %134 = zext i32 %133 to i64
  %135 = load i64, ptr %13, align 8, !tbaa !12
  %136 = add i64 %134, %135
  %137 = trunc i64 %136 to i32
  %138 = call i32 %131(ptr noundef %132, i32 noundef %137)
  store i32 %138, ptr %29, align 4, !tbaa !9
  %139 = load i32, ptr %29, align 4, !tbaa !9
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %143

141:                                              ; preds = %128
  %142 = load i32, ptr %29, align 4, !tbaa !9
  store i32 %142, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %144

143:                                              ; preds = %128
  store i32 0, ptr %22, align 4
  br label %144

144:                                              ; preds = %143, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #3
  %145 = load i32, ptr %22, align 4
  switch i32 %145, label %233 [
    i32 0, label %146
  ]

146:                                              ; preds = %144
  %147 = load i64, ptr %14, align 8, !tbaa !12
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct._ISzAlloc, ptr %148, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8, !tbaa !20
  %151 = call i32 @SzByteBufferCreate(ptr noundef %18, i64 noundef %147, ptr noundef %150)
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %154, label %153

153:                                              ; preds = %146
  store i32 2, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %233

154:                                              ; preds = %146
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._CSzByteBuffer, ptr %18, i32 0, i32 1
  %157 = load ptr, ptr %156, align 8, !tbaa !22
  %158 = load i64, ptr %14, align 8, !tbaa !12
  %159 = call i32 @SafeReadDirect(ptr noundef %155, ptr noundef %157, i64 noundef %158)
  store i32 %159, ptr %20, align 4, !tbaa !9
  %160 = load i32, ptr %20, align 4, !tbaa !9
  %161 = icmp eq i32 %160, 0
  br i1 %161, label %162, label %228

162:                                              ; preds = %154
  %163 = load i32, ptr %15, align 4, !tbaa !9
  %164 = getelementptr inbounds %struct._CSzByteBuffer, ptr %18, i32 0, i32 1
  %165 = load ptr, ptr %164, align 8, !tbaa !22
  %166 = load i64, ptr %14, align 8, !tbaa !12
  %167 = trunc i64 %166 to i32
  %168 = zext i32 %167 to i64
  %169 = call i32 @CrcVerifyDigest(i32 noundef %163, ptr noundef %165, i64 noundef %168)
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %227

171:                                              ; preds = %162
  br label %172

172:                                              ; preds = %225, %171
  br label %173

173:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #3
  %174 = getelementptr inbounds %struct._CSzByteBuffer, ptr %18, i32 0, i32 1
  %175 = load ptr, ptr %174, align 8, !tbaa !22
  %176 = getelementptr inbounds %struct._CSzState, ptr %19, i32 0, i32 0
  store ptr %175, ptr %176, align 8, !tbaa !25
  %177 = getelementptr inbounds %struct._CSzByteBuffer, ptr %18, i32 0, i32 0
  %178 = load i64, ptr %177, align 8, !tbaa !27
  %179 = getelementptr inbounds %struct._CSzState, ptr %19, i32 0, i32 1
  store i64 %178, ptr %179, align 8, !tbaa !28
  %180 = call i32 @SzReadID(ptr noundef %19, ptr noundef %30)
  store i32 %180, ptr %20, align 4, !tbaa !9
  %181 = load i32, ptr %20, align 4, !tbaa !9
  %182 = icmp ne i32 %181, 0
  br i1 %182, label %183, label %184

183:                                              ; preds = %173
  store i32 3, ptr %22, align 4
  br label %223

184:                                              ; preds = %173
  %185 = load i64, ptr %30, align 8, !tbaa !12
  %186 = icmp eq i64 %185, 1
  br i1 %186, label %187, label %192

187:                                              ; preds = %184
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  %189 = load ptr, ptr %8, align 8, !tbaa !5
  %190 = load ptr, ptr %9, align 8, !tbaa !5
  %191 = call i32 @SzReadHeader(ptr noundef %19, ptr noundef %188, ptr noundef %189, ptr noundef %190)
  store i32 %191, ptr %20, align 4, !tbaa !9
  store i32 3, ptr %22, align 4
  br label %223

192:                                              ; preds = %184
  %193 = load i64, ptr %30, align 8, !tbaa !12
  %194 = icmp ne i64 %193, 23
  br i1 %194, label %195, label %196

195:                                              ; preds = %192
  store i32 6, ptr %20, align 4, !tbaa !9
  store i32 3, ptr %22, align 4
  br label %223

196:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #3
  %197 = load ptr, ptr %6, align 8, !tbaa !5
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct._CArchiveDatabaseEx, ptr %198, i32 0, i32 1
  %200 = getelementptr inbounds %struct._CInArchiveInfo, ptr %199, i32 0, i32 0
  %201 = load i32, ptr %200, align 8, !tbaa !14
  %202 = load ptr, ptr %9, align 8, !tbaa !5
  %203 = call i32 @SzReadAndDecodePackedStreams(ptr noundef %197, ptr noundef %19, ptr noundef %31, i32 noundef %201, ptr noundef %202)
  store i32 %203, ptr %20, align 4, !tbaa !9
  %204 = load i32, ptr %20, align 4, !tbaa !9
  %205 = icmp ne i32 %204, 0
  br i1 %205, label %206, label %210

206:                                              ; preds = %196
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._ISzAlloc, ptr %207, i32 0, i32 1
  %209 = load ptr, ptr %208, align 8, !tbaa !29
  call void @SzByteBufferFree(ptr noundef %31, ptr noundef %209)
  store i32 3, ptr %22, align 4
  br label %220

210:                                              ; preds = %196
  %211 = load ptr, ptr %9, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct._ISzAlloc, ptr %211, i32 0, i32 1
  %213 = load ptr, ptr %212, align 8, !tbaa !29
  call void @SzByteBufferFree(ptr noundef %18, ptr noundef %213)
  %214 = getelementptr inbounds %struct._CSzByteBuffer, ptr %31, i32 0, i32 1
  %215 = load ptr, ptr %214, align 8, !tbaa !22
  %216 = getelementptr inbounds %struct._CSzByteBuffer, ptr %18, i32 0, i32 1
  store ptr %215, ptr %216, align 8, !tbaa !22
  %217 = getelementptr inbounds %struct._CSzByteBuffer, ptr %31, i32 0, i32 0
  %218 = load i64, ptr %217, align 8, !tbaa !27
  %219 = getelementptr inbounds %struct._CSzByteBuffer, ptr %18, i32 0, i32 0
  store i64 %218, ptr %219, align 8, !tbaa !27
  store i32 0, ptr %22, align 4
  br label %220

220:                                              ; preds = %210, %206
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #3
  %221 = load i32, ptr %22, align 4
  switch i32 %221, label %223 [
    i32 0, label %222
  ]

222:                                              ; preds = %220
  store i32 0, ptr %22, align 4
  br label %223

223:                                              ; preds = %222, %220, %195, %187, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #3
  %224 = load i32, ptr %22, align 4
  switch i32 %224, label %235 [
    i32 0, label %225
    i32 3, label %226
  ]

225:                                              ; preds = %223
  br label %172

226:                                              ; preds = %223
  br label %227

227:                                              ; preds = %226, %162
  br label %228

228:                                              ; preds = %227, %154
  %229 = load ptr, ptr %9, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct._ISzAlloc, ptr %229, i32 0, i32 1
  %231 = load ptr, ptr %230, align 8, !tbaa !29
  call void @SzByteBufferFree(ptr noundef %18, ptr noundef %231)
  %232 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %232, ptr %5, align 4
  store i32 1, ptr %22, align 4
  br label %233

233:                                              ; preds = %228, %153, %144, %127, %123, %112, %101, %90, %80, %70, %61, %55, %46, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 6, ptr %10) #3
  %234 = load i32, ptr %5, align 4
  ret i32 %234

235:                                              ; preds = %223
  unreachable
}

declare void @CrcInit(ptr noundef) #2

declare void @CrcUpdateUInt64(ptr noundef, i64 noundef) #2

declare void @CrcUpdateUInt32(ptr noundef, i32 noundef) #2

declare i32 @CrcGetDigest(ptr noundef) #2

declare void @SzByteBufferFree(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!15, !10, i64 64}
!15 = !{!"_CArchiveDatabaseEx", !16, i64 0, !17, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!16 = !{!"_CArchiveDatabase", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !6, i64 40, !10, i64 48, !6, i64 56}
!17 = !{!"_CInArchiveInfo", !10, i64 0, !10, i64 4}
!18 = !{!19, !6, i64 8}
!19 = !{!"_ISzInStream", !6, i64 0, !6, i64 8}
!20 = !{!21, !6, i64 0}
!21 = !{!"_ISzAlloc", !6, i64 0, !6, i64 8}
!22 = !{!23, !6, i64 8}
!23 = !{!"_CSzByteBuffer", !24, i64 0, !6, i64 8}
!24 = !{!"long", !7, i64 0}
!25 = !{!26, !6, i64 0}
!26 = !{!"_CSzState", !6, i64 0, !24, i64 8}
!27 = !{!23, !24, i64 0}
!28 = !{!26, !24, i64 8}
!29 = !{!21, !6, i64 8}


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

%struct._CSzByteBuffer = type { i64, ptr }
%struct._CSzState = type { ptr, i64 }

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @SafeReadDirect(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @SafeReadDirectByte(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @SafeReadDirectUInt32(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @SafeReadDirectUInt64(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @TestSignatureCandidate(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @SzReadID(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @SzByteBufferCreate(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @SzReadHeader(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @CrcVerifyDigest(i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @SzReadAndDecodePackedStreams(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @SzArchiveOpen2(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = alloca [6 x i8], align 1
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct._CSzByteBuffer, align 8
  %13 = alloca %struct._CSzState, align 8
  %14 = alloca i64, align 8
  %15 = alloca %struct._CSzByteBuffer, align 8
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #3
  %16 = call i32 @SafeReadDirect(ptr noundef %0, ptr noundef nonnull %5, i64 noundef 6)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %17, label %87

17:                                               ; preds = %4
  %18 = call i32 @TestSignatureCandidate(ptr noundef nonnull %5)
  %.not82 = icmp eq i32 %18, 0
  br i1 %.not82, label %87, label %19

19:                                               ; preds = %17
  %20 = call i32 @SafeReadDirectByte(ptr noundef %0, ptr noundef nonnull %6)
  %.not83 = icmp eq i32 %20, 0
  br i1 %.not83, label %21, label %87

21:                                               ; preds = %19
  %22 = load i8, ptr %6, align 1, !tbaa !5
  %.not84 = icmp eq i8 %22, 0
  br i1 %.not84, label %23, label %87

23:                                               ; preds = %21
  %24 = call i32 @SafeReadDirectByte(ptr noundef %0, ptr noundef nonnull %6)
  %.not85 = icmp eq i32 %24, 0
  br i1 %.not85, label %25, label %87

25:                                               ; preds = %23
  %26 = call i32 @SafeReadDirectUInt32(ptr noundef %0, ptr noundef nonnull %7)
  %.not86 = icmp eq i32 %26, 0
  br i1 %.not86, label %27, label %87

27:                                               ; preds = %25
  call void @CrcInit(ptr noundef nonnull %11) #3
  %28 = call i32 @SafeReadDirectUInt64(ptr noundef %0, ptr noundef nonnull %8)
  %.not87 = icmp eq i32 %28, 0
  br i1 %.not87, label %29, label %87

29:                                               ; preds = %27
  %30 = load i64, ptr %8, align 8, !tbaa !8
  call void @CrcUpdateUInt64(ptr noundef nonnull %11, i64 noundef %30) #3
  %31 = call i32 @SafeReadDirectUInt64(ptr noundef %0, ptr noundef nonnull %9)
  %.not88 = icmp eq i32 %31, 0
  br i1 %.not88, label %32, label %87

32:                                               ; preds = %29
  %33 = load i64, ptr %9, align 8, !tbaa !8
  call void @CrcUpdateUInt64(ptr noundef nonnull %11, i64 noundef %33) #3
  %34 = call i32 @SafeReadDirectUInt32(ptr noundef %0, ptr noundef nonnull %10)
  %.not89 = icmp eq i32 %34, 0
  br i1 %.not89, label %35, label %87

35:                                               ; preds = %32
  %36 = load i32, ptr %10, align 4, !tbaa !10
  call void @CrcUpdateUInt32(ptr noundef nonnull %11, i32 noundef %36) #3
  %37 = getelementptr inbounds i8, ptr %1, i64 64
  store i32 32, ptr %37, align 8, !tbaa !12
  %38 = call i32 @CrcGetDigest(ptr noundef nonnull %11) #3
  %39 = load i32, ptr %7, align 4, !tbaa !10
  %.not90 = icmp eq i32 %38, %39
  br i1 %.not90, label %40, label %87

40:                                               ; preds = %35
  %41 = load i64, ptr %9, align 8, !tbaa !8
  %42 = icmp eq i64 %41, 0
  br i1 %42, label %87, label %43

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %0, i64 8
  %45 = load ptr, ptr %44, align 8, !tbaa !17
  %46 = load i64, ptr %8, align 8, !tbaa !8
  %47 = trunc i64 %46 to i32
  %48 = add i32 %47, 32
  %49 = call i32 %45(ptr noundef %0, i32 noundef %48) #3
  %.not91 = icmp eq i32 %49, 0
  br i1 %.not91, label %50, label %87

50:                                               ; preds = %43
  %51 = load i64, ptr %9, align 8, !tbaa !8
  %52 = load ptr, ptr %3, align 8, !tbaa !19
  %53 = call i32 @SzByteBufferCreate(ptr noundef nonnull %12, i64 noundef %51, ptr noundef %52) #3
  %.not92 = icmp eq i32 %53, 0
  br i1 %.not92, label %87, label %54

54:                                               ; preds = %50
  %55 = getelementptr inbounds i8, ptr %12, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !21
  %57 = load i64, ptr %9, align 8, !tbaa !8
  %58 = call i32 @SafeReadDirect(ptr noundef nonnull %0, ptr noundef %56, i64 noundef %57)
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %60, label %84

60:                                               ; preds = %54
  %61 = load i32, ptr %10, align 4, !tbaa !10
  %62 = load ptr, ptr %55, align 8, !tbaa !21
  %63 = load i64, ptr %9, align 8, !tbaa !8
  %64 = and i64 %63, 4294967295
  %65 = call i32 @CrcVerifyDigest(i32 noundef %61, ptr noundef %62, i64 noundef %64) #3
  %.not93 = icmp eq i32 %65, 0
  br i1 %.not93, label %84, label %.preheader

.preheader:                                       ; preds = %60
  %66 = getelementptr inbounds i8, ptr %13, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #3
  %67 = load ptr, ptr %55, align 8, !tbaa !21
  store ptr %67, ptr %13, align 8, !tbaa !24
  %68 = load i64, ptr %12, align 8, !tbaa !26
  store i64 %68, ptr %66, align 8, !tbaa !27
  %69 = call i32 @SzReadID(ptr noundef nonnull %13, ptr noundef nonnull %14)
  %.not94103 = icmp eq i32 %69, 0
  br i1 %.not94103, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %.preheader
  %70 = getelementptr inbounds i8, ptr %3, i64 8
  %71 = getelementptr inbounds i8, ptr %15, i64 8
  br label %72

72:                                               ; preds = %.lr.ph, %80
  %73 = load i64, ptr %14, align 8, !tbaa !8
  switch i64 %73, label %.thread [
    i64 1, label %74
    i64 23, label %76
  ]

74:                                               ; preds = %72
  %75 = call i32 @SzReadHeader(ptr noundef nonnull %13, ptr noundef nonnull %1, ptr noundef %2, ptr noundef nonnull %3)
  br label %.thread

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %15) #3
  %77 = load i32, ptr %37, align 8, !tbaa !12
  %78 = call i32 @SzReadAndDecodePackedStreams(ptr noundef %0, ptr noundef nonnull %13, ptr noundef nonnull %15, i32 noundef %77, ptr noundef nonnull %3)
  %.not96 = icmp eq i32 %78, 0
  %79 = load ptr, ptr %70, align 8, !tbaa !28
  br i1 %.not96, label %80, label %.thread100

.thread100:                                       ; preds = %76
  call void @SzByteBufferFree(ptr noundef nonnull %15, ptr noundef %79) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  br label %84

.thread:                                          ; preds = %72, %80, %.preheader, %74
  %.061.ph = phi i32 [ %75, %74 ], [ %69, %.preheader ], [ 6, %72 ], [ %83, %80 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  br label %84

80:                                               ; preds = %76
  call void @SzByteBufferFree(ptr noundef nonnull %12, ptr noundef %79) #3
  %81 = load ptr, ptr %71, align 8, !tbaa !21
  store ptr %81, ptr %55, align 8, !tbaa !21
  %82 = load i64, ptr %15, align 8, !tbaa !26
  store i64 %82, ptr %12, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #3
  store ptr %81, ptr %13, align 8, !tbaa !24
  store i64 %82, ptr %66, align 8, !tbaa !27
  %83 = call i32 @SzReadID(ptr noundef nonnull %13, ptr noundef nonnull %14)
  %.not94 = icmp eq i32 %83, 0
  br i1 %.not94, label %72, label %.thread

84:                                               ; preds = %.thread100, %.thread, %60, %54
  %.162 = phi i32 [ 0, %60 ], [ %58, %54 ], [ %.061.ph, %.thread ], [ %78, %.thread100 ]
  %85 = getelementptr inbounds i8, ptr %3, i64 8
  %86 = load ptr, ptr %85, align 8, !tbaa !28
  call void @SzByteBufferFree(ptr noundef nonnull %12, ptr noundef %86) #3
  br label %87

87:                                               ; preds = %50, %40, %35, %21, %17, %43, %32, %29, %27, %25, %23, %19, %4, %84
  %.8 = phi i32 [ %.162, %84 ], [ %49, %43 ], [ %34, %32 ], [ %31, %29 ], [ %28, %27 ], [ %26, %25 ], [ %24, %23 ], [ %20, %19 ], [ %16, %4 ], [ 6, %17 ], [ 6, %21 ], [ 6, %35 ], [ 0, %40 ], [ 2, %50 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %5) #3
  ret i32 %.8
}

declare void @CrcInit(ptr noundef) local_unnamed_addr #2

declare void @CrcUpdateUInt64(ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @CrcUpdateUInt32(ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @CrcGetDigest(ptr noundef) local_unnamed_addr #2

declare void @SzByteBufferFree(ptr noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!13, !11, i64 64}
!13 = !{!"_CArchiveDatabaseEx", !14, i64 0, !16, i64 64, !15, i64 72, !15, i64 80, !15, i64 88, !15, i64 96}
!14 = !{!"_CArchiveDatabase", !11, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !11, i64 32, !15, i64 40, !11, i64 48, !15, i64 56}
!15 = !{!"any pointer", !6, i64 0}
!16 = !{!"_CInArchiveInfo", !11, i64 0, !11, i64 4}
!17 = !{!18, !15, i64 8}
!18 = !{!"_ISzInStream", !15, i64 0, !15, i64 8}
!19 = !{!20, !15, i64 0}
!20 = !{!"_ISzAlloc", !15, i64 0, !15, i64 8}
!21 = !{!22, !15, i64 8}
!22 = !{!"_CSzByteBuffer", !23, i64 0, !15, i64 8}
!23 = !{!"long", !6, i64 0}
!24 = !{!25, !15, i64 0}
!25 = !{!"_CSzState", !15, i64 0, !23, i64 8}
!26 = !{!22, !23, i64 0}
!27 = !{!25, !23, i64 8}
!28 = !{!20, !15, i64 8}


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