; LLVM IR from mncoppola/rpef :: utilities_src/squashfs4.1/squashfs-tools (read_fs)

; 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.squashfs_dir_header = type { i32, i32, i32 }
%struct.squashfs_super_block = type { i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16, i64, i64, i64, i64, i64, i64, i64, i64 }
%struct.squashfs_dir_entry = type { i16, i16, i16, i16, [0 x i8] }

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

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

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

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

; 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) #3

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

; Function Attrs: nounwind uwtable
define dso_local ptr @squashfs_readdir(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #0 {
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca %struct.squashfs_dir_header, align 4
  %19 = alloca [265 x i8], align 16
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i32, align 4
  store i32 %0, ptr %10, align 4, !tbaa !5
  store i32 %1, ptr %11, align 4, !tbaa !5
  store i32 %2, ptr %12, align 4, !tbaa !5
  store i32 %3, ptr %13, align 4, !tbaa !5
  store i32 %4, ptr %14, align 4, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !9
  store ptr %6, ptr %16, align 8, !tbaa !9
  store ptr %7, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 265, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %28 = getelementptr inbounds [265 x i8], ptr %19, i64 0, i64 0
  store ptr %28, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  store ptr null, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %29 = load ptr, ptr %16, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct.squashfs_super_block, ptr %29, i32 0, i32 16
  %31 = load i64, ptr %30, align 8, !tbaa !11
  %32 = load i32, ptr %12, align 4, !tbaa !5
  %33 = zext i32 %32 to i64
  %34 = add nsw i64 %31, %33
  store i64 %34, ptr %25, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %35 = load i64, ptr %25, align 8, !tbaa !15
  store i64 %35, ptr %26, align 8, !tbaa !15
  %36 = load i32, ptr %13, align 4, !tbaa !5
  %37 = load i32, ptr %14, align 4, !tbaa !5
  %38 = add nsw i32 %37, %36
  store i32 %38, ptr %14, align 4, !tbaa !5
  %39 = load i32, ptr %14, align 4, !tbaa !5
  %40 = add nsw i32 %39, 16384
  %41 = sub nsw i32 %40, 1
  %42 = and i32 %41, -8192
  %43 = sext i32 %42 to i64
  %44 = call noalias ptr @malloc(i64 noundef %43) #6
  store ptr %44, ptr %21, align 8, !tbaa !9
  %45 = load ptr, ptr %21, align 8, !tbaa !9
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %48

47:                                               ; preds = %8
  store ptr null, ptr %9, align 8
  store i32 1, ptr %27, align 4
  br label %172

48:                                               ; preds = %8
  br label %49

49:                                               ; preds = %66, %48
  %50 = load i32, ptr %23, align 4, !tbaa !5
  %51 = load i32, ptr %14, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %53, label %70

53:                                               ; preds = %49
  %54 = load i64, ptr %25, align 8, !tbaa !15
  store i64 %54, ptr %26, align 8, !tbaa !15
  %55 = load i32, ptr %10, align 4, !tbaa !5
  %56 = load i64, ptr %25, align 8, !tbaa !15
  %57 = load ptr, ptr %21, align 8, !tbaa !9
  %58 = load i32, ptr %23, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i8, ptr %57, i64 %59
  %61 = call i32 @read_block(i32 noundef %55, i64 noundef %56, ptr noundef %25, ptr noundef %60)
  store i32 %61, ptr %22, align 4, !tbaa !5
  %62 = load i32, ptr %22, align 4, !tbaa !5
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %66

64:                                               ; preds = %53
  %65 = load ptr, ptr %21, align 8, !tbaa !9
  call void @free(ptr noundef %65) #5
  store ptr null, ptr %9, align 8
  store i32 1, ptr %27, align 4
  br label %172

66:                                               ; preds = %53
  %67 = load i32, ptr %22, align 4, !tbaa !5
  %68 = load i32, ptr %23, align 4, !tbaa !5
  %69 = add nsw i32 %68, %67
  store i32 %69, ptr %23, align 4, !tbaa !5
  br label %49, !llvm.loop !16

70:                                               ; preds = %49
  %71 = load i32, ptr %11, align 4, !tbaa !5
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %74, label %73

73:                                               ; preds = %70
  br label %161

74:                                               ; preds = %70
  %75 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %75, ptr %23, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %159, %74
  %77 = load i32, ptr %23, align 4, !tbaa !5
  %78 = load i32, ptr %14, align 4, !tbaa !5
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %160

80:                                               ; preds = %76
  %81 = load ptr, ptr %21, align 8, !tbaa !9
  %82 = load i32, ptr %23, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i8, ptr %81, i64 %83
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 1 %84, i64 12, i1 false)
  %85 = getelementptr inbounds %struct.squashfs_dir_header, ptr %18, i32 0, i32 0
  %86 = load i32, ptr %85, align 4, !tbaa !18
  %87 = add i32 %86, 1
  store i32 %87, ptr %24, align 4, !tbaa !5
  %88 = load i32, ptr %23, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = add i64 %89, 12
  %91 = trunc i64 %90 to i32
  store i32 %91, ptr %23, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %96, %80
  %93 = load i32, ptr %24, align 4, !tbaa !5
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr %24, align 4, !tbaa !5
  %95 = icmp ne i32 %93, 0
  br i1 %95, label %96, label %159

96:                                               ; preds = %92
  %97 = load ptr, ptr %20, align 8, !tbaa !9
  %98 = load ptr, ptr %21, align 8, !tbaa !9
  %99 = load i32, ptr %23, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i8, ptr %98, i64 %100
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %97, ptr align 1 %101, i64 8, i1 false)
  %102 = load i32, ptr %23, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = add i64 %103, 8
  %105 = trunc i64 %104 to i32
  store i32 %105, ptr %23, align 4, !tbaa !5
  %106 = load ptr, ptr %20, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.squashfs_dir_entry, ptr %106, i32 0, i32 4
  %108 = getelementptr inbounds [0 x i8], ptr %107, i64 0, i64 0
  %109 = load ptr, ptr %21, align 8, !tbaa !9
  %110 = load i32, ptr %23, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i8, ptr %109, i64 %111
  %113 = load ptr, ptr %20, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.squashfs_dir_entry, ptr %113, i32 0, i32 3
  %115 = load i16, ptr %114, align 2, !tbaa !20
  %116 = zext i16 %115 to i32
  %117 = add nsw i32 %116, 1
  %118 = sext i32 %117 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %108, ptr align 1 %112, i64 %118, i1 false)
  %119 = load ptr, ptr %20, align 8, !tbaa !9
  %120 = getelementptr inbounds %struct.squashfs_dir_entry, ptr %119, i32 0, i32 4
  %121 = load ptr, ptr %20, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.squashfs_dir_entry, ptr %121, i32 0, i32 3
  %123 = load i16, ptr %122, align 2, !tbaa !20
  %124 = zext i16 %123 to i32
  %125 = add nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [0 x i8], ptr %120, i64 0, i64 %126
  store i8 0, ptr %127, align 1, !tbaa !22
  %128 = load ptr, ptr %17, align 8, !tbaa !9
  %129 = load ptr, ptr %20, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.squashfs_dir_entry, ptr %129, i32 0, i32 4
  %131 = getelementptr inbounds [0 x i8], ptr %130, i64 0, i64 0
  %132 = getelementptr inbounds %struct.squashfs_dir_header, ptr %18, i32 0, i32 1
  %133 = load i32, ptr %132, align 4, !tbaa !23
  %134 = zext i32 %133 to i64
  %135 = shl i64 %134, 16
  %136 = load ptr, ptr %20, align 8, !tbaa !9
  %137 = getelementptr inbounds %struct.squashfs_dir_entry, ptr %136, i32 0, i32 0
  %138 = load i16, ptr %137, align 2, !tbaa !24
  %139 = zext i16 %138 to i64
  %140 = add nsw i64 %135, %139
  %141 = getelementptr inbounds %struct.squashfs_dir_header, ptr %18, i32 0, i32 2
  %142 = load i32, ptr %141, align 4, !tbaa !25
  %143 = load ptr, ptr %20, align 8, !tbaa !9
  %144 = getelementptr inbounds %struct.squashfs_dir_entry, ptr %143, i32 0, i32 1
  %145 = load i16, ptr %144, align 2, !tbaa !26
  %146 = sext i16 %145 to i32
  %147 = add i32 %142, %146
  %148 = load ptr, ptr %20, align 8, !tbaa !9
  %149 = getelementptr inbounds %struct.squashfs_dir_entry, ptr %148, i32 0, i32 2
  %150 = load i16, ptr %149, align 2, !tbaa !27
  %151 = zext i16 %150 to i32
  call void %128(ptr noundef %131, i64 noundef %140, i32 noundef %147, i32 noundef %151)
  %152 = load ptr, ptr %20, align 8, !tbaa !9
  %153 = getelementptr inbounds %struct.squashfs_dir_entry, ptr %152, i32 0, i32 3
  %154 = load i16, ptr %153, align 2, !tbaa !20
  %155 = zext i16 %154 to i32
  %156 = add nsw i32 %155, 1
  %157 = load i32, ptr %23, align 4, !tbaa !5
  %158 = add nsw i32 %157, %156
  store i32 %158, ptr %23, align 4, !tbaa !5
  br label %92, !llvm.loop !28

159:                                              ; preds = %92
  br label %76, !llvm.loop !29

160:                                              ; preds = %76
  br label %161

161:                                              ; preds = %160, %73
  %162 = load i64, ptr %26, align 8, !tbaa !15
  %163 = trunc i64 %162 to i32
  %164 = zext i32 %163 to i64
  %165 = load ptr, ptr %16, align 8, !tbaa !9
  %166 = getelementptr inbounds %struct.squashfs_super_block, ptr %165, i32 0, i32 16
  %167 = load i64, ptr %166, align 8, !tbaa !11
  %168 = sub nsw i64 %164, %167
  %169 = trunc i64 %168 to i32
  %170 = load ptr, ptr %15, align 8, !tbaa !9
  store i32 %169, ptr %170, align 4, !tbaa !5
  %171 = load ptr, ptr %21, align 8, !tbaa !9
  store ptr %171, ptr %9, align 8
  store i32 1, ptr %27, align 4
  br label %172

172:                                              ; preds = %161, %64, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 265, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #5
  %173 = load ptr, ptr %9, align 8
  ret ptr %173
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !14, i64 72}
!12 = !{!"squashfs_super_block", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !13, i64 20, !13, i64 22, !13, i64 24, !13, i64 26, !13, i64 28, !13, i64 30, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88}
!13 = !{!"short", !7, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!14, !14, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !6, i64 0}
!19 = !{!"squashfs_dir_header", !6, i64 0, !6, i64 4, !6, i64 8}
!20 = !{!21, !13, i64 6}
!21 = !{!"squashfs_dir_entry", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !7, i64 8}
!22 = !{!7, !7, i64 0}
!23 = !{!19, !6, i64 4}
!24 = !{!21, !13, i64 0}
!25 = !{!19, !6, i64 8}
!26 = !{!21, !13, i64 2}
!27 = !{!21, !13, i64 4}
!28 = distinct !{!28, !17}
!29 = distinct !{!29, !17}


; 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: nounwind uwtable
declare dso_local i32 @read_block(i32 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress 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) #3

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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @squashfs_readdir(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef readonly %6, ptr nocapture noundef readonly %7) local_unnamed_addr #0 {
  %9 = alloca [265 x i8], align 16
  %10 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 265, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %11 = getelementptr inbounds i8, ptr %6, i64 72
  %12 = load i64, ptr %11, align 8, !tbaa !5
  %13 = zext i32 %2 to i64
  %14 = add nsw i64 %12, %13
  store i64 %14, ptr %10, align 8, !tbaa !12
  %15 = add nsw i32 %4, %3
  %16 = add nsw i32 %15, 16383
  %17 = and i32 %16, -8192
  %18 = sext i32 %17 to i64
  %19 = tail call noalias ptr @malloc(i64 noundef %18) #6
  %20 = icmp eq ptr %19, null
  br i1 %20, label %68, label %.preheader51

.preheader51:                                     ; preds = %8
  %21 = icmp sgt i32 %15, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

22:                                               ; preds = %.lr.ph
  %23 = add nsw i32 %28, %.04553
  %24 = icmp slt i32 %23, %15
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.lr.ph:                                           ; preds = %.preheader51, %22
  %.04553 = phi i32 [ %23, %22 ], [ 0, %.preheader51 ]
  %25 = load i64, ptr %10, align 8, !tbaa !12
  %26 = sext i32 %.04553 to i64
  %27 = getelementptr inbounds i8, ptr %19, i64 %26
  %28 = call i32 @read_block(i32 noundef %0, i64 noundef %25, ptr noundef nonnull %10, ptr noundef nonnull %27)
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %30, label %22

30:                                               ; preds = %.lr.ph
  call void @free(ptr noundef %19) #5
  br label %68

._crit_edge:                                      ; preds = %22, %.preheader51
  %.0.lcssa = phi i64 [ %14, %.preheader51 ], [ %25, %22 ]
  %.not = icmp ne i32 %1, 0
  %31 = icmp sgt i32 %4, 0
  %or.cond = and i1 %.not, %31
  br i1 %or.cond, label %.lr.ph61, label %.loopexit50

.lr.ph61:                                         ; preds = %._crit_edge
  %32 = getelementptr inbounds i8, ptr %9, i64 8
  %33 = getelementptr inbounds i8, ptr %9, i64 6
  br label %35

.loopexit:                                        ; preds = %42, %35
  %.2.lcssa = phi i32 [ %39, %35 ], [ %64, %42 ]
  %34 = icmp slt i32 %.2.lcssa, %15
  br i1 %34, label %35, label %.loopexit50, !llvm.loop !15

35:                                               ; preds = %.lr.ph61, %.loopexit
  %.160 = phi i32 [ %3, %.lr.ph61 ], [ %.2.lcssa, %.loopexit ]
  %36 = sext i32 %.160 to i64
  %37 = getelementptr inbounds i8, ptr %19, i64 %36
  %.sroa.0.0.copyload = load i32, ptr %37, align 1
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %37, i64 8
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 1
  %38 = add i32 %.sroa.0.0.copyload, 1
  %39 = add i32 %.160, 12
  %.not4954 = icmp eq i32 %38, 0
  br i1 %.not4954, label %.loopexit, label %.lr.ph58

.lr.ph58:                                         ; preds = %35
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %37, i64 4
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 1
  %40 = zext i32 %.sroa.4.0.copyload to i64
  %41 = shl nuw nsw i64 %40, 16
  br label %42

42:                                               ; preds = %.lr.ph58, %42
  %.04456 = phi i32 [ %38, %.lr.ph58 ], [ %43, %42 ]
  %.255 = phi i32 [ %39, %.lr.ph58 ], [ %64, %42 ]
  %43 = add nsw i32 %.04456, -1
  %44 = sext i32 %.255 to i64
  %45 = getelementptr inbounds i8, ptr %19, i64 %44
  %46 = load i64, ptr %45, align 1
  store i64 %46, ptr %9, align 16
  %47 = add i32 %.255, 8
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %19, i64 %48
  %50 = lshr i64 %46, 48
  %51 = add nuw nsw i64 %50, 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %32, ptr noundef nonnull align 1 dereferenceable(1) %49, i64 %51, i1 false)
  %52 = getelementptr inbounds [0 x i8], ptr %32, i64 0, i64 %51
  store i8 0, ptr %52, align 1, !tbaa !16
  %53 = and i64 %46, 65535
  %54 = or disjoint i64 %41, %53
  %55 = trunc i64 %46 to i32
  %56 = ashr i32 %55, 16
  %57 = add i32 %.sroa.5.0.copyload, %56
  %58 = lshr i64 %46, 32
  %59 = trunc nuw i64 %58 to i32
  %60 = and i32 %59, 65535
  call void %7(ptr noundef nonnull %32, i64 noundef %54, i32 noundef %57, i32 noundef %60) #5
  %61 = load i16, ptr %33, align 2, !tbaa !17
  %62 = zext i16 %61 to i32
  %63 = add i32 %.255, 9
  %64 = add i32 %63, %62
  %.not49 = icmp eq i32 %43, 0
  br i1 %.not49, label %.loopexit, label %42, !llvm.loop !19

.loopexit50:                                      ; preds = %.loopexit, %._crit_edge
  %65 = load i64, ptr %11, align 8, !tbaa !5
  %66 = sub i64 %.0.lcssa, %65
  %67 = trunc i64 %66 to i32
  store i32 %67, ptr %5, align 4, !tbaa !20
  br label %68

68:                                               ; preds = %8, %.loopexit50, %30
  %.046 = phi ptr [ null, %30 ], [ %19, %.loopexit50 ], [ null, %8 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 265, ptr nonnull %9) #5
  ret ptr %.046
}

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { 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, !11, i64 72}
!6 = !{!"squashfs_super_block", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 20, !10, i64 22, !10, i64 24, !10, i64 26, !10, i64 28, !10, i64 30, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!11, !11, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!8, !8, i64 0}
!17 = !{!18, !10, i64 6}
!18 = !{!"squashfs_dir_entry", !10, i64 0, !10, i64 2, !10, i64 4, !10, i64 6, !8, i64 8}
!19 = distinct !{!19, !14}
!20 = !{!7, !7, i64 0}


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