; LLVM IR from mncoppola/rpef :: utilities_src/squashfs4.2/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 = load ptr, ptr %15, align 8, !tbaa !9
  %70 = icmp eq ptr %69, null
  br i1 %70, label %71, label %79

71:                                               ; preds = %53
  br label %72

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

77:                                               ; No predecessors!
  br label %78

78:                                               ; preds = %77
  br label %79

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

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

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

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

131:                                              ; preds = %142, %124
  %132 = load i32, ptr %17, align 4, !tbaa !5
  %133 = load i32, ptr %18, align 4, !tbaa !5
  %134 = add nsw i32 8, %133
  %135 = icmp slt i32 %132, %134
  br i1 %135, label %136, label %145

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

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

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

158:                                              ; preds = %169, %145
  %159 = load i32, ptr %17, align 4, !tbaa !5
  %160 = load i32, ptr %18, align 4, !tbaa !5
  %161 = add nsw i32 24, %160
  %162 = icmp slt i32 %159, %161
  br i1 %162, label %163, label %172

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

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

172:                                              ; preds = %158
  %173 = load i64, ptr %19, align 8, !tbaa !21
  %174 = load i32, ptr %18, align 4, !tbaa !5
  %175 = sub nsw i32 40, %174
  %176 = zext i32 %175 to i64
  %177 = lshr i64 %173, %176
  %178 = trunc i64 %177 to i32
  %179 = load i32, ptr %7, align 1
  %180 = and i32 %178, 16777215
  %181 = shl i32 %180, 8
  %182 = and i32 %179, 255
  %183 = or i32 %182, %181
  store i32 %183, 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 %189

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

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

197:                                              ; preds = %361, %189
  %198 = load i32, ptr %12, align 4, !tbaa !5
  %199 = add nsw i32 %198, -1
  store i32 %199, ptr %12, align 4, !tbaa !5
  %200 = icmp ne i32 %198, 0
  br i1 %200, label %201, label %424

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

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

212:                                              ; preds = %223, %204
  %213 = load i32, ptr %23, align 4, !tbaa !5
  %214 = load i32, ptr %24, align 4, !tbaa !5
  %215 = add nsw i32 13, %214
  %216 = icmp slt i32 %213, %215
  br i1 %216, label %217, label %226

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

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

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

242:                                              ; preds = %253, %226
  %243 = load i32, ptr %23, align 4, !tbaa !5
  %244 = load i32, ptr %24, align 4, !tbaa !5
  %245 = add nsw i32 3, %244
  %246 = icmp slt i32 %243, %245
  br i1 %246, label %247, label %256

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

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

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

273:                                              ; preds = %284, %256
  %274 = load i32, ptr %23, align 4, !tbaa !5
  %275 = load i32, ptr %24, align 4, !tbaa !5
  %276 = add nsw i32 8, %275
  %277 = icmp slt i32 %274, %276
  br i1 %277, label %278, label %287

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

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

287:                                              ; preds = %273
  %288 = load i64, ptr %25, align 8, !tbaa !21
  %289 = load i32, ptr %24, align 4, !tbaa !5
  %290 = sub nsw i32 56, %289
  %291 = zext i32 %290 to i64
  %292 = lshr i64 %288, %291
  %293 = trunc i64 %292 to i32
  %294 = load ptr, ptr %9, align 8, !tbaa !9
  %295 = getelementptr inbounds %struct.squashfs_dir_entry_2, ptr %294, i32 0, i32 1
  %296 = trunc i32 %293 to i8
  store i8 %296, ptr %295, align 1
  %297 = zext i8 %296 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 %304

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

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

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

349:                                              ; preds = %336
  br label %350

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

355:                                              ; No predecessors!
  br label %356

356:                                              ; preds = %355
  br label %357

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

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

424:                                              ; preds = %197
  br label %117, !llvm.loop !50

425:                                              ; preds = %117
  %426 = 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 %426
}

; 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 ]
  %.lcssa137 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %.loopexit ]
  %.0109135 = 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 %.0109135 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.insert189200 = or disjoint i32 %66, %67
  %68 = lshr i32 %.sroa.0.0.copyload, 16
  %69 = and i32 %68, 65280
  %.sroa.6179.0.insert.insert184201 = or disjoint i32 %.sroa.7.0.insert.insert189200, %69
  %70 = or disjoint i32 %.sroa.6179.0.insert.insert184201, %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 %.0109135, 4
  %74 = lshr i32 %.sroa.0.1, 8
  %sext = shl i64 %.lcssa137, 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 ]
  %.1110134 = phi i32 [ %73, %71 ], [ %124, %110 ]
  %79 = load i32, ptr @swap, align 4, !tbaa !38
  %.not116 = icmp eq i32 %79, 0
  %80 = load ptr, ptr @directory_table, align 8, !tbaa !10
  %81 = sext i32 %.1110134 to i64
  %82 = getelementptr inbounds i8, ptr %80, i64 %81
  br i1 %.not116, label %87, label %83

83:                                               ; preds = %76
  %.sroa.0.0.copyload172 = 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.copyload202 = load i8, ptr %.sroa.6.0..sroa_idx, align 1
  %.sroa.9.0.insert.ext = zext i8 %.sroa.0.0.copyload172 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.diff118 = shl i16 %.sroa.8.0.insert.ext.tr, 13
  %86 = or disjoint i16 %tr.sh.diff118, %85
  store i16 %86, ptr %4, align 16
  store i8 %.sroa.6.0.copyload202, 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.copyload202, %83 ]
  %90 = add i32 %.1110134, 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 %.1110134, 4
  %124 = add i32 %123, %122
  %125 = add nsw i32 %78, -1
  %.not115 = icmp eq i32 %78, 0
  br i1 %.not115, 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