; LLVM IR from mncoppola/rpef :: utilities_src/squashfs2.1/lzma/C/7zip/Compress/LZMA_C (LzmaStateTest)

; 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._CLzmaDecoderState = type { %struct._CLzmaProperties, ptr, ptr, [64 x i8], i32, i32, i32, i32, i32, i32, [4 x i32], i32, i32, [4 x i8] }
%struct._CLzmaProperties = type { i32, i32, i32, i32 }

@kCantReadMessage = external dso_local global ptr, align 8
@kCantWriteMessage = external dso_local global ptr, align 8
@kCantAllocateMessage = external dso_local global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@g_InBuffer = external dso_local global [32768 x i8], align 16
@g_OutBuffer = external dso_local global [32768 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @MyReadFile(ptr noundef, ptr noundef, i64 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @MyReadFileAndCheck(ptr noundef, ptr noundef, i64 noundef) #0

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @main3(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %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
  %13 = alloca %struct._CLzmaDecoderState, align 8
  %14 = alloca [5 x i8], align 1
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i8, align 1
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 152, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 5, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store ptr null, ptr %16, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds [5 x i8], ptr %14, i64 0, i64 0
  %25 = call i32 @MyReadFileAndCheck(ptr noundef %23, ptr noundef %24, i64 noundef 5)
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %31, label %27

27:                                               ; preds = %3
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = load ptr, ptr @kCantReadMessage, align 8, !tbaa !5
  %30 = call i32 @PrintError(ptr noundef %28, ptr noundef %29)
  store i32 %30, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %244

31:                                               ; preds = %3
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %72, %31
  %33 = load i32, ptr %11, align 4, !tbaa !9
  %34 = icmp slt i32 %33, 8
  br i1 %34, label %35, label %75

35:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #6
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call i32 @MyReadFileAndCheck(ptr noundef %36, ptr noundef %18, i64 noundef 1)
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %43, label %39

39:                                               ; preds = %35
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load ptr, ptr @kCantReadMessage, align 8, !tbaa !5
  %42 = call i32 @PrintError(ptr noundef %40, ptr noundef %41)
  store i32 %42, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %69

43:                                               ; preds = %35
  %44 = load i8, ptr %18, align 1, !tbaa !11
  %45 = zext i8 %44 to i32
  %46 = icmp ne i32 %45, 255
  br i1 %46, label %47, label %48

47:                                               ; preds = %43
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %47, %43
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = icmp slt i32 %49, 4
  br i1 %50, label %51, label %59

51:                                               ; preds = %48
  %52 = load i8, ptr %18, align 1, !tbaa !11
  %53 = zext i8 %52 to i32
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = mul nsw i32 %54, 8
  %56 = shl i32 %53, %55
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = add i32 %57, %56
  store i32 %58, ptr %8, align 4, !tbaa !9
  br label %68

59:                                               ; preds = %48
  %60 = load i8, ptr %18, align 1, !tbaa !11
  %61 = zext i8 %60 to i32
  %62 = load i32, ptr %11, align 4, !tbaa !9
  %63 = sub nsw i32 %62, 4
  %64 = mul nsw i32 %63, 8
  %65 = shl i32 %61, %64
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = add i32 %66, %65
  store i32 %67, ptr %9, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %59, %51
  store i32 0, ptr %17, align 4
  br label %69

69:                                               ; preds = %68, %39
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #6
  %70 = load i32, ptr %17, align 4
  switch i32 %70, label %244 [
    i32 0, label %71
  ]

71:                                               ; preds = %69
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %11, align 4, !tbaa !9
  br label %32, !llvm.loop !12

75:                                               ; preds = %32
  %76 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 0
  %77 = getelementptr inbounds [5 x i8], ptr %14, i64 0, i64 0
  %78 = call i32 @LzmaDecodeProperties(ptr noundef %76, ptr noundef %77, i32 noundef 5)
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %83

80:                                               ; preds = %75
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = call i32 @PrintError(ptr noundef %81, ptr noundef @.str.4)
  store i32 %82, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %244

83:                                               ; preds = %75
  %84 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 0
  %85 = getelementptr inbounds %struct._CLzmaProperties, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 8, !tbaa !14
  %87 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 0
  %88 = getelementptr inbounds %struct._CLzmaProperties, ptr %87, i32 0, i32 1
  %89 = load i32, ptr %88, align 4, !tbaa !17
  %90 = add nsw i32 %86, %89
  %91 = shl i32 768, %90
  %92 = add nsw i32 1846, %91
  %93 = sext i32 %92 to i64
  %94 = mul i64 %93, 2
  %95 = call noalias ptr @malloc(i64 noundef %94) #7
  %96 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 1
  store ptr %95, ptr %96, align 8, !tbaa !18
  %97 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !18
  %99 = icmp eq ptr %98, null
  br i1 %99, label %100, label %104

100:                                              ; preds = %83
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = load ptr, ptr @kCantAllocateMessage, align 8, !tbaa !5
  %103 = call i32 @PrintError(ptr noundef %101, ptr noundef %102)
  store i32 %103, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %244

104:                                              ; preds = %83
  %105 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 0
  %106 = getelementptr inbounds %struct._CLzmaProperties, ptr %105, i32 0, i32 3
  %107 = load i32, ptr %106, align 4, !tbaa !19
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %111

109:                                              ; preds = %104
  %110 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 2
  store ptr null, ptr %110, align 8, !tbaa !20
  br label %128

111:                                              ; preds = %104
  %112 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 0
  %113 = getelementptr inbounds %struct._CLzmaProperties, ptr %112, i32 0, i32 3
  %114 = load i32, ptr %113, align 4, !tbaa !19
  %115 = zext i32 %114 to i64
  %116 = call noalias ptr @malloc(i64 noundef %115) #7
  %117 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 2
  store ptr %116, ptr %117, align 8, !tbaa !20
  %118 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 2
  %119 = load ptr, ptr %118, align 8, !tbaa !20
  %120 = icmp eq ptr %119, null
  br i1 %120, label %121, label %127

121:                                              ; preds = %111
  %122 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 1
  %123 = load ptr, ptr %122, align 8, !tbaa !18
  call void @free(ptr noundef %123) #6
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = load ptr, ptr @kCantAllocateMessage, align 8, !tbaa !5
  %126 = call i32 @PrintError(ptr noundef %124, ptr noundef %125)
  store i32 %126, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %244

127:                                              ; preds = %111
  br label %128

128:                                              ; preds = %127, %109
  %129 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 12
  store i32 -2, ptr %129, align 4, !tbaa !21
  %130 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 4
  store i32 0, ptr %130, align 8, !tbaa !22
  br label %131

131:                                              ; preds = %236, %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 32768, ptr %22, align 4, !tbaa !9
  %132 = load i32, ptr %10, align 4, !tbaa !9
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %143, label %134

134:                                              ; preds = %131
  %135 = load i32, ptr %9, align 4, !tbaa !9
  %136 = icmp eq i32 %135, 0
  br i1 %136, label %137, label %143

137:                                              ; preds = %134
  %138 = load i32, ptr %22, align 4, !tbaa !9
  %139 = load i32, ptr %8, align 4, !tbaa !9
  %140 = icmp ugt i32 %138, %139
  br i1 %140, label %141, label %143

141:                                              ; preds = %137
  %142 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %142, ptr %22, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %141, %137, %134, %131
  %144 = load i32, ptr %15, align 4, !tbaa !9
  %145 = icmp eq i32 %144, 0
  br i1 %145, label %146, label %150

146:                                              ; preds = %143
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = call i64 @MyReadFile(ptr noundef %147, ptr noundef @g_InBuffer, i64 noundef 32768)
  %149 = trunc i64 %148 to i32
  store i32 %149, ptr %15, align 4, !tbaa !9
  store ptr @g_InBuffer, ptr %16, align 8, !tbaa !5
  br label %150

150:                                              ; preds = %146, %143
  %151 = load i32, ptr %15, align 4, !tbaa !9
  %152 = icmp eq i32 %151, 0
  %153 = zext i1 %152 to i32
  store i32 %153, ptr %21, align 4, !tbaa !9
  %154 = load ptr, ptr %16, align 8, !tbaa !5
  %155 = load i32, ptr %15, align 4, !tbaa !9
  %156 = load i32, ptr %22, align 4, !tbaa !9
  %157 = load i32, ptr %21, align 4, !tbaa !9
  %158 = call i32 @LzmaDecode(ptr noundef %13, ptr noundef %154, i32 noundef %155, ptr noundef %19, ptr noundef @g_OutBuffer, i32 noundef %156, ptr noundef %20, i32 noundef %157)
  store i32 %158, ptr %12, align 4, !tbaa !9
  %159 = load i32, ptr %12, align 4, !tbaa !9
  %160 = icmp ne i32 %159, 0
  br i1 %160, label %161, label %168

161:                                              ; preds = %150
  %162 = load ptr, ptr %7, align 8, !tbaa !5
  %163 = load ptr, ptr %7, align 8, !tbaa !5
  %164 = call i64 @strlen(ptr noundef %163) #8
  %165 = getelementptr inbounds i8, ptr %162, i64 %164
  %166 = load i32, ptr %12, align 4, !tbaa !9
  %167 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %165, ptr noundef @.str.5, i32 noundef %166) #6
  store i32 1, ptr %12, align 4, !tbaa !9
  store i32 5, ptr %17, align 4
  br label %221

168:                                              ; preds = %150
  %169 = load i32, ptr %19, align 4, !tbaa !9
  %170 = load i32, ptr %15, align 4, !tbaa !9
  %171 = sub i32 %170, %169
  store i32 %171, ptr %15, align 4, !tbaa !9
  %172 = load i32, ptr %19, align 4, !tbaa !9
  %173 = load ptr, ptr %16, align 8, !tbaa !5
  %174 = zext i32 %172 to i64
  %175 = getelementptr inbounds i8, ptr %173, i64 %174
  store ptr %175, ptr %16, align 8, !tbaa !5
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = icmp ne ptr %176, null
  br i1 %177, label %178, label %191

178:                                              ; preds = %168
  %179 = load i32, ptr %20, align 4, !tbaa !9
  %180 = zext i32 %179 to i64
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = call i64 @fwrite(ptr noundef @g_OutBuffer, i64 noundef 1, i64 noundef %180, ptr noundef %181)
  %183 = load i32, ptr %20, align 4, !tbaa !9
  %184 = zext i32 %183 to i64
  %185 = icmp ne i64 %182, %184
  br i1 %185, label %186, label %190

186:                                              ; preds = %178
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = load ptr, ptr @kCantWriteMessage, align 8, !tbaa !5
  %189 = call i32 @PrintError(ptr noundef %187, ptr noundef %188)
  store i32 1, ptr %12, align 4, !tbaa !9
  store i32 5, ptr %17, align 4
  br label %221

190:                                              ; preds = %178
  br label %191

191:                                              ; preds = %190, %168
  %192 = load i32, ptr %8, align 4, !tbaa !9
  %193 = load i32, ptr %20, align 4, !tbaa !9
  %194 = icmp ult i32 %192, %193
  br i1 %194, label %195, label %198

195:                                              ; preds = %191
  %196 = load i32, ptr %9, align 4, !tbaa !9
  %197 = add i32 %196, -1
  store i32 %197, ptr %9, align 4, !tbaa !9
  br label %198

198:                                              ; preds = %195, %191
  %199 = load i32, ptr %20, align 4, !tbaa !9
  %200 = load i32, ptr %8, align 4, !tbaa !9
  %201 = sub i32 %200, %199
  store i32 %201, ptr %8, align 4, !tbaa !9
  %202 = load i32, ptr %8, align 4, !tbaa !9
  %203 = and i32 %202, -1
  store i32 %203, ptr %8, align 4, !tbaa !9
  %204 = load i32, ptr %20, align 4, !tbaa !9
  %205 = icmp eq i32 %204, 0
  br i1 %205, label %206, label %220

206:                                              ; preds = %198
  %207 = load i32, ptr %21, align 4, !tbaa !9
  %208 = icmp ne i32 %207, 0
  br i1 %208, label %209, label %220

209:                                              ; preds = %206
  %210 = load i32, ptr %10, align 4, !tbaa !9
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %219, label %212

212:                                              ; preds = %209
  %213 = load i32, ptr %8, align 4, !tbaa !9
  %214 = icmp ne i32 %213, 0
  br i1 %214, label %218, label %215

215:                                              ; preds = %212
  %216 = load i32, ptr %9, align 4, !tbaa !9
  %217 = icmp ne i32 %216, 0
  br i1 %217, label %218, label %219

218:                                              ; preds = %215, %212
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %219

219:                                              ; preds = %218, %215, %209
  store i32 5, ptr %17, align 4
  br label %221

220:                                              ; preds = %206, %198
  store i32 0, ptr %17, align 4
  br label %221

221:                                              ; preds = %220, %219, %186, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %222 = load i32, ptr %17, align 4
  switch i32 %222, label %246 [
    i32 0, label %223
    i32 5, label %238
  ]

223:                                              ; preds = %221
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %8, align 4, !tbaa !9
  %226 = icmp ne i32 %225, 0
  br i1 %226, label %227, label %230

227:                                              ; preds = %224
  %228 = load i32, ptr %9, align 4, !tbaa !9
  %229 = icmp eq i32 %228, 0
  br i1 %229, label %236, label %230

230:                                              ; preds = %227, %224
  %231 = load i32, ptr %9, align 4, !tbaa !9
  %232 = icmp ne i32 %231, 0
  br i1 %232, label %236, label %233

233:                                              ; preds = %230
  %234 = load i32, ptr %10, align 4, !tbaa !9
  %235 = icmp ne i32 %234, 0
  br label %236

236:                                              ; preds = %233, %230, %227
  %237 = phi i1 [ true, %230 ], [ true, %227 ], [ %235, %233 ]
  br i1 %237, label %131, label %238, !llvm.loop !23

238:                                              ; preds = %236, %221
  %239 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 2
  %240 = load ptr, ptr %239, align 8, !tbaa !20
  call void @free(ptr noundef %240) #6
  %241 = getelementptr inbounds %struct._CLzmaDecoderState, ptr %13, i32 0, i32 1
  %242 = load ptr, ptr %241, align 8, !tbaa !18
  call void @free(ptr noundef %242) #6
  %243 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %243, ptr %4, align 4
  store i32 1, ptr %17, align 4
  br label %244

244:                                              ; preds = %238, %121, %100, %80, %69, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 5, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 152, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %245 = load i32, ptr %4, align 4
  ret i32 %245

246:                                              ; preds = %221
  unreachable
}

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

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

declare i32 @LzmaDecodeProperties(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

declare i32 @LzmaDecode(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #4

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

attributes #0 = { 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 #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 = { nounwind willreturn memory(read) "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { nounwind allocsize(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 = { nounwind allocsize(0) }
attributes #8 = { nounwind willreturn memory(read) }

!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 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !10, i64 0}
!15 = !{!"_CLzmaDecoderState", !16, i64 0, !6, i64 16, !6, i64 24, !7, i64 32, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !7, i64 120, !10, i64 136, !10, i64 140, !7, i64 144}
!16 = !{!"_CLzmaProperties", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!17 = !{!15, !10, i64 4}
!18 = !{!15, !6, i64 16}
!19 = !{!15, !10, i64 12}
!20 = !{!15, !6, i64 24}
!21 = !{!15, !10, i64 140}
!22 = !{!15, !10, i64 96}
!23 = distinct !{!23, !13}


; 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._CLzmaDecoderState = type { %struct._CLzmaProperties, ptr, ptr, [64 x i8], i32, i32, i32, i32, i32, i32, [4 x i32], i32, i32, [4 x i8] }
%struct._CLzmaProperties = type { i32, i32, i32, i32 }

@kCantReadMessage = external dso_local local_unnamed_addr global ptr, align 8
@kCantWriteMessage = external dso_local local_unnamed_addr global ptr, align 8
@kCantAllocateMessage = external dso_local local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@g_InBuffer = external dso_local global [32768 x i8], align 16
@g_OutBuffer = external dso_local global [32768 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i64 @MyReadFile(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @main3(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct._CLzmaDecoderState, align 8
  %5 = alloca [5 x i8], align 1
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 152, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %5) #8
  %9 = call i32 @MyReadFileAndCheck(ptr noundef %0, ptr noundef nonnull %5, i64 noundef 5)
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %11, label %.preheader.preheader

.preheader.preheader:                             ; preds = %3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  %10 = call i32 @MyReadFileAndCheck(ptr noundef %0, ptr noundef nonnull %6, i64 noundef 1)
  %.not93.not = icmp eq i32 %10, 0
  br i1 %.not93.not, label %14, label %.preheader.1

11:                                               ; preds = %3
  %12 = load ptr, ptr @kCantReadMessage, align 8, !tbaa !5
  %13 = call i32 @PrintError(ptr noundef %2, ptr noundef %12)
  br label %173

14:                                               ; preds = %.preheader.7, %.preheader.6, %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  %15 = load ptr, ptr @kCantReadMessage, align 8, !tbaa !5
  %16 = call i32 @PrintError(ptr noundef %2, ptr noundef %15)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  br label %173

.preheader.1:                                     ; preds = %.preheader.preheader
  %17 = load i8, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  %18 = call i32 @MyReadFileAndCheck(ptr noundef %0, ptr noundef nonnull %6, i64 noundef 1)
  %.not93.not.1 = icmp eq i32 %18, 0
  br i1 %.not93.not.1, label %14, label %.preheader.2

.preheader.2:                                     ; preds = %.preheader.1
  %19 = load i8, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  %20 = call i32 @MyReadFileAndCheck(ptr noundef %0, ptr noundef nonnull %6, i64 noundef 1)
  %.not93.not.2 = icmp eq i32 %20, 0
  br i1 %.not93.not.2, label %14, label %.preheader.3

.preheader.3:                                     ; preds = %.preheader.2
  %21 = load i8, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  %22 = call i32 @MyReadFileAndCheck(ptr noundef %0, ptr noundef nonnull %6, i64 noundef 1)
  %.not93.not.3 = icmp eq i32 %22, 0
  br i1 %.not93.not.3, label %14, label %.preheader.4

.preheader.4:                                     ; preds = %.preheader.3
  %.fr.2 = freeze i8 %21
  %23 = zext i8 %.fr.2 to i32
  %24 = shl nuw nsw i32 %23, 16
  %.fr.1 = freeze i8 %19
  %25 = zext i8 %.fr.1 to i32
  %26 = shl nuw nsw i32 %25, 8
  %.fr = freeze i8 %17
  %27 = zext i8 %.fr to i32
  %28 = or disjoint i32 %26, %27
  %29 = or disjoint i32 %24, %28
  %30 = load i8, ptr %6, align 1, !tbaa !9
  %.fr.3 = freeze i8 %30
  %31 = zext i8 %.fr.3 to i32
  %32 = shl nuw i32 %31, 24
  %33 = or disjoint i32 %32, %29
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  %34 = call i32 @MyReadFileAndCheck(ptr noundef %0, ptr noundef nonnull %6, i64 noundef 1)
  %.not93.not.4 = icmp eq i32 %34, 0
  br i1 %.not93.not.4, label %14, label %.preheader.5

.preheader.5:                                     ; preds = %.preheader.4
  %35 = load i8, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  %36 = call i32 @MyReadFileAndCheck(ptr noundef %0, ptr noundef nonnull %6, i64 noundef 1)
  %.not93.not.5 = icmp eq i32 %36, 0
  br i1 %.not93.not.5, label %14, label %.preheader.6

.preheader.6:                                     ; preds = %.preheader.5
  %37 = load i8, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  %38 = call i32 @MyReadFileAndCheck(ptr noundef %0, ptr noundef nonnull %6, i64 noundef 1)
  %.not93.not.6 = icmp eq i32 %38, 0
  br i1 %.not93.not.6, label %14, label %.preheader.7

.preheader.7:                                     ; preds = %.preheader.6
  %39 = load i8, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  %40 = call i32 @MyReadFileAndCheck(ptr noundef %0, ptr noundef nonnull %6, i64 noundef 1)
  %.not93.not.7 = icmp eq i32 %40, 0
  br i1 %.not93.not.7, label %14, label %41

41:                                               ; preds = %.preheader.7
  %.fr.6 = freeze i8 %39
  %42 = zext i8 %.fr.6 to i32
  %43 = shl nuw nsw i32 %42, 16
  %.fr.5 = freeze i8 %37
  %44 = zext i8 %.fr.5 to i32
  %45 = shl nuw nsw i32 %44, 8
  %.fr.4 = freeze i8 %35
  %46 = zext i8 %.fr.4 to i32
  %47 = or disjoint i32 %45, %46
  %48 = or disjoint i32 %43, %47
  %49 = and i8 %.fr.1, %.fr
  %50 = and i8 %.fr.2, %49
  %51 = and i8 %.fr.3, %50
  %52 = and i8 %.fr.4, %51
  %53 = and i8 %.fr.5, %52
  %54 = and i8 %.fr.6, %53
  %55 = load i8, ptr %6, align 1, !tbaa !9
  %.fr.7 = freeze i8 %55
  %56 = and i8 %.fr.7, %54
  %narrow = icmp eq i8 %56, -1
  %57 = zext i8 %.fr.7 to i32
  %58 = shl nuw i32 %57, 24
  %59 = or disjoint i32 %58, %48
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  %60 = call i32 @LzmaDecodeProperties(ptr noundef nonnull %4, ptr noundef nonnull %5, i32 noundef 5) #8
  %.not88 = icmp eq i32 %60, 0
  br i1 %.not88, label %63, label %61

61:                                               ; preds = %41
  %62 = call i32 @PrintError(ptr noundef %2, ptr noundef nonnull @.str.4)
  br label %173

63:                                               ; preds = %41
  %64 = load i32, ptr %4, align 8, !tbaa !10
  %65 = getelementptr inbounds i8, ptr %4, i64 4
  %66 = load i32, ptr %65, align 4, !tbaa !14
  %67 = add nsw i32 %66, %64
  %68 = shl i32 768, %67
  %69 = add nuw nsw i32 %68, 1846
  %70 = sext i32 %69 to i64
  %71 = shl nsw i64 %70, 1
  %72 = call noalias ptr @malloc(i64 noundef %71) #9
  %73 = getelementptr inbounds i8, ptr %4, i64 16
  store ptr %72, ptr %73, align 8, !tbaa !15
  %74 = icmp eq ptr %72, null
  br i1 %74, label %75, label %78

75:                                               ; preds = %63
  %76 = load ptr, ptr @kCantAllocateMessage, align 8, !tbaa !5
  %77 = call i32 @PrintError(ptr noundef %2, ptr noundef %76)
  br label %173

78:                                               ; preds = %63
  %79 = getelementptr inbounds i8, ptr %4, i64 12
  %80 = load i32, ptr %79, align 4, !tbaa !16
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %84

82:                                               ; preds = %78
  %83 = getelementptr inbounds i8, ptr %4, i64 24
  store ptr null, ptr %83, align 8, !tbaa !17
  br label %92

84:                                               ; preds = %78
  %85 = zext i32 %80 to i64
  %86 = call noalias ptr @malloc(i64 noundef %85) #9
  %87 = getelementptr inbounds i8, ptr %4, i64 24
  store ptr %86, ptr %87, align 8, !tbaa !17
  %88 = icmp eq ptr %86, null
  br i1 %88, label %89, label %92

89:                                               ; preds = %84
  call void @free(ptr noundef nonnull %72) #8
  %90 = load ptr, ptr @kCantAllocateMessage, align 8, !tbaa !5
  %91 = call i32 @PrintError(ptr noundef %2, ptr noundef %90)
  br label %173

92:                                               ; preds = %84, %82
  %93 = getelementptr inbounds i8, ptr %4, i64 140
  store i32 -2, ptr %93, align 4, !tbaa !18
  %94 = getelementptr inbounds i8, ptr %4, i64 96
  store i32 0, ptr %94, align 8, !tbaa !19
  %.not90 = icmp eq ptr %1, null
  br i1 %.not90, label %.split.us, label %.critedge

.split.us:                                        ; preds = %92
  br i1 %narrow, label %.critedge.us.us.us, label %.critedge.us

.critedge.us.us.us:                               ; preds = %.split.us, %106
  %.067.us.us.us = phi i32 [ %110, %106 ], [ 0, %.split.us ]
  %.064.us.us.us = phi ptr [ %109, %106 ], [ null, %.split.us ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %95 = icmp eq i32 %.067.us.us.us, 0
  br i1 %95, label %96, label %99

96:                                               ; preds = %.critedge.us.us.us
  %97 = call i64 @MyReadFile(ptr noundef %0, ptr noundef nonnull @g_InBuffer, i64 noundef 32768)
  %98 = trunc i64 %97 to i32
  br label %99

99:                                               ; preds = %96, %.critedge.us.us.us
  %.168.us.us.us = phi i32 [ %98, %96 ], [ %.067.us.us.us, %.critedge.us.us.us ]
  %.165.us.us.us = phi ptr [ @g_InBuffer, %96 ], [ %.064.us.us.us, %.critedge.us.us.us ]
  %100 = icmp eq i32 %.168.us.us.us, 0
  %101 = zext i1 %100 to i32
  %102 = call i32 @LzmaDecode(ptr noundef nonnull %4, ptr noundef %.165.us.us.us, i32 noundef %.168.us.us.us, ptr noundef nonnull %7, ptr noundef nonnull @g_OutBuffer, i32 noundef 32768, ptr noundef nonnull %8, i32 noundef %101) #8
  %.not89.us.us.us = icmp eq i32 %102, 0
  br i1 %.not89.us.us.us, label %103, label %.split134.us

103:                                              ; preds = %99
  %104 = load i32, ptr %8, align 4, !tbaa !20
  %105 = or i32 %104, %.168.us.us.us
  %or.cond3.us.us.us = icmp eq i32 %105, 0
  br i1 %or.cond3.us.us.us, label %.thread107, label %106

106:                                              ; preds = %103
  %107 = load i32, ptr %7, align 4, !tbaa !20
  %108 = zext i32 %107 to i64
  %109 = getelementptr inbounds i8, ptr %.165.us.us.us, i64 %108
  %110 = sub i32 %.168.us.us.us, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %.critedge.us.us.us

.critedge.us:                                     ; preds = %.split.us, %127
  %.382.us = phi i32 [ %125, %127 ], [ %33, %.split.us ]
  %.3.us = phi i32 [ %spec.select96.us, %127 ], [ %59, %.split.us ]
  %.067.us = phi i32 [ %131, %127 ], [ 0, %.split.us ]
  %.064.us = phi ptr [ %130, %127 ], [ null, %.split.us ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %111 = icmp eq i32 %.3.us, 0
  %112 = call i32 @llvm.umin.i32(i32 %.382.us, i32 32768)
  %spec.select172 = select i1 %111, i32 %112, i32 32768
  %113 = icmp eq i32 %.067.us, 0
  br i1 %113, label %114, label %117

114:                                              ; preds = %.critedge.us
  %115 = call i64 @MyReadFile(ptr noundef %0, ptr noundef nonnull @g_InBuffer, i64 noundef 32768)
  %116 = trunc i64 %115 to i32
  br label %117

117:                                              ; preds = %114, %.critedge.us
  %.168.us = phi i32 [ %116, %114 ], [ %.067.us, %.critedge.us ]
  %.165.us = phi ptr [ @g_InBuffer, %114 ], [ %.064.us, %.critedge.us ]
  %118 = icmp eq i32 %.168.us, 0
  %119 = zext i1 %118 to i32
  %120 = call i32 @LzmaDecode(ptr noundef nonnull %4, ptr noundef %.165.us, i32 noundef %.168.us, ptr noundef nonnull %7, ptr noundef nonnull @g_OutBuffer, i32 noundef %spec.select172, ptr noundef nonnull %8, i32 noundef %119) #8
  %.not89.us = icmp eq i32 %120, 0
  br i1 %.not89.us, label %121, label %.split134.us

121:                                              ; preds = %117
  %122 = load i32, ptr %8, align 4, !tbaa !20
  %123 = icmp ult i32 %.382.us, %122
  %124 = sext i1 %123 to i32
  %spec.select96.us = add i32 %.3.us, %124
  %125 = sub i32 %.382.us, %122
  %126 = or i32 %122, %.168.us
  %or.cond3.us = icmp eq i32 %126, 0
  br i1 %or.cond3.us, label %.split136.us.thread, label %127

127:                                              ; preds = %121
  %128 = load i32, ptr %7, align 4, !tbaa !20
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds i8, ptr %.165.us, i64 %129
  %131 = sub i32 %.168.us, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  %132 = icmp ne i32 %125, 0
  %133 = icmp ne i32 %spec.select96.us, 0
  %or.cond9.us = select i1 %132, i1 true, i1 %133
  br i1 %or.cond9.us, label %.critedge.us, label %.loopexit, !llvm.loop !21

.critedge:                                        ; preds = %92, %167
  %.382 = phi i32 [ %163, %167 ], [ %33, %92 ]
  %.3 = phi i32 [ %spec.select96, %167 ], [ %59, %92 ]
  %.067 = phi i32 [ %149, %167 ], [ 0, %92 ]
  %.064 = phi ptr [ %151, %167 ], [ null, %92 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  %134 = icmp ne i32 %.3, 0
  %or.cond.not = select i1 %narrow, i1 true, i1 %134
  %135 = call i32 @llvm.umin.i32(i32 %.382, i32 32768)
  %.0 = select i1 %or.cond.not, i32 32768, i32 %135
  %136 = icmp eq i32 %.067, 0
  br i1 %136, label %137, label %140

137:                                              ; preds = %.critedge
  %138 = call i64 @MyReadFile(ptr noundef %0, ptr noundef nonnull @g_InBuffer, i64 noundef 32768)
  %139 = trunc i64 %138 to i32
  br label %140

140:                                              ; preds = %137, %.critedge
  %.168 = phi i32 [ %139, %137 ], [ %.067, %.critedge ]
  %.165 = phi ptr [ @g_InBuffer, %137 ], [ %.064, %.critedge ]
  %141 = icmp eq i32 %.168, 0
  %142 = zext i1 %141 to i32
  %143 = call i32 @LzmaDecode(ptr noundef nonnull %4, ptr noundef %.165, i32 noundef %.168, ptr noundef nonnull %7, ptr noundef nonnull @g_OutBuffer, i32 noundef %.0, ptr noundef nonnull %8, i32 noundef %142) #8
  %.not89 = icmp eq i32 %143, 0
  br i1 %.not89, label %147, label %.split134.us

.split134.us:                                     ; preds = %140, %117, %99
  %.us-phi = phi i32 [ %102, %99 ], [ %120, %117 ], [ %143, %140 ]
  %144 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #10
  %145 = getelementptr inbounds i8, ptr %2, i64 %144
  %146 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %145, ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %.us-phi) #8
  br label %.thread107

147:                                              ; preds = %140
  %148 = load i32, ptr %7, align 4, !tbaa !20
  %149 = sub i32 %.168, %148
  %150 = zext i32 %148 to i64
  %151 = getelementptr inbounds i8, ptr %.165, i64 %150
  %152 = load i32, ptr %8, align 4, !tbaa !20
  %153 = zext i32 %152 to i64
  %154 = call i64 @fwrite(ptr noundef nonnull @g_OutBuffer, i64 noundef 1, i64 noundef %153, ptr noundef nonnull %1)
  %155 = load i32, ptr %8, align 4, !tbaa !20
  %156 = zext i32 %155 to i64
  %.not91 = icmp eq i64 %154, %156
  br i1 %.not91, label %160, label %157

157:                                              ; preds = %147
  %158 = load ptr, ptr @kCantWriteMessage, align 8, !tbaa !5
  %159 = call i32 @PrintError(ptr noundef %2, ptr noundef %158)
  br label %.thread107

160:                                              ; preds = %147
  %161 = icmp ult i32 %.382, %155
  %162 = sext i1 %161 to i32
  %spec.select96 = add i32 %.3, %162
  %163 = sub i32 %.382, %155
  %164 = or i32 %155, %.168
  %or.cond3 = icmp eq i32 %164, 0
  br i1 %or.cond3, label %.split136.us, label %167

.split136.us:                                     ; preds = %160
  br i1 %narrow, label %.thread107, label %.split136.us.thread

.split136.us.thread:                              ; preds = %121, %.split136.us
  %.us-phi138215 = phi i32 [ %163, %.split136.us ], [ %125, %121 ]
  %.us-phi137214 = phi i32 [ %spec.select96, %.split136.us ], [ %spec.select96.us, %121 ]
  %165 = icmp ne i32 %.us-phi138215, 0
  %166 = icmp ne i32 %.us-phi137214, 0
  %or.cond5 = select i1 %165, i1 true, i1 %166
  %spec.select97 = zext i1 %or.cond5 to i32
  br label %.thread107

.thread107:                                       ; preds = %103, %.split134.us, %157, %.split136.us.thread, %.split136.us
  %.171.ph = phi i32 [ %spec.select97, %.split136.us.thread ], [ 0, %.split136.us ], [ 1, %157 ], [ 1, %.split134.us ], [ 0, %103 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  br label %.loopexit

167:                                              ; preds = %160
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  %168 = icmp ne i32 %163, 0
  %169 = icmp ne i32 %spec.select96, 0
  %or.cond9 = select i1 %168, i1 true, i1 %169
  %or.cond11 = select i1 %or.cond9, i1 true, i1 %narrow
  br i1 %or.cond11, label %.critedge, label %.loopexit, !llvm.loop !21

.loopexit:                                        ; preds = %167, %127, %.thread107
  %.171115 = phi i32 [ %.171.ph, %.thread107 ], [ 0, %127 ], [ 0, %167 ]
  %170 = getelementptr inbounds i8, ptr %4, i64 24
  %171 = load ptr, ptr %170, align 8, !tbaa !17
  call void @free(ptr noundef %171) #8
  %172 = load ptr, ptr %73, align 8, !tbaa !15
  call void @free(ptr noundef %172) #8
  br label %173

173:                                              ; preds = %14, %.loopexit, %89, %75, %61, %11
  %.2 = phi i32 [ %16, %14 ], [ %62, %61 ], [ %77, %75 ], [ %.171115, %.loopexit ], [ %91, %89 ], [ %13, %11 ]
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %4) #8
  ret i32 %.2
}

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

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

declare i32 @LzmaDecodeProperties(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5

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

declare i32 @LzmaDecode(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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

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

attributes #0 = { 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 #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 nofree nounwind willreturn memory(argmem: read) "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind willreturn memory(read) }

!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 = !{!7, !7, i64 0}
!10 = !{!11, !13, i64 0}
!11 = !{!"_CLzmaDecoderState", !12, i64 0, !6, i64 16, !6, i64 24, !7, i64 32, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !13, i64 112, !13, i64 116, !7, i64 120, !13, i64 136, !13, i64 140, !7, i64 144}
!12 = !{!"_CLzmaProperties", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!13 = !{!"int", !7, i64 0}
!14 = !{!11, !13, i64 4}
!15 = !{!11, !6, i64 16}
!16 = !{!11, !13, i64 12}
!17 = !{!11, !6, i64 24}
!18 = !{!11, !13, i64 140}
!19 = !{!11, !13, i64 96}
!20 = !{!13, !13, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass