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

; 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.super_block = type { %struct.squashfs_super_block, i32, i32, i64, i64 }
%struct.squashfs_super_block = type { i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16, i64, i64, i64, i64, i64, i64, i64, i64 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.squashfs_operations = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.squashfs_dir_header_2 = type { i32 }
%struct.squashfs_dir_entry_2 = type <{ i16, i8, [0 x i8] }>
%struct.inode = type { i32, ptr, i64, i32, i32, i32, i32, i32, i32, i64, ptr, i64, i32, i32, i8, i32 }
%struct.dir = type { i32, i32, i32, i32, i32, i32, i32, ptr }
%struct.dir_ent = type { [257 x i8], i32, i32, i32 }

@swap = external global i32, align 4
@sBlk = external global %struct.super_block, align 8
@screen_mutex = external global %union.pthread_mutex_t, align 8
@stderr = external global ptr, align 8
@s_ops = external global %struct.squashfs_operations, align 8
@directory_table_hash = external global [65536 x ptr], align 16
@.str.3 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [56 x i8], align 1
@directory_table = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [57 x i8], align 1

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, 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

declare i32 @lookup_entry(ptr noundef, i64 noundef) #3

; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) #4

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) #4

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

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

; Function Attrs: nounwind uwtable
define dso_local ptr @squashfs_opendir_1(i32 noundef %0, i32 noundef %1, ptr noundef %2) #7 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %struct.squashfs_dir_header_2, align 1
  %8 = alloca [260 x i8], align 16
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %struct.squashfs_dir_header_2, align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca %struct.squashfs_dir_entry_2, align 1
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i64, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 260, ptr %8) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %28 = getelementptr inbounds [260 x i8], ptr %8, i64 0, i64 0
  store ptr %28, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, 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 8, ptr %14) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %29 = load ptr, ptr getelementptr inbounds (%struct.squashfs_operations, ptr @s_ops, i32 0, i32 4), align 8, !tbaa !11
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = call ptr %29(i32 noundef %30, i32 noundef %31)
  %33 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %32, ptr %33, align 8, !tbaa !9
  %34 = load i64, ptr getelementptr inbounds (%struct.squashfs_super_block, ptr @sBlk, i32 0, i32 16), align 8, !tbaa !13
  %35 = load ptr, ptr %6, align 8, !tbaa !9
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.inode, ptr %36, i32 0, i32 9
  %38 = load i64, ptr %37, align 8, !tbaa !18
  %39 = add nsw i64 %34, %38
  store i64 %39, ptr %10, align 8, !tbaa !21
  %40 = load i64, ptr %10, align 8, !tbaa !21
  %41 = call i32 @lookup_entry(ptr noundef @directory_table_hash, i64 noundef %40)
  store i32 %41, ptr %11, align 4, !tbaa !5
  %42 = load i32, ptr %11, align 4, !tbaa !5
  %43 = icmp eq i32 %42, -1
  br i1 %43, label %44, label %53

44:                                               ; preds = %3
  br label %45

45:                                               ; preds = %44
  %46 = call i32 @pthread_mutex_lock(ptr noundef @screen_mutex) #9
  %47 = load ptr, ptr @stderr, align 8, !tbaa !9
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.3, i32 noundef %48) #9
  %50 = call i32 @pthread_mutex_unlock(ptr noundef @screen_mutex) #9
  call void @exit(i32 noundef 1) #10
  unreachable

51:                                               ; No predecessors!
  br label %52

52:                                               ; preds = %51
  br label %53

53:                                               ; preds = %52, %3
  %54 = load ptr, ptr %6, align 8, !tbaa !9
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.inode, ptr %55, i32 0, i32 8
  %57 = load i32, ptr %56, align 4, !tbaa !22
  %58 = load i32, ptr %11, align 4, !tbaa !5
  %59 = add nsw i32 %58, %57
  store i32 %59, ptr %11, align 4, !tbaa !5
  %60 = load ptr, ptr %6, align 8, !tbaa !9
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = getelementptr inbounds %struct.inode, ptr %61, i32 0, i32 2
  %63 = load i64, ptr %62, align 8, !tbaa !23
  %64 = load i32, ptr %11, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = add nsw i64 %63, %65
  %67 = trunc i64 %66 to i32
  store i32 %67, ptr %13, align 4, !tbaa !5
  %68 = call noalias ptr @malloc(i64 noundef 40) #11
  store ptr %68, ptr %15, align 8, !tbaa !9
  %69 = icmp eq ptr %68, null
  br i1 %69, label %70, label %78

70:                                               ; preds = %53
  br label %71

71:                                               ; preds = %70
  %72 = call i32 @pthread_mutex_lock(ptr noundef @screen_mutex) #9
  %73 = load ptr, ptr @stderr, align 8, !tbaa !9
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef @.str.4) #9
  %75 = call i32 @pthread_mutex_unlock(ptr noundef @screen_mutex) #9
  call void @exit(i32 noundef 1) #10
  unreachable

76:                                               ; No predecessors!
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77, %53
  %79 = load ptr, ptr %15, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct.dir, ptr %79, i32 0, i32 0
  store i32 0, ptr %80, align 8, !tbaa !24
  %81 = load ptr, ptr %15, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct.dir, ptr %81, i32 0, i32 1
  store i32 0, ptr %82, align 4, !tbaa !26
  %83 = load ptr, ptr %6, align 8, !tbaa !9
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  %85 = getelementptr inbounds %struct.inode, ptr %84, i32 0, i32 7
  %86 = load i32, ptr %85, align 8, !tbaa !27
  %87 = load ptr, ptr %15, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct.dir, ptr %87, i32 0, i32 2
  store i32 %86, ptr %88, align 8, !tbaa !28
  %89 = load ptr, ptr %6, align 8, !tbaa !9
  %90 = load ptr, ptr %89, align 8, !tbaa !9
  %91 = getelementptr inbounds %struct.inode, ptr %90, i32 0, i32 13
  %92 = load i32, ptr %91, align 4, !tbaa !29
  %93 = load ptr, ptr %15, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.dir, ptr %93, i32 0, i32 3
  store i32 %92, ptr %94, align 4, !tbaa !30
  %95 = load ptr, ptr %6, align 8, !tbaa !9
  %96 = load ptr, ptr %95, align 8, !tbaa !9
  %97 = getelementptr inbounds %struct.inode, ptr %96, i32 0, i32 5
  %98 = load i32, ptr %97, align 8, !tbaa !31
  %99 = load ptr, ptr %15, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.dir, ptr %99, i32 0, i32 4
  store i32 %98, ptr %100, align 8, !tbaa !32
  %101 = load ptr, ptr %6, align 8, !tbaa !9
  %102 = load ptr, ptr %101, align 8, !tbaa !9
  %103 = getelementptr inbounds %struct.inode, ptr %102, i32 0, i32 11
  %104 = load i64, ptr %103, align 8, !tbaa !33
  %105 = trunc i64 %104 to i32
  %106 = load ptr, ptr %15, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.dir, ptr %106, i32 0, i32 5
  store i32 %105, ptr %107, align 4, !tbaa !34
  %108 = load ptr, ptr %6, align 8, !tbaa !9
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.inode, ptr %109, i32 0, i32 15
  %111 = load i32, ptr %110, align 4, !tbaa !35
  %112 = load ptr, ptr %15, align 8, !tbaa !9
  %113 = getelementptr inbounds %struct.dir, ptr %112, i32 0, i32 6
  store i32 %111, ptr %113, align 8, !tbaa !36
  %114 = load ptr, ptr %15, align 8, !tbaa !9
  %115 = getelementptr inbounds %struct.dir, ptr %114, i32 0, i32 7
  store ptr null, ptr %115, align 8, !tbaa !37
  br label %116

116:                                              ; preds = %423, %78
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = load i32, ptr %13, align 4, !tbaa !5
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %120, label %424

120:                                              ; preds = %116
  %121 = load i32, ptr @swap, align 4, !tbaa !5
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %183

123:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #9
  %124 = load ptr, ptr @directory_table, align 8, !tbaa !9
  %125 = load i32, ptr %11, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i8, ptr %124, i64 %126
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %16, ptr align 1 %127, i64 4, i1 false)
  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 8, ptr %19) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  call void @llvm.memset.p0.i64(ptr align 1 %7, i8 0, i64 4, i1 false)
  store i32 0, ptr %18, align 4, !tbaa !5
  store i64 0, ptr %19, align 8, !tbaa !21
  %128 = getelementptr inbounds i8, ptr %16, i64 0
  store ptr %128, ptr %20, align 8, !tbaa !9
  %129 = getelementptr inbounds i8, ptr %19, i64 7
  store ptr %129, ptr %21, align 8, !tbaa !9
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %141, %123
  %131 = load i32, ptr %17, align 4, !tbaa !5
  %132 = load i32, ptr %18, align 4, !tbaa !5
  %133 = add nsw i32 8, %132
  %134 = icmp slt i32 %131, %133
  br i1 %134, label %135, label %144

135:                                              ; preds = %130
  %136 = load ptr, ptr %20, align 8, !tbaa !9
  %137 = getelementptr inbounds i8, ptr %136, i32 1
  store ptr %137, ptr %20, align 8, !tbaa !9
  %138 = load i8, ptr %136, align 1, !tbaa !38
  %139 = load ptr, ptr %21, align 8, !tbaa !9
  %140 = getelementptr inbounds i8, ptr %139, i32 -1
  store ptr %140, ptr %21, align 8, !tbaa !9
  store i8 %138, ptr %139, align 1, !tbaa !38
  br label %141

141:                                              ; preds = %135
  %142 = load i32, ptr %17, align 4, !tbaa !5
  %143 = add nsw i32 %142, 8
  store i32 %143, ptr %17, align 4, !tbaa !5
  br label %130, !llvm.loop !39

144:                                              ; preds = %130
  %145 = load i64, ptr %19, align 8, !tbaa !21
  %146 = load i32, ptr %18, align 4, !tbaa !5
  %147 = sub nsw i32 56, %146
  %148 = zext i32 %147 to i64
  %149 = lshr i64 %145, %148
  %150 = trunc i64 %149 to i32
  %151 = load i32, ptr %7, align 1
  %152 = and i32 %150, 255
  %153 = and i32 %151, -256
  %154 = or i32 %153, %152
  store i32 %154, ptr %7, align 1
  store i32 0, ptr %18, align 4, !tbaa !5
  store i64 0, ptr %19, align 8, !tbaa !21
  %155 = getelementptr inbounds i8, ptr %16, i64 1
  store ptr %155, ptr %20, align 8, !tbaa !9
  %156 = getelementptr inbounds i8, ptr %19, i64 7
  store ptr %156, ptr %21, align 8, !tbaa !9
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %168, %144
  %158 = load i32, ptr %17, align 4, !tbaa !5
  %159 = load i32, ptr %18, align 4, !tbaa !5
  %160 = add nsw i32 24, %159
  %161 = icmp slt i32 %158, %160
  br i1 %161, label %162, label %171

162:                                              ; preds = %157
  %163 = load ptr, ptr %20, align 8, !tbaa !9
  %164 = getelementptr inbounds i8, ptr %163, i32 1
  store ptr %164, ptr %20, align 8, !tbaa !9
  %165 = load i8, ptr %163, align 1, !tbaa !38
  %166 = load ptr, ptr %21, align 8, !tbaa !9
  %167 = getelementptr inbounds i8, ptr %166, i32 -1
  store ptr %167, ptr %21, align 8, !tbaa !9
  store i8 %165, ptr %166, align 1, !tbaa !38
  br label %168

168:                                              ; preds = %162
  %169 = load i32, ptr %17, align 4, !tbaa !5
  %170 = add nsw i32 %169, 8
  store i32 %170, ptr %17, align 4, !tbaa !5
  br label %157, !llvm.loop !41

171:                                              ; preds = %157
  %172 = load i64, ptr %19, align 8, !tbaa !21
  %173 = load i32, ptr %18, align 4, !tbaa !5
  %174 = sub nsw i32 40, %173
  %175 = zext i32 %174 to i64
  %176 = lshr i64 %172, %175
  %177 = trunc i64 %176 to i32
  %178 = load i32, ptr %7, align 1
  %179 = and i32 %177, 16777215
  %180 = shl i32 %179, 8
  %181 = and i32 %178, 255
  %182 = or i32 %181, %180
  store i32 %182, ptr %7, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 8, 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
  br label %188

183:                                              ; preds = %120
  %184 = load ptr, ptr @directory_table, align 8, !tbaa !9
  %185 = load i32, ptr %11, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds i8, ptr %184, i64 %186
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %7, ptr align 1 %187, i64 4, i1 false)
  br label %188

188:                                              ; preds = %183, %171
  %189 = load i32, ptr %7, align 1
  %190 = and i32 %189, 255
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %12, align 4, !tbaa !5
  %192 = load i32, ptr %11, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = add i64 %193, 4
  %195 = trunc i64 %194 to i32
  store i32 %195, ptr %11, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %360, %188
  %197 = load i32, ptr %12, align 4, !tbaa !5
  %198 = add nsw i32 %197, -1
  store i32 %198, ptr %12, align 4, !tbaa !5
  %199 = icmp ne i32 %197, 0
  br i1 %199, label %200, label %423

200:                                              ; preds = %196
  %201 = load i32, ptr @swap, align 4, !tbaa !5
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %203, label %297

203:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 3, ptr %22) #9
  %204 = load ptr, ptr @directory_table, align 8, !tbaa !9
  %205 = load i32, ptr %11, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds i8, ptr %204, i64 %206
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %22, ptr align 1 %207, i64 3, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %208 = load ptr, ptr %9, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 1 %208, i8 0, i64 3, i1 false)
  store i32 0, ptr %24, align 4, !tbaa !5
  store i64 0, ptr %25, align 8, !tbaa !21
  %209 = getelementptr inbounds i8, ptr %22, i64 0
  store ptr %209, ptr %26, align 8, !tbaa !9
  %210 = getelementptr inbounds i8, ptr %25, i64 7
  store ptr %210, ptr %27, align 8, !tbaa !9
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %211

211:                                              ; preds = %222, %203
  %212 = load i32, ptr %23, align 4, !tbaa !5
  %213 = load i32, ptr %24, align 4, !tbaa !5
  %214 = add nsw i32 13, %213
  %215 = icmp slt i32 %212, %214
  br i1 %215, label %216, label %225

216:                                              ; preds = %211
  %217 = load ptr, ptr %26, align 8, !tbaa !9
  %218 = getelementptr inbounds i8, ptr %217, i32 1
  store ptr %218, ptr %26, align 8, !tbaa !9
  %219 = load i8, ptr %217, align 1, !tbaa !38
  %220 = load ptr, ptr %27, align 8, !tbaa !9
  %221 = getelementptr inbounds i8, ptr %220, i32 -1
  store ptr %221, ptr %27, align 8, !tbaa !9
  store i8 %219, ptr %220, align 1, !tbaa !38
  br label %222

222:                                              ; preds = %216
  %223 = load i32, ptr %23, align 4, !tbaa !5
  %224 = add nsw i32 %223, 8
  store i32 %224, ptr %23, align 4, !tbaa !5
  br label %211, !llvm.loop !42

225:                                              ; preds = %211
  %226 = load i64, ptr %25, align 8, !tbaa !21
  %227 = load i32, ptr %24, align 4, !tbaa !5
  %228 = sub nsw i32 51, %227
  %229 = zext i32 %228 to i64
  %230 = lshr i64 %226, %229
  %231 = trunc i64 %230 to i32
  %232 = load ptr, ptr %9, align 8, !tbaa !9
  %233 = trunc i32 %231 to i16
  %234 = load i16, ptr %232, align 1
  %235 = and i16 %233, 8191
  %236 = and i16 %234, -8192
  %237 = or i16 %236, %235
  store i16 %237, ptr %232, align 1
  %238 = zext i16 %235 to i32
  store i32 5, ptr %24, align 4, !tbaa !5
  store i64 0, ptr %25, align 8, !tbaa !21
  %239 = getelementptr inbounds i8, ptr %22, i64 1
  store ptr %239, ptr %26, align 8, !tbaa !9
  %240 = getelementptr inbounds i8, ptr %25, i64 7
  store ptr %240, ptr %27, align 8, !tbaa !9
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %252, %225
  %242 = load i32, ptr %23, align 4, !tbaa !5
  %243 = load i32, ptr %24, align 4, !tbaa !5
  %244 = add nsw i32 3, %243
  %245 = icmp slt i32 %242, %244
  br i1 %245, label %246, label %255

246:                                              ; preds = %241
  %247 = load ptr, ptr %26, align 8, !tbaa !9
  %248 = getelementptr inbounds i8, ptr %247, i32 1
  store ptr %248, ptr %26, align 8, !tbaa !9
  %249 = load i8, ptr %247, align 1, !tbaa !38
  %250 = load ptr, ptr %27, align 8, !tbaa !9
  %251 = getelementptr inbounds i8, ptr %250, i32 -1
  store ptr %251, ptr %27, align 8, !tbaa !9
  store i8 %249, ptr %250, align 1, !tbaa !38
  br label %252

252:                                              ; preds = %246
  %253 = load i32, ptr %23, align 4, !tbaa !5
  %254 = add nsw i32 %253, 8
  store i32 %254, ptr %23, align 4, !tbaa !5
  br label %241, !llvm.loop !43

255:                                              ; preds = %241
  %256 = load i64, ptr %25, align 8, !tbaa !21
  %257 = load i32, ptr %24, align 4, !tbaa !5
  %258 = sub nsw i32 61, %257
  %259 = zext i32 %258 to i64
  %260 = lshr i64 %256, %259
  %261 = trunc i64 %260 to i32
  %262 = load ptr, ptr %9, align 8, !tbaa !9
  %263 = trunc i32 %261 to i16
  %264 = load i16, ptr %262, align 1
  %265 = and i16 %263, 7
  %266 = shl i16 %265, 13
  %267 = and i16 %264, 8191
  %268 = or i16 %267, %266
  store i16 %268, ptr %262, align 1
  %269 = zext i16 %265 to i32
  store i32 0, ptr %24, align 4, !tbaa !5
  store i64 0, ptr %25, align 8, !tbaa !21
  %270 = getelementptr inbounds i8, ptr %22, i64 2
  store ptr %270, ptr %26, align 8, !tbaa !9
  %271 = getelementptr inbounds i8, ptr %25, i64 7
  store ptr %271, ptr %27, align 8, !tbaa !9
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %272

272:                                              ; preds = %283, %255
  %273 = load i32, ptr %23, align 4, !tbaa !5
  %274 = load i32, ptr %24, align 4, !tbaa !5
  %275 = add nsw i32 8, %274
  %276 = icmp slt i32 %273, %275
  br i1 %276, label %277, label %286

277:                                              ; preds = %272
  %278 = load ptr, ptr %26, align 8, !tbaa !9
  %279 = getelementptr inbounds i8, ptr %278, i32 1
  store ptr %279, ptr %26, align 8, !tbaa !9
  %280 = load i8, ptr %278, align 1, !tbaa !38
  %281 = load ptr, ptr %27, align 8, !tbaa !9
  %282 = getelementptr inbounds i8, ptr %281, i32 -1
  store ptr %282, ptr %27, align 8, !tbaa !9
  store i8 %280, ptr %281, align 1, !tbaa !38
  br label %283

283:                                              ; preds = %277
  %284 = load i32, ptr %23, align 4, !tbaa !5
  %285 = add nsw i32 %284, 8
  store i32 %285, ptr %23, align 4, !tbaa !5
  br label %272, !llvm.loop !44

286:                                              ; preds = %272
  %287 = load i64, ptr %25, align 8, !tbaa !21
  %288 = load i32, ptr %24, align 4, !tbaa !5
  %289 = sub nsw i32 56, %288
  %290 = zext i32 %289 to i64
  %291 = lshr i64 %287, %290
  %292 = trunc i64 %291 to i32
  %293 = load ptr, ptr %9, align 8, !tbaa !9
  %294 = getelementptr inbounds %struct.squashfs_dir_entry_2, ptr %293, i32 0, i32 1
  %295 = trunc i32 %292 to i8
  store i8 %295, ptr %294, align 1
  %296 = zext i8 %295 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 3, ptr %22) #9
  br label %303

297:                                              ; preds = %200
  %298 = load ptr, ptr %9, align 8, !tbaa !9
  %299 = load ptr, ptr @directory_table, align 8, !tbaa !9
  %300 = load i32, ptr %11, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds i8, ptr %299, i64 %301
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %298, ptr align 1 %302, i64 3, i1 false)
  br label %303

303:                                              ; preds = %297, %286
  %304 = load i32, ptr %11, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = add i64 %305, 3
  %307 = trunc i64 %306 to i32
  store i32 %307, ptr %11, align 4, !tbaa !5
  %308 = load ptr, ptr %9, align 8, !tbaa !9
  %309 = getelementptr inbounds %struct.squashfs_dir_entry_2, ptr %308, i32 0, i32 2
  %310 = getelementptr inbounds [0 x i8], ptr %309, i64 0, i64 0
  %311 = load ptr, ptr @directory_table, align 8, !tbaa !9
  %312 = load i32, ptr %11, align 4, !tbaa !5
  %313 = sext i32 %312 to i64
  %314 = getelementptr inbounds i8, ptr %311, i64 %313
  %315 = load ptr, ptr %9, align 8, !tbaa !9
  %316 = getelementptr inbounds %struct.squashfs_dir_entry_2, ptr %315, i32 0, i32 1
  %317 = load i8, ptr %316, align 1
  %318 = zext i8 %317 to i32
  %319 = add nsw i32 %318, 1
  %320 = sext i32 %319 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %310, ptr align 1 %314, i64 %320, i1 false)
  %321 = load ptr, ptr %9, align 8, !tbaa !9
  %322 = getelementptr inbounds %struct.squashfs_dir_entry_2, ptr %321, i32 0, i32 2
  %323 = load ptr, ptr %9, align 8, !tbaa !9
  %324 = getelementptr inbounds %struct.squashfs_dir_entry_2, ptr %323, i32 0, i32 1
  %325 = load i8, ptr %324, align 1
  %326 = zext i8 %325 to i32
  %327 = add nsw i32 %326, 1
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [0 x i8], ptr %322, i64 0, i64 %328
  store i8 0, ptr %329, align 1, !tbaa !38
  %330 = load ptr, ptr %15, align 8, !tbaa !9
  %331 = getelementptr inbounds %struct.dir, ptr %330, i32 0, i32 0
  %332 = load i32, ptr %331, align 8, !tbaa !24
  %333 = srem i32 %332, 16
  %334 = icmp eq i32 %333, 0
  br i1 %334, label %335, label %360

335:                                              ; preds = %303
  %336 = load ptr, ptr %15, align 8, !tbaa !9
  %337 = getelementptr inbounds %struct.dir, ptr %336, i32 0, i32 7
  %338 = load ptr, ptr %337, align 8, !tbaa !37
  %339 = load ptr, ptr %15, align 8, !tbaa !9
  %340 = getelementptr inbounds %struct.dir, ptr %339, i32 0, i32 0
  %341 = load i32, ptr %340, align 8, !tbaa !24
  %342 = add nsw i32 %341, 16
  %343 = sext i32 %342 to i64
  %344 = mul i64 %343, 272
  %345 = call ptr @realloc(ptr noundef %338, i64 noundef %344) #12
  store ptr %345, ptr %14, align 8, !tbaa !9
  %346 = load ptr, ptr %14, align 8, !tbaa !9
  %347 = icmp eq ptr %346, null
  br i1 %347, label %348, label %356

348:                                              ; preds = %335
  br label %349

349:                                              ; preds = %348
  %350 = call i32 @pthread_mutex_lock(ptr noundef @screen_mutex) #9
  %351 = load ptr, ptr @stderr, align 8, !tbaa !9
  %352 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %351, ptr noundef @.str.5) #9
  %353 = call i32 @pthread_mutex_unlock(ptr noundef @screen_mutex) #9
  call void @exit(i32 noundef 1) #10
  unreachable

354:                                              ; No predecessors!
  br label %355

355:                                              ; preds = %354
  br label %356

356:                                              ; preds = %355, %335
  %357 = load ptr, ptr %14, align 8, !tbaa !9
  %358 = load ptr, ptr %15, align 8, !tbaa !9
  %359 = getelementptr inbounds %struct.dir, ptr %358, i32 0, i32 7
  store ptr %357, ptr %359, align 8, !tbaa !37
  br label %360

360:                                              ; preds = %356, %303
  %361 = load ptr, ptr %15, align 8, !tbaa !9
  %362 = getelementptr inbounds %struct.dir, ptr %361, i32 0, i32 7
  %363 = load ptr, ptr %362, align 8, !tbaa !37
  %364 = load ptr, ptr %15, align 8, !tbaa !9
  %365 = getelementptr inbounds %struct.dir, ptr %364, i32 0, i32 0
  %366 = load i32, ptr %365, align 8, !tbaa !24
  %367 = sext i32 %366 to i64
  %368 = getelementptr inbounds %struct.dir_ent, ptr %363, i64 %367
  %369 = getelementptr inbounds %struct.dir_ent, ptr %368, i32 0, i32 0
  %370 = getelementptr inbounds [257 x i8], ptr %369, i64 0, i64 0
  %371 = load ptr, ptr %9, align 8, !tbaa !9
  %372 = getelementptr inbounds %struct.squashfs_dir_entry_2, ptr %371, i32 0, i32 2
  %373 = getelementptr inbounds [0 x i8], ptr %372, i64 0, i64 0
  %374 = call ptr @strcpy(ptr noundef %370, ptr noundef %373) #9
  %375 = load i32, ptr %7, align 1
  %376 = lshr i32 %375, 8
  %377 = load ptr, ptr %15, align 8, !tbaa !9
  %378 = getelementptr inbounds %struct.dir, ptr %377, i32 0, i32 7
  %379 = load ptr, ptr %378, align 8, !tbaa !37
  %380 = load ptr, ptr %15, align 8, !tbaa !9
  %381 = getelementptr inbounds %struct.dir, ptr %380, i32 0, i32 0
  %382 = load i32, ptr %381, align 8, !tbaa !24
  %383 = sext i32 %382 to i64
  %384 = getelementptr inbounds %struct.dir_ent, ptr %379, i64 %383
  %385 = getelementptr inbounds %struct.dir_ent, ptr %384, i32 0, i32 1
  store i32 %376, ptr %385, align 4, !tbaa !45
  %386 = load ptr, ptr %9, align 8, !tbaa !9
  %387 = load i16, ptr %386, align 1
  %388 = and i16 %387, 8191
  %389 = zext i16 %388 to i32
  %390 = load ptr, ptr %15, align 8, !tbaa !9
  %391 = getelementptr inbounds %struct.dir, ptr %390, i32 0, i32 7
  %392 = load ptr, ptr %391, align 8, !tbaa !37
  %393 = load ptr, ptr %15, align 8, !tbaa !9
  %394 = getelementptr inbounds %struct.dir, ptr %393, i32 0, i32 0
  %395 = load i32, ptr %394, align 8, !tbaa !24
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds %struct.dir_ent, ptr %392, i64 %396
  %398 = getelementptr inbounds %struct.dir_ent, ptr %397, i32 0, i32 2
  store i32 %389, ptr %398, align 4, !tbaa !47
  %399 = load ptr, ptr %9, align 8, !tbaa !9
  %400 = load i16, ptr %399, align 1
  %401 = lshr i16 %400, 13
  %402 = zext i16 %401 to i32
  %403 = load ptr, ptr %15, align 8, !tbaa !9
  %404 = getelementptr inbounds %struct.dir, ptr %403, i32 0, i32 7
  %405 = load ptr, ptr %404, align 8, !tbaa !37
  %406 = load ptr, ptr %15, align 8, !tbaa !9
  %407 = getelementptr inbounds %struct.dir, ptr %406, i32 0, i32 0
  %408 = load i32, ptr %407, align 8, !tbaa !24
  %409 = sext i32 %408 to i64
  %410 = getelementptr inbounds %struct.dir_ent, ptr %405, i64 %409
  %411 = getelementptr inbounds %struct.dir_ent, ptr %410, i32 0, i32 3
  store i32 %402, ptr %411, align 4, !tbaa !48
  %412 = load ptr, ptr %15, align 8, !tbaa !9
  %413 = getelementptr inbounds %struct.dir, ptr %412, i32 0, i32 0
  %414 = load i32, ptr %413, align 8, !tbaa !24
  %415 = add nsw i32 %414, 1
  store i32 %415, ptr %413, align 8, !tbaa !24
  %416 = load ptr, ptr %9, align 8, !tbaa !9
  %417 = getelementptr inbounds %struct.squashfs_dir_entry_2, ptr %416, i32 0, i32 1
  %418 = load i8, ptr %417, align 1
  %419 = zext i8 %418 to i32
  %420 = add nsw i32 %419, 1
  %421 = load i32, ptr %11, align 4, !tbaa !5
  %422 = add nsw i32 %421, %420
  store i32 %422, ptr %11, align 4, !tbaa !5
  br label %196, !llvm.loop !49

423:                                              ; preds = %196
  br label %116, !llvm.loop !50

424:                                              ; preds = %116
  %425 = load ptr, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, 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 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 260, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  ret ptr %425
}

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

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 = { noreturn 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 #6 = { 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 #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind allocsize(0) }
attributes #12 = { nounwind allocsize(1) }

!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, !10, i64 32}
!12 = !{!"squashfs_operations", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!13 = !{!14, !17, i64 72}
!14 = !{!"super_block", !15, i64 0, !6, i64 96, !6, i64 100, !17, i64 104, !17, i64 112}
!15 = !{!"squashfs_super_block", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !16, i64 20, !16, i64 22, !16, i64 24, !16, i64 26, !16, i64 28, !16, i64 30, !17, i64 32, !17, i64 40, !17, i64 48, !17, i64 56, !17, i64 64, !17, i64 72, !17, i64 80, !17, i64 88}
!16 = !{!"short", !7, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = !{!19, !17, i64 48}
!19 = !{!"inode", !6, i64 0, !10, i64 8, !17, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !17, i64 48, !10, i64 56, !20, i64 64, !6, i64 72, !6, i64 76, !7, i64 80, !6, i64 84}
!20 = !{!"long", !7, i64 0}
!21 = !{!17, !17, i64 0}
!22 = !{!19, !6, i64 44}
!23 = !{!19, !17, i64 16}
!24 = !{!25, !6, i64 0}
!25 = !{!"dir", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !10, i64 32}
!26 = !{!25, !6, i64 4}
!27 = !{!19, !6, i64 40}
!28 = !{!25, !6, i64 8}
!29 = !{!19, !6, i64 76}
!30 = !{!25, !6, i64 12}
!31 = !{!19, !6, i64 32}
!32 = !{!25, !6, i64 16}
!33 = !{!19, !20, i64 64}
!34 = !{!25, !6, i64 20}
!35 = !{!19, !6, i64 84}
!36 = !{!25, !6, i64 24}
!37 = !{!25, !10, i64 32}
!38 = !{!7, !7, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = distinct !{!41, !40}
!42 = distinct !{!42, !40}
!43 = distinct !{!43, !40}
!44 = distinct !{!44, !40}
!45 = !{!46, !6, i64 260}
!46 = !{!"dir_ent", !7, i64 0, !6, i64 260, !6, i64 264, !6, i64 268}
!47 = !{!46, !6, i64 264}
!48 = !{!46, !6, i64 268}
!49 = distinct !{!49, !40}
!50 = distinct !{!50, !40}


; 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.super_block = type { %struct.squashfs_super_block, i32, i32, i64, i64 }
%struct.squashfs_super_block = type { i32, i32, i32, i32, i32, i16, i16, i16, i16, i16, i16, i64, i64, i64, i64, i64, i64, i64, i64 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.squashfs_operations = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.dir_ent = type { [257 x i8], i32, i32, i32 }

@swap = external local_unnamed_addr global i32, align 4
@sBlk = external local_unnamed_addr global %struct.super_block, align 8
@screen_mutex = external global %union.pthread_mutex_t, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@s_ops = external local_unnamed_addr global %struct.squashfs_operations, align 8
@directory_table_hash = external global [65536 x ptr], align 16
@.str.3 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [56 x i8], align 1
@directory_table = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [57 x i8], align 1

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

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

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

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

; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @squashfs_opendir_1(i32 noundef %0, i32 noundef %1, ptr nocapture noundef %2) local_unnamed_addr #7 {
  %4 = alloca [260 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 260, ptr nonnull %4) #10
  %5 = load ptr, ptr getelementptr inbounds (i8, ptr @s_ops, i64 32), align 8, !tbaa !5
  %6 = tail call ptr %5(i32 noundef %0, i32 noundef %1) #10
  store ptr %6, ptr %2, align 8, !tbaa !10
  %7 = load i64, ptr getelementptr inbounds (i8, ptr @sBlk, i64 72), align 8, !tbaa !11
  %8 = getelementptr inbounds i8, ptr %6, i64 48
  %9 = load i64, ptr %8, align 8, !tbaa !17
  %10 = add nsw i64 %9, %7
  %11 = tail call i32 @lookup_entry(ptr noundef nonnull @directory_table_hash, i64 noundef %10) #10
  %12 = icmp eq i32 %11, -1
  br i1 %12, label %13, label %18

13:                                               ; preds = %3
  %14 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull @screen_mutex) #10
  %15 = load ptr, ptr @stderr, align 8, !tbaa !10
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.3, i32 noundef %0) #11
  %17 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull @screen_mutex) #10
  tail call void @exit(i32 noundef 1) #12
  unreachable

18:                                               ; preds = %3
  %19 = load ptr, ptr %2, align 8, !tbaa !10
  %20 = getelementptr inbounds i8, ptr %19, i64 44
  %21 = load i32, ptr %20, align 4, !tbaa !20
  %22 = add nsw i32 %21, %11
  %23 = getelementptr inbounds i8, ptr %19, i64 16
  %24 = load i64, ptr %23, align 8, !tbaa !21
  %25 = trunc i64 %24 to i32
  %26 = add i32 %22, %25
  %27 = tail call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #13
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %34

29:                                               ; preds = %18
  %30 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull @screen_mutex) #10
  %31 = load ptr, ptr @stderr, align 8, !tbaa !10
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.4) #11
  %33 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull @screen_mutex) #10
  tail call void @exit(i32 noundef 1) #12
  unreachable

34:                                               ; preds = %18
  store i32 0, ptr %27, align 8, !tbaa !22
  %35 = getelementptr inbounds i8, ptr %27, i64 4
  store i32 0, ptr %35, align 4, !tbaa !24
  %36 = getelementptr inbounds i8, ptr %19, i64 40
  %37 = load i32, ptr %36, align 8, !tbaa !25
  %38 = getelementptr inbounds i8, ptr %27, i64 8
  store i32 %37, ptr %38, align 8, !tbaa !26
  %39 = getelementptr inbounds i8, ptr %19, i64 76
  %40 = load i32, ptr %39, align 4, !tbaa !27
  %41 = getelementptr inbounds i8, ptr %27, i64 12
  store i32 %40, ptr %41, align 4, !tbaa !28
  %42 = getelementptr inbounds i8, ptr %19, i64 32
  %43 = load i32, ptr %42, align 8, !tbaa !29
  %44 = getelementptr inbounds i8, ptr %27, i64 16
  store i32 %43, ptr %44, align 8, !tbaa !30
  %45 = getelementptr inbounds i8, ptr %19, i64 64
  %46 = load i64, ptr %45, align 8, !tbaa !31
  %47 = trunc i64 %46 to i32
  %48 = getelementptr inbounds i8, ptr %27, i64 20
  store i32 %47, ptr %48, align 4, !tbaa !32
  %49 = getelementptr inbounds i8, ptr %19, i64 84
  %50 = load i32, ptr %49, align 4, !tbaa !33
  %51 = getelementptr inbounds i8, ptr %27, i64 24
  store i32 %50, ptr %51, align 8, !tbaa !34
  %52 = getelementptr inbounds i8, ptr %27, i64 32
  store ptr null, ptr %52, align 8, !tbaa !35
  %53 = icmp slt i32 %22, %26
  br i1 %53, label %.lr.ph, label %127

.lr.ph:                                           ; preds = %34
  %54 = getelementptr inbounds i8, ptr %4, i64 3
  %55 = getelementptr inbounds i8, ptr %4, i64 2
  br label %57

.loopexit:                                        ; preds = %110
  %56 = icmp slt i32 %124, %26
  br i1 %56, label %57, label %._crit_edge, !llvm.loop !36

57:                                               ; preds = %.lr.ph, %.loopexit
  %58 = phi ptr [ null, %.lr.ph ], [ %111, %.loopexit ]
  %.lcssa136 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %.loopexit ]
  %.0108134 = phi i32 [ %22, %.lr.ph ], [ %124, %.loopexit ]
  %59 = load i32, ptr @swap, align 4, !tbaa !38
  %.not = icmp eq i32 %59, 0
  %60 = load ptr, ptr @directory_table, align 8, !tbaa !10
  %61 = sext i32 %.0108134 to i64
  %62 = getelementptr inbounds i8, ptr %60, i64 %61
  %.sroa.0.0.copyload = load i32, ptr %62, align 1
  br i1 %.not, label %71, label %63

63:                                               ; preds = %57
  %64 = and i32 %.sroa.0.0.copyload, 255
  %65 = shl i32 %.sroa.0.0.copyload, 16
  %66 = and i32 %65, -16777216
  %67 = and i32 %.sroa.0.0.copyload, 16711680
  %.sroa.7.0.insert.insert188199 = or disjoint i32 %66, %67
  %68 = lshr i32 %.sroa.0.0.copyload, 16
  %69 = and i32 %68, 65280
  %.sroa.6178.0.insert.insert183200 = or disjoint i32 %.sroa.7.0.insert.insert188199, %69
  %70 = or disjoint i32 %.sroa.6178.0.insert.insert183200, %64
  br label %71

71:                                               ; preds = %57, %63
  %.sroa.0.1 = phi i32 [ %70, %63 ], [ %.sroa.0.0.copyload, %57 ]
  %72 = and i32 %.sroa.0.1, 255
  %73 = add i32 %.0108134, 4
  %74 = lshr i32 %.sroa.0.1, 8
  %sext = shl i64 %.lcssa136, 32
  %75 = ashr exact i64 %sext, 32
  br label %76

76:                                               ; preds = %71, %110
  %77 = phi ptr [ %58, %71 ], [ %111, %110 ]
  %indvars.iv = phi i64 [ %75, %71 ], [ %indvars.iv.next, %110 ]
  %78 = phi i32 [ %72, %71 ], [ %125, %110 ]
  %.1109133 = phi i32 [ %73, %71 ], [ %124, %110 ]
  %79 = load i32, ptr @swap, align 4, !tbaa !38
  %.not115 = icmp eq i32 %79, 0
  %80 = load ptr, ptr @directory_table, align 8, !tbaa !10
  %81 = sext i32 %.1109133 to i64
  %82 = getelementptr inbounds i8, ptr %80, i64 %81
  br i1 %.not115, label %87, label %83

83:                                               ; preds = %76
  %.sroa.0.0.copyload171 = load i8, ptr %82, align 1
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %82, i64 1
  %.sroa.4.0.copyload = load i8, ptr %.sroa.4.0..sroa_idx, align 1
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %82, i64 2
  %.sroa.6.0.copyload201 = load i8, ptr %.sroa.6.0..sroa_idx, align 1
  %.sroa.9.0.insert.ext = zext i8 %.sroa.0.0.copyload171 to i64
  %.sroa.9.0.insert.shift = shl nuw i64 %.sroa.9.0.insert.ext, 56
  %.sroa.8.0.insert.ext = zext i8 %.sroa.4.0.copyload to i64
  %.sroa.8.0.insert.shift = shl nuw nsw i64 %.sroa.8.0.insert.ext, 48
  %.sroa.8.0.insert.insert = or disjoint i64 %.sroa.9.0.insert.shift, %.sroa.8.0.insert.shift
  %84 = lshr i64 %.sroa.8.0.insert.insert, 51
  %85 = trunc nuw nsw i64 %84 to i16
  %.sroa.8.0.insert.ext.tr = zext i8 %.sroa.4.0.copyload to i16
  %tr.sh.diff117 = shl i16 %.sroa.8.0.insert.ext.tr, 13
  %86 = or disjoint i16 %tr.sh.diff117, %85
  store i16 %86, ptr %4, align 16
  store i8 %.sroa.6.0.copyload201, ptr %55, align 2
  br label %88

87:                                               ; preds = %76
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(3) %4, ptr noundef nonnull align 1 dereferenceable(3) %82, i64 3, i1 false)
  %.pre = load i8, ptr %55, align 2
  br label %88

88:                                               ; preds = %87, %83
  %89 = phi i8 [ %.pre, %87 ], [ %.sroa.6.0.copyload201, %83 ]
  %90 = add i32 %.1109133, 3
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %80, i64 %91
  %93 = zext i8 %89 to i64
  %94 = add nuw nsw i64 %93, 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %54, ptr noundef nonnull align 1 dereferenceable(1) %92, i64 %94, i1 false)
  %95 = getelementptr inbounds [0 x i8], ptr %54, i64 0, i64 %94
  store i8 0, ptr %95, align 1, !tbaa !39
  %96 = trunc nsw i64 %indvars.iv to i32
  %97 = and i32 %96, 15
  %98 = icmp eq i32 %97, 0
  br i1 %98, label %99, label %110

99:                                               ; preds = %88
  %100 = mul i64 %indvars.iv, 272
  %101 = add i64 %100, 4352
  %102 = tail call ptr @realloc(ptr noundef %77, i64 noundef %101) #14
  %103 = icmp eq ptr %102, null
  br i1 %103, label %104, label %109

104:                                              ; preds = %99
  store i32 %96, ptr %27, align 8, !tbaa !22
  %105 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull @screen_mutex) #10
  %106 = load ptr, ptr @stderr, align 8, !tbaa !10
  %107 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef nonnull @.str.5) #11
  %108 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull @screen_mutex) #10
  tail call void @exit(i32 noundef 1) #12
  unreachable

109:                                              ; preds = %99
  store ptr %102, ptr %52, align 8, !tbaa !35
  br label %110

110:                                              ; preds = %109, %88
  %111 = phi ptr [ %102, %109 ], [ %77, %88 ]
  %112 = getelementptr inbounds %struct.dir_ent, ptr %111, i64 %indvars.iv
  %113 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %112, ptr noundef nonnull dereferenceable(1) %54) #10
  %114 = getelementptr inbounds %struct.dir_ent, ptr %111, i64 %indvars.iv, i32 1
  store i32 %74, ptr %114, align 4, !tbaa !40
  %115 = load i16, ptr %4, align 16
  %116 = and i16 %115, 8191
  %117 = zext nneg i16 %116 to i32
  %118 = getelementptr inbounds %struct.dir_ent, ptr %111, i64 %indvars.iv, i32 2
  store i32 %117, ptr %118, align 4, !tbaa !42
  %119 = lshr i16 %115, 13
  %120 = zext nneg i16 %119 to i32
  %121 = getelementptr inbounds %struct.dir_ent, ptr %111, i64 %indvars.iv, i32 3
  store i32 %120, ptr %121, align 4, !tbaa !43
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %122 = zext i8 %89 to i32
  %123 = add i32 %.1109133, 4
  %124 = add i32 %123, %122
  %125 = add nsw i32 %78, -1
  %.not114 = icmp eq i32 %78, 0
  br i1 %.not114, label %.loopexit, label %76, !llvm.loop !44

._crit_edge:                                      ; preds = %.loopexit
  %126 = trunc nsw i64 %indvars.iv.next to i32
  store i32 %126, ptr %27, align 8, !tbaa !22
  br label %127

127:                                              ; preds = %._crit_edge, %34
  call void @llvm.lifetime.end.p0(i64 260, ptr nonnull %4) #10
  ret ptr %27
}

; 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 #8

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #9

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "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 = { 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 #5 = { noreturn 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 #6 = { 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 #7 = { 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 #8 = { 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 #9 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 #10 = { nounwind }
attributes #11 = { cold nounwind }
attributes #12 = { noreturn nounwind }
attributes #13 = { nounwind allocsize(0) }
attributes #14 = { nounwind allocsize(1) }

!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, !7, i64 32}
!6 = !{!"squashfs_operations", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !16, i64 72}
!12 = !{!"super_block", !13, i64 0, !14, i64 96, !14, i64 100, !16, i64 104, !16, i64 112}
!13 = !{!"squashfs_super_block", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !15, i64 20, !15, i64 22, !15, i64 24, !15, i64 26, !15, i64 28, !15, i64 30, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88}
!14 = !{!"int", !8, i64 0}
!15 = !{!"short", !8, i64 0}
!16 = !{!"long long", !8, i64 0}
!17 = !{!18, !16, i64 48}
!18 = !{!"inode", !14, i64 0, !7, i64 8, !16, i64 16, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !16, i64 48, !7, i64 56, !19, i64 64, !14, i64 72, !14, i64 76, !8, i64 80, !14, i64 84}
!19 = !{!"long", !8, i64 0}
!20 = !{!18, !14, i64 44}
!21 = !{!18, !16, i64 16}
!22 = !{!23, !14, i64 0}
!23 = !{!"dir", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !7, i64 32}
!24 = !{!23, !14, i64 4}
!25 = !{!18, !14, i64 40}
!26 = !{!23, !14, i64 8}
!27 = !{!18, !14, i64 76}
!28 = !{!23, !14, i64 12}
!29 = !{!18, !14, i64 32}
!30 = !{!23, !14, i64 16}
!31 = !{!18, !19, i64 64}
!32 = !{!23, !14, i64 20}
!33 = !{!18, !14, i64 84}
!34 = !{!23, !14, i64 24}
!35 = !{!23, !7, i64 32}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!14, !14, i64 0}
!39 = !{!8, !8, i64 0}
!40 = !{!41, !14, i64 260}
!41 = !{!"dir_ent", !8, i64 0, !14, i64 260, !14, i64 264, !14, i64 268}
!42 = !{!41, !14, i64 264}
!43 = !{!41, !14, i64 268}
!44 = distinct !{!44, !37}


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