; LLVM IR from yourtion/LearningMasteringAlgorithms-C :: source (lz77)

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__bswap_32(i32 noundef) #4

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #5

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

declare void @bit_set(ptr noundef, i32 noundef, i32 noundef) #7

declare i32 @bit_get(ptr noundef, i32 noundef) #7

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

; 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
define dso_local i32 @lz77_uncompress(ptr noundef %0, ptr noundef %1) #8 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [4096 x i8], align 16
  %7 = alloca [32 x i8], align 16
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4096, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  store ptr null, ptr %8, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr null, ptr %22, align 8, !tbaa !5
  store i32 4, ptr %14, align 4, !tbaa !9
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 1 %23, i64 4, i1 false)
  %24 = getelementptr inbounds [4096 x i8], ptr %6, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %24, i8 0, i64 4096, i1 false)
  %25 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %25, i8 0, i64 32, i1 false)
  %26 = load i32, ptr %14, align 4, !tbaa !9
  %27 = mul nsw i32 %26, 8
  store i32 %27, ptr %16, align 4, !tbaa !9
  store i32 0, ptr %17, align 4, !tbaa !9
  %28 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %28, ptr %13, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %231, %2
  %30 = load i32, ptr %13, align 4, !tbaa !9
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %32, label %246

32:                                               ; preds = %29
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = load i32, ptr %16, align 4, !tbaa !9
  %35 = call i32 @bit_get(ptr noundef %33, i32 noundef %34)
  store i32 %35, ptr %19, align 4, !tbaa !9
  %36 = load i32, ptr %16, align 4, !tbaa !9
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %16, align 4, !tbaa !9
  %38 = load i32, ptr %19, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 1
  br i1 %39, label %40, label %178

40:                                               ; preds = %32
  call void @llvm.memset.p0.i64(ptr align 4 %11, i8 0, i64 4, i1 false)
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %55, %40
  %42 = load i32, ptr %20, align 4, !tbaa !9
  %43 = icmp slt i32 %42, 12
  br i1 %43, label %44, label %58

44:                                               ; preds = %41
  %45 = load i32, ptr %20, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = add i64 20, %46
  %48 = trunc i64 %47 to i32
  store i32 %48, ptr %18, align 4, !tbaa !9
  %49 = load i32, ptr %18, align 4, !tbaa !9
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = load i32, ptr %16, align 4, !tbaa !9
  %52 = call i32 @bit_get(ptr noundef %50, i32 noundef %51)
  call void @bit_set(ptr noundef %11, i32 noundef %49, i32 noundef %52)
  %53 = load i32, ptr %16, align 4, !tbaa !9
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %16, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %44
  %56 = load i32, ptr %20, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %20, align 4, !tbaa !9
  br label %41, !llvm.loop !11

58:                                               ; preds = %41
  call void @llvm.memset.p0.i64(ptr align 4 %12, i8 0, i64 4, i1 false)
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %73, %58
  %60 = load i32, ptr %20, align 4, !tbaa !9
  %61 = icmp slt i32 %60, 5
  br i1 %61, label %62, label %76

62:                                               ; preds = %59
  %63 = load i32, ptr %20, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = add i64 27, %64
  %66 = trunc i64 %65 to i32
  store i32 %66, ptr %18, align 4, !tbaa !9
  %67 = load i32, ptr %18, align 4, !tbaa !9
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = load i32, ptr %16, align 4, !tbaa !9
  %70 = call i32 @bit_get(ptr noundef %68, i32 noundef %69)
  call void @bit_set(ptr noundef %12, i32 noundef %67, i32 noundef %70)
  %71 = load i32, ptr %16, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %16, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %62
  %74 = load i32, ptr %20, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %20, align 4, !tbaa !9
  br label %59, !llvm.loop !13

76:                                               ; preds = %59
  store i8 0, ptr %10, align 1, !tbaa !14
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %77

77:                                               ; preds = %91, %76
  %78 = load i32, ptr %20, align 4, !tbaa !9
  %79 = icmp slt i32 %78, 8
  br i1 %79, label %80, label %94

80:                                               ; preds = %77
  %81 = load i32, ptr %20, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = add i64 0, %82
  %84 = trunc i64 %83 to i32
  store i32 %84, ptr %18, align 4, !tbaa !9
  %85 = load i32, ptr %18, align 4, !tbaa !9
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = load i32, ptr %16, align 4, !tbaa !9
  %88 = call i32 @bit_get(ptr noundef %86, i32 noundef %87)
  call void @bit_set(ptr noundef %10, i32 noundef %85, i32 noundef %88)
  %89 = load i32, ptr %16, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %16, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %80
  %92 = load i32, ptr %20, align 4, !tbaa !9
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %20, align 4, !tbaa !9
  br label %77, !llvm.loop !15

94:                                               ; preds = %77
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = call i32 @__bswap_32(i32 noundef %95)
  store i32 %96, ptr %11, align 4, !tbaa !9
  %97 = load i32, ptr %12, align 4, !tbaa !9
  %98 = call i32 @__bswap_32(i32 noundef %97)
  store i32 %98, ptr %12, align 4, !tbaa !9
  store i32 0, ptr %20, align 4, !tbaa !9
  %99 = load i32, ptr %17, align 4, !tbaa !9
  %100 = icmp sgt i32 %99, 0
  br i1 %100, label %101, label %114

101:                                              ; preds = %94
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = load i32, ptr %17, align 4, !tbaa !9
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = add nsw i32 %103, %104
  %106 = add nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = call ptr @realloc(ptr noundef %102, i64 noundef %107) #10
  store ptr %108, ptr %9, align 8, !tbaa !5
  %109 = icmp eq ptr %108, null
  br i1 %109, label %110, label %112

110:                                              ; preds = %101
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %111) #9
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %250

112:                                              ; preds = %101
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %113, ptr %8, align 8, !tbaa !5
  br label %122

114:                                              ; preds = %94
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = add nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = call noalias ptr @malloc(i64 noundef %117) #11
  store ptr %118, ptr %8, align 8, !tbaa !5
  %119 = icmp eq ptr %118, null
  br i1 %119, label %120, label %121

120:                                              ; preds = %114
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %250

121:                                              ; preds = %114
  br label %122

122:                                              ; preds = %121, %112
  br label %123

123:                                              ; preds = %132, %122
  %124 = load i32, ptr %20, align 4, !tbaa !9
  %125 = load i32, ptr %12, align 4, !tbaa !9
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %127, label %130

127:                                              ; preds = %123
  %128 = load i32, ptr %13, align 4, !tbaa !9
  %129 = icmp sgt i32 %128, 0
  br label %130

130:                                              ; preds = %127, %123
  %131 = phi i1 [ false, %123 ], [ %129, %127 ]
  br i1 %131, label %132, label %158

132:                                              ; preds = %130
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = load i32, ptr %20, align 4, !tbaa !9
  %135 = add nsw i32 %133, %134
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [4096 x i8], ptr %6, i64 0, i64 %136
  %138 = load i8, ptr %137, align 1, !tbaa !14
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = load i32, ptr %17, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i8, ptr %139, i64 %141
  store i8 %138, ptr %142, align 1, !tbaa !14
  %143 = load i32, ptr %17, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %17, align 4, !tbaa !9
  %145 = load i32, ptr %11, align 4, !tbaa !9
  %146 = load i32, ptr %20, align 4, !tbaa !9
  %147 = add nsw i32 %145, %146
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [4096 x i8], ptr %6, i64 0, i64 %148
  %150 = load i8, ptr %149, align 1, !tbaa !14
  %151 = load i32, ptr %20, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 %152
  store i8 %150, ptr %153, align 1, !tbaa !14
  %154 = load i32, ptr %20, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %20, align 4, !tbaa !9
  %156 = load i32, ptr %13, align 4, !tbaa !9
  %157 = add nsw i32 %156, -1
  store i32 %157, ptr %13, align 4, !tbaa !9
  br label %123, !llvm.loop !16

158:                                              ; preds = %130
  %159 = load i32, ptr %13, align 4, !tbaa !9
  %160 = icmp sgt i32 %159, 0
  br i1 %160, label %161, label %175

161:                                              ; preds = %158
  %162 = load i8, ptr %10, align 1, !tbaa !14
  %163 = load ptr, ptr %8, align 8, !tbaa !5
  %164 = load i32, ptr %17, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i8, ptr %163, i64 %165
  store i8 %162, ptr %166, align 1, !tbaa !14
  %167 = load i32, ptr %17, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %17, align 4, !tbaa !9
  %169 = load i8, ptr %10, align 1, !tbaa !14
  %170 = load i32, ptr %20, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 %171
  store i8 %169, ptr %172, align 1, !tbaa !14
  %173 = load i32, ptr %13, align 4, !tbaa !9
  %174 = add nsw i32 %173, -1
  store i32 %174, ptr %13, align 4, !tbaa !9
  br label %175

175:                                              ; preds = %161, %158
  %176 = load i32, ptr %12, align 4, !tbaa !9
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %12, align 4, !tbaa !9
  br label %231

178:                                              ; preds = %32
  store i8 0, ptr %10, align 1, !tbaa !14
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %179

179:                                              ; preds = %193, %178
  %180 = load i32, ptr %20, align 4, !tbaa !9
  %181 = icmp slt i32 %180, 8
  br i1 %181, label %182, label %196

182:                                              ; preds = %179
  %183 = load i32, ptr %20, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = add i64 0, %184
  %186 = trunc i64 %185 to i32
  store i32 %186, ptr %18, align 4, !tbaa !9
  %187 = load i32, ptr %18, align 4, !tbaa !9
  %188 = load ptr, ptr %4, align 8, !tbaa !5
  %189 = load i32, ptr %16, align 4, !tbaa !9
  %190 = call i32 @bit_get(ptr noundef %188, i32 noundef %189)
  call void @bit_set(ptr noundef %10, i32 noundef %187, i32 noundef %190)
  %191 = load i32, ptr %16, align 4, !tbaa !9
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %16, align 4, !tbaa !9
  br label %193

193:                                              ; preds = %182
  %194 = load i32, ptr %20, align 4, !tbaa !9
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %20, align 4, !tbaa !9
  br label %179, !llvm.loop !17

196:                                              ; preds = %179
  %197 = load i32, ptr %17, align 4, !tbaa !9
  %198 = icmp sgt i32 %197, 0
  br i1 %198, label %199, label %210

199:                                              ; preds = %196
  %200 = load ptr, ptr %8, align 8, !tbaa !5
  %201 = load i32, ptr %17, align 4, !tbaa !9
  %202 = add nsw i32 %201, 1
  %203 = sext i32 %202 to i64
  %204 = call ptr @realloc(ptr noundef %200, i64 noundef %203) #10
  store ptr %204, ptr %9, align 8, !tbaa !5
  %205 = icmp eq ptr %204, null
  br i1 %205, label %206, label %208

206:                                              ; preds = %199
  %207 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %207) #9
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %250

208:                                              ; preds = %199
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %209, ptr %8, align 8, !tbaa !5
  br label %215

210:                                              ; preds = %196
  %211 = call noalias ptr @malloc(i64 noundef 1) #11
  store ptr %211, ptr %8, align 8, !tbaa !5
  %212 = icmp eq ptr %211, null
  br i1 %212, label %213, label %214

213:                                              ; preds = %210
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %250

214:                                              ; preds = %210
  br label %215

215:                                              ; preds = %214, %208
  %216 = load i8, ptr %10, align 1, !tbaa !14
  %217 = load ptr, ptr %8, align 8, !tbaa !5
  %218 = load i32, ptr %17, align 4, !tbaa !9
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds i8, ptr %217, i64 %219
  store i8 %216, ptr %220, align 1, !tbaa !14
  %221 = load i32, ptr %17, align 4, !tbaa !9
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %17, align 4, !tbaa !9
  %223 = load i32, ptr %13, align 4, !tbaa !9
  %224 = icmp sgt i32 %223, 0
  br i1 %224, label %225, label %228

225:                                              ; preds = %215
  %226 = load i8, ptr %10, align 1, !tbaa !14
  %227 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  store i8 %226, ptr %227, align 16, !tbaa !14
  br label %228

228:                                              ; preds = %225, %215
  %229 = load i32, ptr %13, align 4, !tbaa !9
  %230 = add nsw i32 %229, -1
  store i32 %230, ptr %13, align 4, !tbaa !9
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %231

231:                                              ; preds = %228, %175
  %232 = getelementptr inbounds [4096 x i8], ptr %6, i64 0, i64 0
  %233 = load i32, ptr %12, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [4096 x i8], ptr %6, i64 0, i64 %234
  %236 = load i32, ptr %12, align 4, !tbaa !9
  %237 = sub nsw i32 4096, %236
  %238 = sext i32 %237 to i64
  call void @llvm.memmove.p0.p0.i64(ptr align 16 %232, ptr align 1 %235, i64 %238, i1 false)
  %239 = load i32, ptr %12, align 4, !tbaa !9
  %240 = sub nsw i32 4096, %239
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [4096 x i8], ptr %6, i64 0, i64 %241
  %243 = getelementptr inbounds [32 x i8], ptr %7, i64 0, i64 0
  %244 = load i32, ptr %12, align 4, !tbaa !9
  %245 = sext i32 %244 to i64
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %242, ptr align 16 %243, i64 %245, i1 false)
  br label %29, !llvm.loop !18

246:                                              ; preds = %29
  %247 = load ptr, ptr %8, align 8, !tbaa !5
  %248 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %247, ptr %248, align 8, !tbaa !5
  %249 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %249, ptr %3, align 4
  store i32 1, ptr %21, align 4
  br label %250

250:                                              ; preds = %246, %213, %206, %120, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4096, ptr %6) #9
  %251 = load i32, ptr %3, align 4
  ret i32 %251
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { inlinehint 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 #5 = { nounwind allocsize(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 #6 = { 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 #7 = { "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 #8 = { 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 #9 = { nounwind }
attributes #10 = { nounwind allocsize(1) }
attributes #11 = { nounwind allocsize(0) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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

; 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__bswap_32(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #4

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

declare void @bit_set(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

declare i32 @bit_get(ptr noundef, i32 noundef) local_unnamed_addr #6

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

; 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
define dso_local i32 @lz77_uncompress(ptr noundef %0, ptr nocapture noundef writeonly %1) local_unnamed_addr #8 {
  %3 = alloca [4096 x i8], align 16
  %4 = alloca [32 x i8], align 16
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %3) #11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #11
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #11
  store ptr null, ptr %1, align 8, !tbaa !5
  %.0.copyload = load i32, ptr %0, align 1
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4096) %3, i8 0, i64 4096, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %4, i8 0, i64 32, i1 false)
  %8 = icmp sgt i32 %.0.copyload, 0
  br i1 %8, label %.lr.ph121, label %._crit_edge122

.lr.ph121:                                        ; preds = %2, %143
  %.072119 = phi i32 [ %.375, %143 ], [ 0, %2 ]
  %.076118 = phi i32 [ %.5, %143 ], [ 32, %2 ]
  %.081117 = phi ptr [ %.384, %143 ], [ null, %2 ]
  %.085116 = phi i32 [ %.388, %143 ], [ %.0.copyload, %2 ]
  %9 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %.076118) #11
  %10 = add nsw i32 %.076118, 1
  %11 = icmp eq i32 %9, 1
  %12 = add nsw i32 %.076118, 2
  %13 = add nsw i32 %.076118, 3
  %14 = add nsw i32 %.076118, 4
  %15 = add nsw i32 %.076118, 5
  %16 = add nsw i32 %.076118, 6
  %17 = add nsw i32 %.076118, 7
  %18 = add nsw i32 %.076118, 8
  %19 = add nsw i32 %.076118, 9
  br i1 %11, label %20, label %119

20:                                               ; preds = %.lr.ph121
  store i32 0, ptr %6, align 4
  %21 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %10) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 20, i32 noundef %21) #11
  %22 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %12) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 21, i32 noundef %22) #11
  %23 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %13) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 22, i32 noundef %23) #11
  %24 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %14) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 23, i32 noundef %24) #11
  %25 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %15) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 24, i32 noundef %25) #11
  %26 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %16) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 25, i32 noundef %26) #11
  %27 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %17) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 26, i32 noundef %27) #11
  %28 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %18) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 27, i32 noundef %28) #11
  %29 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %19) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 28, i32 noundef %29) #11
  %30 = add nsw i32 %.076118, 10
  %31 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %30) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 29, i32 noundef %31) #11
  %32 = add nsw i32 %.076118, 11
  %33 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %32) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 30, i32 noundef %33) #11
  %34 = add nsw i32 %.076118, 12
  %35 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %34) #11
  call void @bit_set(ptr noundef nonnull %6, i32 noundef 31, i32 noundef %35) #11
  %36 = add nsw i32 %.076118, 13
  store i32 0, ptr %7, align 4
  %37 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %36) #11
  call void @bit_set(ptr noundef nonnull %7, i32 noundef 27, i32 noundef %37) #11
  %38 = add nsw i32 %.076118, 14
  %39 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %38) #11
  call void @bit_set(ptr noundef nonnull %7, i32 noundef 28, i32 noundef %39) #11
  %40 = add nsw i32 %.076118, 15
  %41 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %40) #11
  call void @bit_set(ptr noundef nonnull %7, i32 noundef 29, i32 noundef %41) #11
  %42 = add nsw i32 %.076118, 16
  %43 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %42) #11
  call void @bit_set(ptr noundef nonnull %7, i32 noundef 30, i32 noundef %43) #11
  %44 = add nsw i32 %.076118, 17
  %45 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %44) #11
  call void @bit_set(ptr noundef nonnull %7, i32 noundef 31, i32 noundef %45) #11
  %46 = add nsw i32 %.076118, 18
  store i8 0, ptr %5, align 1, !tbaa !9
  %47 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %46) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 0, i32 noundef %47) #11
  %48 = add nsw i32 %.076118, 19
  %49 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %48) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 1, i32 noundef %49) #11
  %50 = add nsw i32 %.076118, 20
  %51 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %50) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 2, i32 noundef %51) #11
  %52 = add nsw i32 %.076118, 21
  %53 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %52) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 3, i32 noundef %53) #11
  %54 = add nsw i32 %.076118, 22
  %55 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %54) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 4, i32 noundef %55) #11
  %56 = add nsw i32 %.076118, 23
  %57 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %56) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 5, i32 noundef %57) #11
  %58 = add nsw i32 %.076118, 24
  %59 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %58) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 6, i32 noundef %59) #11
  %60 = add nsw i32 %.076118, 25
  %61 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %60) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 7, i32 noundef %61) #11
  %62 = add nsw i32 %.076118, 26
  %63 = load i32, ptr %6, align 4, !tbaa !10
  %64 = call i32 @__bswap_32(i32 noundef %63)
  store i32 %64, ptr %6, align 4, !tbaa !10
  %65 = load i32, ptr %7, align 4, !tbaa !10
  %66 = call i32 @__bswap_32(i32 noundef %65)
  store i32 %66, ptr %7, align 4, !tbaa !10
  %67 = icmp sgt i32 %.072119, 0
  br i1 %67, label %68, label %75

68:                                               ; preds = %20
  %69 = add nuw i32 %.072119, 1
  %70 = add i32 %69, %66
  %71 = sext i32 %70 to i64
  %72 = call ptr @realloc(ptr noundef %.081117, i64 noundef %71) #12
  %73 = icmp eq ptr %72, null
  br i1 %73, label %74, label %._crit_edge145

._crit_edge145:                                   ; preds = %68
  %.pre = load i32, ptr %7, align 4, !tbaa !10
  br label %80

74:                                               ; preds = %68
  call void @free(ptr noundef %.081117) #11
  br label %.loopexit

75:                                               ; preds = %20
  %76 = add nsw i32 %66, 1
  %77 = sext i32 %76 to i64
  %78 = call noalias ptr @malloc(i64 noundef %77) #13
  %79 = icmp eq ptr %78, null
  br i1 %79, label %.loopexit, label %80

80:                                               ; preds = %._crit_edge145, %75
  %81 = phi i32 [ %66, %75 ], [ %.pre, %._crit_edge145 ]
  %.182 = phi ptr [ %78, %75 ], [ %72, %._crit_edge145 ]
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %80
  %83 = load i32, ptr %6, align 4, !tbaa !10
  %84 = sext i32 %.072119 to i64
  %scevgep = getelementptr i8, ptr %.182, i64 %84
  %85 = sext i32 %83 to i64
  %scevgep136 = getelementptr i8, ptr %3, i64 %85
  %86 = add nsw i32 %.085116, -1
  %87 = add nsw i32 %81, -1
  %88 = call i32 @llvm.umin.i32(i32 %86, i32 %87)
  %umin = zext nneg i32 %88 to i64
  %89 = add nuw nsw i64 %umin, 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, ptr noundef nonnull align 1 dereferenceable(1) %scevgep136, i64 %89, i1 false), !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %4, ptr noundef nonnull align 1 dereferenceable(1) %scevgep136, i64 %89, i1 false), !tbaa !9
  %90 = zext nneg i32 %81 to i64
  %91 = add nsw i64 %90, -1
  %92 = add nsw i32 %.085116, -1
  %93 = zext i32 %92 to i64
  %umin164 = call i64 @llvm.umin.i64(i64 %91, i64 %93)
  %94 = add nuw nsw i64 %umin164, 1
  %min.iters.check = icmp ult i64 %umin164, 3
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %94, 8589934588
  %.cast = trunc i64 %n.vec to i32
  %ind.end = sub i32 %.085116, %.cast
  %95 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %84, i64 0
  %96 = add nsw i32 %.085116, -1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ %95, %vector.ph ], [ %98, %vector.body ]
  %vec.phi166 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %99, %vector.body ]
  %97 = phi i32 [ %96, %vector.ph ], [ %100, %vector.body ]
  %98 = add <2 x i64> %vec.phi, <i64 1, i64 1>
  %99 = add <2 x i64> %vec.phi166, <i64 1, i64 1>
  %index.next = add nuw i64 %index, 4
  %100 = add i32 %97, -4
  %101 = icmp eq i64 %index.next, %n.vec
  br i1 %101, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %102 = and i32 %97, -2
  %103 = icmp ne i32 %102, 2
  %bin.rdx = add <2 x i64> %99, %98
  %104 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %94, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv140.ph = phi i64 [ %84, %.lr.ph ], [ %104, %middle.block ]
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  %.186109.ph = phi i32 [ %.085116, %.lr.ph ], [ %ind.end, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv140 = phi i64 [ %indvars.iv.next141, %scalar.ph ], [ %indvars.iv140.ph, %scalar.ph.preheader ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %.186109 = phi i32 [ %105, %scalar.ph ], [ %.186109.ph, %scalar.ph.preheader ]
  %indvars.iv.next141 = add nsw i64 %indvars.iv140, 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %105 = add nsw i32 %.186109, -1
  %106 = icmp ult i64 %indvars.iv.next, %90
  %107 = icmp ugt i32 %.186109, 1
  %108 = select i1 %106, i1 %107, i1 false
  br i1 %108, label %scalar.ph, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %indvars.iv.next141.lcssa = phi i64 [ %104, %middle.block ], [ %indvars.iv.next141, %scalar.ph ]
  %indvars.iv.next.lcssa = phi i64 [ %n.vec, %middle.block ], [ %indvars.iv.next, %scalar.ph ]
  %.lcssa159 = phi i32 [ %ind.end, %middle.block ], [ %105, %scalar.ph ]
  %.lcssa = phi i1 [ %103, %middle.block ], [ %107, %scalar.ph ]
  %109 = trunc nsw i64 %indvars.iv.next141.lcssa to i32
  br i1 %.lcssa, label %._crit_edge.thread, label %117

._crit_edge.thread:                               ; preds = %80, %._crit_edge
  %.3.lcssa154 = phi i64 [ %indvars.iv.next.lcssa, %._crit_edge ], [ 0, %80 ]
  %.173.lcssa153 = phi i32 [ %109, %._crit_edge ], [ %.072119, %80 ]
  %.186.lcssa152 = phi i32 [ %.lcssa159, %._crit_edge ], [ %.085116, %80 ]
  %110 = load i8, ptr %5, align 1, !tbaa !9
  %111 = sext i32 %.173.lcssa153 to i64
  %112 = getelementptr inbounds i8, ptr %.182, i64 %111
  store i8 %110, ptr %112, align 1, !tbaa !9
  %113 = add nsw i32 %.173.lcssa153, 1
  %114 = and i64 %.3.lcssa154, 4294967295
  %115 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 %114
  store i8 %110, ptr %115, align 1, !tbaa !9
  %116 = add nsw i32 %.186.lcssa152, -1
  br label %117

117:                                              ; preds = %._crit_edge.thread, %._crit_edge
  %.287 = phi i32 [ %116, %._crit_edge.thread ], [ 0, %._crit_edge ]
  %.274 = phi i32 [ %113, %._crit_edge.thread ], [ %109, %._crit_edge ]
  %118 = add nsw i32 %81, 1
  br label %143

119:                                              ; preds = %.lr.ph121
  store i8 0, ptr %5, align 1, !tbaa !9
  %120 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %10) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 0, i32 noundef %120) #11
  %121 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %12) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 1, i32 noundef %121) #11
  %122 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %13) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 2, i32 noundef %122) #11
  %123 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %14) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 3, i32 noundef %123) #11
  %124 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %15) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 4, i32 noundef %124) #11
  %125 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %16) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 5, i32 noundef %125) #11
  %126 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %17) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 6, i32 noundef %126) #11
  %127 = call i32 @bit_get(ptr noundef nonnull %0, i32 noundef %18) #11
  call void @bit_set(ptr noundef nonnull %5, i32 noundef 7, i32 noundef %127) #11
  %128 = icmp sgt i32 %.072119, 0
  br i1 %128, label %129, label %135

129:                                              ; preds = %119
  %130 = add nuw nsw i32 %.072119, 1
  %131 = zext nneg i32 %130 to i64
  %132 = call ptr @realloc(ptr noundef %.081117, i64 noundef %131) #12
  %133 = icmp eq ptr %132, null
  br i1 %133, label %134, label %138

134:                                              ; preds = %129
  call void @free(ptr noundef %.081117) #11
  br label %.loopexit

135:                                              ; preds = %119
  %136 = call noalias dereferenceable_or_null(1) ptr @malloc(i64 noundef 1) #13
  %137 = icmp eq ptr %136, null
  br i1 %137, label %.loopexit, label %._crit_edge146

._crit_edge146:                                   ; preds = %135
  %.pre147 = add nsw i32 %.072119, 1
  br label %138

138:                                              ; preds = %._crit_edge146, %129
  %.pre-phi = phi i32 [ %.pre147, %._crit_edge146 ], [ %130, %129 ]
  %.283 = phi ptr [ %136, %._crit_edge146 ], [ %132, %129 ]
  %139 = load i8, ptr %5, align 1, !tbaa !9
  %140 = sext i32 %.072119 to i64
  %141 = getelementptr inbounds i8, ptr %.283, i64 %140
  store i8 %139, ptr %141, align 1, !tbaa !9
  store i8 %139, ptr %4, align 16, !tbaa !9
  %142 = add nsw i32 %.085116, -1
  br label %143

143:                                              ; preds = %138, %117
  %storemerge = phi i32 [ 1, %138 ], [ %118, %117 ]
  %.388 = phi i32 [ %142, %138 ], [ %.287, %117 ]
  %.384 = phi ptr [ %.283, %138 ], [ %.182, %117 ]
  %.5 = phi i32 [ %19, %138 ], [ %62, %117 ]
  %.375 = phi i32 [ %.pre-phi, %138 ], [ %.274, %117 ]
  store i32 %storemerge, ptr %7, align 4, !tbaa !10
  %144 = sext i32 %storemerge to i64
  %145 = getelementptr inbounds [4096 x i8], ptr %3, i64 0, i64 %144
  %146 = sub nsw i32 4096, %storemerge
  %147 = sext i32 %146 to i64
  call void @llvm.memmove.p0.p0.i64(ptr nonnull align 16 %3, ptr nonnull align 1 %145, i64 %147, i1 false)
  %148 = getelementptr inbounds [4096 x i8], ptr %3, i64 0, i64 %147
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %148, ptr nonnull align 16 %4, i64 %144, i1 false)
  %149 = icmp sgt i32 %.388, 0
  br i1 %149, label %.lr.ph121, label %._crit_edge122, !llvm.loop !17

._crit_edge122:                                   ; preds = %143, %2
  %.081.lcssa = phi ptr [ null, %2 ], [ %.384, %143 ]
  %.072.lcssa = phi i32 [ 0, %2 ], [ %.375, %143 ]
  store ptr %.081.lcssa, ptr %1, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %135, %75, %._crit_edge122, %134, %74
  %.071 = phi i32 [ -1, %74 ], [ -1, %134 ], [ %.072.lcssa, %._crit_edge122 ], [ -1, %75 ], [ -1, %135 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #11
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %3) #11
  ret i32 %.071
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #10

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint 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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 #5 = { 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 #6 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { 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 #9 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind }
attributes #12 = { nounwind allocsize(1) }
attributes #13 = { nounwind allocsize(0) }

!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, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13, !14, !15}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !13, !15, !14}
!17 = distinct !{!17, !13}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass