; LLVM IR from jingweizhanghuai/Morn :: src/util (morn_file)

; 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.Chunk = type { i32, i32, i32 }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.MObject = type { i32, %union.anon }
%union.anon = type { ptr }
%struct.HandleMORNFile = type { ptr, ptr, i32 }

@.str = external hidden unnamed_addr constant [76 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1
@__FUNCTION__.MORNInit = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @endMORNFile(ptr noundef) #0

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #1

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

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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
define dso_local ptr @MORNInit(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.Chunk, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = icmp eq ptr %24, null
  br i1 %25, label %30, label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = ptrtoint ptr %27 to i64
  %29 = icmp eq i64 %28, -1
  br label %30

30:                                               ; preds = %26, %23
  %31 = phi i1 [ true, %23 ], [ %29, %26 ]
  %32 = zext i1 %31 to i32
  store i32 %32, ptr %3, align 4, !tbaa !9
  %33 = load i32, ptr %3, align 4, !tbaa !9
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %37

35:                                               ; preds = %30
  %36 = load i32, ptr %3, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %36, i32 noundef -1, ptr noundef @.str, i32 noundef 41, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.2)
  br label %37

37:                                               ; preds = %35, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %38

38:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = call ptr @GetHandle(ptr noundef %39, i32 noundef 24, i32 noundef 853567417, ptr noundef @endMORNFile)
  store ptr %40, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.MHandle, ptr %41, i32 0, i32 3
  %43 = load ptr, ptr %42, align 8, !tbaa !11
  store ptr %43, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.MHandle, ptr %44, i32 0, i32 1
  %46 = load volatile i32, ptr %45, align 4, !tbaa !13
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %349

48:                                               ; preds = %38
  br label %49

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.MObject, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !14
  %53 = icmp eq ptr %52, null
  br i1 %53, label %60, label %54

54:                                               ; preds = %49
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.MObject, ptr %55, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !14
  %58 = ptrtoint ptr %57 to i64
  %59 = icmp eq i64 %58, -1
  br label %60

60:                                               ; preds = %54, %49
  %61 = phi i1 [ true, %49 ], [ %59, %54 ]
  %62 = zext i1 %61 to i32
  store i32 %62, ptr %6, align 4, !tbaa !9
  %63 = load i32, ptr %6, align 4, !tbaa !9
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %67

65:                                               ; preds = %60
  %66 = load i32, ptr %6, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %66, i32 noundef -1, ptr noundef @.str, i32 noundef 46, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.2)
  br label %67

67:                                               ; preds = %65, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %68

68:                                               ; preds = %67
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.HandleMORNFile, ptr %70, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !15
  %73 = icmp eq ptr %72, null
  br i1 %73, label %74, label %78

74:                                               ; preds = %69
  %75 = call ptr @ListCreate(i32 noundef -1, ptr noundef null)
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.HandleMORNFile, ptr %76, i32 0, i32 1
  store ptr %75, ptr %77, align 8, !tbaa !15
  br label %78

78:                                               ; preds = %74, %69
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.HandleMORNFile, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !17
  %82 = icmp eq ptr %81, null
  br i1 %82, label %83, label %90

83:                                               ; preds = %78
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.MObject, ptr %84, i32 0, i32 1
  %86 = load ptr, ptr %85, align 8, !tbaa !14
  %87 = call noalias ptr @fopen(ptr noundef %86, ptr noundef @.str.3)
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.HandleMORNFile, ptr %88, i32 0, i32 0
  store ptr %87, ptr %89, align 8, !tbaa !17
  br label %90

90:                                               ; preds = %83, %78
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.HandleMORNFile, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !17
  %94 = icmp eq ptr %93, null
  br i1 %94, label %95, label %102

95:                                               ; preds = %90
  %96 = load ptr, ptr %2, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.MObject, ptr %96, i32 0, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !14
  %99 = call noalias ptr @fopen(ptr noundef %98, ptr noundef @.str.4)
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.HandleMORNFile, ptr %100, i32 0, i32 0
  store ptr %99, ptr %101, align 8, !tbaa !17
  br label %102

102:                                              ; preds = %95, %90
  br label %103

103:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.HandleMORNFile, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !17
  %107 = icmp eq ptr %106, null
  %108 = zext i1 %107 to i32
  store i32 %108, ptr %7, align 4, !tbaa !9
  %109 = load i32, ptr %7, align 4, !tbaa !9
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %116

111:                                              ; preds = %103
  %112 = load i32, ptr %7, align 4, !tbaa !9
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.MObject, ptr %113, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !14
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %112, i32 noundef -1, ptr noundef @.str, i32 noundef 51, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.5, ptr noundef %115)
  br label %116

116:                                              ; preds = %111, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.HandleMORNFile, ptr %119, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !17
  %122 = call i32 @fseek(ptr noundef %121, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.HandleMORNFile, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !17
  %126 = call i32 @fsize(ptr noundef %125)
  store i32 %126, ptr %8, align 4, !tbaa !9
  %127 = load i32, ptr %8, align 4, !tbaa !9
  %128 = icmp eq i32 %127, 0
  br i1 %128, label %129, label %179

129:                                              ; preds = %118
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.HandleMORNFile, ptr %130, i32 0, i32 2
  store i32 4, ptr %131, align 8, !tbaa !18
  br label %132

132:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %133 = load ptr, ptr %5, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.HandleMORNFile, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !17
  %136 = call i64 @fwrite(ptr noundef @.str.6, i64 noundef 1, i64 noundef 4, ptr noundef %135)
  %137 = trunc i64 %136 to i32
  %138 = icmp ne i32 %137, 4
  %139 = zext i1 %138 to i32
  store i32 %139, ptr %9, align 4, !tbaa !9
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %144

142:                                              ; preds = %132
  %143 = load i32, ptr %9, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %143, i32 noundef -1, ptr noundef @.str, i32 noundef 58, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.1)
  br label %144

144:                                              ; preds = %142, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.HandleMORNFile, ptr %148, i32 0, i32 2
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.HandleMORNFile, ptr %150, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !17
  %153 = call i64 @fwrite(ptr noundef %149, i64 noundef 4, i64 noundef 1, ptr noundef %152)
  %154 = trunc i64 %153 to i32
  %155 = icmp ne i32 %154, 1
  %156 = zext i1 %155 to i32
  store i32 %156, ptr %10, align 4, !tbaa !9
  %157 = load i32, ptr %10, align 4, !tbaa !9
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %161

159:                                              ; preds = %147
  %160 = load i32, ptr %10, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %160, i32 noundef -1, ptr noundef @.str, i32 noundef 59, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.1)
  br label %161

161:                                              ; preds = %159, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.HandleMORNFile, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !17
  %168 = call i64 @fwrite(ptr noundef @.str.7, i64 noundef 1, i64 noundef 4, ptr noundef %167)
  %169 = trunc i64 %168 to i32
  %170 = icmp ne i32 %169, 4
  %171 = zext i1 %170 to i32
  store i32 %171, ptr %11, align 4, !tbaa !9
  %172 = load i32, ptr %11, align 4, !tbaa !9
  %173 = icmp ne i32 %172, 0
  br i1 %173, label %174, label %176

174:                                              ; preds = %164
  %175 = load i32, ptr %11, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %175, i32 noundef -1, ptr noundef @.str, i32 noundef 60, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.1)
  br label %176

176:                                              ; preds = %174, %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %177

177:                                              ; preds = %176
  br label %178

178:                                              ; preds = %177
  br label %346

179:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  br label %180

180:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.HandleMORNFile, ptr %181, i32 0, i32 0
  %183 = load ptr, ptr %182, align 8, !tbaa !17
  %184 = call i64 @fread(ptr noundef %12, i64 noundef 1, i64 noundef 4, ptr noundef %183)
  %185 = trunc i64 %184 to i32
  %186 = icmp ne i32 %185, 4
  %187 = zext i1 %186 to i32
  store i32 %187, ptr %13, align 4, !tbaa !9
  %188 = load i32, ptr %13, align 4, !tbaa !9
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %190, label %192

190:                                              ; preds = %180
  %191 = load i32, ptr %13, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %191, i32 noundef -1, ptr noundef @.str, i32 noundef 64, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.8)
  br label %192

192:                                              ; preds = %190, %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %193

193:                                              ; preds = %192
  br label %194

194:                                              ; preds = %193
  br label %195

195:                                              ; preds = %194
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %196 = call i32 @memcmp(ptr noundef %12, ptr noundef @.str.6, i64 noundef 4) #5
  %197 = icmp ne i32 %196, 0
  %198 = zext i1 %197 to i32
  store i32 %198, ptr %14, align 4, !tbaa !9
  %199 = load i32, ptr %14, align 4, !tbaa !9
  %200 = icmp ne i32 %199, 0
  br i1 %200, label %201, label %203

201:                                              ; preds = %195
  %202 = load i32, ptr %14, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %202, i32 noundef -1, ptr noundef @.str, i32 noundef 65, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.9)
  br label %203

203:                                              ; preds = %201, %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %204

204:                                              ; preds = %203
  br label %205

205:                                              ; preds = %204
  br label %206

206:                                              ; preds = %205
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %207 = load ptr, ptr %5, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.HandleMORNFile, ptr %207, i32 0, i32 2
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.HandleMORNFile, ptr %209, i32 0, i32 0
  %211 = load ptr, ptr %210, align 8, !tbaa !17
  %212 = call i64 @fread(ptr noundef %208, i64 noundef 4, i64 noundef 1, ptr noundef %211)
  %213 = trunc i64 %212 to i32
  %214 = icmp ne i32 %213, 1
  %215 = zext i1 %214 to i32
  store i32 %215, ptr %15, align 4, !tbaa !9
  %216 = load i32, ptr %15, align 4, !tbaa !9
  %217 = icmp ne i32 %216, 0
  br i1 %217, label %218, label %220

218:                                              ; preds = %206
  %219 = load i32, ptr %15, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %219, i32 noundef -1, ptr noundef @.str, i32 noundef 67, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.8)
  br label %220

220:                                              ; preds = %218, %206
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %221

221:                                              ; preds = %220
  br label %222

222:                                              ; preds = %221
  br label %223

223:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %224 = load ptr, ptr %5, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.HandleMORNFile, ptr %224, i32 0, i32 0
  %226 = load ptr, ptr %225, align 8, !tbaa !17
  %227 = call i64 @fread(ptr noundef %12, i64 noundef 4, i64 noundef 1, ptr noundef %226)
  %228 = trunc i64 %227 to i32
  %229 = icmp ne i32 %228, 1
  %230 = zext i1 %229 to i32
  store i32 %230, ptr %16, align 4, !tbaa !9
  %231 = load i32, ptr %16, align 4, !tbaa !9
  %232 = icmp ne i32 %231, 0
  br i1 %232, label %233, label %235

233:                                              ; preds = %223
  %234 = load i32, ptr %16, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %234, i32 noundef -1, ptr noundef @.str, i32 noundef 69, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.8)
  br label %235

235:                                              ; preds = %233, %223
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %236

236:                                              ; preds = %235
  br label %237

237:                                              ; preds = %236
  br label %238

238:                                              ; preds = %237
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %239 = call i32 @memcmp(ptr noundef %12, ptr noundef @.str.7, i64 noundef 4) #5
  %240 = icmp ne i32 %239, 0
  %241 = zext i1 %240 to i32
  store i32 %241, ptr %17, align 4, !tbaa !9
  %242 = load i32, ptr %17, align 4, !tbaa !9
  %243 = icmp ne i32 %242, 0
  br i1 %243, label %244, label %246

244:                                              ; preds = %238
  %245 = load i32, ptr %17, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %245, i32 noundef -1, ptr noundef @.str, i32 noundef 70, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.9)
  br label %246

246:                                              ; preds = %244, %238
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %247

247:                                              ; preds = %246
  br label %248

248:                                              ; preds = %247
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 12, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #4
  br label %249

249:                                              ; preds = %319, %248
  br label %250

250:                                              ; preds = %249
  br label %251

251:                                              ; preds = %250
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %252 = getelementptr inbounds %struct.Chunk, ptr %19, i32 0, i32 0
  %253 = load ptr, ptr %5, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.HandleMORNFile, ptr %253, i32 0, i32 0
  %255 = load ptr, ptr %254, align 8, !tbaa !17
  %256 = call i64 @fread(ptr noundef %252, i64 noundef 1, i64 noundef 4, ptr noundef %255)
  %257 = trunc i64 %256 to i32
  %258 = icmp ne i32 %257, 4
  %259 = zext i1 %258 to i32
  store i32 %259, ptr %20, align 4, !tbaa !9
  %260 = load i32, ptr %20, align 4, !tbaa !9
  %261 = icmp ne i32 %260, 0
  br i1 %261, label %262, label %264

262:                                              ; preds = %251
  %263 = load i32, ptr %20, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %263, i32 noundef -1, ptr noundef @.str, i32 noundef 76, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.8)
  br label %264

264:                                              ; preds = %262, %251
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %265

265:                                              ; preds = %264
  br label %266

266:                                              ; preds = %265
  br label %267

267:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %268 = getelementptr inbounds %struct.Chunk, ptr %19, i32 0, i32 1
  %269 = load ptr, ptr %5, align 8, !tbaa !5
  %270 = getelementptr inbounds %struct.HandleMORNFile, ptr %269, i32 0, i32 0
  %271 = load ptr, ptr %270, align 8, !tbaa !17
  %272 = call i64 @fread(ptr noundef %268, i64 noundef 1, i64 noundef 4, ptr noundef %271)
  %273 = trunc i64 %272 to i32
  %274 = icmp ne i32 %273, 4
  %275 = zext i1 %274 to i32
  store i32 %275, ptr %21, align 4, !tbaa !9
  %276 = load i32, ptr %21, align 4, !tbaa !9
  %277 = icmp ne i32 %276, 0
  br i1 %277, label %278, label %280

278:                                              ; preds = %267
  %279 = load i32, ptr %21, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %279, i32 noundef -1, ptr noundef @.str, i32 noundef 77, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.8)
  br label %280

280:                                              ; preds = %278, %267
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  br label %281

281:                                              ; preds = %280
  br label %282

282:                                              ; preds = %281
  %283 = load i32, ptr %18, align 4, !tbaa !9
  %284 = add nsw i32 %283, 8
  %285 = getelementptr inbounds %struct.Chunk, ptr %19, i32 0, i32 1
  %286 = load i32, ptr %285, align 4, !tbaa !19
  %287 = add nsw i32 %284, %286
  %288 = load i32, ptr %8, align 4, !tbaa !9
  %289 = icmp sgt i32 %287, %288
  br i1 %289, label %290, label %291

290:                                              ; preds = %282
  br label %320

291:                                              ; preds = %282
  %292 = load i32, ptr %18, align 4, !tbaa !9
  %293 = add nsw i32 %292, 4
  %294 = add nsw i32 %293, 4
  store i32 %294, ptr %18, align 4, !tbaa !9
  %295 = load i32, ptr %18, align 4, !tbaa !9
  %296 = getelementptr inbounds %struct.Chunk, ptr %19, i32 0, i32 2
  store i32 %295, ptr %296, align 4, !tbaa !21
  %297 = load ptr, ptr %5, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.HandleMORNFile, ptr %297, i32 0, i32 1
  %299 = load ptr, ptr %298, align 8, !tbaa !15
  %300 = call ptr @mListWrite(ptr noundef %299, i32 noundef -1, ptr noundef %19, i32 noundef 12)
  %301 = load i32, ptr %18, align 4, !tbaa !9
  %302 = getelementptr inbounds %struct.Chunk, ptr %19, i32 0, i32 1
  %303 = load i32, ptr %302, align 4, !tbaa !19
  %304 = add nsw i32 %301, %303
  store i32 %304, ptr %18, align 4, !tbaa !9
  %305 = load i32, ptr %18, align 4, !tbaa !9
  %306 = load i32, ptr %8, align 4, !tbaa !9
  %307 = icmp eq i32 %305, %306
  br i1 %307, label %308, label %309

308:                                              ; preds = %291
  br label %320

309:                                              ; preds = %291
  %310 = load ptr, ptr %5, align 8, !tbaa !5
  %311 = getelementptr inbounds %struct.HandleMORNFile, ptr %310, i32 0, i32 0
  %312 = load ptr, ptr %311, align 8, !tbaa !17
  %313 = getelementptr inbounds %struct.Chunk, ptr %19, i32 0, i32 1
  %314 = load i32, ptr %313, align 4, !tbaa !19
  %315 = sext i32 %314 to i64
  %316 = call i32 @fseek(ptr noundef %312, i64 noundef %315, i32 noundef 1)
  %317 = icmp ne i32 %316, 0
  br i1 %317, label %318, label %319

318:                                              ; preds = %309
  br label %320

319:                                              ; preds = %309
  br label %249

320:                                              ; preds = %318, %308, %290
  %321 = load i32, ptr %18, align 4, !tbaa !9
  %322 = sub nsw i32 %321, 8
  %323 = load ptr, ptr %5, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.HandleMORNFile, ptr %323, i32 0, i32 2
  store i32 %322, ptr %324, align 8, !tbaa !18
  %325 = load ptr, ptr %5, align 8, !tbaa !5
  %326 = getelementptr inbounds %struct.HandleMORNFile, ptr %325, i32 0, i32 0
  %327 = load ptr, ptr %326, align 8, !tbaa !17
  %328 = call i32 @fseek(ptr noundef %327, i64 noundef 4, i32 noundef 0)
  br label %329

329:                                              ; preds = %320
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %330 = load ptr, ptr %5, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct.HandleMORNFile, ptr %330, i32 0, i32 2
  %332 = load ptr, ptr %5, align 8, !tbaa !5
  %333 = getelementptr inbounds %struct.HandleMORNFile, ptr %332, i32 0, i32 0
  %334 = load ptr, ptr %333, align 8, !tbaa !17
  %335 = call i64 @fwrite(ptr noundef %331, i64 noundef 4, i64 noundef 1, ptr noundef %334)
  %336 = trunc i64 %335 to i32
  %337 = icmp ne i32 %336, 1
  %338 = zext i1 %337 to i32
  store i32 %338, ptr %22, align 4, !tbaa !9
  %339 = load i32, ptr %22, align 4, !tbaa !9
  %340 = icmp ne i32 %339, 0
  br i1 %340, label %341, label %343

341:                                              ; preds = %329
  %342 = load i32, ptr %22, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %342, i32 noundef -1, ptr noundef @.str, i32 noundef 90, ptr noundef @__FUNCTION__.MORNInit, ptr noundef @.str.1)
  br label %343

343:                                              ; preds = %341, %329
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %344

344:                                              ; preds = %343
  br label %345

345:                                              ; preds = %344
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %346

346:                                              ; preds = %345, %178
  %347 = load ptr, ptr %4, align 8, !tbaa !5
  %348 = getelementptr inbounds %struct.MHandle, ptr %347, i32 0, i32 1
  store volatile i32 1, ptr %348, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %349

349:                                              ; preds = %346, %38
  %350 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  ret ptr %350
}

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

declare ptr @ListCreate(i32 noundef, ptr noundef) #1

declare noalias ptr @fopen(ptr noundef, ptr noundef) #1

declare i32 @fsize(ptr noundef) #1

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #3

declare ptr @mListWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!13 = !{!12, !10, i64 4}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !6, i64 8}
!16 = !{!"HandleMORNFile", !6, i64 0, !6, i64 8, !10, i64 16}
!17 = !{!16, !6, i64 0}
!18 = !{!16, !10, i64 16}
!19 = !{!20, !10, i64 4}
!20 = !{!"Chunk", !10, i64 0, !10, i64 4, !10, i64 8}
!21 = !{!20, !10, i64 8}


; 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.Chunk = type { i32, i32, i32 }

@.str = external hidden unnamed_addr constant [76 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1
@__FUNCTION__.MORNInit = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @endMORNFile(ptr noundef) #0

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

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

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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local ptr @MORNInit(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca i32, align 4
  %3 = alloca %struct.Chunk, align 4
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %9 [
    i64 -1, label %4
    i64 0, label %4
  ]

4:                                                ; preds = %1, %1
  %5 = icmp eq ptr %0, null
  %6 = icmp eq ptr %0, inttoptr (i64 -1 to ptr)
  %7 = or i1 %5, %6
  %8 = zext i1 %7 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %8, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 41, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.2) #5
  br label %9

9:                                                ; preds = %1, %4
  %10 = tail call ptr @GetHandle(ptr noundef %0, i32 noundef 24, i32 noundef 853567417, ptr noundef nonnull @endMORNFile) #5
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %10, i64 4
  %14 = load volatile i32, ptr %13, align 4, !tbaa !11
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %121

16:                                               ; preds = %9
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  %magicptr79 = ptrtoint ptr %18 to i64
  switch i64 %magicptr79, label %23 [
    i64 -1, label %19
    i64 0, label %19
  ]

19:                                               ; preds = %16, %16
  %20 = icmp eq ptr %18, null
  %21 = icmp eq ptr %18, inttoptr (i64 -1 to ptr)
  %spec.select = or i1 %20, %21
  %22 = zext i1 %spec.select to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %22, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 46, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.2) #5
  br label %23

23:                                               ; preds = %16, %19
  %24 = getelementptr inbounds i8, ptr %12, i64 8
  %25 = load ptr, ptr %24, align 8, !tbaa !13
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %29

27:                                               ; preds = %23
  %28 = tail call ptr @ListCreate(i32 noundef -1, ptr noundef null) #5
  store ptr %28, ptr %24, align 8, !tbaa !13
  br label %29

29:                                               ; preds = %27, %23
  %30 = load ptr, ptr %12, align 8, !tbaa !15
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %.thread80

32:                                               ; preds = %29
  %33 = load ptr, ptr %17, align 8, !tbaa !12
  %34 = tail call noalias ptr @fopen(ptr noundef %33, ptr noundef nonnull @.str.3)
  store ptr %34, ptr %12, align 8, !tbaa !15
  %35 = icmp eq ptr %34, null
  br i1 %35, label %36, label %.thread80

36:                                               ; preds = %32
  %37 = load ptr, ptr %17, align 8, !tbaa !12
  %38 = tail call noalias ptr @fopen(ptr noundef %37, ptr noundef nonnull @.str.4)
  store ptr %38, ptr %12, align 8, !tbaa !15
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %.thread80

40:                                               ; preds = %36
  %41 = load ptr, ptr %17, align 8, !tbaa !12
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 51, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.5, ptr noundef %41) #5
  %.pre = load ptr, ptr %12, align 8, !tbaa !15
  br label %.thread80

.thread80:                                        ; preds = %29, %32, %40, %36
  %42 = phi ptr [ %30, %29 ], [ %34, %32 ], [ %.pre, %40 ], [ %38, %36 ]
  %43 = tail call i32 @fseek(ptr noundef %42, i64 noundef 0, i32 noundef 0)
  %44 = load ptr, ptr %12, align 8, !tbaa !15
  %45 = tail call i32 @fsize(ptr noundef %44) #5
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %63

47:                                               ; preds = %.thread80
  %48 = getelementptr inbounds i8, ptr %12, i64 16
  store i32 4, ptr %48, align 8, !tbaa !16
  %49 = load ptr, ptr %12, align 8, !tbaa !15
  %50 = tail call i64 @fwrite(ptr noundef nonnull @.str.6, i64 noundef 1, i64 noundef 4, ptr noundef %49)
  %51 = and i64 %50, 4294967295
  %.not89 = icmp eq i64 %51, 4
  br i1 %.not89, label %53, label %52

52:                                               ; preds = %47
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 58, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.1) #5
  br label %53

53:                                               ; preds = %52, %47
  %54 = load ptr, ptr %12, align 8, !tbaa !15
  %55 = tail call i64 @fwrite(ptr noundef nonnull %48, i64 noundef 4, i64 noundef 1, ptr noundef %54)
  %56 = and i64 %55, 4294967295
  %.not90 = icmp eq i64 %56, 1
  br i1 %.not90, label %58, label %57

57:                                               ; preds = %53
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 59, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.1) #5
  br label %58

58:                                               ; preds = %57, %53
  %59 = load ptr, ptr %12, align 8, !tbaa !15
  %60 = tail call i64 @fwrite(ptr noundef nonnull @.str.7, i64 noundef 1, i64 noundef 4, ptr noundef %59)
  %61 = and i64 %60, 4294967295
  %.not91 = icmp eq i64 %61, 4
  br i1 %.not91, label %120, label %62

62:                                               ; preds = %58
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 60, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.1) #5
  br label %120

63:                                               ; preds = %.thread80
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %64 = load ptr, ptr %12, align 8, !tbaa !15
  %65 = call i64 @fread(ptr noundef nonnull %2, i64 noundef 1, i64 noundef 4, ptr noundef %64)
  %66 = and i64 %65, 4294967295
  %.not81 = icmp eq i64 %66, 4
  br i1 %.not81, label %68, label %67

67:                                               ; preds = %63
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 64, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.8) #5
  br label %68

68:                                               ; preds = %67, %63
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %2, ptr noundef nonnull dereferenceable(4) @.str.6, i64 4)
  %.not82 = icmp eq i32 %bcmp, 0
  br i1 %.not82, label %70, label %69

69:                                               ; preds = %68
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 65, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.9) #5
  br label %70

70:                                               ; preds = %69, %68
  %71 = getelementptr inbounds i8, ptr %12, i64 16
  %72 = load ptr, ptr %12, align 8, !tbaa !15
  %73 = tail call i64 @fread(ptr noundef nonnull %71, i64 noundef 4, i64 noundef 1, ptr noundef %72)
  %74 = and i64 %73, 4294967295
  %.not83 = icmp eq i64 %74, 1
  br i1 %.not83, label %76, label %75

75:                                               ; preds = %70
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 67, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.8) #5
  br label %76

76:                                               ; preds = %75, %70
  %77 = load ptr, ptr %12, align 8, !tbaa !15
  %78 = call i64 @fread(ptr noundef nonnull %2, i64 noundef 4, i64 noundef 1, ptr noundef %77)
  %79 = and i64 %78, 4294967295
  %.not84 = icmp eq i64 %79, 1
  br i1 %.not84, label %81, label %80

80:                                               ; preds = %76
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 69, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.8) #5
  br label %81

81:                                               ; preds = %80, %76
  %bcmp78 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %2, ptr noundef nonnull dereferenceable(4) @.str.7, i64 4)
  %.not85 = icmp eq i32 %bcmp78, 0
  br i1 %.not85, label %83, label %82

82:                                               ; preds = %81
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 70, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.9) #5
  br label %83

83:                                               ; preds = %82, %81
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #5
  %84 = getelementptr inbounds i8, ptr %3, i64 8
  %85 = getelementptr inbounds i8, ptr %3, i64 4
  br label %86

86:                                               ; preds = %107, %83
  %.0 = phi i32 [ 12, %83 ], [ %105, %107 ]
  %87 = load ptr, ptr %12, align 8, !tbaa !15
  %88 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 1, i64 noundef 4, ptr noundef %87)
  %89 = and i64 %88, 4294967295
  %.not86 = icmp eq i64 %89, 4
  br i1 %.not86, label %91, label %90

90:                                               ; preds = %86
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 76, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.8) #5
  br label %91

91:                                               ; preds = %90, %86
  %92 = load ptr, ptr %12, align 8, !tbaa !15
  %93 = call i64 @fread(ptr noundef nonnull %85, i64 noundef 1, i64 noundef 4, ptr noundef %92)
  %94 = and i64 %93, 4294967295
  %.not87 = icmp eq i64 %94, 4
  br i1 %.not87, label %96, label %95

95:                                               ; preds = %91
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 77, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.8) #5
  br label %96

96:                                               ; preds = %95, %91
  %97 = add nsw i32 %.0, 8
  %98 = load i32, ptr %85, align 4, !tbaa !17
  %99 = add nsw i32 %98, %97
  %100 = icmp sgt i32 %99, %45
  br i1 %100, label %111, label %101

101:                                              ; preds = %96
  store i32 %97, ptr %84, align 4, !tbaa !19
  %102 = load ptr, ptr %24, align 8, !tbaa !13
  %103 = call ptr @mListWrite(ptr noundef %102, i32 noundef -1, ptr noundef nonnull %3, i32 noundef 12) #5
  %104 = load i32, ptr %85, align 4, !tbaa !17
  %105 = add nsw i32 %104, %97
  %106 = icmp eq i32 %105, %45
  br i1 %106, label %111, label %107

107:                                              ; preds = %101
  %108 = load ptr, ptr %12, align 8, !tbaa !15
  %109 = sext i32 %104 to i64
  %110 = call i32 @fseek(ptr noundef %108, i64 noundef %109, i32 noundef 1)
  %.not = icmp eq i32 %110, 0
  br i1 %.not, label %86, label %111

111:                                              ; preds = %107, %101, %96
  %.1 = phi i32 [ %.0, %96 ], [ %45, %101 ], [ %105, %107 ]
  %112 = add nsw i32 %.1, -8
  store i32 %112, ptr %71, align 8, !tbaa !16
  %113 = load ptr, ptr %12, align 8, !tbaa !15
  %114 = call i32 @fseek(ptr noundef %113, i64 noundef 4, i32 noundef 0)
  %115 = load ptr, ptr %12, align 8, !tbaa !15
  %116 = call i64 @fwrite(ptr noundef nonnull %71, i64 noundef 4, i64 noundef 1, ptr noundef %115)
  %117 = and i64 %116, 4294967295
  %.not88 = icmp eq i64 %117, 1
  br i1 %.not88, label %119, label %118

118:                                              ; preds = %111
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 90, ptr noundef nonnull @__FUNCTION__.MORNInit, ptr noundef nonnull @.str.1) #5
  br label %119

119:                                              ; preds = %118, %111
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  br label %120

120:                                              ; preds = %58, %62, %119
  store volatile i32 1, ptr %13, align 4, !tbaa !11
  br label %121

121:                                              ; preds = %120, %9
  ret ptr %12
}

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare ptr @ListCreate(i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

declare i32 @fsize(ptr noundef) local_unnamed_addr #3

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

declare ptr @mListWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nofree nounwind willreturn memory(argmem: read) }
attributes #5 = { nounwind }

!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, !10, i64 16}
!6 = !{!"MHandle", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!8, !8, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"HandleMORNFile", !10, i64 0, !10, i64 8, !7, i64 16}
!15 = !{!14, !10, i64 0}
!16 = !{!14, !7, i64 16}
!17 = !{!18, !7, i64 4}
!18 = !{!"Chunk", !7, i64 0, !7, i64 4, !7, i64 8}
!19 = !{!18, !7, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass