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

; 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.MHandle = type { i32, i32, ptr, ptr }
%struct.HandleJSON = type { [64 x %struct.ListLayer], [64 x %struct.ArrayLayer], [2 x %struct.ListNode], [2 x %struct.ArrayNode], ptr, i32, ptr }
%struct.ListLayer = type { ptr, i32, i32 }
%struct.ArrayLayer = type { ptr, i32, i32 }
%struct.ListNode = type <{ %union.JsonData, i8, i32, [3 x i8], ptr }>
%union.JsonData = type { double }
%struct.ArrayNode = type <{ %union.JsonData, i8, i32, [3 x i8] }>
%struct.MObject = type { i32, %union.anon }
%union.anon = type { ptr }
%struct.anon = type { i16, i16, i32 }

@.str = external hidden unnamed_addr constant [76 x i8], align 1
@__FUNCTION__.mJSONLoad = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 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

declare ptr @m_Malloc(i32 noundef) #1

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

declare void @m_Free(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @endJSON(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @JSONListLoad(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @JSONArrayLoad(ptr noundef, ptr noundef, i32 noundef) #3

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

19:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %26, label %22

22:                                               ; preds = %19
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = ptrtoint ptr %23 to i64
  %25 = icmp eq i64 %24, -1
  br label %26

26:                                               ; preds = %22, %19
  %27 = phi i1 [ true, %19 ], [ %25, %22 ]
  %28 = zext i1 %27 to i32
  store i32 %28, ptr %4, align 4, !tbaa !9
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %33

31:                                               ; preds = %26
  %32 = load i32, ptr %4, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %32, i32 noundef -1, ptr noundef @.str, i32 noundef 405, ptr noundef @__FUNCTION__.mJSONLoad, ptr noundef @.str.4)
  br label %33

33:                                               ; preds = %31, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = call ptr @GetHandle(ptr noundef %35, i32 noundef 2152, i32 noundef 514859913, ptr noundef @endJSON)
  store ptr %36, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.MHandle, ptr %37, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !11
  store ptr %39, ptr %6, align 8, !tbaa !5
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = call i32 @mHandleValid(ptr noundef %40)
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %103, label %43

43:                                               ; preds = %34
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.HandleJSON, ptr %45, i32 0, i32 2
  %47 = getelementptr inbounds [2 x %struct.ListNode], ptr %46, i64 0, i64 0
  %48 = getelementptr inbounds %struct.ListNode, ptr %47, i32 0, i32 0
  store ptr %44, ptr %48, align 8, !tbaa !13
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.HandleJSON, ptr %49, i32 0, i32 2
  %51 = getelementptr inbounds [2 x %struct.ListNode], ptr %50, i64 0, i64 0
  %52 = getelementptr inbounds %struct.ListNode, ptr %51, i32 0, i32 1
  store i8 0, ptr %52, align 8, !tbaa !14
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.HandleJSON, ptr %54, i32 0, i32 3
  %56 = getelementptr inbounds [2 x %struct.ArrayNode], ptr %55, i64 0, i64 0
  %57 = getelementptr inbounds %struct.ArrayNode, ptr %56, i32 0, i32 0
  store ptr %53, ptr %57, align 8, !tbaa !13
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.HandleJSON, ptr %58, i32 0, i32 3
  %60 = getelementptr inbounds [2 x %struct.ArrayNode], ptr %59, i64 0, i64 0
  %61 = getelementptr inbounds %struct.ArrayNode, ptr %60, i32 0, i32 1
  store i8 0, ptr %61, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %97, %43
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = icmp slt i32 %63, 64
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %100

66:                                               ; preds = %62
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.HandleJSON, ptr %67, i32 0, i32 2
  %69 = getelementptr inbounds [2 x %struct.ListNode], ptr %68, i64 0, i64 0
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.HandleJSON, ptr %70, i32 0, i32 0
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [64 x %struct.ListLayer], ptr %71, i64 0, i64 %73
  %75 = getelementptr inbounds %struct.ListLayer, ptr %74, i32 0, i32 0
  store ptr %69, ptr %75, align 8, !tbaa !18
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.HandleJSON, ptr %76, i32 0, i32 0
  %78 = load i32, ptr %7, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [64 x %struct.ListLayer], ptr %77, i64 0, i64 %79
  %81 = getelementptr inbounds %struct.ListLayer, ptr %80, i32 0, i32 1
  store i32 1, ptr %81, align 8, !tbaa !20
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.HandleJSON, ptr %82, i32 0, i32 3
  %84 = getelementptr inbounds [2 x %struct.ArrayNode], ptr %83, i64 0, i64 0
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.HandleJSON, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %7, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [64 x %struct.ArrayLayer], ptr %86, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.ArrayLayer, ptr %89, i32 0, i32 0
  store ptr %84, ptr %90, align 8, !tbaa !21
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.HandleJSON, ptr %91, i32 0, i32 1
  %93 = load i32, ptr %7, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [64 x %struct.ArrayLayer], ptr %92, i64 0, i64 %94
  %96 = getelementptr inbounds %struct.ArrayLayer, ptr %95, i32 0, i32 1
  store i32 1, ptr %96, align 8, !tbaa !23
  br label %97

97:                                               ; preds = %66
  %98 = load i32, ptr %7, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %7, align 4, !tbaa !9
  br label %62, !llvm.loop !24

100:                                              ; preds = %65
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.MHandle, ptr %101, i32 0, i32 1
  store volatile i32 1, ptr %102, align 4, !tbaa !26
  br label %103

103:                                              ; preds = %100, %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %104

104:                                              ; preds = %121, %103
  %105 = load i32, ptr %8, align 4, !tbaa !9
  %106 = icmp slt i32 %105, 64
  br i1 %106, label %108, label %107

107:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %124

108:                                              ; preds = %104
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.HandleJSON, ptr %109, i32 0, i32 0
  %111 = load i32, ptr %8, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [64 x %struct.ListLayer], ptr %110, i64 0, i64 %112
  %114 = getelementptr inbounds %struct.ListLayer, ptr %113, i32 0, i32 2
  store i32 1, ptr %114, align 4, !tbaa !27
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.HandleJSON, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %8, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [64 x %struct.ArrayLayer], ptr %116, i64 0, i64 %118
  %120 = getelementptr inbounds %struct.ArrayLayer, ptr %119, i32 0, i32 2
  store i32 1, ptr %120, align 4, !tbaa !28
  br label %121

121:                                              ; preds = %108
  %122 = load i32, ptr %8, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %8, align 4, !tbaa !9
  br label %104, !llvm.loop !29

124:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.MObject, ptr %125, i32 0, i32 0
  %127 = load i32, ptr %126, align 8, !tbaa !30
  %128 = icmp slt i32 %127, 0
  br i1 %128, label %129, label %137

129:                                              ; preds = %124
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.MObject, ptr %130, i32 0, i32 1
  %132 = load ptr, ptr %131, align 8, !tbaa !13
  %133 = call i64 @strlen(ptr noundef %132) #6
  %134 = trunc i64 %133 to i32
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.MObject, ptr %135, i32 0, i32 0
  store i32 %134, ptr %136, align 8, !tbaa !30
  br label %137

137:                                              ; preds = %129, %124
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.MObject, ptr %138, i32 0, i32 1
  %140 = load ptr, ptr %139, align 8, !tbaa !13
  store ptr %140, ptr %10, align 8, !tbaa !5
  br label %141

141:                                              ; preds = %154, %137
  %142 = load ptr, ptr %10, align 8, !tbaa !5
  %143 = load i8, ptr %142, align 1, !tbaa !13
  %144 = sext i8 %143 to i32
  %145 = icmp sle i32 %144, 32
  br i1 %145, label %151, label %146

146:                                              ; preds = %141
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = load i8, ptr %147, align 1, !tbaa !13
  %149 = sext i8 %148 to i32
  %150 = icmp eq i32 %149, 0
  br label %151

151:                                              ; preds = %146, %141
  %152 = phi i1 [ true, %141 ], [ %150, %146 ]
  br i1 %152, label %153, label %157

153:                                              ; preds = %151
  br label %154

154:                                              ; preds = %153
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  %156 = getelementptr inbounds i8, ptr %155, i32 1
  store ptr %156, ptr %10, align 8, !tbaa !5
  br label %141, !llvm.loop !32

157:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.MObject, ptr %158, i32 0, i32 1
  %160 = load ptr, ptr %159, align 8, !tbaa !13
  %161 = load ptr, ptr %3, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.MObject, ptr %161, i32 0, i32 0
  %163 = load i32, ptr %162, align 8, !tbaa !30
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds i8, ptr %160, i64 %164
  %166 = getelementptr inbounds i8, ptr %165, i64 -1
  store ptr %166, ptr %11, align 8, !tbaa !5
  br label %167

167:                                              ; preds = %180, %157
  %168 = load ptr, ptr %11, align 8, !tbaa !5
  %169 = load i8, ptr %168, align 1, !tbaa !13
  %170 = sext i8 %169 to i32
  %171 = icmp sle i32 %170, 32
  br i1 %171, label %177, label %172

172:                                              ; preds = %167
  %173 = load ptr, ptr %11, align 8, !tbaa !5
  %174 = load i8, ptr %173, align 1, !tbaa !13
  %175 = sext i8 %174 to i32
  %176 = icmp eq i32 %175, 0
  br label %177

177:                                              ; preds = %172, %167
  %178 = phi i1 [ true, %167 ], [ %176, %172 ]
  br i1 %178, label %179, label %183

179:                                              ; preds = %177
  br label %180

180:                                              ; preds = %179
  %181 = load ptr, ptr %11, align 8, !tbaa !5
  %182 = getelementptr inbounds i8, ptr %181, i32 -1
  store ptr %182, ptr %11, align 8, !tbaa !5
  br label %167, !llvm.loop !33

183:                                              ; preds = %177
  %184 = load ptr, ptr %10, align 8, !tbaa !5
  %185 = load i8, ptr %184, align 1, !tbaa !13
  %186 = sext i8 %185 to i32
  %187 = icmp eq i32 %186, 123
  br i1 %187, label %188, label %193

188:                                              ; preds = %183
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  %190 = load i8, ptr %189, align 1, !tbaa !13
  %191 = sext i8 %190 to i32
  %192 = icmp eq i32 %191, 125
  br i1 %192, label %203, label %193

193:                                              ; preds = %188, %183
  %194 = load ptr, ptr %10, align 8, !tbaa !5
  %195 = load i8, ptr %194, align 1, !tbaa !13
  %196 = sext i8 %195 to i32
  %197 = icmp eq i32 %196, 91
  br i1 %197, label %198, label %246

198:                                              ; preds = %193
  %199 = load ptr, ptr %11, align 8, !tbaa !5
  %200 = load i8, ptr %199, align 1, !tbaa !13
  %201 = sext i8 %200 to i32
  %202 = icmp eq i32 %201, 93
  br i1 %202, label %203, label %246

203:                                              ; preds = %198, %188
  %204 = load ptr, ptr %6, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.HandleJSON, ptr %204, i32 0, i32 5
  %206 = load i32, ptr %205, align 8, !tbaa !34
  %207 = load ptr, ptr %3, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.MObject, ptr %207, i32 0, i32 0
  %209 = load i32, ptr %208, align 8, !tbaa !30
  %210 = icmp slt i32 %206, %209
  br i1 %210, label %211, label %232

211:                                              ; preds = %203
  %212 = load ptr, ptr %6, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.HandleJSON, ptr %212, i32 0, i32 4
  %214 = load ptr, ptr %213, align 8, !tbaa !36
  %215 = icmp ne ptr %214, null
  br i1 %215, label %216, label %220

216:                                              ; preds = %211
  %217 = load ptr, ptr %6, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.HandleJSON, ptr %217, i32 0, i32 4
  %219 = load ptr, ptr %218, align 8, !tbaa !36
  call void @m_Free(ptr noundef %219)
  br label %220

220:                                              ; preds = %216, %211
  %221 = load ptr, ptr %3, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.MObject, ptr %221, i32 0, i32 0
  %223 = load i32, ptr %222, align 8, !tbaa !30
  %224 = call ptr @m_Malloc(i32 noundef %223)
  %225 = load ptr, ptr %6, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.HandleJSON, ptr %225, i32 0, i32 4
  store ptr %224, ptr %226, align 8, !tbaa !36
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.MObject, ptr %227, i32 0, i32 0
  %229 = load i32, ptr %228, align 8, !tbaa !30
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.HandleJSON, ptr %230, i32 0, i32 5
  store i32 %229, ptr %231, align 8, !tbaa !34
  br label %232

232:                                              ; preds = %220, %203
  %233 = load ptr, ptr %6, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.HandleJSON, ptr %233, i32 0, i32 4
  %235 = load ptr, ptr %234, align 8, !tbaa !36
  %236 = load ptr, ptr %3, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.MObject, ptr %236, i32 0, i32 1
  %238 = load ptr, ptr %237, align 8, !tbaa !13
  %239 = load ptr, ptr %3, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.MObject, ptr %239, i32 0, i32 0
  %241 = load i32, ptr %240, align 8, !tbaa !30
  %242 = sext i32 %241 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %235, ptr align 1 %238, i64 %242, i1 false)
  %243 = load ptr, ptr %6, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.HandleJSON, ptr %243, i32 0, i32 4
  %245 = load ptr, ptr %244, align 8, !tbaa !36
  store ptr %245, ptr %9, align 8, !tbaa !5
  br label %310

246:                                              ; preds = %198, %193
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %247 = load ptr, ptr %3, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.MObject, ptr %247, i32 0, i32 1
  %249 = load ptr, ptr %248, align 8, !tbaa !13
  %250 = call noalias ptr @fopen(ptr noundef %249, ptr noundef @.str.5)
  store ptr %250, ptr %12, align 8, !tbaa !5
  br label %251

251:                                              ; preds = %246
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %252 = load ptr, ptr %12, align 8, !tbaa !5
  %253 = icmp eq ptr %252, null
  %254 = zext i1 %253 to i32
  store i32 %254, ptr %13, align 4, !tbaa !9
  %255 = load i32, ptr %13, align 4, !tbaa !9
  %256 = icmp ne i32 %255, 0
  br i1 %256, label %257, label %259

257:                                              ; preds = %251
  %258 = load i32, ptr %13, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %258, i32 noundef -1, ptr noundef @.str, i32 noundef 442, ptr noundef @__FUNCTION__.mJSONLoad, ptr noundef @.str.6)
  br label %259

259:                                              ; preds = %257, %251
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %260

260:                                              ; preds = %259
  br label %261

261:                                              ; preds = %260
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %262 = load ptr, ptr %12, align 8, !tbaa !5
  %263 = call i32 @fsize(ptr noundef %262)
  store i32 %263, ptr %14, align 4, !tbaa !9
  %264 = load ptr, ptr %6, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.HandleJSON, ptr %264, i32 0, i32 5
  %266 = load i32, ptr %265, align 8, !tbaa !34
  %267 = load i32, ptr %14, align 4, !tbaa !9
  %268 = icmp slt i32 %266, %267
  br i1 %268, label %269, label %286

269:                                              ; preds = %261
  %270 = load ptr, ptr %6, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.HandleJSON, ptr %270, i32 0, i32 4
  %272 = load ptr, ptr %271, align 8, !tbaa !36
  %273 = icmp ne ptr %272, null
  br i1 %273, label %274, label %278

274:                                              ; preds = %269
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.HandleJSON, ptr %275, i32 0, i32 4
  %277 = load ptr, ptr %276, align 8, !tbaa !36
  call void @m_Free(ptr noundef %277)
  br label %278

278:                                              ; preds = %274, %269
  %279 = load i32, ptr %14, align 4, !tbaa !9
  %280 = call ptr @m_Malloc(i32 noundef %279)
  %281 = load ptr, ptr %6, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.HandleJSON, ptr %281, i32 0, i32 4
  store ptr %280, ptr %282, align 8, !tbaa !36
  %283 = load i32, ptr %14, align 4, !tbaa !9
  %284 = load ptr, ptr %6, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.HandleJSON, ptr %284, i32 0, i32 5
  store i32 %283, ptr %285, align 8, !tbaa !34
  br label %286

286:                                              ; preds = %278, %261
  br label %287

287:                                              ; preds = %286
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %288 = load ptr, ptr %6, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.HandleJSON, ptr %288, i32 0, i32 4
  %290 = load ptr, ptr %289, align 8, !tbaa !36
  %291 = load i32, ptr %14, align 4, !tbaa !9
  %292 = sext i32 %291 to i64
  %293 = load ptr, ptr %12, align 8, !tbaa !5
  %294 = call i64 @fread(ptr noundef %290, i64 noundef %292, i64 noundef 1, ptr noundef %293)
  %295 = trunc i64 %294 to i32
  %296 = icmp ne i32 %295, 1
  %297 = zext i1 %296 to i32
  store i32 %297, ptr %15, align 4, !tbaa !9
  %298 = load i32, ptr %15, align 4, !tbaa !9
  %299 = icmp ne i32 %298, 0
  br i1 %299, label %300, label %302

300:                                              ; preds = %287
  %301 = load i32, ptr %15, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %301, i32 noundef -1, ptr noundef @.str, i32 noundef 450, ptr noundef @__FUNCTION__.mJSONLoad, ptr noundef @.str.7)
  br label %302

302:                                              ; preds = %300, %287
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %303

303:                                              ; preds = %302
  br label %304

304:                                              ; preds = %303
  %305 = load ptr, ptr %12, align 8, !tbaa !5
  %306 = call i32 @fclose(ptr noundef %305)
  %307 = load ptr, ptr %6, align 8, !tbaa !5
  %308 = getelementptr inbounds %struct.HandleJSON, ptr %307, i32 0, i32 4
  %309 = load ptr, ptr %308, align 8, !tbaa !36
  store ptr %309, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %310

310:                                              ; preds = %304, %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %311 = load ptr, ptr %6, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct.HandleJSON, ptr %311, i32 0, i32 3
  %313 = getelementptr inbounds [2 x %struct.ArrayNode], ptr %312, i64 0, i64 1
  store ptr %313, ptr %16, align 8, !tbaa !5
  %314 = load ptr, ptr %16, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.ArrayNode, ptr %314, i32 0, i32 0
  %316 = getelementptr inbounds %struct.anon, ptr %315, i32 0, i32 2
  store i32 1, ptr %316, align 4, !tbaa !13
  %317 = load ptr, ptr %16, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct.ArrayNode, ptr %317, i32 0, i32 0
  %319 = getelementptr inbounds %struct.anon, ptr %318, i32 0, i32 1
  store i16 1, ptr %319, align 2, !tbaa !13
  %320 = load ptr, ptr %16, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct.ArrayNode, ptr %320, i32 0, i32 2
  %322 = load i32, ptr %321, align 1
  %323 = and i32 %322, -16777216
  %324 = or i32 %323, 1
  store i32 %324, ptr %321, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %325 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %325, ptr %17, align 8, !tbaa !5
  br label %326

326:                                              ; preds = %369, %310
  %327 = load ptr, ptr %17, align 8, !tbaa !5
  %328 = getelementptr inbounds i8, ptr %327, i64 0
  %329 = load i8, ptr %328, align 1, !tbaa !13
  %330 = sext i8 %329 to i32
  %331 = icmp eq i32 %330, 123
  br i1 %331, label %332, label %347

332:                                              ; preds = %326
  %333 = load ptr, ptr %6, align 8, !tbaa !5
  call void @JSONListLoad(ptr noundef %17, ptr noundef %333, i32 noundef 1)
  %334 = load ptr, ptr %16, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.ArrayNode, ptr %334, i32 0, i32 1
  store i8 10, ptr %335, align 8, !tbaa !16
  %336 = load ptr, ptr %6, align 8, !tbaa !5
  %337 = getelementptr inbounds %struct.HandleJSON, ptr %336, i32 0, i32 0
  %338 = getelementptr inbounds [64 x %struct.ListLayer], ptr %337, i64 0, i64 1
  %339 = getelementptr inbounds %struct.ListLayer, ptr %338, i32 0, i32 2
  %340 = load i32, ptr %339, align 4, !tbaa !27
  %341 = sub nsw i32 %340, 1
  %342 = trunc i32 %341 to i16
  %343 = load ptr, ptr %16, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.ArrayNode, ptr %343, i32 0, i32 0
  %345 = getelementptr inbounds %struct.anon, ptr %344, i32 0, i32 0
  store i16 %342, ptr %345, align 8, !tbaa !13
  %346 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %346, ptr %2, align 8
  store i32 1, ptr %18, align 4
  br label %372

347:                                              ; preds = %326
  %348 = load ptr, ptr %17, align 8, !tbaa !5
  %349 = getelementptr inbounds i8, ptr %348, i64 0
  %350 = load i8, ptr %349, align 1, !tbaa !13
  %351 = sext i8 %350 to i32
  %352 = icmp eq i32 %351, 91
  br i1 %352, label %353, label %368

353:                                              ; preds = %347
  %354 = load ptr, ptr %6, align 8, !tbaa !5
  call void @JSONArrayLoad(ptr noundef %17, ptr noundef %354, i32 noundef 1)
  %355 = load ptr, ptr %16, align 8, !tbaa !5
  %356 = getelementptr inbounds %struct.ArrayNode, ptr %355, i32 0, i32 1
  store i8 12, ptr %356, align 8, !tbaa !16
  %357 = load ptr, ptr %6, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct.HandleJSON, ptr %357, i32 0, i32 1
  %359 = getelementptr inbounds [64 x %struct.ArrayLayer], ptr %358, i64 0, i64 1
  %360 = getelementptr inbounds %struct.ArrayLayer, ptr %359, i32 0, i32 2
  %361 = load i32, ptr %360, align 4, !tbaa !28
  %362 = sub nsw i32 %361, 1
  %363 = trunc i32 %362 to i16
  %364 = load ptr, ptr %16, align 8, !tbaa !5
  %365 = getelementptr inbounds %struct.ArrayNode, ptr %364, i32 0, i32 0
  %366 = getelementptr inbounds %struct.anon, ptr %365, i32 0, i32 0
  store i16 %363, ptr %366, align 8, !tbaa !13
  %367 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %367, ptr %2, align 8
  store i32 1, ptr %18, align 4
  br label %372

368:                                              ; preds = %347
  br label %369

369:                                              ; preds = %368
  %370 = load ptr, ptr %17, align 8, !tbaa !5
  %371 = getelementptr inbounds i8, ptr %370, i32 1
  store ptr %371, ptr %17, align 8, !tbaa !5
  br label %326

372:                                              ; preds = %353, %332
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %373 = load ptr, ptr %2, align 8
  ret ptr %373
}

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

declare i32 @mHandleValid(ptr noundef) #1

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

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

declare i32 @fclose(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!7, !7, i64 0}
!14 = !{!15, !7, i64 8}
!15 = !{!"ListNode", !7, i64 0, !7, i64 8, !10, i64 9, !6, i64 16}
!16 = !{!17, !7, i64 8}
!17 = !{!"ArrayNode", !7, i64 0, !7, i64 8, !10, i64 9}
!18 = !{!19, !6, i64 0}
!19 = !{!"ListLayer", !6, i64 0, !10, i64 8, !10, i64 12}
!20 = !{!19, !10, i64 8}
!21 = !{!22, !6, i64 0}
!22 = !{!"ArrayLayer", !6, i64 0, !10, i64 8, !10, i64 12}
!23 = !{!22, !10, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!12, !10, i64 4}
!27 = !{!19, !10, i64 12}
!28 = !{!22, !10, i64 12}
!29 = distinct !{!29, !25}
!30 = !{!31, !10, i64 0}
!31 = !{!"MObject", !10, i64 0, !7, i64 8}
!32 = distinct !{!32, !25}
!33 = distinct !{!33, !25}
!34 = !{!35, !10, i64 2136}
!35 = !{!"HandleJSON", !7, i64 0, !7, i64 1024, !7, i64 2048, !7, i64 2096, !6, i64 2128, !10, i64 2136, !6, i64 2144}
!36 = !{!35, !6, i64 2128}


; 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.ListLayer = type { ptr, i32, i32 }
%struct.ArrayLayer = type { ptr, i32, i32 }

@.str = external hidden unnamed_addr constant [76 x i8], align 1
@__FUNCTION__.mJSONLoad = external hidden unnamed_addr constant [10 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 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

declare ptr @m_Malloc(i32 noundef) local_unnamed_addr #1

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

declare void @m_Free(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @endJSON(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @JSONListLoad(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @JSONArrayLoad(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef nonnull ptr @mJSONLoad(ptr noundef %0) local_unnamed_addr #3 {
  %2 = alloca ptr, align 8
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %8 [
    i64 -1, label %3
    i64 0, label %3
  ]

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

8:                                                ; preds = %1, %3
  %9 = tail call ptr @GetHandle(ptr noundef %0, i32 noundef 2152, i32 noundef 514859913, ptr noundef nonnull @endJSON) #6
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  %12 = tail call i32 @mHandleValid(ptr noundef %9) #6
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %13, label %30

13:                                               ; preds = %8
  %14 = getelementptr inbounds i8, ptr %11, i64 2048
  store ptr %11, ptr %14, align 8, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %11, i64 2056
  store i8 0, ptr %15, align 8, !tbaa !12
  %16 = getelementptr inbounds i8, ptr %11, i64 2096
  store ptr %11, ptr %16, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %11, i64 2104
  store i8 0, ptr %17, align 8, !tbaa !14
  %18 = getelementptr inbounds i8, ptr %11, i64 1024
  br label %21

19:                                               ; preds = %21
  %20 = getelementptr inbounds i8, ptr %9, i64 4
  store volatile i32 1, ptr %20, align 4, !tbaa !16
  br label %30

21:                                               ; preds = %21, %13
  %indvars.iv = phi i64 [ 0, %13 ], [ %indvars.iv.next.1, %21 ]
  %22 = getelementptr inbounds [64 x %struct.ListLayer], ptr %11, i64 0, i64 %indvars.iv
  store ptr %14, ptr %22, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  store i32 1, ptr %23, align 8, !tbaa !19
  %24 = getelementptr inbounds [64 x %struct.ArrayLayer], ptr %18, i64 0, i64 %indvars.iv
  store ptr %16, ptr %24, align 8, !tbaa !20
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  store i32 1, ptr %25, align 8, !tbaa !22
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %26 = getelementptr inbounds [64 x %struct.ListLayer], ptr %11, i64 0, i64 %indvars.iv.next
  store ptr %14, ptr %26, align 8, !tbaa !17
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  store i32 1, ptr %27, align 8, !tbaa !19
  %28 = getelementptr inbounds [64 x %struct.ArrayLayer], ptr %18, i64 0, i64 %indvars.iv.next
  store ptr %16, ptr %28, align 8, !tbaa !20
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  store i32 1, ptr %29, align 8, !tbaa !22
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 64
  br i1 %exitcond.not.1, label %19, label %21, !llvm.loop !23

30:                                               ; preds = %19, %8
  %31 = getelementptr inbounds i8, ptr %11, i64 1024
  br label %37

32:                                               ; preds = %37
  %33 = load i32, ptr %0, align 8, !tbaa !25
  %34 = icmp slt i32 %33, 0
  %35 = getelementptr inbounds i8, ptr %0, i64 8
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  br i1 %34, label %42, label %._crit_edge

37:                                               ; preds = %37, %30
  %indvars.iv116 = phi i64 [ 0, %30 ], [ %indvars.iv.next117.1, %37 ]
  %38 = getelementptr inbounds [64 x %struct.ListLayer], ptr %11, i64 0, i64 %indvars.iv116, i32 2
  store i32 1, ptr %38, align 4, !tbaa !27
  %39 = getelementptr inbounds [64 x %struct.ArrayLayer], ptr %31, i64 0, i64 %indvars.iv116, i32 2
  store i32 1, ptr %39, align 4, !tbaa !28
  %indvars.iv.next117 = or disjoint i64 %indvars.iv116, 1
  %40 = getelementptr inbounds [64 x %struct.ListLayer], ptr %11, i64 0, i64 %indvars.iv.next117, i32 2
  store i32 1, ptr %40, align 4, !tbaa !27
  %41 = getelementptr inbounds [64 x %struct.ArrayLayer], ptr %31, i64 0, i64 %indvars.iv.next117, i32 2
  store i32 1, ptr %41, align 4, !tbaa !28
  %indvars.iv.next117.1 = add nuw nsw i64 %indvars.iv116, 2
  %exitcond119.not.1 = icmp eq i64 %indvars.iv.next117.1, 64
  br i1 %exitcond119.not.1, label %32, label %37, !llvm.loop !29

42:                                               ; preds = %32
  %43 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %36) #7
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %0, align 8, !tbaa !25
  br label %._crit_edge

._crit_edge:                                      ; preds = %32, %42
  %45 = phi i32 [ %44, %42 ], [ %33, %32 ]
  %46 = getelementptr inbounds i8, ptr %0, i64 8
  br label %.critedge

.critedge:                                        ; preds = %.critedge, %._crit_edge
  %.0100 = phi ptr [ %36, %._crit_edge ], [ %49, %.critedge ]
  %47 = load i8, ptr %.0100, align 1, !tbaa !11
  %48 = icmp slt i8 %47, 33
  %49 = getelementptr inbounds i8, ptr %.0100, i64 1
  br i1 %48, label %.critedge, label %50, !llvm.loop !30

50:                                               ; preds = %.critedge
  %51 = sext i32 %45 to i64
  %52 = getelementptr inbounds i8, ptr %36, i64 %51
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2, %50
  %.pn = phi ptr [ %52, %50 ], [ %.0101, %.critedge2 ]
  %.0101 = getelementptr inbounds i8, ptr %.pn, i64 -1
  %53 = load i8, ptr %.0101, align 1, !tbaa !11
  %54 = icmp slt i8 %53, 33
  br i1 %54, label %.critedge2, label %55, !llvm.loop !31

55:                                               ; preds = %.critedge2
  %56 = icmp eq i8 %47, 123
  %57 = icmp eq i8 %53, 125
  %or.cond = and i1 %56, %57
  br i1 %or.cond, label %61, label %58

58:                                               ; preds = %55
  %59 = icmp eq i8 %47, 91
  %60 = icmp eq i8 %53, 93
  %or.cond109 = and i1 %59, %60
  br i1 %or.cond109, label %61, label %75

61:                                               ; preds = %58, %55
  %62 = getelementptr inbounds i8, ptr %11, i64 2136
  %63 = load i32, ptr %62, align 8, !tbaa !32
  %64 = icmp slt i32 %63, %45
  %65 = getelementptr inbounds i8, ptr %11, i64 2128
  %66 = load ptr, ptr %65, align 8, !tbaa !34
  br i1 %64, label %67, label %._crit_edge124

67:                                               ; preds = %61
  %.not107 = icmp eq ptr %66, null
  br i1 %.not107, label %69, label %68

68:                                               ; preds = %67
  tail call void @m_Free(ptr noundef nonnull %66) #6
  %.pre123 = load i32, ptr %0, align 8, !tbaa !25
  br label %69

69:                                               ; preds = %68, %67
  %70 = phi i32 [ %.pre123, %68 ], [ %45, %67 ]
  %71 = tail call ptr @m_Malloc(i32 noundef %70) #6
  store ptr %71, ptr %65, align 8, !tbaa !34
  %72 = load i32, ptr %0, align 8, !tbaa !25
  store i32 %72, ptr %62, align 8, !tbaa !32
  %.pre127 = load ptr, ptr %46, align 8, !tbaa !11
  %.pre128 = sext i32 %72 to i64
  br label %._crit_edge124

._crit_edge124:                                   ; preds = %61, %69
  %.pre-phi = phi i64 [ %.pre128, %69 ], [ %51, %61 ]
  %73 = phi ptr [ %.pre127, %69 ], [ %36, %61 ]
  %74 = phi ptr [ %71, %69 ], [ %66, %61 ]
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %74, ptr align 1 %73, i64 %.pre-phi, i1 false)
  br label %97

75:                                               ; preds = %58
  %76 = tail call noalias ptr @fopen(ptr noundef %36, ptr noundef nonnull @.str.5)
  %77 = icmp eq ptr %76, null
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 442, ptr noundef nonnull @__FUNCTION__.mJSONLoad, ptr noundef nonnull @.str.6) #6
  br label %79

79:                                               ; preds = %78, %75
  %80 = tail call i32 @fsize(ptr noundef %76) #6
  %81 = getelementptr inbounds i8, ptr %11, i64 2136
  %82 = load i32, ptr %81, align 8, !tbaa !32
  %83 = icmp slt i32 %82, %80
  %84 = getelementptr inbounds i8, ptr %11, i64 2128
  %85 = load ptr, ptr %84, align 8, !tbaa !34
  br i1 %83, label %86, label %._crit_edge120

86:                                               ; preds = %79
  %.not106 = icmp eq ptr %85, null
  br i1 %.not106, label %88, label %87

87:                                               ; preds = %86
  tail call void @m_Free(ptr noundef nonnull %85) #6
  br label %88

88:                                               ; preds = %87, %86
  %89 = tail call ptr @m_Malloc(i32 noundef %80) #6
  store ptr %89, ptr %84, align 8, !tbaa !34
  store i32 %80, ptr %81, align 8, !tbaa !32
  br label %._crit_edge120

._crit_edge120:                                   ; preds = %79, %88
  %90 = phi ptr [ %89, %88 ], [ %85, %79 ]
  %91 = sext i32 %80 to i64
  %92 = tail call i64 @fread(ptr noundef %90, i64 noundef %91, i64 noundef 1, ptr noundef %76)
  %93 = and i64 %92, 4294967295
  %.not110 = icmp eq i64 %93, 1
  br i1 %.not110, label %95, label %94

94:                                               ; preds = %._crit_edge120
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 450, ptr noundef nonnull @__FUNCTION__.mJSONLoad, ptr noundef nonnull @.str.7) #6
  br label %95

95:                                               ; preds = %94, %._crit_edge120
  %96 = tail call i32 @fclose(ptr noundef %76)
  br label %97

97:                                               ; preds = %95, %._crit_edge124
  %.099.in = getelementptr inbounds i8, ptr %11, i64 2128
  %.099 = load ptr, ptr %.099.in, align 8, !tbaa !34
  %98 = getelementptr inbounds i8, ptr %11, i64 2116
  store i32 1, ptr %98, align 4, !tbaa !11
  %99 = getelementptr inbounds i8, ptr %11, i64 2114
  store i16 1, ptr %99, align 2, !tbaa !11
  %100 = getelementptr inbounds i8, ptr %11, i64 2121
  %101 = load i32, ptr %100, align 1
  %102 = and i32 %101, -16777216
  %103 = or disjoint i32 %102, 1
  store i32 %103, ptr %100, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  br label %104

104:                                              ; preds = %108, %97
  %storemerge = phi ptr [ %.099, %97 ], [ %109, %108 ]
  store ptr %storemerge, ptr %2, align 8, !tbaa !35
  %105 = load i8, ptr %storemerge, align 1, !tbaa !11
  switch i8 %105, label %108 [
    i8 123, label %106
    i8 91, label %107
  ]

106:                                              ; preds = %104
  call void @JSONListLoad(ptr noundef nonnull %2, ptr noundef %11, i32 noundef 1)
  br label %110

107:                                              ; preds = %104
  call void @JSONArrayLoad(ptr noundef nonnull %2, ptr noundef %11, i32 noundef 1)
  br label %110

108:                                              ; preds = %104
  %109 = getelementptr inbounds i8, ptr %storemerge, i64 1
  br label %104

110:                                              ; preds = %107, %106
  %.sink130 = phi i8 [ 12, %107 ], [ 10, %106 ]
  %.sink = phi i64 [ 1052, %107 ], [ 28, %106 ]
  %111 = getelementptr inbounds i8, ptr %11, i64 2120
  store i8 %.sink130, ptr %111, align 8, !tbaa !14
  %112 = getelementptr inbounds i8, ptr %11, i64 %.sink
  %storemerge108.in.in = load i32, ptr %112, align 4, !tbaa !36
  %storemerge108.in = trunc i32 %storemerge108.in.in to i16
  %storemerge108 = add i16 %storemerge108.in, -1
  %113 = getelementptr inbounds i8, ptr %11, i64 2112
  store i16 %storemerge108, ptr %113, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  ret ptr %113
}

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

declare i32 @mHandleValid(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4

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

declare i32 @fsize(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { 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, !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 = !{!8, !8, i64 0}
!12 = !{!13, !8, i64 8}
!13 = !{!"ListNode", !8, i64 0, !8, i64 8, !7, i64 9, !10, i64 16}
!14 = !{!15, !8, i64 8}
!15 = !{!"ArrayNode", !8, i64 0, !8, i64 8, !7, i64 9}
!16 = !{!6, !7, i64 4}
!17 = !{!18, !10, i64 0}
!18 = !{!"ListLayer", !10, i64 0, !7, i64 8, !7, i64 12}
!19 = !{!18, !7, i64 8}
!20 = !{!21, !10, i64 0}
!21 = !{!"ArrayLayer", !10, i64 0, !7, i64 8, !7, i64 12}
!22 = !{!21, !7, i64 8}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !7, i64 0}
!26 = !{!"MObject", !7, i64 0, !8, i64 8}
!27 = !{!18, !7, i64 12}
!28 = !{!21, !7, i64 12}
!29 = distinct !{!29, !24}
!30 = distinct !{!30, !24}
!31 = distinct !{!31, !24}
!32 = !{!33, !7, i64 2136}
!33 = !{!"HandleJSON", !8, i64 0, !8, i64 1024, !8, i64 2048, !8, i64 2096, !10, i64 2128, !7, i64 2136, !10, i64 2144}
!34 = !{!33, !10, i64 2128}
!35 = !{!10, !10, i64 0}
!36 = !{!7, !7, i64 0}


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